/* assets/style.css - Mobile-First Native App Design System for CV. Amal Sejati */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --primary: #ef4444;
    --primary-dark: #dc2626;
    --primary-light: #fee2e2;
    --navy-header: #0b1329;
    --navy-card: #0f172a;
    --bg-page: #f8fafc;
    --surface: #ffffff;
    --border: #e2e8f0;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --success: #16a34a;
    --success-bg: #dcfce7;
    --warning: #d97706;
    --warning-bg: #fef3c7;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 20px;
}

/* MOBILE DRAWER & HAMBURGER BUTTON */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: #ffffff;
    cursor: pointer;
    padding: 6px;
    border-radius: var(--radius-sm);
}

.mobile-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(2px);
    z-index: 10001;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.mobile-drawer-overlay.open {
    display: block;
    opacity: 1;
}

.mobile-drawer {
    position: fixed;
    top: 0;
    left: -290px;
    width: 280px;
    height: 100%;
    background: #ffffff;
    z-index: 10002;
    box-shadow: 4px 0 20px rgba(0,0,0,0.2);
    transition: left 0.25s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-drawer.open {
    left: 0;
}

.drawer-header {
    padding: 16px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.drawer-close-btn {
    background: none;
    border: none;
    font-size: 26px;
    color: var(--text-muted);
    cursor: pointer;
    line-height: 1;
}

.drawer-user-info {
    padding: 12px 16px;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border);
}

.drawer-menu {
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.drawer-heading {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--text-light);
    padding: 8px 12px 4px;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-main);
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.15s ease;
}

.drawer-link svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-muted);
    stroke-width: 2;
    fill: none;
    flex-shrink: 0;
}

.drawer-link:hover, .drawer-link.active {
    background: var(--primary-light);
    color: var(--primary);
}

.drawer-link:hover svg, .drawer-link.active svg {
    stroke: var(--primary);
}

@media (max-width: 768px) {
    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}
input[type=number]::-webkit-inner-spin-button, 
input[type=number]::-webkit-outer-spin-button { 
    -webkit-appearance: none; 
    margin: 0; 
}
input[type=number] {
    -moz-appearance: textfield;
}

/* TOP HEADER MODERN */
.top-header {
    background: var(--navy-header);
    color: #ffffff;
    height: 60px;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    border-bottom: 2px solid var(--primary);
}

.brand-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    height: 100%;
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: #ffffff;
    border: 2px solid #ffffff;
    flex-shrink: 0;
}

.brand-title {
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.2px;
    color: #ffffff;
    line-height: 1.2;
}

.brand-subtitle {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    color: #38bdf8;
    text-transform: uppercase;
}

/* DESKTOP NAV LINKS (Disembunyikan di Mobile) */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 100%;
}

.nav-link {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
    color: #ffffff;
    background: rgba(255,255,255,0.12);
}

.btn-nav-logout {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171 !important;
    border: 1px solid rgba(239, 68, 68, 0.35);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.btn-nav-logout:hover {
    background: var(--primary);
    color: #ffffff !important;
}

/* BOTTOM NAVIGATION BAR DIHAPUS TOTAL AGAR TIDAK DOUBLE */
.bottom-nav {
    display: none !important;
}

/* CONTAINER */
.container {
    max-width: 1080px;
    margin: 16px auto;
    padding: 0 16px;
}

/* CARDS */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.card-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 4px;
    letter-spacing: -0.3px;
}

.card-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* STEP BOX / FORM SECTION */
.step-box {
    background: var(--bg-page);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.step-num {
    background: var(--navy-header);
    color: #ffffff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 13px;
    flex-shrink: 0;
}

.step-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-main);
}

.step-badge {
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: auto;
}

/* GRIDS */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

/* FORMS & INPUTS - TOUCH FRIENDLY */
.form-group {
    margin-bottom: 14px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #334155;
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    height: 48px;
    padding: 10px 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    font-size: 16px; /* 16px mencegah auto-zoom di browser iOS */
    color: var(--text-main);
    background: #ffffff;
    font-weight: 600;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.form-control[readonly] {
    background: #f1f5f9;
    color: #64748b;
    border-color: var(--border);
}

.form-help {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.35;
}

/* BUTTONS */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
    min-height: 46px;
}

.btn-primary {
    background: var(--primary);
    color: #ffffff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #ffffff;
    border-color: #cbd5e1;
    color: #334155;
}

.btn-secondary:hover {
    background: var(--bg-page);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    min-height: 34px;
}

/* STAT BOX KPI */
.stat-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 2px;
}

.stat-value {
    font-size: 22px;
    font-weight: 900;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.stat-desc {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

/* CALC CARD */
.calc-card {
    background: var(--navy-header);
    color: #ffffff;
    border-radius: var(--radius-md);
    padding: 18px;
    margin: 16px 0;
}

.calc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #1e293b;
    font-size: 14px;
}

.calc-row:last-child {
    border-bottom: none;
    padding-top: 12px;
}

.calc-val {
    font-size: 17px;
    font-weight: 800;
    color: #38bdf8;
    text-align: right;
}

.calc-val-huge {
    font-size: 24px;
    font-weight: 900;
    color: #4ade80;
}

/* BADGES */
.badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--primary-light); color: var(--primary-dark); }
.badge-info    { background: #e0f2fe; color: #0284c7; }
.badge-neutral { background: #f1f5f9; color: #475569; }

/* ALERTS */
.alert {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    font-weight: 600;
}

.alert-success { background: var(--success-bg); border: 1px solid #bbf7d0; color: #15803d; }
.alert-danger  { background: var(--primary-light); border: 1px solid #fecaca; color: #991b1b; }
.alert-warning { background: var(--warning-bg); border: 1px solid #fde68a; color: #92400e; }

/* TABLES */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.sheet-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
}

.sheet-table th, .sheet-table td {
    border: 1px solid var(--border);
    padding: 8px 10px;
}

.sheet-table th {
    background: #f1f5f9;
    color: var(--text-main);
    font-weight: 800;
    font-size: 12px;
}

/* ============================================================== */
/* MOBILE SPECIFIC OVERRIDES (SCREEN <= 768px)                   */
/* ============================================================== */
@media (max-width: 768px) {
    /* Mobile KPI Grid 2x2 */
    .grid-4 {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    .stat-box {
        padding: 12px;
    }
    .stat-value {
        font-size: 17px;
    }
    .stat-label {
        font-size: 11px;
    }
    .stat-desc {
        display: none;
    }

    body {
        padding-bottom: 24px;
    }

    .container {
        padding: 0 12px;
        margin: 10px auto;
    }

    .card {
        padding: 16px;
        margin-bottom: 12px;
        border-radius: var(--radius-md);
    }

    /* Hilangkan Top Desktop Nav di Layar HP */
    .desktop-nav {
        display: none !important;
    }

    .top-header {
        height: 54px;
        padding: 0 16px;
    }

    .brand-title {
        font-size: 15px;
    }

    /* BOTTOM NAV BAR DIHAPUS TOTAL AGAR TIDAK DOUBLE */

    /* Grids to Single Column */
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Form Inputs Full Touch */
    .form-control {
        height: 48px;
        font-size: 16px;
    }

    .btn {
        width: 100%;
        height: 48px;
        font-size: 15px;
    }

    .step-box {
        padding: 14px;
        margin-bottom: 12px;
    }

    .calc-card {
        padding: 14px;
    }

    .calc-val-huge {
        font-size: 20px;
    }

    .stat-value {
        font-size: 20px;
    }
}
