/* ============================================================
   Entrify – Design System v3
   Layout: fixed sidebar + main-wrap
   ============================================================ */

:root {
    --sidebar-w: 248px;
    --sidebar-bg: #07091a;
    --sidebar-hover: rgba(255,255,255,0.06);
    --sidebar-active-bg: #2563eb;
    --brand: #2563eb;
    --brand-light: #3b82f6;
    --brand-dark: #1e3a8a;
    --app-bg: #f0f4f8;
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --surface-3: #f1f5f9;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;
    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;
    --shadow-sm: 0 1px 3px rgba(15,23,42,.06),0 1px 2px rgba(15,23,42,.04);
    --shadow: 0 4px 16px rgba(15,23,42,.08),0 2px 6px rgba(15,23,42,.05);
    --shadow-lg: 0 12px 40px rgba(15,23,42,.12),0 4px 12px rgba(15,23,42,.08);
    --radius: 12px;
    --radius-sm: 10px;
    --transition: 160ms ease;
    --page-pad-x: clamp(1rem, 2vw, 2rem);
    --page-pad-y: clamp(1rem, 1.6vw, 1.65rem);
    --card-pad: clamp(1rem, 1.3vw, 1.3rem);
    --text-sm: clamp(.78rem, .72rem + .18vw, .88rem);
    --text-md: clamp(.88rem, .82rem + .22vw, .98rem);
    --title-lg: clamp(1.5rem, 1.15rem + .95vw, 1.95rem);
    --title-md: clamp(1.18rem, 1rem + .5vw, 1.45rem);
}

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

body {
    font-family: "Space Grotesk","IBM Plex Sans","Inter",sans-serif;
    background: var(--app-bg);
    color: var(--text);
    font-size: var(--text-md);
    letter-spacing: -.1px;
    min-height: 100vh;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

/* ── Layout shell ───────────────────────────────────────────── */
.layout {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform 240ms ease;
    overflow-y: auto;
    scrollbar-width: none;
}
.sidebar::-webkit-scrollbar { display: none; }

.sidebar__brand {
    padding: 1.2rem 1.1rem .9rem;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}

.sidebar__brand img {
    height: 32px;
    filter: brightness(0) invert(1);
    object-fit: contain;
    object-position: left;
}

.sidebar__brand-sub {
    font-size: .72rem;
    color: rgba(255,255,255,.4);
    font-weight: 500;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.sidebar__nav {
    flex: 1;
    padding: .65rem;
    display: flex;
    flex-direction: column;
    gap: .15rem;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .62rem .82rem;
    border-radius: 10px;
    color: rgba(255,255,255,.6);
    font-weight: 500;
    font-size: .88rem;
    transition: background var(--transition), color var(--transition);
    cursor: pointer;
}

.sidebar__link svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    stroke-width: 1.7;
}

.sidebar__link:hover {
    background: var(--sidebar-hover);
    color: rgba(255,255,255,.9);
}

.sidebar__link.is-active {
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(37,99,235,.4);
}

.sidebar__footer {
    padding: .72rem .65rem;
    border-top: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}

.sidebar__user {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .65rem .7rem;
    border-radius: 10px;
    background: rgba(255,255,255,.05);
    cursor: pointer;
    transition: background var(--transition);
}

.sidebar__user:hover { background: rgba(255,255,255,.09); }

.sidebar__avatar {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    font-size: .88rem;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    letter-spacing: -.5px;
}

.sidebar__user-name {
    font-size: .85rem;
    font-weight: 600;
    color: rgba(255,255,255,.9);
    line-height: 1.2;
}

.sidebar__user-role {
    font-size: .72rem;
    color: rgba(255,255,255,.4);
    text-transform: capitalize;
}

.sidebar__logout {
    margin-left: auto;
    color: rgba(255,255,255,.35);
    padding: .25rem;
    border-radius: 6px;
    transition: color var(--transition);
    display: flex;
    flex-shrink: 0;
}

.sidebar__logout:hover { color: rgba(255,255,255,.8); }
.sidebar__logout svg { width: 16px; height: 16px; }

/* ── Sidebar overlay (mobile) ───────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    z-index: 199;
    backdrop-filter: blur(2px);
}

/* ── Main wrap ──────────────────────────────────────────────── */
.main-wrap {
    margin-left: var(--sidebar-w);
    flex: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--app-bg);
}

/* ── Mobile topbar ──────────────────────────────────────────── */
.mobile-topbar {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: .75rem 1rem;
    background: var(--sidebar-bg);
    position: sticky;
    top: 0;
    z-index: 150;
}

.mobile-topbar img {
    height: 28px;
    filter: brightness(0) invert(1);
}

.hamburger {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: .25rem;
    display: flex;
}
.hamburger svg { width: 24px; height: 24px; }

/* ── Page content ───────────────────────────────────────────── */
.page-content {
    flex: 1;
    padding: var(--page-pad-y) var(--page-pad-x) calc(var(--page-pad-y) * 1.35);
}

/* ── Page topbar ────────────────────────────────────────────── */
.page-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.45rem;
}

.welcome-title {
    font-size: var(--title-lg);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.5px;
}

.welcome-sub {
    color: var(--muted);
    font-size: var(--text-sm);
    margin-top: .15rem;
}

.page-title {
    font-size: var(--title-md);
    font-weight: 700;
    letter-spacing: -.4px;
    color: var(--text);
}

.page-subtitle {
    color: var(--muted);
    font-size: var(--text-sm);
    margin-top: .2rem;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

/* ── KPI cards (dashboard) ──────────────────────────────────── */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--card-pad);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition), transform var(--transition);
}

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

.kpi-label {
    font-size: .74rem;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: .5rem;
}

.kpi-value {
    font-size: clamp(1.65rem, 1.25rem + 1vw, 2.15rem);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.8px;
    line-height: 1;
}

.kpi-delta {
    font-size: .76rem;
    font-weight: 600;
    margin-top: .45rem;
}

.kpi-delta.up   { color: #16a34a; }
.kpi-delta.down { color: #dc2626; }
.kpi-delta.neutral { color: var(--muted); }

.kpi-icon {
    width: 40px; height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.kpi-icon svg { width: 20px; height: 20px; }
.kpi-icon--blue   { background: rgba(37,99,235,.1);  color: #2563eb; }
.kpi-icon--teal   { background: rgba(8,145,178,.1);  color: #0891b2; }
.kpi-icon--amber  { background: rgba(217,119,6,.1);  color: #d97706; }
.kpi-icon--violet { background: rgba(124,58,237,.1); color: #7c3aed; }

/* ── Charts row ─────────────────────────────────────────────── */
.charts-row {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--card-pad);
    box-shadow: var(--shadow-sm);
}

.chart-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: .95rem;
}

.chart-card__title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.2px;
}

.chart-card__sub {
    font-size: .75rem;
    color: var(--muted);
    background: var(--surface-3);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .25rem .75rem;
    font-weight: 600;
}

.donut-center-label {
    text-align: center;
    margin: .5rem 0 1rem;
}

.donut-center-label .donut-total {
    font-size: 1.9rem;
    font-weight: 700;
    letter-spacing: -.5px;
    color: var(--text);
}

.donut-center-label .donut-lbl {
    font-size: .8rem;
    color: var(--muted);
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: .55rem;
    margin-top: .75rem;
}

.donut-legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: .82rem;
}

.donut-legend-item__left {
    display: flex;
    align-items: center;
    gap: .5rem;
    color: var(--text-2);
}

.donut-dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.donut-legend-item__right {
    color: var(--muted);
    font-weight: 600;
}

/* ── Mini stat cards ────────────────────────────────────────── */
.mini-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.mini-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: .95rem 1rem;
    display: flex;
    align-items: center;
    gap: .9rem;
    box-shadow: var(--shadow-sm);
}

.mini-stat__icon {
    width: 40px; height: 40px;
    border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    background: rgba(37,99,235,.1);
    color: var(--brand);
}

.mini-stat__icon svg { width: 20px; height: 20px; }

.mini-stat__info { flex: 1; min-width: 0; }

.mini-stat__label {
    font-size: .78rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

.mini-stat__period {
    font-size: .72rem;
    color: var(--muted);
}

.mini-stat__value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.4px;
    margin-top: .2rem;
}

.mini-stat__delta {
    font-size: .75rem;
    font-weight: 700;
    margin-left: .3rem;
}
.mini-stat__delta.up   { color: #16a34a; }
.mini-stat__delta.down { color: #dc2626; }

.mini-stat__spark { flex-shrink: 0; }
.mini-stat__spark svg { display: block; }

/* ── Recent visitors table ──────────────────────────────────── */
.recent-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.recent-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .9rem 1.15rem;
    border-bottom: 1px solid var(--border);
}

.recent-header h3 {
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: -.2px;
}

.recent-header a {
    font-size: .82rem;
    font-weight: 600;
    color: var(--muted);
    padding: .3rem .75rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    transition: color var(--transition), border-color var(--transition);
}

.recent-header a:hover { color: var(--brand); border-color: var(--brand); }

.recent-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
}

.recent-table thead th {
    padding: .65rem 1.15rem;
    font-size: .72rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .5px;
    border-bottom: 1px solid var(--border);
    background: transparent;
    text-align: left;
}

.recent-table tbody tr {
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.recent-table tbody tr:last-child { border-bottom: none; }
.recent-table tbody tr:hover { background: var(--surface-2); }

.recent-table tbody td {
    padding: .72rem 1.15rem;
    vertical-align: middle;
    color: var(--text-2);
}

.visitor-cell {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.avatar-circle {
    width: 34px; height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--brand-dark), var(--brand));
    color: #fff;
    font-size: .75rem;
    font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    letter-spacing: -.3px;
}

.visitor-name {
    font-weight: 600;
    color: var(--text);
    font-size: .88rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    padding: .25rem .75rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .2px;
}

.status-pill--in  { background: rgba(34,197,94,.12); color: #16a34a; }
.status-pill--out { background: rgba(100,116,139,.1); color: #64748b; }
.status-pill--sched { background: rgba(37,99,235,.1); color: var(--brand); }

/* ── Standard cards ─────────────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--border);
    padding: .9rem 1.1rem;
    font-weight: 700;
    font-size: .92rem;
    color: var(--text);
}

.card-body { padding: 1rem; }

/* ── Stat cards ─────────────────────────────────────────────── */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(175px,1fr));
    gap: 1rem;
}

.stat-card {
    padding: 1.05rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow var(--transition),transform var(--transition);
}

.stat-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.stat-card--primary { border-top: 3px solid #2563eb; }
.stat-card--success { border-top: 3px solid #0891b2; }
.stat-card--warning { border-top: 3px solid #d97706; }
.stat-card--danger  { border-top: 3px solid #dc2626; }

.stat-label {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.stat-value {
    font-size: clamp(1.5rem, 1.2rem + .8vw, 1.9rem);
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.5px;
    margin-top: .3rem;
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-control, .form-select {
    border-radius: var(--radius-sm);
    padding: .58rem .82rem;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font-size: .9rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
    outline: none;
}

.form-label {
    font-weight: 600;
    font-size: .87rem;
    color: var(--text-2);
    margin-bottom: .4rem;
    display: block;
}

.input-group-text {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface-3);
    color: var(--muted);
    font-family: inherit;
}

/* ── Buttons ─────────────────────────────────────────────────── */
.btn {
    border-radius: 999px;
    padding: .5rem 1rem;
    font-weight: 600;
    font-size: .84rem;
    font-family: inherit;
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
    letter-spacing: -.1px;
    cursor: pointer;
}

.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(15,23,42,.14); }

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

.btn-primary:hover, .btn-primary:focus {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: #fff;
}

/* ── Bootstrap green override ───────────────────────────────── */
.btn-success, .btn-success:hover, .btn-success:focus, .btn-success:active {
    background-color: #0891b2 !important;
    border-color: #0891b2 !important;
    color: #fff !important;
}

.bg-success     { background-color: #0891b2 !important; }
.text-success   { color: #0891b2 !important; }
.border-success { border-color: #0891b2 !important; }
.badge.bg-success { background-color: #0891b2 !important; }

/* ── Table ──────────────────────────────────────────────────── */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
}

.table { margin: 0; font-size: .9rem; }

.table thead th {
    border-bottom: 1px solid var(--border);
    background: #1e3a8a;
    color: rgba(255,255,255,.9);
    font-weight: 600;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    padding: .85rem 1rem;
}

.table th, .table td { vertical-align: middle; padding: .85rem 1rem; }

.table tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child { border-bottom: none; }
.table td .btn { padding: .3rem .65rem; font-size: .8rem; }

/* ── Modals ─────────────────────────────────────────────────── */
.modal-content {
    border-radius: 18px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--border);
    padding: 1.1rem 1.4rem .9rem;
}

.modal-title { font-weight: 700; letter-spacing: -.2px; }
.modal-backdrop.show { opacity: .55; backdrop-filter: blur(4px); }

/* ── FullCalendar ────────────────────────────────────────────── */
.fc { font-family: inherit; }

.fc .fc-toolbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -.3px;
}

.fc .fc-button {
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    padding: .35rem .85rem;
    font-weight: 600;
    font-size: .85rem;
    font-family: inherit;
    box-shadow: var(--shadow-sm);
    transition: background var(--transition),transform var(--transition);
}

.fc .fc-button:hover { background: var(--surface-3); transform: translateY(-1px); }

.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37,99,235,.3);
}

.fc .fc-button:focus { box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.fc .fc-button .fc-icon { display: none; }
.fc .fc-prev-button::before { content: "‹"; font-size: 1.2rem; }
.fc .fc-next-button::before { content: "›"; font-size: 1.2rem; }

.fc-theme-standard .fc-scrollgrid { border: none; }
.fc-theme-standard td, .fc-theme-standard th { border-color: var(--border); }
.fc .fc-daygrid-day-frame, .fc .fc-timegrid-col-frame { background: #fff; }
.fc .fc-daygrid-day-top { padding: .4rem .6rem; }
.fc .fc-daygrid-day-number { color: var(--text); font-weight: 600; font-size: .85rem; }
.fc .fc-timegrid-slot { height: 2.4rem; }
.fc .fc-event { border-radius: 8px; border: none; padding: 2px 6px; box-shadow: 0 2px 6px rgba(15,23,42,.12); }
.fc .fc-event-title { font-weight: 600; }
.fc .fc-timegrid-now-indicator-line { border-color: #dc2626; }
.fc .fc-day-today { background: rgba(37,99,235,.04) !important; }
.fc .fc-col-header-cell-cushion { color: var(--muted); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; padding: .6rem .5rem; }
.fc .fc-timegrid-axis-cushion, .fc .fc-timegrid-slot-label-cushion { color: var(--muted); font-size: .78rem; }

.fc-event.status-active    { background: rgba(8,145,178,.9); }
.fc-event.status-upcoming  { background: rgba(37,99,235,.9); }
.fc-event.status-completed { background: rgba(100,116,139,.8); }

.fc-event-card { display: flex; flex-direction: column; gap: .25rem; padding: .35rem .5rem; color: #fff; }
.fc-event-card__time  { font-size: .78rem; opacity: .85; }
.fc-event-card__title { font-size: .88rem; font-weight: 700; line-height: 1.2; }
.fc-event-card__status { align-self: flex-start; font-size: .68rem; font-weight: 700; padding: .12rem .45rem; border-radius: 999px; background: rgba(255,255,255,.22); }

.fc-list { border: none; }
.fc-list-day-cushion { background: transparent; color: var(--muted); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .5px; padding: .75rem .25rem .5rem; }
.fc-list-event { background: transparent; border: none; }
.fc-list-event:hover td { background: transparent; }
.fc-list-event .fc-list-event-title { padding: 0; }

.fc-list-event-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem 1rem; box-shadow: var(--shadow-sm); display: grid; gap: .5rem; }
.fc-list-event-card__header { display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.fc-list-event-card__title { font-weight: 700; font-size: .95rem; }
.fc-list-event-card__time  { color: var(--muted); font-size: .83rem; }

.fc-status-pill { font-size: .7rem; font-weight: 700; padding: .18rem .55rem; border-radius: 999px; color: #fff; }
.fc-status-pill.status-active    { background: #0891b2; }
.fc-status-pill.status-upcoming  { background: #2563eb; }
.fc-status-pill.status-completed { background: #64748b; }

.fc-event-modal .modal-body { display: grid; gap: .75rem; }
.fc-event-modal .btn[disabled] { opacity: .45; }

/* ── Auth screen ─────────────────────────────────────────────── */
.auth-screen {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 52.5% 47.5%;
    background:
        linear-gradient(90deg, #061233 0 52.5%, #f8f8f8 52.5% 100%);
}

/* ── Auth left panel ─────────────────────────────────────────── */
.auth-left {
    background:
        radial-gradient(circle at 22% 18%, rgba(18, 84, 228, 0.18), transparent 32%),
        linear-gradient(180deg, #04102c 0%, #06153a 48%, #081332 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: clamp(2rem, 3vw, 3rem) clamp(2rem, 3.2vw, 3.4rem) clamp(1.6rem, 2vw, 2.2rem);
    min-height: 100vh;
    border-right: 1px solid rgba(255,255,255,.08);
}

/* Blue beam glow at bottom-left */
.auth-left__beam {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 38% 21% at 74% 100%, rgba(18, 101, 255, .6) 0%, rgba(18,101,255,.22) 36%, transparent 66%),
        radial-gradient(ellipse 20% 18% at 87% 99%, rgba(88, 198, 255, .9) 0%, transparent 58%);
    pointer-events: none;
    z-index: 0;
}

.auth-left__flare {
    position: absolute;
    right: -12%;
    bottom: -16%;
    width: 68%;
    height: 44%;
    background: radial-gradient(circle, rgba(20,126,255,.56) 0%, rgba(20,126,255,.18) 38%, transparent 70%);
    filter: blur(30px);
    pointer-events: none;
    z-index: 0;
}

.auth-left__line {
    position: absolute;
    right: -7%;
    bottom: 8.25%;
    width: 55%;
    height: 3px;
    background: linear-gradient(90deg, rgba(0,0,0,0) 0%, #0c70ff 40%, #57d4ff 100%);
    border-radius: 999px;
    box-shadow: 0 0 18px rgba(60, 189, 255, .95), 0 0 42px rgba(12, 112, 255, .45);
    transform: rotate(-11deg);
    transform-origin: right center;
    pointer-events: none;
    z-index: 1;
}

/* Large watermark icon in background */
.auth-left__wm {
    display: none;
}
.auth-left__wm svg { width: 100%; height: 100%; }

/* All real content sits above decorations */
.auth-left__inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    min-height: 0;
}

.auth-left__hero {
    display: flex;
    flex-direction: column;
    padding-top: .2rem;
}

.auth-logo {
    display: block;
}

.auth-logo__image-wrap {
    position: relative;
    width: min(390px, 100%);
    aspect-ratio: 949 / 389;
    max-width: 100%;
}

.auth-logo__img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 0 18px rgba(15, 91, 255, .16));
}

.auth-logo__img--wordmark {
    position: absolute;
    inset: 0;
    filter: brightness(0) invert(1);
    clip-path: inset(31% 0 30% 28%);
    opacity: .98;
    pointer-events: none;
}

.auth-headline {
    max-width: 610px;
    font-size: clamp(2.2rem, 2rem + 1.3vw, 3.05rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.16;
    letter-spacing: -.05em;
    margin: 1.6rem 0 .9rem;
}

.auth-headline__accent { color: #176dff; }

.auth-desc {
    font-size: .88rem;
    color: rgba(255,255,255,.84);
    line-height: 1.6;
    max-width: 520px;
    margin: 0;
}

/* Trust badges row */
.auth-badges {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: .7rem;
    padding-top: .85rem;
    flex-wrap: nowrap;
    overflow: hidden;
}

.auth-badge {
    display: grid;
    grid-template-columns: 28px auto;
    align-items: center;
    gap: .55rem;
    color: rgba(255,255,255,.94);
    font-size: .62rem;
    font-weight: 500;
    text-align: left;
    line-height: 1.3;
    flex: 1 1 0;
    min-width: 0;
}

.auth-badge svg {
    width: 28px;
    height: 28px;
    stroke-width: 1.6;
    flex-shrink: 0;
    color: #8fb4ff;
}

.auth-badge-sep {
    width: 1px;
    height: 2.45rem;
    background: rgba(103,144,220,.35);
    flex-shrink: 0;
}

/* ── Auth right panel ────────────────────────────────────────── */
.auth-right {
    background:
        radial-gradient(circle at 12% 10%, rgba(255,255,255,.95), rgba(247,247,247,1) 55%),
        linear-gradient(180deg, #fafafa 0%, #f6f6f6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(1rem, 2vw, 1.4rem) clamp(1rem, 2.5vw, 1.8rem);
    min-height: 100vh;
}

.auth-card {
    width: min(430px, 100%);
    background: #fff;
    border: 1px solid #e8edf5;
    border-radius: 22px;
    box-shadow: 0 14px 42px rgba(19, 38, 72, .08), 0 2px 10px rgba(19, 38, 72, .04);
    padding: 2.15rem 1.75rem 1.65rem;
}

.auth-card__title {
    font-size: clamp(1.35rem, 1.2rem + .7vw, 1.58rem);
    font-weight: 800;
    letter-spacing: -.05em;
    color: #101938;
    text-align: center;
    margin: 0 0 .55rem;
    line-height: 1.2;
}

.auth-card__sub {
    font-size: .84rem;
    color: #667085;
    text-align: center;
    margin: 0 0 1.2rem;
    line-height: 1.5;
}

/* Field wrappers */
.auth-field { margin-bottom: .85rem; }

.auth-field > label {
    display: block;
    font-weight: 700;
    font-size: .84rem;
    color: #101938;
    margin-bottom: .45rem;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-icon {
    position: absolute;
    left: 1rem;
    color: #667085;
    display: flex;
    pointer-events: none;
    z-index: 1;
}
.auth-input-icon svg { width: 20px; height: 20px; stroke-width: 1.8; }

.auth-input-eye {
    position: absolute;
    right: 1rem;
    background: none;
    border: none;
    color: #667085;
    cursor: pointer;
    display: flex;
    padding: 0;
    z-index: 1;
    transition: color var(--transition);
}
.auth-input-eye:hover { color: #344054; }
.auth-input-eye svg { width: 19px; height: 19px; stroke-width: 1.8; }

.auth-input-wrap input {
    width: 100%;
    height: 46px;
    padding: 0 1rem 0 3.35rem;
    border: 1.5px solid #dbe4f0;
    border-radius: 12px;
    background: #fff;
    color: #101938;
    font-size: .88rem;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    -webkit-appearance: none;
}
.auth-input-wrap input.has-right { padding-right: 3.25rem; }

.auth-input-wrap input:focus {
    border-color: #0f5bff;
    box-shadow: 0 0 0 4px rgba(15,91,255,.1);
}

.auth-input-wrap input::placeholder { color: #667085; }

/* Remember + forgot row */
.auth-remember {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: .05rem 0 1rem;
}

.auth-remember label {
    display: flex;
    align-items: center;
    gap: .6rem;
    font-size: .84rem;
    font-weight: 500;
    color: #344054;
    cursor: pointer;
    user-select: none;
}

.auth-remember input[type="checkbox"] {
    width: 18px; height: 18px;
    border-radius: 4px;
    accent-color: #0f5bff;
    cursor: pointer;
    flex-shrink: 0;
}

.auth-forgot {
    font-size: .84rem;
    font-weight: 600;
    color: #0f5bff;
    transition: color var(--transition);
}
.auth-forgot:hover { color: #0a47cb; text-decoration: underline; }

/* Submit */
.auth-submit {
    display: block;
    width: 100%;
    height: 45px;
    background: linear-gradient(180deg, #1862ff 0%, #0f5bff 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: .9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    letter-spacing: -.02em;
    box-shadow: 0 8px 20px rgba(15,91,255,.24);
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
    margin-bottom: .95rem;
}
.auth-submit:hover {
    background: linear-gradient(180deg, #0f5bff 0%, #0a47cb 100%);
    box-shadow: 0 10px 24px rgba(15,91,255,.28);
    transform: translateY(-1px);
}

/* Oppure divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #667085;
    font-size: .8rem;
    font-weight: 500;
    margin: 0 0 .95rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

/* Social buttons */
.auth-social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    width: 100%;
    height: 44px;
    background: #fff;
    border: 1.5px solid #dbe4f0;
    border-radius: 12px;
    color: #101938;
    font-size: .86rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
    margin-bottom: .5rem;
    text-decoration: none;
}
.auth-social-btn:last-of-type { margin-bottom: 0; }
.auth-social-btn:hover {
    border-color: #bfd0ea;
    background: #fbfdff;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    color: #101938;
}
.auth-social-btn svg { flex-shrink: 0; }

/* Card footer */
.auth-card__footer {
    text-align: center;
    margin-top: 1.55rem;
    font-size: .84rem;
    color: #475467;
}
.auth-card__footer a {
    color: #0f5bff;
    font-weight: 600;
}
.auth-card__footer a:hover { color: #0a47cb; text-decoration: underline; }

/* Error */
.auth-error {
    display: flex;
    align-items: center;
    gap: .5rem;
    background: #fef3f2;
    border: 1px solid #fecdca;
    color: #b42318;
    border-radius: 12px;
    font-size: .9rem;
    padding: .85rem 1rem;
    margin-bottom: 1.3rem;
}
.auth-error svg { flex-shrink: 0; }

/* PWA install */
.auth-pwa-btn {
    display: block;
    width: 100%;
    margin-top: .65rem;
    background: transparent;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    color: #94a3b8;
    font-size: .82rem;
    font-weight: 600;
    padding: .55rem 1rem;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    transition: border-color var(--transition), color var(--transition);
}
.auth-pwa-btn:hover { border-color: #2563eb; color: #2563eb; }
#pwaInstallHelp,
.auth-pwa-btn {
    display: none !important;
}

/* ── Pagination ──────────────────────────────────────────────── */
.pagination .page-link {
    border-radius: 8px !important;
    margin: 0 2px;
    font-weight: 600;
    font-size: .85rem;
    color: var(--text-2);
    border-color: var(--border);
}

.pagination .page-item.active .page-link {
    background: var(--brand);
    border-color: var(--brand);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1200px) {
    .page-content { padding: 1.35rem 1.35rem 2rem; }
    .kpi-grid       { grid-template-columns: repeat(2,1fr); }
    .mini-stats-grid { grid-template-columns: repeat(2,1fr); }
    .charts-row     { grid-template-columns: 1fr; }
}

@media (max-width: 992px) {
    .page-content { padding: 1.15rem 1.05rem 1.75rem; }
    .sidebar { width: 224px; }
    .main-wrap { margin-left: 224px; }
    .sidebar__link { font-size: .84rem; }
    .sidebar__brand img { height: 28px; }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        width: min(84vw, 280px);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .sidebar-overlay.is-open { display: block; }

    .main-wrap { margin-left: 0; }

    .mobile-topbar { display: flex; }

    .page-content { padding: 1rem .9rem 1.5rem; }

    .kpi-grid        { grid-template-columns: repeat(2,1fr); gap: .75rem; }
    .mini-stats-grid { grid-template-columns: 1fr 1fr; gap: .75rem; }
    .charts-row      { grid-template-columns: 1fr; }

    .welcome-title { font-size: 1.28rem; }

    .table-responsive { border: none; box-shadow: none; background: transparent; }
    .table thead { display: none; }
    .table tbody tr {
        display: block;
        background: var(--surface);
        margin-bottom: .75rem;
        border-radius: var(--radius);
        border: 1px solid var(--border);
        padding: .75rem 1rem;
        box-shadow: var(--shadow-sm);
    }
    .table tbody td {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        padding: .45rem 0;
        border: none;
    }
    .table tbody td::before { content: attr(data-label); font-weight: 700; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .4px; }
    .table tbody td:last-child { justify-content: flex-end; }
    .table tbody td:last-child::before { display: none; }
    .modal-dialog { margin: 0; position: fixed; bottom: 0; left: 0; right: 0; }
    .modal-content { border-radius: 18px 18px 0 0; }

    .recent-table thead th,
    .recent-table tbody td { padding: .65rem .9rem; }

    .page-topbar { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
    .kpi-grid { grid-template-columns: 1fr; }
    .mini-stats-grid { grid-template-columns: 1fr; }
    .page-content { padding: .9rem .8rem 1.25rem; }
    .btn { width: 100%; justify-content: center; }
}

/* ── Auth responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
    .auth-screen { grid-template-columns: 1fr 1fr; }
    .auth-left { padding: 2rem 1.8rem 1.6rem; }
    .auth-logo__image-wrap { width: 320px; }
    .auth-headline { font-size: 2.35rem; margin-top: 1.4rem; }
    .auth-desc { max-width: 470px; }
    .auth-card { width: min(390px, 100%); padding: 1.9rem 1.35rem 1.55rem; }
}

@media (max-width: 820px) {
    .auth-screen { grid-template-columns: 1fr; background: #f8f8f8; }
    .auth-left { display: none; }
    .auth-right { padding: 1.5rem; }
    .auth-card { width: min(620px, 100%); }
}

@media (max-width: 640px) {
    .auth-right {
        background: #f8f8f8;
        padding: 1rem;
        min-height: 100vh;
    }
    .auth-card {
        background: #fff;
        border-color: #e8edf5;
        box-shadow: 0 14px 36px rgba(19, 38, 72, .08);
        padding: 2.2rem 1.15rem 1.75rem;
    }
    .auth-card__title { font-size: 1.72rem; }
    .auth-card__sub { margin-bottom: 2rem; }
    .auth-remember {
        flex-direction: column;
        align-items: flex-start;
        gap: .8rem;
    }
}

/* ── Dashboard v2 ───────────────────────────────────────────── */
body.dashboard-shell {
    background:
        radial-gradient(circle at top, rgba(43, 118, 255, .09) 0%, rgba(255,255,255,0) 38%),
        #f8fbff;
}

.dashboard-shell {
    --sidebar-w: 264px;
}

.dashboard-shell .sidebar {
    background: linear-gradient(180deg, #06163f 0%, #08193f 100%);
    border-right: 1px solid rgba(255,255,255,.06);
    box-shadow: inset -1px 0 0 rgba(255,255,255,.03);
}

.dashboard-shell .sidebar__brand {
    padding: 1.45rem 1.2rem 1.1rem;
    border-bottom: none;
}

.dashboard-shell .sidebar__brand a {
    display: block;
}

.sidebar__brand-logo {
    position: relative;
    display: block;
    width: 176px;
    max-width: 100%;
    aspect-ratio: 949 / 389;
}

.sidebar__brand-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: none;
}

.sidebar__brand-logo-wordmark {
    position: absolute;
    inset: 0;
    filter: brightness(0) invert(1);
    clip-path: inset(31% 0 30% 28%);
    pointer-events: none;
}

.dashboard-shell .sidebar__nav {
    padding: .75rem .8rem;
    gap: .3rem;
}

.dashboard-shell .sidebar__link {
    min-height: 48px;
    padding: .72rem .9rem;
    border-radius: 12px;
    color: rgba(255,255,255,.88);
    font-size: .9rem;
    font-weight: 500;
    gap: .95rem;
}

.dashboard-shell .sidebar__link svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.9;
}

.dashboard-shell .sidebar__link:hover {
    background: rgba(255,255,255,.06);
    color: #fff;
}

.dashboard-shell .sidebar__link.is-active {
    background: linear-gradient(180deg, rgba(22, 84, 227, .52) 0%, rgba(17, 62, 171, .62) 100%);
    box-shadow: inset 0 0 0 1px rgba(73, 133, 255, .28);
}

.dashboard-shell .sidebar__footer {
    padding: .8rem;
    border-top: none;
}

.dashboard-shell .sidebar__user {
    background: rgba(11, 38, 94, .88);
    border: 1px solid rgba(128, 167, 255, .14);
    border-radius: 14px;
    padding: .8rem;
}

.dashboard-shell .sidebar__avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #6ea8ff, #2563eb);
    font-size: .9rem;
}

.dashboard-shell .sidebar__user-name {
    font-size: .92rem;
}

.dashboard-shell .sidebar__user-role {
    font-size: .82rem;
    color: rgba(255,255,255,.58);
}

.dashboard-shell .sidebar__logout {
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    margin-left: 0;
    color: rgba(255,255,255,.8);
}

.dashboard-main-wrap {
    background: transparent;
}

.dashboard-shell .mobile-topbar img {
    filter: none;
}

.dashboard-shell .mobile-topbar .sidebar__brand-logo {
    width: 150px;
}

.dashboard-page {
    padding: 1.45rem 1.6rem 1rem;
}

.dash-hero {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.15rem;
}

.dash-hero__title {
    font-size: clamp(1.55rem, 1.25rem + .8vw, 1.85rem);
    line-height: 1.08;
    letter-spacing: -.05em;
    font-weight: 700;
    color: #152042;
}

.dash-hero__subtitle {
    margin-top: .35rem;
    font-size: .9rem;
    color: #152042;
    font-weight: 500;
}

.dash-hero__actions {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.dash-action-btn {
    width: 42px;
    height: 42px;
    border-radius: 999px;
    border: 1px solid #dce6f5;
    background: rgba(255,255,255,.86);
    color: #152042;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 10px 28px rgba(16, 35, 78, .06);
}

.dash-action-btn svg,
.dash-profile__chevron {
    width: 19px;
    height: 19px;
    stroke-width: 1.9;
}

.dash-action-btn__dot {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #1f63ff;
    box-shadow: 0 0 0 3px #fff;
}

.dash-profile {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.dash-profile__avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #fff;
    background: linear-gradient(135deg, #0f172a, #2563eb);
    box-shadow: 0 10px 28px rgba(16, 35, 78, .12);
}

.dash-profile__chevron {
    width: 18px;
    height: 18px;
    color: #1e293b;
}

.dash-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .9rem;
    margin-bottom: 1rem;
}

.dash-kpi-card,
.dash-panel,
.dash-mini-card,
.dash-table-panel {
    background: rgba(255,255,255,.95);
    border: 1px solid #e6eef9;
    box-shadow: 0 10px 35px rgba(17, 42, 90, .06);
}

.dash-kpi-card {
    border-radius: 18px;
    padding: 1.05rem 1.1rem 1rem;
}

.dash-kpi-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
}

.dash-kpi-card__label {
    font-size: .84rem;
    color: #18264a;
    font-weight: 500;
}

.dash-kpi-card__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #eef4ff 0%, #f8fbff 100%);
    color: #2158f3;
}

.dash-kpi-card__icon svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.9;
}

.dash-kpi-card__value {
    margin-top: .65rem;
    font-size: clamp(1.9rem, 1.5rem + 1vw, 2.45rem);
    line-height: 1;
    letter-spacing: -.06em;
    font-weight: 700;
    color: #152042;
}

.dash-kpi-card__meta {
    margin-top: .65rem;
    display: flex;
    align-items: center;
    gap: .35rem;
    color: #41537d;
    font-size: .82rem;
}

.dash-kpi-card__meta--plain {
    display: block;
}

.dash-trend {
    font-weight: 700;
}

.dash-trend.is-up { color: #16a34a; }
.dash-trend.is-down { color: #dc2626; }

.dash-analytics {
    display: grid;
    grid-template-columns: minmax(0, 1.95fr) minmax(320px, .95fr);
    gap: .9rem;
    margin-bottom: 1rem;
}

.dash-panel {
    border-radius: 18px;
    padding: 1rem 1.05rem 1rem;
}

.dash-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .9rem;
}

.dash-panel__header h2,
.dash-table-panel__header h2 {
    font-size: .94rem;
    line-height: 1.2;
    font-weight: 700;
    color: #152042;
}

.dash-select-badge {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    min-height: 38px;
    padding: 0 .9rem;
    border: 1px solid #dce6f5;
    border-radius: 11px;
    font-size: .94rem;
    color: #31446d;
    background: #fff;
}

.dash-select-badge svg,
.dash-info-btn svg {
    width: 18px;
    height: 18px;
    stroke-width: 1.9;
}

.dash-info-btn {
    background: transparent;
    color: #6880b5;
}

.dash-chart-wrap {
    position: relative;
    height: 250px;
}

.dash-donut {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dash-donut__chart {
    position: relative;
    width: 100%;
    max-width: 210px;
    height: 210px;
}

.dash-donut__center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.dash-donut__center span {
    color: #31446d;
    font-size: .92rem;
}

.dash-donut__center strong {
    color: #152042;
    font-size: 2.05rem;
    line-height: 1;
    letter-spacing: -.05em;
}

.dash-donut__legend {
    width: 100%;
    margin-top: .35rem;
    display: grid;
    gap: .45rem;
}

.dash-donut__legend-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    font-size: .9rem;
    color: #31446d;
}

.dash-donut__legend-row span {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
}

.dash-donut__legend-row i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.dash-donut__legend-row strong {
    color: #41537d;
    font-weight: 600;
}

.dash-mini-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .9rem;
    margin-bottom: 1rem;
}

.dash-mini-card {
    border-radius: 16px;
    padding: .85rem .9rem;
}

.dash-mini-card__head {
    display: flex;
    align-items: center;
    gap: .85rem;
}

.dash-mini-card__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #2158f3;
    background: linear-gradient(180deg, #2967ff 0%, #175cff 100%);
}

.dash-mini-card__icon svg {
    width: 18px;
    height: 18px;
    stroke: #fff;
    stroke-width: 1.9;
}

.dash-mini-card__title {
    font-size: .84rem;
    color: #152042;
    font-weight: 600;
}

.dash-mini-card__period {
    font-size: .75rem;
    color: #64748b;
    margin-top: .12rem;
}

.dash-mini-card__body {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .8rem;
    margin-top: .95rem;
}

.dash-mini-card__value {
    font-size: 1.05rem;
    color: #152042;
    font-weight: 700;
    letter-spacing: -.04em;
}

.dash-spark {
    width: 92px;
    height: 32px;
    flex-shrink: 0;
}

.dash-table-panel {
    border-radius: 18px;
    overflow: hidden;
}

.dash-table-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 1rem;
    border-bottom: 1px solid #edf2fa;
}

.dash-table-panel__header a {
    min-height: 34px;
    padding: 0 .9rem;
    display: inline-flex;
    align-items: center;
    border: 1px solid #dce6f5;
    border-radius: 10px;
    color: #31446d;
    font-size: .88rem;
    font-weight: 600;
    background: #fff;
}

.dash-table-wrap {
    overflow-x: auto;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
}

.dash-table thead th {
    padding: .8rem .9rem .65rem;
    text-align: left;
    font-size: .7rem;
    color: #5c6f97;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-weight: 700;
}

.dash-table tbody td {
    padding: .68rem .9rem;
    border-top: 1px solid #edf2fa;
    font-size: .84rem;
    color: #31446d;
    vertical-align: middle;
}

.dash-table__visitor {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.dash-table__avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f172a, #2563eb);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .68rem;
    font-weight: 700;
}

.dash-table__name {
    color: #152042;
    font-weight: 500;
}

.dash-status {
    min-width: 74px;
    min-height: 26px;
    padding: 0 .75rem;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .78rem;
    font-weight: 700;
}

.dash-status.is-live {
    background: #e9f8e8;
    color: #3f8c35;
}

.dash-status.is-out {
    background: #f1f5f9;
    color: #64748b;
}

.dash-status.is-scheduled {
    background: #eaf1ff;
    color: #175cff;
}

.dash-table__empty {
    text-align: center;
    color: #64748b;
    padding: 1.6rem 1rem !important;
}

@media (max-width: 1280px) {
    .dash-kpis,
    .dash-mini-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dash-analytics {
        grid-template-columns: 1fr;
    }

    .dashboard-page { padding: 1.2rem 1.15rem .9rem; }
    .dashboard-shell .sidebar__brand { padding: 1.1rem 1rem .9rem; }
    .sidebar__brand-logo { width: 160px; }
}

@media (max-width: 768px) {
    .dashboard-page {
        padding: .95rem .85rem .9rem;
    }

    .dash-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .dash-kpis,
    .dash-mini-grid {
        grid-template-columns: 1fr;
    }

    .dash-hero__actions { width: 100%; justify-content: flex-end; }
    .dash-panel,
    .dash-table-panel,
    .dash-kpi-card,
    .dash-mini-card { border-radius: 14px; }
    .dash-chart-wrap { height: 220px; }
}

/* ── Visitors page ──────────────────────────────────────────── */
.visitors-page {
    padding: 1.45rem 1.35rem 1rem;
}

.visitors-kpis .dash-kpi-card__head {
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
}

.visitors-kpis .dash-kpi-card__label {
    font-size: .88rem;
}

.visitors-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.85fr) 300px;
    gap: .95rem;
}

.visitors-main {
    min-width: 0;
}

.visitors-filters {
    display: grid;
    grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(140px, .72fr)) 110px 200px;
    gap: .7rem;
    margin-bottom: .9rem;
}

.visitors-search,
.visitors-select,
.visitors-filter-btn,
.visitors-new-btn,
.visitors-per-page select {
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid #dce6f5;
    background: rgba(255,255,255,.95);
    box-shadow: 0 8px 24px rgba(17, 42, 90, .04);
}

.visitors-search {
    display: flex;
    align-items: center;
    padding: 0 .95rem;
    gap: .75rem;
}

.visitors-search input {
    border: 0;
    outline: none;
    background: transparent;
    width: 100%;
    font: inherit;
    color: #152042;
}

.visitors-search input::placeholder {
    color: #8b9abb;
}

.visitors-search svg,
.visitors-filter-btn svg,
.visitors-new-btn svg,
.visitors-qr-btn svg,
.visitors-page-btn svg {
    width: 20px;
    height: 20px;
    stroke-width: 1.9;
}

.visitors-select,
.visitors-per-page select {
    padding: 0 .95rem;
    color: #152042;
    font: inherit;
}

.visitors-filter-btn,
.visitors-new-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    color: #152042;
    font-size: .86rem;
    font-weight: 500;
}

.visitors-new-btn {
    background: linear-gradient(180deg, #2967ff 0%, #175cff 100%);
    border-color: #175cff;
    color: #fff;
}

.visitors-table-card,
.visitors-side-card {
    background: rgba(255,255,255,.95);
    border: 1px solid #e6eef9;
    border-radius: 18px;
    box-shadow: 0 10px 35px rgba(17, 42, 90, .06);
}

.visitors-table-card {
    overflow: hidden;
}

.visitors-table-wrap {
    overflow-x: auto;
}

.visitors-table {
    width: 100%;
    border-collapse: collapse;
}

.visitors-table thead th {
    text-align: left;
    padding: .75rem .55rem .62rem;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #5c6f97;
    font-weight: 700;
    border-bottom: 1px solid #edf2fa;
}

.visitors-table thead th:first-child,
.visitors-table tbody td:first-child {
    padding-left: .35rem;
}

.visitors-table tbody td {
    padding: .72rem .55rem;
    border-bottom: 1px solid #edf2fa;
    font-size: .84rem;
    color: #31446d;
    vertical-align: middle;
}

.visitors-table tbody tr:last-child td {
    border-bottom: 0;
}

.visitors-table__person {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.visitors-table__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0f172a, #2563eb);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .74rem;
    font-weight: 700;
    flex-shrink: 0;
}

.visitors-table__name {
    color: #152042;
    font-weight: 500;
}

.visitors-table__contact {
    display: flex;
    flex-direction: column;
    gap: .18rem;
}

.visitors-table__contact small {
    color: #5c6f97;
    font-size: .78rem;
}

.visitors-qr-btn {
    border: 0;
    background: transparent;
    color: #31446d;
    padding: 0;
}

.visitors-actions {
    position: relative;
}

.visitors-actions summary {
    list-style: none;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #31446d;
}

.visitors-actions summary::-webkit-details-marker {
    display: none;
}

.visitors-actions summary svg {
    width: 18px;
    height: 18px;
}

.visitors-actions[open] .visitors-actions__menu {
    display: flex;
}

.visitors-actions__menu {
    display: none;
    position: absolute;
    right: 0;
    top: 36px;
    z-index: 30;
    min-width: 150px;
    padding: .4rem;
    flex-direction: column;
    gap: .2rem;
    background: #fff;
    border: 1px solid #dce6f5;
    border-radius: 12px;
    box-shadow: 0 14px 36px rgba(17, 42, 90, .14);
}

.visitors-actions__menu button {
    width: 100%;
    min-height: 36px;
    padding: 0 .75rem;
    text-align: left;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #152042;
    font: inherit;
}

.visitors-actions__menu button:hover {
    background: #f5f8ff;
}

.visitors-table-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem 0;
    color: #5c6f97;
    font-size: .84rem;
}

.visitors-pagination {
    display: flex;
    align-items: center;
    gap: .45rem;
}

.visitors-page-btn {
    min-width: 34px;
    height: 34px;
    padding: 0 .7rem;
    border-radius: 10px;
    border: 1px solid #dce6f5;
    background: #fff;
    color: #152042;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

.visitors-page-btn.is-active {
    background: linear-gradient(180deg, #2967ff 0%, #175cff 100%);
    color: #fff;
    border-color: #175cff;
}

.visitors-per-page select {
    min-width: 120px;
}

.visitors-side {
    display: flex;
    flex-direction: column;
    gap: .85rem;
}

.visitors-side-card {
    padding: .9rem .9rem;
}

.visitors-side-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .9rem;
}

.visitors-side-card__header h2 {
    color: #152042;
    font-size: .92rem;
    font-weight: 700;
}

.visitors-occupancy {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.visitors-occupancy__ring {
    --present-angle: calc(var(--present) * 3.6deg);
    --waiting-angle: calc(var(--waiting) * 3.6deg);
    --noshow-angle: calc(var(--noshow) * 3.6deg);
    width: 132px;
    height: 132px;
    border-radius: 50%;
    background:
        radial-gradient(closest-side, #fff 63%, transparent 64% 100%),
        conic-gradient(
            #44c44f 0deg var(--present-angle),
            #f4b400 var(--present-angle) calc(var(--present-angle) + var(--waiting-angle)),
            #d8e2f1 calc(var(--present-angle) + var(--waiting-angle)) calc(var(--present-angle) + var(--waiting-angle) + var(--noshow-angle)),
            #edf2fa calc(var(--present-angle) + var(--waiting-angle) + var(--noshow-angle)) 360deg
        );
    display: flex;
    align-items: center;
    justify-content: center;
}

.visitors-occupancy__center {
    text-align: center;
}

.visitors-occupancy__center strong {
    display: block;
    color: #152042;
    font-size: 1.7rem;
    line-height: 1;
    letter-spacing: -.05em;
}

.visitors-occupancy__center span {
    color: #31446d;
    font-size: .92rem;
}

.visitors-occupancy__stats {
    width: 100%;
    display: grid;
    gap: .45rem;
    margin-top: 1rem;
}

.visitors-occupancy__stats div {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: .55rem;
    color: #31446d;
    font-size: .82rem;
}

.visitors-occupancy__stats span {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
}

.visitors-occupancy__stats i {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.visitors-occupancy__stats i.is-present { background: #44c44f; }
.visitors-occupancy__stats i.is-waiting { background: #f4b400; }
.visitors-occupancy__stats i.is-noshow { background: #d8e2f1; }

.visitors-occupancy__stats strong,
.visitors-occupancy__stats small {
    color: #152042;
    font-weight: 600;
}

.visitors-occupancy__note {
    width: 100%;
    margin-top: .85rem;
    padding-top: .8rem;
    border-top: 1px solid #edf2fa;
    color: #5c6f97;
    font-size: .92rem;
}

.visitors-feed {
    display: grid;
    gap: .65rem;
}

.visitors-feed__item {
    display: grid;
    grid-template-columns: 28px 1fr auto;
    align-items: flex-start;
    gap: .7rem;
}

.visitors-feed__icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .86rem;
    font-weight: 700;
}

.visitors-feed__icon.is-present {
    background: #eaf8ea;
    color: #3f8c35;
}

.visitors-feed__icon.is-waiting {
    background: #fff4d8;
    color: #d39b00;
}

.visitors-feed__icon.is-noshow {
    background: #edf2fa;
    color: #64748b;
}

.visitors-feed__copy {
    display: flex;
    flex-direction: column;
    gap: .1rem;
}

.visitors-feed__copy strong {
    color: #152042;
    font-size: .84rem;
    font-weight: 600;
}

.visitors-feed__copy small,
.visitors-feed__time,
.visitors-feed__empty {
    color: #5c6f97;
    font-size: .78rem;
}

.visitors-feed__link {
    margin-top: 1rem;
    min-height: 46px;
    border: 1px solid #dce6f5;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    color: #175cff;
    font-weight: 600;
    font-size: .86rem;
}

@media (max-width: 1280px) {
    .visitors-layout {
        grid-template-columns: 1fr;
    }

    .visitors-side {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .visitors-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1024px) {
    .visitors-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .visitors-new-btn {
        grid-column: span 2;
    }
}

@media (max-width: 768px) {
    .visitors-page {
        padding: .95rem .85rem .9rem;
    }

    .visitors-filters,
    .visitors-side {
        grid-template-columns: 1fr;
    }

    .visitors-table-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .visitors-new-btn {
        grid-column: auto;
    }

    .visitors-side-card,
    .visitors-table-card { border-radius: 14px; }
    .visitors-table { min-width: 860px; }
}

@media (max-width: 560px) {
    .auth-card {
        width: 100%;
        padding: 1.65rem 1rem 1.35rem;
    }

    .auth-card__title { font-size: 1.35rem; }
    .auth-input-wrap input,
    .auth-submit,
    .auth-social-btn { height: 42px; }
}
