/* ===== RESET & VARIABLES ===== */
:root {
    --primary: #0A2647;
    --primary-dark: #05192F;
    --secondary: #2C3E50;
    --accent: #4A90E2;
    --success: #27AE60;
    --danger: #E74C3C;
    --warning: #F39C12;
    --dark: #1E293B;
    --gray: #64748B;
    --light-gray: #F1F5F9;
    --white: #FFFFFF;
    --border: #E2E8F0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    background: var(--light-gray);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* ===== MAIN CONTAINER ===== */
.app-wrapper {
    max-width: 440px;
    width: 100%;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    position: relative;
}

/* ===== HEADER SECTION ===== */
.section-header {
    padding: 32px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    color: white;
}

.section-header h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.section-header p {
    font-size: 15px;
    opacity: 0.9;
    line-height: 1.5;
}

/* ===== CONTENT SECTION ===== */
.section-content {
    padding: 28px 24px;
}

/* ===== TYPOGRAPHY ===== */
.title-large {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.title-medium {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 16px;
}

.text-muted {
    color: var(--gray);
    font-size: 15px;
    line-height: 1.5;
    margin-bottom: 24px;
}

/* ===== FORM GROUP ===== */
.form-group-modern {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.input-container {
    display: flex;
    align-items: center;
    background: var(--light-gray);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.2s;
}

.input-container:focus-within {
    border-color: var(--accent);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(74, 144, 226, 0.1);
}

.input-prefix {
    padding: 0 16px;
    font-size: 16px;
    color: var(--gray);
    background: transparent;
    border-right: 1.5px solid var(--border);
    font-weight: 500;
}

.input-container input {
    flex: 1;
    padding: 18px 16px;
    border: none;
    background: transparent;
    font-size: 16px;
    outline: none;
    color: var(--dark);
}

.input-container input::placeholder {
    color: #94A3B8;
}

.input-hint {
    font-size: 13px;
    color: var(--gray);
    margin-top: 8px;
    display: block;
}

/* ===== BUTTONS ===== */
.btn-modern {
    display: block;
    width: 100%;
    padding: 18px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.btn-primary-modern {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(10, 38, 71, 0.2);
}

.btn-primary-modern:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(10, 38, 71, 0.3);
}

.btn-primary-modern:active {
    transform: translateY(0);
}

.btn-outline-modern {
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
}

.btn-outline-modern:hover {
    background: var(--light-gray);
}

/* ===== FEATURE CARDS ===== */
.feature-grid {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.feature-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--light-gray);
    border-radius: var(--radius-md);
    transition: all 0.2s;
}

.feature-card:hover {
    background: #E9EDF2;
    transform: translateX(4px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--white);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 24px;
    box-shadow: var(--shadow-sm);
}

.feature-text h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
}

.feature-text p {
    font-size: 14px;
    color: var(--gray);
    line-height: 1.4;
}

/* ===== ADMIN LINK ===== */
.admin-link-modern {
    text-align: center;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.admin-link-modern a {
    color: var(--gray);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
    border-radius: 30px;
    transition: all 0.2s;
}

.admin-link-modern a:hover {
    background: var(--light-gray);
    color: var(--primary);
}

/* ===== STATS CARDS ===== */
.stats-grid-modern {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 24px 0 32px;
}

.stat-card-modern {
    background: var(--light-gray);
    padding: 20px 12px;
    border-radius: var(--radius-md);
    text-align: center;
    transition: all 0.2s;
}

.stat-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-value-modern {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}

.stat-label-modern {
    font-size: 12px;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ===== SEARCH BAR ===== */
.search-bar-modern {
    background: var(--light-gray);
    border-radius: 30px;
    padding: 6px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.search-bar-modern span {
    color: var(--gray);
    font-size: 20px;
}

.search-bar-modern input {
    flex: 1;
    padding: 14px 0;
    border: none;
    background: transparent;
    font-size: 15px;
    outline: none;
}

.search-bar-modern input::placeholder {
    color: #94A3B8;
}

/* ===== ORDER CARDS ===== */
.order-card-modern {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.order-card-modern::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
}

.order-card-modern.cicil::before {
    background: var(--danger);
}

.order-card-modern.lunas::before {
    background: var(--success);
}

.order-card-modern:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.order-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.order-title-modern {
    font-weight: 600;
    color: var(--dark);
    font-size: 16px;
}

.order-badge-modern {
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-cicil-modern {
    background: #FEF2F2;
    color: var(--danger);
}

.badge-lunas-modern {
    background: #ECFDF3;
    color: var(--success);
}

.order-row {
    display: flex;
    justify-content: space-between;
    margin: 8px 0;
}

.order-label {
    color: var(--gray);
    font-size: 14px;
}

.order-value {
    font-weight: 600;
    color: var(--dark);
}

.order-sisa-modern {
    color: var(--danger);
    font-weight: 700;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
    font-size: 13px;
}

.order-date {
    color: var(--gray);
}

.order-link {
    color: var(--accent);
    font-weight: 500;
    text-decoration: none;
}

/* ===== DETAIL CARD ===== */
.detail-card {
    background: var(--light-gray);
    border-radius: var(--radius-md);
    padding: 24px;
    margin-bottom: 28px;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.detail-row:last-child {
    margin-bottom: 0;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.detail-label {
    color: var(--gray);
    font-size: 15px;
}

.detail-value {
    font-weight: 600;
    color: var(--dark);
    font-size: 16px;
}

.detail-value.success {
    color: var(--success);
}

.detail-value.danger {
    color: var(--danger);
    font-size: 18px;
}

/* ===== PAYMENT ITEM ===== */
.payment-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--light-gray);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    transition: all 0.2s;
}

.payment-item:hover {
    background: #E9EDF2;
}

.payment-info h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
}

.payment-info p {
    font-size: 13px;
    color: var(--gray);
}

.payment-amount {
    font-weight: 700;
    color: var(--success);
    font-size: 16px;
}

/* ===== BACK BUTTON ===== */
.back-button-modern {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--gray);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    margin-bottom: 24px;
    padding: 8px 16px;
    border-radius: 30px;
    background: var(--light-gray);
    transition: all 0.2s;
}

.back-button-modern:hover {
    background: #E2E8F0;
    color: var(--primary);
}

/* ===== EMPTY STATE ===== */
.empty-state-modern {
    text-align: center;
    padding: 48px 24px;
}

.empty-emoji {
    font-size: 64px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-modern h3 {
    font-size: 20px;
    color: var(--dark);
    margin-bottom: 8px;
    font-weight: 600;
}

.empty-state-modern p {
    color: var(--gray);
    font-size: 15px;
}

/* ===== ALERT ===== */
.alert-modern {
    padding: 16px 20px;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    border-left: 4px solid transparent;
}

.alert-error-modern {
    background: #FEF2F2;
    border-left-color: var(--danger);
    color: var(--danger);
}

.alert-success-modern {
    background: #ECFDF3;
    border-left-color: var(--success);
    color: var(--success);
}

/* ===== MODAL ===== */
.modal-modern {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
}

.modal-modern.active {
    display: flex;
}

.modal-content-modern {
    background: white;
    width: 100%;
    max-width: 440px;
    border-radius: 32px 32px 0 0;
    padding: 32px 24px;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.modal-header-modern {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.modal-header-modern h3 {
    font-size: 20px;
    color: var(--dark);
    font-weight: 700;
}

.modal-close {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--light-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 20px;
    color: var(--gray);
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--danger);
    color: white;
}

/* ===== FLOATING BUTTON ===== */
.fab-modern {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 30px;
    background: var(--primary);
    color: white;
    border: none;
    font-size: 24px;
    box-shadow: 0 4px 16px rgba(10, 38, 71, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fab-modern:hover {
    transform: scale(1.1);
    background: var(--accent);
}

/* ===== LOADING ===== */
.loading-modern {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.9);
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.loading-modern.active {
    display: flex;
}

.spinner-modern {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}