/* === SECURITY PLATFORM — NEW PREMIUM UI === */
/* Palette: Warm European — cream, deep teal, copper */

:root {
    --bg: #FAF7F2;
    --surface: #FFFFFF;
    --surface-alt: #F5F1EA;
    --surface-hover: #F0EBE0;
    --primary: #0F4C5C;
    --primary-light: #1A6B7E;
    --primary-dark: #0A3540;
    --accent: #B87333;
    --accent-light: #D49553;
    --accent-soft: #F4E8D8;
    --success: #5B8C5A;
    --success-soft: #E8F0E7;
    --warning: #E8A93C;
    --warning-soft: #FCF3E0;
    --danger: #D8593F;
    --danger-soft: #FAE8E2;
    --text: #1A1A2E;
    --text-muted: #6B6B7B;
    --text-light: #9B9BAB;
    --border: #E8E2D8;
    --border-strong: #D5CDBE;
    --shadow: 0 2px 12px rgba(26,26,46,0.06);
    --shadow-md: 0 4px 20px rgba(26,26,46,0.08);
    --shadow-lg: 0 8px 32px rgba(26,26,46,0.12);
    --radius: 14px;
    --radius-sm: 8px;
    --radius-xs: 6px;
    --topbar-h: 64px;
}

/* Dark mode support */
[data-light="false"] {
    --bg: #141318;
    --surface: #1E1D24;
    --surface-alt: #25232D;
    --surface-hover: #2A2833;
    --primary: #2B8A9E;
    --primary-light: #3DA5BB;
    --accent: #D49553;
    --accent-soft: #3A3024;
    --text: #E8E6E0;
    --text-muted: #9B9BAB;
    --text-light: #6B6B7B;
    --border: #2E2C36;
    --border-strong: #3A3842;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    line-height: 1.6;
}

/* === TOP BAR === */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.topbar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    margin-right: 32px;
    white-space: nowrap;
}

.topbar-logo svg { flex-shrink: 0; }

.topbar-nav {
    display: flex;
    gap: 4px;
    flex: 1;
}

.nav-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
}

.nav-pill:hover {
    background: var(--surface-alt);
    color: var(--text);
}

.nav-pill.active {
    background: var(--primary);
    color: #fff;
}

.nav-pill svg { width: 16px; height: 16px; }

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.topbar-search {
    width: 200px;
    padding: 8px 12px 8px 36px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-alt) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236B6B7B' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") 10px center no-repeat;
    font-size: 13px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s;
}

.topbar-search:focus { border-color: var(--primary); }

.topbar-search::placeholder { color: var(--text-light); }

.lang-switcher {
    display: flex;
    gap: 2px;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    padding: 2px;
}

.lang-btn {
    padding: 4px 8px;
    border: none;
    background: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.15s;
}

.lang-btn:hover { color: var(--text); }
.lang-btn.active { background: var(--primary); color: #fff; }

.notif-btn {
    position: relative;
    padding: 8px;
    border: none;
    background: var(--surface-alt);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s;
}

.notif-btn:hover { color: var(--text); background: var(--surface-hover); }
.notif-dot {
    position: absolute;
    top: 6px; right: 6px;
    width: 8px; height: 8px;
    background: var(--accent);
    border-radius: 50%;
    border: 2px solid var(--surface);
}

/* === USER MENU === */
.user-menu {
    position: relative;
}

.user-avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    border: 2px solid var(--border);
    transition: border-color 0.2s;
}

.user-avatar:hover { border-color: var(--primary); }

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 260px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s;
    z-index: 1100;
}

.user-dropdown.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
}

.user-dropdown-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}

.user-dropdown-email {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.user-dropdown-role {
    display: inline-block;
    margin-top: 6px;
    padding: 2px 8px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: var(--radius-xs);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.user-dropdown-menu {
    padding: 6px;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    color: var(--text);
    text-decoration: none;
    border-radius: var(--radius-xs);
    font-size: 13px;
    transition: background 0.15s;
}

.user-dropdown-item:hover { background: var(--surface-alt); }
.user-dropdown-item svg { width: 16px; height: 16px; color: var(--text-muted); }

.user-dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

.user-dropdown-logout {
    color: var(--danger) !important;
}

/* === CONTENT === */
.content {
    margin-top: var(--topbar-h);
    padding: 28px 32px;
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* === PAGE HEADER === */
.page-header {
    margin-bottom: 24px;
}

.page-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.page-header p {
    color: var(--text-muted);
    font-size: 14px;
}

/* === INFO BANNER === */
.info-banner {
    background: var(--accent-soft);
    border: 1px solid var(--accent-light);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 13px;
    color: var(--text);
    line-height: 1.6;
}

.info-banner strong { color: var(--accent); }

/* === STAT CARDS === */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: help;
}

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

.stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-info { display: flex; flex-direction: column; }
.stat-label { font-size: 12px; color: var(--text-muted); }
.stat-value { font-size: 22px; font-weight: 700; color: var(--text); }
.stat-value.good { color: var(--success); }
.stat-value.bad { color: var(--danger); }
.stat-value.warning { color: var(--warning); }

/* === FEATURE CARDS (Funzioni) === */
.section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all 0.25s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px);
    border-color: var(--primary-light);
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.25s;
}

.feature-card:hover::before { opacity: 1; }

.feature-card-icon {
    width: 48px; height: 48px;
    border-radius: var(--radius-sm);
    background: var(--surface-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 14px;
}

.feature-card-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.feature-card-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 12px;
}

.feature-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.feature-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-primary { background: var(--primary); color: #fff; }
.badge-accent { background: var(--accent-soft); color: var(--accent); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: var(--surface-alt); color: var(--text-muted); }

.feature-card-reg {
    font-size: 10px;
    color: var(--text-light);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* === COMPLIANCE GAUGE === */
.compliance-hero {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.gauge-wrap {
    position: relative;
    width: 140px; height: 140px;
    flex-shrink: 0;
}

.gauge-bg { stroke: var(--border); stroke-width: 10; fill: none; }
.gauge-fill {
    stroke: var(--primary);
    stroke-width: 10;
    fill: none;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
}

.gauge-text {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.gauge-value { font-size: 32px; font-weight: 700; color: var(--text); }
.gauge-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }

.compliance-hero-info { flex: 1; }
.compliance-hero-info h2 { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.compliance-hero-info p { color: var(--text-muted); font-size: 13px; margin-bottom: 16px; }

.reg-mini-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.reg-mini-card {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px;
    text-align: center;
}

.reg-mini-name { font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.reg-mini-bar {
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin: 6px 0;
}
.reg-mini-fill { height: 100%; border-radius: 3px; transition: width 0.8s ease; }
.reg-mini-pct { font-size: 11px; color: var(--text-muted); }

/* === HELP SECTION === */
.help-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 24px;
}

.help-section h3 {
    font-size: 15px;
    margin-bottom: 12px;
    color: var(--primary);
}

.help-list {
    list-style: none;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.help-list li {
    font-size: 13px;
    color: var(--text-muted);
    padding: 6px 0;
}

.help-list li strong { color: var(--text); }

/* === TABLES === */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.data-table th {
    background: var(--surface-alt);
    padding: 12px 16px;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text);
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--surface-alt); }

/* === STATUS PILLS === */
.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.status-pill::before {
    content: '';
    width: 6px; height: 6px;
    border-radius: 50%;
}

.status-pill.ok { background: var(--success-soft); color: var(--success); }
.status-pill.ok::before { background: var(--success); }
.status-pill.warn { background: var(--warning-soft); color: var(--warning); }
.status-pill.warn::before { background: var(--warning); }
.status-pill.err { background: var(--danger-soft); color: var(--danger); }
.status-pill.err::before { background: var(--danger); }
.status-pill.muted { background: var(--surface-alt); color: var(--text-muted); }
.status-pill.muted::before { background: var(--text-light); }

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

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

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

.btn-accent {
    background: var(--accent);
    color: #fff;
}

.btn-accent:hover { background: var(--accent-light); filter: brightness(1.1); }

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

.btn-outline:hover { background: var(--surface-alt); border-color: var(--primary); }

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-danger:hover { filter: brightness(1.1); }

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

/* === FORMS === */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(15,76,92,0.1);
}

.form-group textarea { resize: vertical; min-height: 80px; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-hint {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* === MODAL === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(26,26,46,0.4);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-overlay.open { display: flex; }

.modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    width: 90%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-header h3 { font-size: 16px; font-weight: 700; }

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
}

.modal-body { padding: 24px; }

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* === TOAST === */
.toast {
    position: fixed;
    bottom: 24px; right: 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    display: none;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    max-width: 400px;
}

.toast.show { display: flex; }
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
.toast.info { border-left: 3px solid var(--primary); }

/* === LOGIN === */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: var(--bg);
    padding: 20px;
}

.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 36px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 28px;
}

.login-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.login-header p { color: var(--text-muted); font-size: 13px; }

/* === CHARTS === */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
}

.chart-card h3 {
    margin: 0 0 14px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

/* === CARDS GENERIC === */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

/* === SECTION HEADER === */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

/* === REGULATION CARDS === */
.reg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.reg-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px;
    transition: all 0.25s;
    position: relative;
}

.reg-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.reg-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
}

.reg-card-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-sm);
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
}

.reg-card-title { font-size: 16px; font-weight: 700; margin-bottom: 2px; }
.reg-card-subtitle { font-size: 12px; color: var(--text-muted); }

.reg-card-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 12px 0;
}

.reg-card-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
}

.toggle-switch {
    position: relative;
    width: 42px; height: 24px;
    background: var(--border-strong);
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.toggle-switch.on { background: var(--success); }

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px; left: 2px;
    width: 20px; height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch.on::after { transform: translateX(18px); }

.toggle-label { font-size: 13px; font-weight: 600; color: var(--text); }

/* === PROGRESS BAR === */
.progress-bar {
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.8s ease;
}

.progress-fill.good { background: var(--success); }
.progress-fill.warn { background: var(--warning); }
.progress-fill.bad { background: var(--danger); }

/* === EMPTY STATE === */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-muted);
}

.empty-state-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
.empty-state h3 { font-size: 16px; color: var(--text); margin-bottom: 4px; }
.empty-state p { font-size: 13px; }

/* === SEARCH & FILTER === */
.toolbar {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.toolbar input,
.toolbar select {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    outline: none;
}

.toolbar input { flex: 1; min-width: 200px; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--primary); }

/* === PAGINATION === */
.pagination {
    display: flex;
    gap: 4px;
    justify-content: center;
    margin-top: 16px;
}

.pagination button {
    padding: 6px 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius-xs);
    cursor: pointer;
    font-size: 13px;
}

.pagination button.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination button:disabled { opacity: 0.4; cursor: default; }

/* === MOBILE === */
@media (max-width: 768px) {
    .topbar { padding: 0 12px; }
    .topbar-nav { display: none; }
    .topbar-search { display: none; }
    .content { padding: 16px; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .charts-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .help-list { grid-template-columns: 1fr; }
    .compliance-hero { flex-direction: column; text-align: center; }
    .section-grid { grid-template-columns: 1fr; }
    .reg-grid { grid-template-columns: 1fr; }
}

/* === System Portal Page Styles === */
.system-page { padding: 24px; max-width: 1400px; margin: 0 auto; }
.system-page h1 { color: #0A3540; font-size: 1.8rem; margin-bottom: 16px; }
.system-page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.system-subtitle { color: #666; margin-bottom: 16px; font-size: 0.9rem; }
.system-stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; margin-bottom: 32px; }
.system-stat-card { background: #fff; border: 1px solid #e0e0e0; border-radius: 12px; padding: 20px; text-align: center; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.system-stat-icon { font-size: 2rem; margin-bottom: 8px; }
.system-stat-value { font-size: 2rem; font-weight: 700; color: #0A3540; }
.system-stat-label { font-size: 0.85rem; color: #888; margin-top: 4px; }
.system-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.system-table th { background: #0A3540; color: #fff; padding: 12px 16px; text-align: left; font-size: 0.85rem; font-weight: 600; }
.system-table td { padding: 10px 16px; border-bottom: 1px solid #f0f0f0; font-size: 0.9rem; }
.system-table tr:hover td { background: #f8f9fa; }
.badge-active { background: #e8f5e9; color: #2e7d32; padding: 2px 10px; border-radius: 12px; font-size: 0.8rem; }
.badge-inactive { background: #fbe9e7; color: #c62828; padding: 2px 10px; border-radius: 12px; font-size: 0.8rem; }
.badge-warn { background: #fff3e0; color: #e65100; padding: 2px 10px; border-radius: 12px; font-size: 0.8rem; }
.badge-info { background: #e3f2fd; color: #1565c0; padding: 2px 10px; border-radius: 12px; font-size: 0.8rem; }
.btn-admin-primary { background: #0A3540; color: #fff; border: none; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: 600; }
.btn-admin-primary:hover { background: #0F4C5C; }
.btn-sm { padding: 4px 12px; border-radius: 6px; border: none; cursor: pointer; font-size: 0.8rem; }
.btn-warn { background: #ff9800; color: #fff; }
.btn-ok { background: #4caf50; color: #fff; }
.btn-accent { background: #B87333; color: #fff; }
.action-cell { display: flex; gap: 6px; }
/* REMOVED duplicate modal-overlay - using .open class instead */
.modal-card { background: #FAF7F2; border-radius: 16px; padding: 32px; max-width: 500px; width: 90%; box-shadow: 0 8px 32px rgba(0,0,0,0.15); }
.modal-card h2 { color: #0A3540; margin-bottom: 20px; }
.modal-card input { width: 100%; padding: 10px 12px; margin-bottom: 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 0.9rem; box-sizing: border-box; }
.modal-card button { width: 100%; }
.system-empty { text-align: center; padding: 40px; color: #888; }

/* Nav Dropdown Submenu */
.nav-dropdown { position: relative; display: inline-block; }
.nav-pill-dropdown { display: flex; align-items: center; gap: 4px; }
.nav-dropdown-menu {
    display: none; position: absolute; top: 100%; left: 0;
    min-width: 180px; background: var(--card, #fff);
    border: 1px solid var(--border, #ddd); border-radius: var(--radius, 8px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 1000; padding: 8px 4px 4px 4px;
    margin-top: 0;
}
.nav-dropdown::before {
    content: ''; position: absolute; top: 100%; left: 0; right: 0; height: 8px;
}
.nav-dropdown:hover .nav-dropdown-menu, .nav-dropdown-menu:hover { display: block; }
.nav-dropdown-menu .nav-dropdown-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 14px; text-decoration: none;
    color: var(--text, #333); font-size: 13px; font-weight: 500;
    border-radius: 6px; transition: background 0.15s;
}
.nav-dropdown-menu .nav-dropdown-item:hover {
    background: var(--accent-soft, rgba(15,76,92,0.08));
    color: var(--primary, #0F4C5C);
}
