* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1e3a5f;
    --primary-light: #2b6cb0;
    --accent: #2b6cb0;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --border: #e2e8f0;
    --green: #15803d;
    --red: #b91c1c;
    --amber: #b45309;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ================================================
   NAVBAR - Professional 3-column layout
   Desktop: Brand [LEFT] | Links [CENTER] | Profile [RIGHT]
   Mobile:  Brand [LEFT] | Profile + Hamburger [RIGHT], links dropdown below
   ================================================ */
.navbar {
    background: var(--primary);
    color: #fff;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}

.nav-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    gap: 16px;
}

/* Brand */
.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    white-space: nowrap;
    flex-shrink: 0;
    text-decoration: none;
}
.brand-mark {
    width: 34px;
    height: 34px;
    display: block;
    border-radius: 9px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .25);
    flex-shrink: 0;
}
.brand-text {
    color: #fff;
    font-weight: 500;
    letter-spacing: .5px;
}
.brand-text strong {
    font-weight: 800;
    color: #fbbf24;
}

/* Nav links - center column on desktop */
.nav-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 2px;
    flex: 1;
}
.nav-links a {
    color: #c5d5ea;
    text-decoration: none;
    padding: 7px 13px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background .18s, color .18s;
}
.nav-links a:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}
.nav-links a.active {
    background: rgba(255, 255, 255, .18);
    color: #fff;
    font-weight: 600;
}

/* Right section */
.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    transition: background .15s;
}
.nav-toggle:hover {
    background: rgba(255, 255, 255, .1);
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: transform .3s, opacity .3s;
}
.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ================================================
   PROFILE DROPDOWN
   ================================================ */
.nav-profile {
    position: relative;
}
.nav-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 24px;
    padding: 4px 14px 4px 4px;
    cursor: pointer;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    transition: background .18s;
}
.nav-profile-btn:hover {
    background: rgba(255, 255, 255, .16);
}
.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fbbf24;
    color: var(--primary);
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.nav-username {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-chevron {
    transition: transform .2s;
    opacity: .7;
}
.nav-profile.open .nav-chevron {
    transform: rotate(180deg);
}

.nav-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    min-width: 230px;
    padding: 8px 0;
    box-shadow: 0 12px 36px rgba(0, 0, 0, .2);
    z-index: 200;
}
.nav-profile.open .nav-dropdown {
    display: block;
}
.nav-dropdown-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
}
.nav-avatar-lg {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--primary);
    color: #fbbf24;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.nav-dropdown .nav-dd-name {
    font-weight: 700;
    color: var(--text);
    font-size: 14px;
}
.nav-dropdown .nav-dd-role {
    font-size: 12px;
    color: var(--muted);
    font-weight: 600;
    margin-top: 2px;
}
.nav-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}
.nav-dropdown .nav-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 400;
    color: var(--text);
    text-decoration: none;
    transition: background .12s;
}
.nav-dropdown .nav-dropdown-item:hover {
    background: #f1f5f9;
    color: var(--primary);
}
.nav-dropdown .nav-dropdown-item svg {
    flex-shrink: 0;
    opacity: .7;
}
.nav-dropdown .nav-dropdown-logout {
    color: var(--red);
    font-weight: 600;
}
.nav-dropdown .nav-dropdown-logout:hover {
    background: #fef2f2;
    color: var(--red);
}
.nav-dropdown .nav-dropdown-logout svg {
    opacity: .9;
}

/* ================================================
   LAYOUT
   ================================================ */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
    flex: 1;
}

.footer {
    text-align: center;
    color: var(--muted);
    font-size: 13px;
    padding: 16px;
    border-top: 1px solid var(--border);
    background: var(--card);
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}
.page-header h1 { font-size: 24px; color: var(--primary); }
.page-header h2 { font-size: 18px; color: var(--primary); }
.page-header p { color: var(--muted); margin-top: 4px; }

/* ================================================
   ALERTS
   ================================================ */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    border: 1px solid transparent;
}
.alert-success { background: #f0fdf4; color: var(--green); border-color: #bbf7d0; }
.alert-error { background: #fef2f2; color: var(--red); border-color: #fecaca; }
.alert-info { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }

/* ================================================
   CARDS
   ================================================ */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}
.card h3 { margin-bottom: 14px; color: var(--primary); }

/* ================================================
   FORMS
   ================================================ */
.form-group { margin-bottom: 14px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 5px;
    color: #334155;
}
.form-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

input[type="text"], input[type="password"], input[type="number"],
input[type="date"], select, textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    color: var(--text);
    transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, .15);
}
textarea { resize: vertical; }

input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px dashed #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    font-size: 13px;
}

.cert-fieldset {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
}
.cert-fieldset legend {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    padding: 0 6px;
}

/* ================================================
   BUTTONS
   ================================================ */
.btn {
    display: inline-block;
    padding: 9px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    background: var(--primary-light);
    color: #fff;
    transition: background .15s, transform .05s;
}
.btn:hover { background: var(--primary); color: #fff; }
.btn-primary { background: var(--primary-light); color: #fff; }
.btn-primary:hover { background: var(--primary); }
.btn-secondary { background: #e2e8f0; color: #334155; }
.btn-secondary:hover { background: #cbd5e1; color: #1e293b; }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-block { width: 100%; }
.btn-small { padding: 5px 10px; font-size: 12px; border-radius: 6px; }

.inline-form { display: inline; }
.inline-flex { display: flex; gap: 10px; }
.inline-flex input[type="text"] { max-width: 320px; }

/* ================================================
   SEARCH
   ================================================ */
.search-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}
.search-bar input[type="text"] { flex: 1; min-width: 220px; }
.search-bar select { width: auto; }

/* ================================================
   TABLES
   ================================================ */
.table-wrap { overflow-x: auto; }

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
    margin-bottom: 20px;
}
.table th {
    background: var(--primary);
    color: #fff;
    text-align: left;
    padding: 12px 14px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    white-space: nowrap;
}
.table td {
    padding: 12px 14px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
.table tbody tr:nth-child(even) { background: #f8fafc; }
.table tbody tr:hover { background: #eef4fc; }
.table .num { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .strong { font-weight: 600; color: var(--primary); white-space: nowrap; }
.table .actions { white-space: nowrap; }
.table .actions .btn, .table .actions form { margin-right: 6px; }

.actions select {
    display: inline-block;
    width: auto;
    padding: 5px 8px;
    font-size: 12px;
    margin-right: 6px;
}

/* ================================================
   BADGES
   ================================================ */
.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.badge-loc { background: #eff6ff; color: #1d4ed8; }
.loc-cell { line-height: 1.7; }
.badge-role { background: #f1f5f9; color: #334155; }
.badge-admin { background: #fee2e2; color: #b91c1c; }
.badge-qaqc { background: #fef3c7; color: #b45309; }
.badge-site { background: #dcfce7; color: #15803d; }
.badge-danger { background: #fee2e2; color: #b91c1c; }
.badge-green { background: #dcfce7; color: #15803d; }

.badge-status { background: #e2e8f0; color: #475569; }
.badge-valid { background: #dcfce7; color: #15803d; }
.badge-expiring { background: #fef3c7; color: #b45309; }
.badge-expired { background: #fee2e2; color: #b91c1c; }
.badge-nodate { background: #e2e8f0; color: #475569; }

/* ================================================
   STATS
   ================================================ */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}
.stat-value { font-size: 24px; font-weight: 700; color: var(--primary); }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ================================================
   TEXT HELPERS
   ================================================ */
.text-green { color: var(--green); font-weight: 700; }
.text-red { color: var(--red); font-weight: 700; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.small { font-size: 12px; }

/* ================================================
   TWO COLUMNS
   ================================================ */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    align-items: start;
}

/* ================================================
   AUTH
   ================================================ */
.auth-wrap {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}
.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 32px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .08);
    text-align: center;
}
.auth-logo {
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}
.auth-logo .brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(22, 50, 79, .28);
}
.auth-logo .brand-text {
    font-size: 24px;
    color: var(--primary);
    letter-spacing: .5px;
}
.auth-logo .brand-text strong {
    font-weight: 800;
    color: #d97706;
}
.auth-card h2 { color: var(--primary); margin-bottom: 4px; }
.auth-card .sub { color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.auth-card form { text-align: left; }
.auth-narrow { max-width: 480px; margin: 0 auto; }

.demo-accounts {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed var(--border);
    text-align: left;
}
.demo-title { font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.demo-accounts table { width: 100%; border-collapse: collapse; }
.demo-accounts td {
    font-size: 13px;
    padding: 4px 0;
    color: #475569;
}
.demo-accounts td:first-child { font-weight: 600; color: var(--primary); }

/* ================================================
   EMPTY STATE
   ================================================ */
.empty-state {
    text-align: center;
    color: var(--muted);
    padding: 48px 20px;
    background: var(--card);
    border: 1px dashed var(--border);
    border-radius: 10px;
}
.empty-state h1 { font-size: 48px; color: var(--border); }
.empty-state p { margin: 8px 0 18px; }

.col-remaining { color: #fbbf24; }

/* ================================================
   CHARTS / ANALYSIS
   ================================================ */
.toolbar {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 18px;
}
.live-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: #f0fdf4;
    color: var(--green);
    border: 1px solid #bbf7d0;
    padding: 7px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}
.live-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    animation: livepulse 1.4s ease-in-out infinite;
}
@keyframes livepulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: .45; transform: scale(.85); }
}
.last-updated { color: var(--muted); font-size: 13px; }

.chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}
.chart-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .05);
}
.chart-card h3 { font-size: 15px; color: var(--primary); margin-bottom: 12px; }
.chart-card img { width: 100%; height: auto; display: block; }

/* ================================================
   EXTRACT HINT / LOADING
   ================================================ */
.extract-hint .spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: -2px;
    margin-right: 6px;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ================================================
   ASSET PICKER (certificate upload) - full width
   ================================================ */
.asset-picker {
    width: 100%;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}
.ap-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}
.ap-title {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--text);
}
.ap-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: var(--bg);
    color: var(--muted);
    border: 1px solid var(--border);
    transition: all .15s ease;
}
.ap-badge-active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* Search */
.ap-search-wrap {
    position: relative;
    width: 100%;
    margin-bottom: 10px;
}
.ap-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}
.ap-search {
    width: 100%;
    padding: 10px 36px 10px 38px !important;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg);
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.ap-search:focus {
    outline: none;
    background: var(--card);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(43, 108, 176, .15);
}
.ap-clear-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 50%;
    background: var(--border);
    color: var(--muted);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ap-clear-btn:hover { background: var(--muted); color: #fff; }

/* Toolbar */
.ap-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.ap-hint { margin-left: auto; }

/* List */
.asset-list {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    background: var(--card);
}
.asset-list::-webkit-scrollbar { width: 8px; }
.asset-list::-webkit-scrollbar-track { background: transparent; }
.asset-list::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}
.asset-list::-webkit-scrollbar-thumb:hover { background: var(--muted); }

.asset-list .asset-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 0;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 400;
    color: var(--text);
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    border-left: 3px solid transparent;
    transition: background .12s ease, border-left-color .12s ease;
    user-select: none;
}
.asset-list .asset-item:last-of-type { border-bottom: none; }
.asset-list .asset-item:hover { background: var(--bg); }
.asset-list .asset-item.selected {
    background: rgba(43, 108, 176, .08);
    border-left-color: var(--primary-light);
}

/* Hide native checkbox, use custom indicator */
.asset-list .asset-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.ai-check {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 5px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card);
    transition: all .12s ease;
}
.ai-check svg { opacity: 0; transform: scale(.5); transition: all .12s ease; }
.asset-item.selected .ai-check,
.asset-item input:checked + .ai-check {
    background: var(--primary-light);
    border-color: var(--primary-light);
}
.asset-item.selected .ai-check svg,
.asset-item input:checked + .ai-check svg {
    opacity: 1;
    transform: scale(1);
}

.ai-no {
    font-family: Consolas, "Courier New", monospace;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--primary);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 4px 8px;
    white-space: nowrap;
    flex-shrink: 0;
}
.asset-item.selected .ai-no {
    background: #fff;
    border-color: rgba(43, 108, 176, .35);
}
.ai-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ai-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ai-cat {
    font-size: 11.5px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .3px;
}
.ai-unit {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px 10px;
    text-transform: uppercase;
    flex-shrink: 0;
}

.ap-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 13px;
}

/* ================================================
   CERTIFICATE UPDATE - current info card
   ================================================ */
.update-current {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px 16px;
}
.uc-row {
    display: flex;
    gap: 12px;
    padding: 5px 0;
    font-size: 14px;
    align-items: baseline;
}
.uc-row + .uc-row { border-top: 1px dashed var(--border); }
.uc-label {
    min-width: 130px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    color: var(--muted);
}
.uc-file {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    word-break: break-all;
}

@media (max-width: 768px) {
    .asset-picker { padding: 12px; }
    .ai-no { display: none; }
    .ap-hint { display: none; }
}

/* ================================================
   RESPONSIVE
   ================================================ */

/* Tablet (max-width: 768px) */
@media (max-width: 768px) {
    .navbar {
        padding: 0 16px;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary);
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 8px 12px 12px;
        box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
    }
    .nav-links.open {
        display: flex;
    }
    .nav-links a {
        padding: 11px 14px;
        font-size: 14px;
        border-radius: 6px;
    }

    .nav-top {
        min-height: 52px;
    }

    .nav-username {
        display: none;
    }

    .container { padding: 16px 12px; }

    .page-header h1 { font-size: 20px; }
    .page-header h2 { font-size: 16px; }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .form-row .form-group { min-width: 100%; }

    .inline-flex {
        flex-direction: column;
    }
    .inline-flex input[type="text"] { max-width: 100%; }

    .search-bar {
        flex-direction: column;
        gap: 8px;
        padding: 12px;
    }
    .search-bar input[type="text"] { min-width: 100%; }
    .search-bar select { width: 100%; }

    .table { font-size: 13px; }
    .table th { padding: 10px 8px; font-size: 11px; }
    .table td { padding: 10px 8px; }

    .stat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .stat-card { padding: 14px 10px; }
    .stat-value { font-size: 20px; }

    .chart-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .auth-card {
        padding: 24px 20px;
        margin: 0 12px;
    }

    .two-col {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .card { padding: 14px; }

    .footer { font-size: 12px; padding: 12px; }
}

/* Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .navbar { padding: 0 12px; }
    .nav-brand { font-size: 17px; gap: 8px; }
    .brand-mark { width: 28px; height: 28px; }
    .nav-toggle { width: 32px; height: 32px; gap: 4px; }
    .nav-toggle span { width: 20px; }

    .container { padding: 12px 8px; }

    .page-header {
        flex-direction: column;
        gap: 8px;
    }
    .page-header h1 { font-size: 18px; }

    .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-value { font-size: 18px; }
    .stat-label { font-size: 12px; }

    .table { font-size: 12px; display: block; overflow-x: auto; }
    .table th { padding: 8px 6px; font-size: 10px; }
    .table td { padding: 8px 6px; }

    .btn { padding: 8px 14px; font-size: 13px; }
    .btn-small { padding: 5px 8px; font-size: 11px; }

    input[type="text"], input[type="password"], input[type="number"],
    input[type="date"], select, textarea {
        padding: 9px 10px;
        font-size: 13px;
    }

    .auth-card { padding: 20px 16px; }
    .auth-logo .brand-mark { width: 38px; height: 38px; }
    .auth-logo .brand-text { font-size: 20px; }

    .empty-state { padding: 32px 16px; }

    .chart-grid { grid-template-columns: 1fr; }
}

/* Large desktop (min-width: 1400px) */
@media (min-width: 1400px) {
    .container { max-width: 1400px; }
}

/* Print */
@media print {
    .navbar, .footer, .btn, .search-bar { display: none !important; }
    .container { padding: 0; max-width: 100%; }
    .table { box-shadow: none; border: 1px solid #ccc; }
}

/* ================================================
   PROFESSIONAL DATA PAGE (Import / Export)
   ================================================ */

/* Page hero */
.page-hero {
    background: linear-gradient(135deg, var(--primary) 0%, #16324f 60%, #1e3a5f 100%);
    border-radius: 14px;
    padding: 28px 30px;
    color: #fff;
    margin-bottom: 22px;
    position: relative;
    overflow: hidden;
}
.page-hero::after {
    content: "";
    position: absolute;
    right: -60px;
    top: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .06);
}
.page-hero h1 {
    font-size: 24px;
    font-weight: 700;
    letter-spacing: .2px;
    margin-bottom: 6px;
}
.page-hero p {
    color: rgba(255, 255, 255, .78);
    font-size: 14px;
    max-width: 640px;
}

/* KPI strip */
.kpi-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}
.kpi {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
    transition: transform .15s, box-shadow .15s;
}
.kpi:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 23, 42, .09);
}
.kpi-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary-light);
    background: rgba(43, 108, 176, .1);
}
.kpi-icon svg { width: 19px; height: 19px; }
.kpi-icon.green { color: var(--green); background: rgba(21, 128, 61, .1); }
.kpi-icon.red { color: var(--red); background: rgba(185, 28, 28, .08); }
.kpi-icon.amber { color: var(--amber); background: rgba(180, 83, 9, .1); }
.kpi-meta { min-width: 0; }
.kpi-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.15;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.kpi-label {
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--muted);
}

/* Panels */
.panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.panel-head {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 18px 22px;
    border-bottom: 1px solid var(--border);
}
.panel-head h2 {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}
.panel-head p {
    font-size: 12.5px;
    color: var(--muted);
    margin-top: 2px;
}
.icon-chip {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #fff;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    box-shadow: 0 4px 10px rgba(30, 58, 95, .25);
}
.icon-chip svg { width: 21px; height: 21px; }
.icon-chip.green { background: linear-gradient(135deg, #16a34a, #15803d); box-shadow: 0 4px 10px rgba(21, 128, 61, .25); }
.panel-body { padding: 18px 22px; flex: 1; }
.panel-foot {
    padding: 16px 22px;
    border-top: 1px solid var(--border);
    background: #f8fafc;
    border-radius: 0 0 14px 14px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Sheet list (export contents) */
.sheet-list { list-style: none; margin: 0; padding: 0; }
.sheet-list li {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 9px 2px;
    border-bottom: 1px dashed var(--border);
    font-size: 13.5px;
}
.sheet-list li:last-child { border-bottom: none; }
.sheet-name {
    flex-shrink: 0;
    width: 118px;
    font-weight: 700;
    font-size: 12px;
    color: var(--primary-light);
    background: rgba(43, 108, 176, .08);
    border: 1px solid rgba(43, 108, 176, .18);
    padding: 3px 8px;
    border-radius: 6px;
    text-align: center;
    letter-spacing: .3px;
}
.sheet-desc { color: #475569; }

/* Steps + rules */
.step-list { list-style: none; counter-reset: step; margin: 0 0 4px; padding: 0; }
.step-list li {
    counter-increment: step;
    position: relative;
    padding: 7px 0 7px 40px;
    font-size: 13.5px;
    color: #475569;
}
.step-list li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 6px;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(43, 108, 176, .1);
    color: var(--primary-light);
    border: 1px solid rgba(43, 108, 176, .25);
    font-size: 12.5px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rule-callout {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 4px solid #d97706;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 13px;
    color: #78350f;
}
.rule-callout strong { color: #92400e; }
.rule-callout ul { margin: 8px 0 0 18px; }
.rule-callout li { margin-bottom: 6px; }
.rule-callout li:last-child { margin-bottom: 0; }

/* File drop zone */
.dropzone {
    display: block;
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    padding: 26px 18px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s, background .15s;
    margin-bottom: 14px;
}
.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent);
    background: rgba(43, 108, 176, .05);
}
.dropzone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    border: 0;
    padding: 0;
    display: block;
}
.dz-icon {
    width: 44px;
    height: 44px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: rgba(43, 108, 176, .1);
    color: var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
}
.dz-icon svg { width: 22px; height: 22px; }
.dz-title { font-size: 14px; font-weight: 700; color: var(--text); }
.dz-title span { color: var(--accent); }
.dz-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.dz-file {
    display: none;
    margin-top: 10px;
    font-size: 13px;
    font-weight: 600;
    color: var(--green);
    word-break: break-all;
}

/* Buttons - large */
.btn-lg {
    padding: 12px 20px;
    font-size: 14.5px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: 100%;
}
.btn-lg svg { width: 17px; height: 17px; }
.btn-outline {
    background: transparent;
    color: var(--primary-light);
    border: 1.5px solid rgba(43, 108, 176, .45);
}
.btn-outline:hover {
    background: rgba(43, 108, 176, .07);
    color: var(--primary);
}

@media (max-width: 1100px) {
    .kpi-strip { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 768px) {
    .kpi-strip { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .page-hero { padding: 20px; }
    .page-hero h1 { font-size: 20px; }
    .panel-head, .panel-body, .panel-foot { padding-left: 16px; padding-right: 16px; }
}

