/* ============================================================
   NOVENTRA ADMIN CONSOLE — admin.css
   Palette: matches main site (green-900 sidebar, white main)
   Aesthetic: editorial dark sidebar + clean light workspace
============================================================ */

/* ── Tokens ───────────────────────────────────────────── */
:root {
    --green-900: #003a00;
    --green-800: #005200;
    --green-700: #006400;
    --green-600: #1a7d1a;
    --green-500: #2e9e2e;
    --green-400: #4ab54a;
    --green-200: #b6dbb6;
    --green-100: #e6f5e6;
    --green-50: #f2faf2;
    --gold: #b8943a;
    --gold-light: #f0d88a;
    --amber: #d97706;
    --teal: #0e7490;
    --red: #b91c1c;

    --ink: #141414;
    --ink-mid: #3a3a3a;
    --ink-muted: #6b6b6b;
    --surface: #fafaf8;
    --white: #ffffff;
    --border: rgba(0, 0, 0, 0.08);
    --border-mid: rgba(0, 0, 0, 0.14);

    --sidebar-bg: #0b1f0b;
    --sidebar-w: 260px;
    --topbar-h: 68px;

    --font-display: 'Playfair Display', Georgia, serif;
    --font-sans: 'DM Sans', system-ui, sans-serif;

    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 18px;
    --radius-xl: 28px;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.14);
}

/* ── Reset ────────────────────────────────────────────── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--surface);
    color: var(--ink-mid);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: var(--font-sans);
    cursor: pointer;
    border: none;
    background: none;
}

input,
select,
textarea {
    font-family: var(--font-sans);
}

img {
    max-width: 100%;
}

/* ── Layout shell ─────────────────────────────────────── */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
}

.main-content {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Sidebar header ───────────────────────────────────── */
.sidebar-header {
    padding: 1.5rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo-mark {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--green-600), var(--green-400));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 100, 0, 0.35);
}

.sidebar-logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.sidebar-brand {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
}

.sidebar-role {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.35);
    text-transform: uppercase;
}

.sidebar-close {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1rem;
    display: none;
    padding: 0.3rem;
    transition: color 0.2s;
}

.sidebar-close:hover {
    color: rgba(255, 255, 255, 0.7);
}

/* ── Sidebar nav ──────────────────────────────────────── */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    overflow-y: auto;
    scrollbar-width: none;
}

.sidebar-nav::-webkit-scrollbar {
    display: none;
}

.nav-section-label {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.22);
    padding: 1.25rem 0.75rem 0.5rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0.875rem;
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-bottom: 2px;
    position: relative;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
}

.nav-item.active {
    background: rgba(74, 181, 74, 0.14);
    color: var(--green-400);
}

.nav-item.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 20%;
    bottom: 20%;
    width: 3px;
    background: var(--green-400);
    border-radius: 0 3px 3px 0;
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.nav-label {
    flex: 1;
}

.nav-badge {
    font-size: 0.6rem;
    font-weight: 700;
    background: var(--green-600);
    color: var(--white);
    padding: 0.15rem 0.45rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.nav-count {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.25);
    font-weight: 600;
}

/* ── Sidebar footer ───────────────────────────────────── */
.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.admin-profile:hover {
    background: rgba(255, 255, 255, 0.05);
}

.admin-avatar {
    width: 34px;
    height: 34px;
    background: var(--green-700);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--white);
    flex-shrink: 0;
}

.admin-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    min-width: 0;
}

.admin-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-email {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-logout {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.9rem;
    padding: 0.25rem;
    transition: color 0.2s;
}

.admin-logout:hover {
    color: var(--red);
}

/* ── Sidebar overlay (mobile) ─────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    z-index: 199;
}

/* ── Topbar ───────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    background: var(--white);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-menu-btn {
    width: 38px;
    height: 38px;
    background: var(--green-50);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--green-700);
    font-size: 1rem;
    display: none;
    transition: all 0.2s;
}

.topbar-menu-btn:hover {
    background: var(--green-100);
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.breadcrumb-root {
    font-family: var(--font-display);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--green-700);
}

.breadcrumb-sep {
    color: var(--ink-muted);
}

.breadcrumb-current {
    font-weight: 500;
    color: var(--ink-mid);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.topbar-search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-sm);
    padding: 0.45rem 0.9rem;
    transition: border-color 0.2s;
}

.topbar-search:focus-within {
    border-color: var(--green-500);
}

.topbar-search i {
    color: var(--ink-muted);
    font-size: 0.8rem;
}

.topbar-search input {
    border: none;
    background: none;
    outline: none;
    font-size: 0.875rem;
    color: var(--ink);
    width: 200px;
}

.topbar-icon-btn {
    width: 38px;
    height: 38px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-mid);
    position: relative;
    transition: all 0.2s;
}

.topbar-icon-btn:hover {
    background: var(--green-50);
    color: var(--green-700);
}

.notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: var(--amber);
    border-radius: 50%;
    border: 2px solid var(--white);
}

.topbar-date {
    font-size: 0.78rem;
    color: var(--ink-muted);
    white-space: nowrap;
}

/* ── Views ────────────────────────────────────────────── */
.view {
    display: none;
    padding: 2rem;
    flex: 1;
    animation: viewIn 0.3s ease;
}

.view.active {
    display: block;
}

@keyframes viewIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.view-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.view-eyebrow {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--green-600);
    margin-bottom: 0.25rem;
}

.view-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
    font-weight: 700;
    color: var(--ink);
    line-height: 1.1;
}

.view-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ── Buttons ──────────────────────────────────────────── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--green-700);
    color: var(--white);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.65rem 1.25rem;
    border-radius: var(--radius-sm);
    transition: all 0.25s;
}

.btn-primary:hover {
    background: var(--green-600);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 100, 0, 0.25);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--ink-mid);
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.65rem 1.25rem;
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-sm);
    transition: all 0.25s;
}

.btn-outline:hover {
    background: var(--surface);
    border-color: var(--green-400);
    color: var(--green-700);
}

.btn-outline.small {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    color: var(--red);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.4rem 0.75rem;
    border: 1px solid rgba(185, 28, 28, 0.25);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
}

.btn-danger:hover {
    background: #fef2f2;
}

/* ── KPI Cards ────────────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.kpi-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.kpi-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.kpi-card[data-color="green"]::before {
    background: linear-gradient(90deg, var(--green-700), var(--green-400));
}

.kpi-card[data-color="gold"]::before {
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

.kpi-card[data-color="teal"]::before {
    background: linear-gradient(90deg, var(--teal), #22d3ee);
}

.kpi-card[data-color="amber"]::before {
    background: linear-gradient(90deg, var(--amber), #fcd34d);
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.kpi-icon {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.kpi-card[data-color="green"] .kpi-icon {
    background: var(--green-50);
    color: var(--green-700);
}

.kpi-card[data-color="gold"] .kpi-icon {
    background: #fef9ec;
    color: var(--gold);
}

.kpi-card[data-color="teal"] .kpi-icon {
    background: #ecfeff;
    color: var(--teal);
}

.kpi-card[data-color="amber"] .kpi-icon {
    background: #fffbeb;
    color: var(--amber);
}

.kpi-body {
    flex: 1;
}

.kpi-value {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--ink);
    line-height: 1;
    margin-bottom: 0.3rem;
}

.kpi-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-muted);
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.5rem;
}

.kpi-trend {
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.kpi-trend.up {
    color: var(--green-600);
}

.kpi-trend.down {
    color: var(--amber);
}

/* ── Charts ───────────────────────────────────────────── */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.chart-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.chart-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.chart-title {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
}

.chart-sub {
    font-size: 0.78rem;
    color: var(--ink-muted);
    margin-top: 0.2rem;
}

.chart-legend {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.78rem;
    color: var(--ink-muted);
    font-weight: 500;
}

.legend-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 0.3rem;
}

.legend-dot.green {
    background: var(--green-600);
}

.legend-dot.gold {
    background: var(--gold);
}

/* Bar chart SVG placeholder */
.chart-area {
    height: 200px;
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding-top: 1rem;
}

.bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.bar-pair {
    width: 100%;
    display: flex;
    gap: 3px;
    align-items: flex-end;
    height: 160px;
}

.bar {
    flex: 1;
    border-radius: 4px 4px 0 0;
    transition: opacity 0.2s;
    min-height: 4px;
}

.bar.green {
    background: linear-gradient(to top, var(--green-700), var(--green-400));
}

.bar.gold {
    background: linear-gradient(to top, var(--gold), var(--gold-light));
}

.bar:hover {
    opacity: 0.8;
}

.bar-label {
    font-size: 0.68rem;
    color: var(--ink-muted);
    text-align: center;
    white-space: nowrap;
}

/* Donut chart */
.donut-area {
    display: flex;
    justify-content: center;
    padding: 1rem 0;
}

.donut-svg {
    overflow: visible;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 0.5rem;
}

.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.8rem;
    color: var(--ink-mid);
}

.donut-dot {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.donut-legend-label {
    flex: 1;
}

.donut-legend-pct {
    font-weight: 700;
    color: var(--ink);
}

/* Horizontal bar chart (analytics) */
.bar-chart-h {
    padding: 1rem 1.5rem 1.5rem;
}

.hbar-row {
    margin-bottom: 1rem;
}

.hbar-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
}

.hbar-name {
    color: var(--ink-mid);
    font-weight: 500;
}

.hbar-val {
    color: var(--green-700);
    font-weight: 700;
}

.hbar-track {
    height: 8px;
    background: var(--green-50);
    border-radius: 8px;
    overflow: hidden;
}

.hbar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--green-700), var(--green-400));
    border-radius: 8px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Pipeline chart */
.pipeline-chart {
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Top list */
.top-list {
    padding: 0.5rem 1rem 1rem;
}

.top-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--border);
}

.top-list-item:last-child {
    border-bottom: none;
}

.top-rank {
    width: 22px;
    height: 22px;
    background: var(--green-50);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--green-700);
    flex-shrink: 0;
}

.top-name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--ink-mid);
}

.top-count {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--green-700);
}

/* ── Panels ───────────────────────────────────────────── */
.two-col-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.panel.full {
    width: 100%;
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.125rem 1.5rem;
    border-bottom: 1px solid var(--border);
    background: var(--white);
}

.panel-title {
    font-family: var(--font-sans);
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: 0.02em;
}

.panel-link {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--green-600);
    transition: color 0.2s;
}

.panel-link:hover {
    color: var(--green-700);
}

/* ── Data tables ──────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.data-table thead th {
    background: var(--surface);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink-muted);
    padding: 0.75rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.data-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: var(--green-50);
}

.data-table tbody td {
    padding: 0.875rem 1.25rem;
    color: var(--ink-mid);
    vertical-align: middle;
    white-space: nowrap;
}

.table-loading {
    text-align: center;
    color: var(--ink-muted);
    font-style: italic;
    padding: 2.5rem !important;
}

/* User cell */
.user-cell {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.user-cell-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--green-100);
    color: var(--green-700);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.user-cell-name {
    font-weight: 600;
    color: var(--ink);
}

.user-cell-email {
    font-size: 0.75rem;
    color: var(--ink-muted);
}

/* Badges / status pills */
.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.pill-green {
    background: var(--green-50);
    color: var(--green-700);
    border: 1px solid var(--green-100);
}

.pill-gold {
    background: #fef9ec;
    color: var(--gold);
    border: 1px solid #fde68a;
}

.pill-amber {
    background: #fffbeb;
    color: var(--amber);
    border: 1px solid #fde68a;
}

.pill-red {
    background: #fef2f2;
    color: var(--red);
    border: 1px solid #fecaca;
}

.pill-teal {
    background: #ecfeff;
    color: var(--teal);
    border: 1px solid #a5f3fc;
}

.pill-gray {
    background: var(--surface);
    color: var(--ink-muted);
    border: 1px solid var(--border-mid);
}

.step-progress {
    display: flex;
    align-items: center;
    gap: 3px;
}

.step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--border-mid);
    transition: background 0.2s;
}

.step-dot.done {
    background: var(--green-500);
}

.step-dot.current {
    background: var(--gold);
    box-shadow: 0 0 0 2px rgba(184, 148, 58, 0.25);
}

/* Action buttons in table */
.action-group {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.action-btn {
    width: 28px;
    height: 28px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--ink-muted);
    transition: all 0.2s;
    background: var(--white);
}

.action-btn:hover {
    background: var(--green-50);
    color: var(--green-700);
    border-color: var(--green-200);
}

.action-btn.danger:hover {
    background: #fef2f2;
    color: var(--red);
    border-color: #fecaca;
}

/* ── Filters & search ─────────────────────────────────── */
.filter-row {
    display: flex;
    gap: 0.5rem;
}

.filter-select {
    background: var(--white);
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.875rem;
    font-size: 0.82rem;
    color: var(--ink-mid);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.filter-select:focus {
    border-color: var(--green-500);
}

.search-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.75rem;
}

.search-inline i {
    color: var(--ink-muted);
    font-size: 0.75rem;
}

.search-inline input {
    border: none;
    background: none;
    outline: none;
    font-size: 0.82rem;
    color: var(--ink);
    width: 160px;
}

/* ── Pagination ───────────────────────────────────────── */
.pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--border);
}

.page-btn {
    min-width: 30px;
    height: 30px;
    padding: 0 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--ink-muted);
    background: var(--white);
    transition: all 0.2s;
}

.page-btn:hover {
    background: var(--green-50);
    color: var(--green-700);
    border-color: var(--green-200);
}

.page-btn.active {
    background: var(--green-700);
    color: var(--white);
    border-color: var(--green-700);
}

/* ── Modals ───────────────────────────────────────────── */
.modal-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    animation: fadeIn 0.2s ease;
}

.modal-backdrop.open {
    display: flex;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 540px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    scrollbar-width: thin;
}

.modal-box.wide {
    max-width: 760px;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.75rem 1rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--white);
    z-index: 1;
}

.modal-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--ink);
}

.modal-close {
    width: 32px;
    height: 32px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-muted);
    font-size: 0.85rem;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #fef2f2;
    color: var(--red);
    border-color: #fecaca;
}

.modal-body {
    padding: 1.5rem 1.75rem;
}

/* Modal form */
.modal-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.form-field label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ink-mid);
}

.form-field input,
.form-field select {
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.875rem;
    font-size: 0.88rem;
    color: var(--ink);
    background: var(--surface);
    outline: none;
    transition: border-color 0.2s;
}

.form-field input:focus,
.form-field select:focus {
    border-color: var(--green-500);
    background: var(--white);
}

.form-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}

.input-with-btn {
    display: flex;
    gap: 0.5rem;
}

.input-with-btn input {
    flex: 1;
}

/* ── Filing detail modal content ──────────────────────── */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem 2rem;
}

.detail-section {
    margin-bottom: 1.25rem;
}

.detail-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--green-600);
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.4rem 0;
    gap: 1rem;
}

.detail-key {
    font-size: 0.78rem;
    color: var(--ink-muted);
    font-weight: 500;
    flex-shrink: 0;
}

.detail-val {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink);
    text-align: right;
}

.doc-list {
    list-style: none;
}

.doc-list li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0;
    font-size: 0.82rem;
    color: var(--ink-muted);
    border-bottom: 1px solid var(--border);
}

.doc-list li:last-child {
    border-bottom: none;
}

.doc-list i {
    color: var(--green-600);
}

/* ── Advisors grid ────────────────────────────────────── */
.advisors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
}

.advisor-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    text-align: center;
    transition: all 0.3s;
}

.advisor-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--green-100);
}

.advisor-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green-700), var(--green-500));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--white);
    margin: 0 auto 1rem;
    box-shadow: 0 4px 12px rgba(0, 100, 0, 0.25);
}

.advisor-name {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 0.25rem;
}

.advisor-email {
    font-size: 0.75rem;
    color: var(--ink-muted);
    margin-bottom: 0.75rem;
}

/* ── Settings ─────────────────────────────────────────── */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1.25rem;
}

.settings-form {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.setting-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.setting-row label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ink-mid);
}

.setting-input {
    border: 1px solid var(--border-mid);
    border-radius: var(--radius-sm);
    padding: 0.65rem 0.875rem;
    font-size: 0.88rem;
    color: var(--ink);
    background: var(--surface);
    outline: none;
    transition: border-color 0.2s;
    width: 100%;
}

.setting-input:focus {
    border-color: var(--green-500);
}

.about-block {
    padding: 2rem 1.5rem;
    text-align: center;
}

.about-logo-mark {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--green-700), var(--green-400));
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--white);
    margin: 0 auto 1.25rem;
    box-shadow: 0 8px 24px rgba(0, 100, 0, 0.2);
}

.about-brand {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--ink);
}

.about-sub {
    font-size: 0.8rem;
    color: var(--ink-muted);
    margin-bottom: 1rem;
}

.about-desc {
    font-size: 0.82rem;
    color: var(--ink-muted);
    line-height: 1.7;
}

/* ── Toast notifications ──────────────────────────────── */
.toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--ink);
    color: var(--white);
    border-radius: var(--radius-sm);
    padding: 0.875rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 280px;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    border-left: 3px solid var(--green-400);
}

.toast.error {
    border-left-color: var(--red);
}

.toast.warning {
    border-left-color: var(--amber);
}

@keyframes toastIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ── Responsive ───────────────────────────────────────── */
@media (max-width: 1200px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .charts-row {
        grid-template-columns: 1fr;
    }

    .chart-card.narrow {
        max-width: 100%;
    }

    .two-col-row {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 991px) {
    .sidebar {
        transform: translateX(calc(-1 * var(--sidebar-w)));
        box-shadow: none;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: var(--shadow-lg);
    }

    .sidebar-close {
        display: flex;
    }

    .sidebar-overlay.open {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .topbar-menu-btn {
        display: flex;
    }

    .topbar-search input {
        width: 140px;
    }

    .view {
        padding: 1.25rem;
    }

    .view-header {
        flex-direction: column;
        gap: 1rem;
    }
}

@media (max-width: 640px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .topbar-search {
        display: none;
    }

    .topbar-date {
        display: none;
    }

    .filter-row {
        flex-direction: column;
    }

    .form-row-2 {
        grid-template-columns: 1fr;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* ════════════════════════════════════════════════════════
   ADMIN LOGIN OVERLAY
════════════════════════════════════════════════════════ */
.admin-login-overlay {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, #0b1f0b 0%, #003a00 60%, #0b2a0b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 1.5rem;
    transition: opacity 0.4s ease;
}

.admin-login-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.admin-login-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2.25rem 2rem;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.45);
    animation: loginCardIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes loginCardIn {
    from { opacity: 0; transform: translateY(24px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.admin-login-logo {
    display: flex;
    justify-content: center;
    margin-bottom: 1.25rem;
}

.admin-login-title {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--ink);
    text-align: center;
    margin-bottom: 0.35rem;
}

.admin-login-sub {
    font-size: 0.88rem;
    color: var(--ink-muted);
    text-align: center;
    margin-bottom: 1.75rem;
    line-height: 1.55;
}

.admin-login-field {
    margin-bottom: 1.1rem;
}

.admin-login-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-mid);
    margin-bottom: 0.4rem;
    letter-spacing: 0.02em;
}

.admin-login-field input {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1.5px solid var(--border-mid);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--ink);
    background: var(--surface);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-login-field input:focus {
    border-color: var(--green-500);
    box-shadow: 0 0 0 3px rgba(46, 158, 46, 0.12);
}

.admin-login-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 1rem;
}

.admin-login-btn {
    width: 100%;
    padding: 0.8rem;
    background: linear-gradient(135deg, var(--green-700), var(--green-500));
    color: var(--white);
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    transition: all 0.25s;
    box-shadow: 0 4px 14px rgba(0, 100, 0, 0.3);
}

.admin-login-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 100, 0, 0.4);
}

.admin-login-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ═══════════════════════════════════════════════════════════
   Notification Dropdown
═══════════════════════════════════════════════════════════ */
.notif-dropdown {
  position: fixed;
  top: 80px;
  right: 20px;
  width: 380px;
  max-height: 500px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: notifSlideIn 0.2s ease-out;
}

@keyframes notifSlideIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.notif-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  background: var(--green-50);
}

.notif-dropdown-header span {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
}

.notif-mark-all {
  background: none;
  border: none;
  color: var(--green-700);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}

.notif-mark-all:hover {
  background: var(--green-100);
}

.notif-dropdown-list {
  flex: 1;
  overflow-y: auto;
  max-height: 420px;
  padding: 0.5rem;
}

.notif-empty {
  padding: 2rem;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.88rem;
}

.notif-empty.error {
  color: var(--red);
}

.notif-item {
  display: flex;
  gap: 0.75rem;
  padding: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}

.notif-item:hover {
  background: var(--green-50);
}

.notif-item.unread {
  background: #f0fdf0;
}

.notif-item.unread::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--green-700);
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 0.9rem;
}

.notif-icon.normal { background: var(--green-100); color: var(--green-700); }
.notif-icon.high { background: #fef2f2; color: var(--red); animation: pulse 2s infinite; }
.notif-icon.low { background: #f5f5f5; color: var(--ink-muted); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.notif-content {
  flex: 1;
  min-width: 0;
}

.notif-title {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink);
  margin-bottom: 0.2rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-message {
  font-size: 0.78rem;
  color: var(--ink-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notif-time {
  font-size: 0.7rem;
  color: var(--ink-muted);
  margin-top: 0.3rem;
}

.notif-unread-dot {
  position: absolute;
  top: 0.85rem;
  right: 0.85rem;
  width: 8px;
  height: 8px;
  background: var(--green-700);
  border-radius: 50%;
}

.topbar-icon-btn {
  position: relative;
}

.notif-dot {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  background: var(--red);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--white);
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}