/* =====================================================================
   PureVision Admin — shared theme
   Black + brass gold (from the brand logo), warm stone background.
   Change the brand in ONE place: the --pv-* tokens below.
   ===================================================================== */

:root {
    /* Brand */
    --pv-ink: #050505;          /* brand black (same as site --primary) */
    --pv-ink-2: #1c1a17;        /* sidebar hover / raised dark */
    --pv-gold: #b8913f;         /* brass gold */
    --pv-gold-deep: #8a6a24;    /* gold text on light backgrounds */
    --pv-gold-soft: #efe4c9;
    --pv-gold-wash: #f8f3e6;

    /* Surfaces */
    --pv-bg: #f3f2ef;
    --pv-surface: #ffffff;
    --pv-surface-2: #faf9f7;
    --pv-line: #e4e1da;
    --pv-line-strong: #cfcac0;

    /* Text */
    --pv-text: #1d1b18;
    --pv-muted: #6f6a61;
    --pv-faint: #9a948a;

    /* Status */
    --pv-green: #2f7d4f;  --pv-green-bg: #e7f3ec;
    --pv-red: #b3261e;    --pv-red-bg: #fbeaea;
    --pv-amber: #9a6a0f;  --pv-amber-bg: #fdf3dc;
    --pv-blue: #2b5f9e;   --pv-blue-bg: #e8f0fa;
    --pv-wa: #1f9d55;     --pv-wa-bg: #e6f6ec;

    /* Tiers */
    --tier-vvip: #6d4c9f; --tier-vip: #b3261e; --tier-gold: #b8913f;
    --tier-silver: #5f7f9e; --tier-regular: #3f8a5c;

    /* Type */
    --pv-font: 'IBM Plex Sans Arabic', system-ui, -apple-system, 'Segoe UI', Tahoma, sans-serif;
    --pv-display: 'Bodoni Moda', 'Didot', Georgia, 'Times New Roman', serif;

    /* Shape */
    --pv-r-sm: 6px;
    --pv-r: 10px;
    --pv-r-lg: 14px;
    --pv-shadow: 0 1px 2px rgba(29, 27, 24, .05);
    --pv-shadow-pop: 0 12px 32px rgba(29, 27, 24, .14);
    --pv-sidebar-w: 248px;

    /* ---- Legacy variable names used across existing pages (mapped to the new palette) ---- */
    --primary: var(--pv-ink);
    --primary-dark: var(--pv-ink-2);
    --secondary: var(--pv-gold);
    --accent: var(--pv-gold);
    --dark: var(--pv-text);
    --light: var(--pv-bg);
    --success: var(--pv-green);
    --warning: var(--pv-amber);
    --info: var(--pv-blue);
    --gold: var(--pv-gold);
    --gold-dark: var(--pv-gold-deep);
    --border-gold: var(--pv-gold-soft);
    --text: var(--pv-text);
    --text-secondary: var(--pv-muted);
    --text-muted: var(--pv-faint);
    --text-dim: var(--pv-faint);
    --border: var(--pv-line);
    --border-light: var(--pv-line);
    --card-bg: var(--pv-surface);
    --bg: var(--pv-surface);
    --bg-secondary: var(--pv-surface-2);
    --shadow: var(--pv-shadow);
    --shadow-lg: var(--pv-shadow-pop);
    --font-primary: var(--pv-font);
    --font-serif: var(--pv-display);
    --platinum: #8b9bb0; --bronze: #a2672e; --silver: #9aa3ad;
    --kimi-color-surface-muted: var(--pv-surface-2);
    --kimi-color-border: var(--pv-line);
    --kimi-color-text-primary: var(--pv-text);
    --kimi-color-text-secondary: var(--pv-muted);
    --kimi-color-text-tertiary: var(--pv-faint);
    --kimi-color-positive: var(--pv-green);
    --kimi-color-danger: var(--pv-red);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.pv {
    margin: 0;
    padding: 0;
    background: var(--pv-bg);
    color: var(--pv-text);
    font-family: var(--pv-font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
body.pv * { font-family: inherit; }
body.pv .fa, body.pv .fas, body.pv .far, body.pv .fab, body.pv .fa-solid, body.pv .fa-regular, body.pv .fa-brands,
body.pv [class^="fa-"], body.pv [class*=" fa-"] { font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands"; }
body.pv .fab, body.pv .fa-brands { font-family: "Font Awesome 6 Brands"; }

body.pv a { color: inherit; text-decoration: none; }
body.pv a:not([class]):hover { color: var(--pv-gold-deep); }
body.pv img { max-width: 100%; }
body.pv h1, body.pv h2, body.pv h3, body.pv h4 { margin: 0 0 .5em; line-height: 1.25; font-weight: 600; color: var(--pv-text); }
body.pv h1 { font-size: 1.6rem; }
body.pv h2 { font-size: 1.35rem; }
body.pv h3 { font-size: 1.1rem; }
body.pv hr { border: 0; border-top: 1px solid var(--pv-line); margin: 16px 0; }
body.pv :focus-visible { outline: 2px solid var(--pv-gold); outline-offset: 2px; }
body.pv mark { background: var(--pv-gold-soft); color: inherit; padding: 0 1px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
    body.pv *, body.pv *::before, body.pv *::after { animation: none !important; transition: none !important; }
}

/* ---------- Shell ---------- */
.pv-shell {
    display: grid;
    grid-template-columns: var(--pv-sidebar-w) minmax(0, 1fr);
    min-height: 100vh;
}
.pv-main {
    min-width: 0;                  /* lets wide tables scroll instead of stretching the page */
    padding: 28px clamp(16px, 3vw, 36px) 64px;
}
.pv-main .main-content { padding: 0; min-width: 0; }

/* ---------- Sidebar ---------- */
.pv-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    background: var(--pv-ink);
    color: #d9d4ca;
    padding: 22px 14px 16px;
    display: flex;
    flex-direction: column;
    box-shadow: none;
    scrollbar-width: thin;
    scrollbar-color: #333 transparent;
}
.pv-sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 18px; margin-bottom: 8px; border-bottom: 1px solid rgba(184,145,63,.28); }
.pv-sidebar .logo { display: block; margin: 0; }
.pv-sidebar .logo img { display: block; height: auto; }
.pv-close-btn { display: none; background: none; border: 0; color: #fff; font-size: 1.2rem; padding: 6px; cursor: pointer; }

.pv-nav-group { margin-top: 16px; }
.pv-nav-label { font-size: .72rem; color: #8c8579; padding: 0 12px 6px; letter-spacing: .02em; }
.pv-sidebar .nav-menu { list-style: none; margin: 0; padding: 0; }
.pv-sidebar .nav-item { margin: 0 0 2px; border-radius: var(--pv-r-sm); background: none; }
.pv-sidebar .nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 9px 12px;
    border-radius: var(--pv-r-sm);
    color: #d9d4ca;
    font-size: .92rem;
    font-weight: 500;
    position: relative;
    transition: background .15s, color .15s;
}
.pv-sidebar .nav-link i { width: 18px; text-align: center; font-size: .95rem; color: #8c8579; margin: 0; transition: color .15s; }
.pv-sidebar .nav-link:hover { background: var(--pv-ink-2); color: #fff; }
.pv-sidebar .nav-link:hover i { color: var(--pv-gold); }
.pv-sidebar .nav-item.active .nav-link { background: var(--pv-ink-2); color: #fff; }
.pv-sidebar .nav-item.active .nav-link i { color: var(--pv-gold); }
.pv-sidebar .nav-item.active .nav-link::before {
    content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px;
    background: var(--pv-gold); border-radius: 0 3px 3px 0;
}

.pv-sidebar-foot { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid #222; display: flex; flex-direction: column; gap: 10px; }
.pv-me { display: flex; align-items: center; gap: 10px; min-width: 0; }
.pv-me-icon { width: 30px; height: 30px; border-radius: 50%; background: var(--pv-ink-2); color: var(--pv-gold); display: grid; place-items: center; font-size: .8rem; flex: none; }
.pv-me-name { font-size: .82rem; color: #bdb6aa; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-signout { font-size: .85rem; color: #8c8579 !important; padding: 4px 0; }
.pv-signout:hover { color: #fff !important; }

/* Mobile top bar (hidden on desktop) */
.pv-topbar { display: none; }
.pv-backdrop { display: none; }

/* ---------- Page header ---------- */
.pv-page-head, body.pv .header {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px;
    flex-wrap: wrap; margin-bottom: 24px;
}
body.pv .pv-title, body.pv .page-title h2 {
    font-family: var(--pv-display);
    font-weight: 600;
    font-size: clamp(1.6rem, 2.6vw, 2.2rem);
    letter-spacing: -.01em;
    margin: 0;
    color: var(--pv-text);
}
.pv-sub { color: var(--pv-muted); font-size: .9rem; margin: 4px 0 0; }
.pv-head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
body.pv .user-profile { display: none; } /* user now shown in sidebar */

/* ---------- Surfaces ---------- */
body.pv .section, body.pv .customers-section, .pv-card, body.pv #container .box, body.pv .table-container, body.pv .search-section {
    background: var(--pv-surface);
    border: 1px solid var(--pv-line);
    border-radius: var(--pv-r-lg);
    padding: 20px;
    box-shadow: var(--pv-shadow);
    margin-bottom: 20px;
}
body.pv .section .section { border: 0; padding: 0; box-shadow: none; margin-bottom: 12px; }
body.pv .table-container { padding: 0; overflow: hidden; }
.pv-card-head, body.pv .section-header, body.pv .table-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    margin-bottom: 14px;
}
body.pv .table-header { padding: 16px 20px; margin: 0; border-bottom: 1px solid var(--pv-line); }
.pv-card-title, body.pv .section-title, body.pv .table-header h3 { font-size: 1.05rem; font-weight: 600; margin: 0; display: flex; align-items: center; gap: 8px; }
.pv-card-title i { color: var(--pv-gold); }

/* ---------- Buttons ---------- */
body.pv .btn, .pv-btn, body.pv button.action-btn.view {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 38px;
    padding: 8px 14px;
    margin: 0;
    border: 1px solid var(--pv-line-strong);
    border-radius: var(--pv-r-sm);
    background: var(--pv-surface);
    color: var(--pv-text);
    font-size: .88rem;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s, border-color .15s, color .15s;
    white-space: nowrap;
}
body.pv .btn:hover:not(.active), .pv-btn:hover { border-color: var(--pv-gold); background: var(--pv-gold-wash); }
body.pv .btn span { margin: 0; }
body.pv .btn.active, .pv-btn-primary {
    background: var(--pv-ink); border-color: var(--pv-ink); color: #fff;
}
body.pv .btn.active:hover, .pv-btn-primary:hover { background: var(--pv-ink-2); border-color: var(--pv-gold); color: #fff; }
body.pv .btn.active a, .pv-btn-primary a { color: #fff; }
.pv-btn-gold { background: var(--pv-gold); border-color: var(--pv-gold); color: #fff; }
.pv-btn-gold:hover { background: var(--pv-gold-deep) !important; border-color: var(--pv-gold-deep) !important; color: #fff !important; }
.pv-btn-danger { color: var(--pv-red); border-color: #e9c4c1; }
.pv-btn-danger:hover { background: var(--pv-red-bg) !important; border-color: var(--pv-red) !important; }
.pv-btn-sm { min-height: 30px; padding: 5px 10px; font-size: .8rem; }
.pv-btn-live { background: var(--pv-red); border-color: var(--pv-red); color: #fff; }
.pv-btn-live:hover { background: #8f1e18 !important; color: #fff !important; }
.pv-btn-live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pv-pulse 1.6s infinite; }
@keyframes pv-pulse { 50% { opacity: .25; } }

body.pv .action-btn {
    width: 34px; height: 34px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--pv-surface); border: 1px solid var(--pv-line); color: var(--pv-muted);
    cursor: pointer; transition: all .15s; padding: 0;
}
body.pv .action-btn:hover { background: var(--pv-ink); color: #fff; border-color: var(--pv-ink); transform: none; }
body.pv .action-btn.whatsapp { color: var(--pv-wa); }
body.pv .action-btns, body.pv .actions { display: flex; gap: 6px; align-items: center; }

/* ---------- Forms ---------- */
body.pv input[type="text"], body.pv input[type="email"], body.pv input[type="tel"], body.pv input[type="number"],
body.pv input[type="password"], body.pv input[type="date"], body.pv input[type="datetime-local"], body.pv input[type="search"],
body.pv input[type="url"], body.pv input:not([type]), body.pv select, body.pv textarea {
    width: 100%;
    max-width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid var(--pv-line-strong);
    border-radius: var(--pv-r-sm);
    background: var(--pv-surface);
    color: var(--pv-text);
    font-size: .92rem;
    transition: border-color .15s, box-shadow .15s;
}
body.pv input:focus, body.pv select:focus, body.pv textarea:focus {
    outline: none; border-color: var(--pv-gold); box-shadow: 0 0 0 3px rgba(184,145,63,.18);
}
body.pv input[type="submit"], body.pv button[type="submit"]:not([class]) {
    min-height: 40px; padding: 8px 18px; border: 0; border-radius: var(--pv-r-sm);
    background: var(--pv-ink); color: #fff; font-weight: 500; cursor: pointer;
}
body.pv input[type="submit"]:hover { background: var(--pv-ink-2); }
body.pv label { font-size: .82rem; color: var(--pv-muted); font-weight: 500; display: inline-block; margin: 6px 0 4px; }
.pv-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pv-field label { margin: 0; }

/* ---------- Tables ---------- */
.pv-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--pv-r); }
body.pv table { width: 100%; border-collapse: collapse; font-size: .88rem; }
body.pv thead { background: none; }
body.pv th {
    padding: 10px 12px; text-align: left; white-space: nowrap;
    font-size: .76rem; font-weight: 600; color: var(--pv-muted);
    text-transform: none; letter-spacing: 0;
    background: var(--pv-surface-2);
    border-bottom: 1px solid var(--pv-line);
}
body.pv td { padding: 12px; border-bottom: 1px solid var(--pv-line); vertical-align: middle; }
body.pv tbody tr:last-child td { border-bottom: 0; }
body.pv tbody tr:hover td { background: #fcfbf9; }
body.pv td.num, body.pv th.num, .pv-num { text-align: right; font-variant-numeric: tabular-nums; }

/* Card-style tables on phones: add class "pv-cards" to <table> and data-label="" to each <td> */
@media (max-width: 720px) {
    body.pv table.pv-cards, body.pv table.pv-cards tbody, body.pv table.pv-cards tr, body.pv table.pv-cards td { display: block; width: 100%; }
    body.pv table.pv-cards thead { display: none; }
    body.pv table.pv-cards tr { padding: 12px 14px; border-bottom: 1px solid var(--pv-line); }
    body.pv table.pv-cards tbody tr:hover td { background: none; }
    body.pv table.pv-cards td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; text-align: right; }
    body.pv table.pv-cards td[data-label]::before { content: attr(data-label); color: var(--pv-muted); font-size: .78rem; text-align: left; flex: none; }
    body.pv table.pv-cards td.pv-cell-main { display: block; text-align: left; padding-bottom: 8px; }
    body.pv table.pv-cards td.pv-cell-main::before { content: none; }
    body.pv table.pv-cards tfoot { display: block; }
    body.pv table.pv-cards tfoot tr { display: flex; flex-wrap: wrap; gap: 8px; background: var(--pv-surface-2); }
    body.pv table.pv-cards tfoot td { display: flex; gap: 6px; width: auto; padding: 2px 8px 2px 0; }
    body.pv table.pv-cards tfoot td:empty { display: none; }
}

/* ---------- Badges ---------- */
body.pv .badge, .pv-badge {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 9px; border-radius: 999px;
    font-size: .74rem; font-weight: 600; line-height: 1.4;
    background: var(--pv-surface-2); color: var(--pv-muted); border: 1px solid var(--pv-line);
}
.pv-badge.ok, .pv-badge.completed, .pv-badge.paid, body.pv .badge-success, body.pv .badge.new { background: var(--pv-green-bg); color: var(--pv-green); border-color: transparent; }
.pv-badge.warn, .pv-badge.queued, .pv-badge.partial, body.pv .badge-warning { background: var(--pv-amber-bg); color: var(--pv-amber); border-color: transparent; }
.pv-badge.info, .pv-badge.running, .pv-badge.covered, body.pv .badge.loyal { background: var(--pv-blue-bg); color: var(--pv-blue); border-color: transparent; }
.pv-badge.bad, .pv-badge.failed, .pv-badge.uncovered { background: var(--pv-red-bg); color: var(--pv-red); border-color: transparent; }
body.pv .badge.vip, .pv-badge.gold { background: var(--pv-gold-wash); color: var(--pv-gold-deep); border-color: var(--pv-gold-soft); }
body.pv .badge.inactive, .pv-badge.draft { background: var(--pv-surface-2); color: var(--pv-faint); }
body.pv .badge-VIP { background: var(--pv-red-bg); color: var(--pv-red); }
body.pv .badge-GOLD, body.pv .badge-Gold { background: var(--pv-gold-wash); color: var(--pv-gold-deep); }
body.pv .badge-SILVER, body.pv .badge-Silver { background: var(--pv-blue-bg); color: var(--pv-blue); }
body.pv .badge-REGULAR, body.pv .badge-REG, body.pv .badge-Regular { background: var(--pv-green-bg); color: var(--pv-green); }
body.pv .badge-primary, body.pv .badge-VVIP, body.pv .badge-Platinum { background: #efe9f7; color: var(--tier-vvip); }
body.pv .badge-Bronze { background: #f6ebe0; color: var(--bronze); }

/* ---------- KPI / stat cards ---------- */
body.pv .stats-grid, .pv-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}
body.pv .stat-card, .pv-kpi {
    background: var(--pv-surface);
    border: 1px solid var(--pv-line);
    border-radius: var(--pv-r-lg);
    padding: 18px;
    box-shadow: var(--pv-shadow);
    transition: none;
    min-width: 0;
}
body.pv .stat-card:hover { transform: none; }
body.pv .stat-header { display: flex; justify-content: space-between; gap: 12px; margin: 0; }
body.pv .stat-title, .pv-kpi-label { font-size: .82rem; color: var(--pv-muted); font-weight: 500; margin: 0 0 6px; }
body.pv .stat-value, body.pv .pv-kpi-value {
    font-family: var(--pv-font);
    font-size: 1.9rem; font-weight: 600; letter-spacing: -.01em; line-height: 1.1; margin: 0 0 6px;
    font-variant-numeric: lining-nums tabular-nums;
    color: var(--pv-text);
}
body.pv .stat-change, .pv-kpi-note { font-size: .8rem; color: var(--pv-muted); display: block; margin: 0; }
body.pv .stat-icon {
    width: 40px; height: 40px; border-radius: 50%; flex: none;
    display: grid; place-items: center; font-size: 1rem;
    background: var(--pv-gold-wash); color: var(--pv-gold-deep);
}
.pv-kpi { display: flex; flex-direction: column; }
.pv-kpi-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.pv-kpi-icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--pv-gold-wash); color: var(--pv-gold-deep); flex: none; font-size: .9rem; }
.pv-kpi-foot { margin-top: auto; padding-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .8rem; color: var(--pv-muted); }
.pv-kpi-foot a { color: var(--pv-gold-deep); font-weight: 500; }
.pv-kpi.is-hero { background: var(--pv-gold-wash); border-color: var(--pv-gold-soft); box-shadow: inset 0 3px 0 var(--pv-gold); }
.pv-kpi.is-hero .pv-kpi-icon { background: #fff; }
.pv-up { color: var(--pv-green); } .pv-down { color: var(--pv-red); }
.sr-icon { height: .8em; width: auto; vertical-align: baseline; opacity: .8; }

/* ---------- Alerts ---------- */
.pv-alerts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 20px; }
.pv-alert {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; border-radius: var(--pv-r);
    background: var(--pv-surface); border: 1px solid var(--pv-line); border-left: 4px solid var(--pv-gold);
}
.pv-alert h4 { margin: 0; font-size: .92rem; }
.pv-alert p { margin: 2px 0 0; font-size: .8rem; color: var(--pv-muted); overflow: hidden; text-overflow: ellipsis; }
.pv-alert.wa { border-left-color: var(--pv-wa); } .pv-alert.wa h4 i { color: var(--pv-wa); }
.pv-alert.run { border-left-color: var(--pv-blue); } .pv-alert.run h4 i { color: var(--pv-blue); }
.pv-alert.mail { border-left-color: var(--pv-red); } .pv-alert.mail h4 i { color: var(--pv-red); }
.pv-alert.event { border-left-color: var(--pv-green); } .pv-alert.event h4 i { color: var(--pv-green); }
body.pv .msg { padding: 10px 14px; border-radius: var(--pv-r-sm); margin-bottom: 16px; font-size: .9rem; }
body.pv .msg.success { background: var(--pv-green-bg); color: var(--pv-green); border: 0; }
body.pv .msg.error { background: var(--pv-red-bg); color: var(--pv-red); border: 0; }

/* ---------- Layout helpers ---------- */
.pv-grid-2 { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 20px; margin-bottom: 20px; }
.pv-grid-2 > * { margin-bottom: 0 !important; }
.pv-grid-even { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 20px; }
.pv-grid-even > * { margin-bottom: 0 !important; }
.pv-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pv-muted { color: var(--pv-muted); } .pv-small { font-size: .82rem; }
.pv-empty { text-align: center; padding: 40px 16px; color: var(--pv-muted); }
.pv-empty i { font-size: 1.8rem; color: var(--pv-line-strong); display: block; margin-bottom: 10px; }

/* Quick actions list */
.pv-actions { display: flex; flex-direction: column; gap: 8px; }
.pv-action {
    display: flex; align-items: center; gap: 12px; padding: 11px 12px;
    border: 1px solid var(--pv-line); border-radius: var(--pv-r); background: var(--pv-surface);
    transition: border-color .15s, background .15s;
}
.pv-action:hover { border-color: var(--pv-gold); background: var(--pv-gold-wash); }
.pv-action i { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--pv-surface-2); color: var(--pv-gold-deep); flex: none; }
.pv-action strong { display: block; font-size: .9rem; font-weight: 600; }
.pv-action span { display: block; font-size: .78rem; color: var(--pv-muted); }

/* Chip links */
.pv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pv-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px;
    border: 1px solid var(--pv-line-strong); border-radius: 999px; font-size: .84rem; background: var(--pv-surface);
}
.pv-chip:hover, .pv-chip.active { border-color: var(--pv-ink); background: var(--pv-ink); color: #fff; }

/* Simple bar chart (no library) */
.pv-bars { display: flex; align-items: flex-end; gap: 8px; height: 180px; padding-top: 10px; }
.pv-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; height: 100%; min-width: 0; }
.pv-bar-fill { width: 100%; max-width: 46px; background: var(--pv-ink); border-radius: 4px 4px 0 0; min-height: 3px; }
.pv-bar.is-today .pv-bar-fill { background: var(--pv-gold); }
.pv-bar-val { font-size: .78rem; font-weight: 600; }
.pv-bar-lbl { font-size: .74rem; color: var(--pv-muted); }

/* Progress */
.pv-progress { height: 10px; background: var(--pv-surface-2); border: 1px solid var(--pv-line); border-radius: 999px; overflow: hidden; }
.pv-progress > span { display: block; height: 100%; background: var(--pv-ink); border-radius: 999px; transition: width .8s ease; }

/* Pagination */
body.pv .pagination { display: flex; justify-content: center; align-items: center; gap: 6px; padding: 16px; flex-wrap: wrap; margin: 0; }
body.pv .page-btn {
    min-width: 36px; height: 36px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--pv-line); border-radius: var(--pv-r-sm);
    background: var(--pv-surface); color: var(--pv-text); font-size: .85rem; cursor: pointer;
}
body.pv .page-btn:hover:not(:disabled):not(.active) { border-color: var(--pv-gold); background: var(--pv-gold-wash); }
body.pv .page-btn.active { background: var(--pv-ink); border-color: var(--pv-ink); color: #fff; }
body.pv .page-btn:disabled { opacity: .4; cursor: default; }
body.pv .page-info { font-size: .82rem; color: var(--pv-muted); margin: 0 8px; }

/* Tooltip (legacy) */
[data-cf-tooltip] { position: relative; }
[data-cf-tooltip]::after {
    content: attr(data-cf-tooltip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
    background: var(--pv-ink); color: #fff; padding: 4px 8px; border-radius: 4px; font-size: .78rem; white-space: nowrap;
    opacity: 0; visibility: hidden; transition: opacity .15s; z-index: 50; pointer-events: none;
}
[data-cf-tooltip]:hover::after { opacity: 1; visibility: visible; }

/* Legacy odometer / customer bits */
body.pv .customer-info { display: flex; align-items: center; gap: 10px; }
body.pv .customer-icon, body.pv .icon {
    width: 38px; height: 38px; border-radius: 50%; background: var(--pv-ink); color: var(--pv-gold);
    display: grid; place-items: center; font-size: .95rem; flex: none; margin: 0;
}
body.pv .mblMenu { display: none !important; }
body.pv .clear { clear: both; }

/* =====================================================================
   Responsive
   ===================================================================== */
@media (max-width: 1100px) {
    .pv-grid-2 { grid-template-columns: 1fr; }
}

@media (max-width: 992px) {
    .pv-shell { grid-template-columns: 1fr; }
    .pv-main { padding: 16px 14px 56px; }

    .pv-topbar {
        display: flex; align-items: center; justify-content: space-between; gap: 12px;
        position: sticky; top: 0; z-index: 60;
        height: 56px; padding: 0 8px; padding-top: env(safe-area-inset-top);
        background: var(--pv-ink); color: #fff;
    }
    .pv-menu-btn, .pv-topbar-action {
        width: 44px; height: 44px; display: grid; place-items: center;
        background: none; border: 0; color: #fff; font-size: 1.1rem; cursor: pointer;
    }
    .pv-topbar-logo img { display: block; height: 26px; width: auto; }

    .pv-sidebar {
        position: fixed; z-index: 80; top: 0; left: 0; bottom: 0;
        width: min(84vw, 300px); height: 100%;
        transform: translateX(-102%);
        transition: transform .22s ease;
        padding-top: calc(18px + env(safe-area-inset-top));
    }
    .pv-close-btn { display: block; }
    body.pv-nav-open .pv-sidebar { transform: none; box-shadow: var(--pv-shadow-pop); }
    body.pv-nav-open .pv-backdrop { display: block; position: fixed; inset: 0; z-index: 70; background: rgba(5,5,5,.45); }
    body.pv-nav-open { overflow: hidden; }
    .pv-sidebar .nav-item.active .nav-link::before { left: -14px; }
}

@media (max-width: 720px) {
    body.pv { font-size: 15px; }
    /* 16px inputs stop iOS from zooming on focus */
    body.pv input, body.pv select, body.pv textarea { font-size: 16px !important; }

    body.pv .section, body.pv .customers-section, .pv-card, body.pv #container .box, body.pv .search-section { padding: 14px; border-radius: var(--pv-r); }
    body.pv .stats-grid, .pv-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    body.pv .stat-card, .pv-kpi { padding: 14px; }
    body.pv .stat-value, .pv-kpi-value { font-size: 1.5rem; }
    body.pv .stat-icon, .pv-kpi-icon { display: none; }
    .pv-page-head, body.pv .header { align-items: flex-start; margin-bottom: 16px; }
    .pv-head-actions { width: 100%; }
    .pv-alert { flex-wrap: wrap; }
    .pv-alert .pv-btn { width: 100%; }
    body.pv th, body.pv td { padding: 10px; }
    .pv-bars { height: 150px; gap: 4px; }
}

@media (max-width: 380px) {
    body.pv .stats-grid, .pv-kpis { grid-template-columns: 1fr; }
}

/* ---------- Login page ---------- */
body.pv-login { min-height: 100vh; display: grid; place-items: center; background: var(--pv-ink); padding: 20px; }
.pv-login-card { width: 100%; max-width: 380px; background: var(--pv-surface); border-radius: var(--pv-r-lg); padding: 32px 28px; box-shadow: var(--pv-shadow-pop); }
.pv-login-card .pv-login-logo { background: var(--pv-ink); margin: -32px -28px 24px; padding: 22px; border-radius: var(--pv-r-lg) var(--pv-r-lg) 0 0; text-align: center; border-bottom: 2px solid var(--pv-gold); }
body.pv .pv-login-card h1 { font-family: var(--pv-display); font-size: 1.6rem; margin: 0 0 18px; }
.pv-login-card .pv-field { margin-bottom: 14px; }
.pv-login-card input[type="submit"] { width: 100%; margin-top: 6px; }
.pv-login-error { background: var(--pv-red-bg); color: var(--pv-red); padding: 10px 12px; border-radius: var(--pv-r-sm); font-size: .88rem; margin-bottom: 14px; }

/* =====================================================================
   Older pages (reserved, search-reserved, reserve, createNewEvent, …)
   They used the public website's stylesheet; this gives them the admin look.
   ===================================================================== */
body.pv .pv-main #container { display: grid; gap: 20px; max-width: 1100px; margin: 0; padding: 0; width: auto; float: none; }
body.pv .pv-main #container > aside,
body.pv .pv-main #container > section > .box,
body.pv .pv-main #container > .box {
    display: block; float: none; width: auto; margin: 0;
    background: var(--pv-surface); border: 1px solid var(--pv-line); border-radius: var(--pv-r-lg);
    padding: 20px; box-shadow: var(--pv-shadow); color: var(--pv-text);
}
body.pv .pv-main #container > section { display: block; float: none; width: auto; margin: 0; padding: 0; background: none; border: 0; }
body.pv .pv-main #container h1 { font-size: 1.3rem; text-align: left; margin: 0 0 12px; }
body.pv .pv-main #container u { text-decoration: none; color: var(--pv-muted); }
body.pv .pv-main #container aside > div { padding: 3px 0; }
body.pv .pv-main #container form > div, body.pv .pv-main #container form p { margin-bottom: 10px; }
body.pv .pv-main button:not([class]), body.pv .pv-main a.button {
    display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px; margin: 2px 4px 2px 0;
    border: 1px solid var(--pv-line-strong); border-radius: var(--pv-r-sm); background: var(--pv-surface);
    color: var(--pv-text); font-size: .84rem; cursor: pointer;
}
body.pv .pv-main button:not([class]):hover, body.pv .pv-main a.button:hover { border-color: var(--pv-gold); background: var(--pv-gold-wash); }
body.pv .pv-main button:not([class]) > a.button { border: 0; padding: 0; margin: 0; min-height: 0; background: none; }
body.pv .pv-main .nav { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
body.pv .pv-main .nav li { list-style: none; }
body.pv .pv-main li.btn { width: auto; }

/* Cards and grids never push past the page edge */
.pv-card, .pv-kpi, body.pv .section { min-width: 0; max-width: 100%; }
.pv-main img[src*="sr.png"] { height: .8em; width: auto !important; vertical-align: baseline; margin-right: 3px; }

/* ---------- Live toggle ---------- */
.pv-live-btn { gap: 8px; }
.pv-live-btn .pv-live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--pv-faint); flex: none; }
.pv-live-btn[data-state="live"] { border-color: var(--pv-green); color: var(--pv-green); background: var(--pv-green-bg); }
.pv-live-btn[data-state="live"] .pv-live-dot { background: var(--pv-green); animation: pv-pulse 1.6s infinite; }
.pv-live-btn[data-state="retry"] { border-color: var(--pv-amber); color: var(--pv-amber); background: var(--pv-amber-bg); }
.pv-live-btn[data-state="retry"] .pv-live-dot { background: var(--pv-amber); animation: pv-pulse .8s infinite; }
.pv-live-btn[data-state="error"] { border-color: var(--pv-red); color: var(--pv-red); background: var(--pv-red-bg); }
.pv-live-btn[data-state="error"] .pv-live-dot { background: var(--pv-red); }
.pv-live-btn .pv-live-label { font-variant-numeric: tabular-nums; }
@keyframes pv-flash { from { background: var(--pv-gold-soft); } to { background: transparent; } }
.pv-flash { animation: pv-flash 1.6s ease-out; border-radius: 4px; }


/* =====================================================================
   System status (SNB + WhatsApp) — side menu, mobile top bar, WhatsApp page
   ===================================================================== */
.pv-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #777; flex: none; box-shadow: 0 0 0 3px rgba(255,255,255,.06); }
.pv-dot.is-ok { background: #3fb36b; box-shadow: 0 0 0 3px rgba(63,179,107,.18); }
.pv-dot.is-bad { background: #e0533f; box-shadow: 0 0 0 3px rgba(224,83,63,.22); animation: pvBlink 1.4s infinite; }
.pv-dot.is-warn { background: #e0b33f; box-shadow: 0 0 0 3px rgba(224,179,63,.2); }
@keyframes pvBlink { 50% { opacity: .35; } }
.pv-sys { display: flex; flex-direction: column; gap: 6px; margin: 4px 8px 6px; padding: 10px 12px; border: 1px solid #222; border-radius: 10px; background: #0d0d0c; }
.pv-sys-label { display: flex; align-items: center; justify-content: space-between; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase; color: #8a8378; }
.pv-sys-refresh { background: none; border: 0; color: #8a8378; cursor: pointer; padding: 4px; font-size: .75rem; }
.pv-sys-refresh:hover { color: var(--pv-gold); }
.pv-sys-refresh.spin i { animation: pvSpin .8s linear infinite; }
@keyframes pvSpin { to { transform: rotate(360deg); } }
.pv-sys-item { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: #d9d3c8; text-decoration: none; min-width: 0; }
.pv-sys-item span { flex: none; }
.pv-sys-item em { font-style: normal; margin-left: auto; color: #8a8378; font-size: .75rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-sys-item.is-ok em { color: #6fcf97; }
.pv-sys-item.is-bad em { color: #f08a7a; }
a.pv-sys-item:hover span { color: var(--pv-gold); }
.pv-sys-mini { display: none; }
@media (max-width: 992px) {
    .pv-sys-mini { display: flex; gap: 6px; align-items: center; margin-left: auto; height: 44px; padding: 0 10px; background: none; border: 0; cursor: pointer; }
}

/* WhatsApp page status card */
.pv-wa-status { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: center; background: var(--pv-surface); border: 1px solid var(--pv-line); border-left: 4px solid var(--pv-line-strong); border-radius: 12px; padding: 16px 18px; margin: 0 0 20px; }
.pv-wa-status.is-ok { border-left-color: #3fb36b; }
.pv-wa-status.is-bad { border-left-color: #e0533f; background: var(--pv-red-bg); }
.pv-wa-status .big { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; font-weight: 600; color: var(--pv-text); }
.pv-wa-status .big .pv-dot { width: 12px; height: 12px; }
.pv-wa-status .kv { display: flex; flex-direction: column; font-size: .78rem; color: var(--pv-muted); }
.pv-wa-status .kv b { font-size: .95rem; color: var(--pv-text); font-weight: 600; }
.pv-wa-status .q-GREEN { color: var(--pv-green); } .pv-wa-status .q-YELLOW { color: #a87a00; } .pv-wa-status .q-RED { color: var(--pv-red); }
.pv-wa-status .why { flex-basis: 100%; font-size: .85rem; color: var(--pv-red); }
.pv-wa-status .warn { flex-basis: 100%; font-size: .85rem; color: #8a6400; }
.pv-wa-status .act { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: .78rem; color: var(--pv-muted); }
.pv-wa-status button { border: 1px solid var(--pv-line-strong); background: var(--pv-surface-2); border-radius: 8px; padding: 8px 14px; cursor: pointer; font: inherit; font-size: .85rem; }

.pv-sys-label a { color: inherit; text-decoration: none; } .pv-sys-label a:hover { color: var(--pv-gold); }
/* status page */
.pv-st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.pv-st { background: var(--pv-surface); border: 1px solid var(--pv-line); border-left: 4px solid var(--pv-line-strong); border-radius: 12px; padding: 16px 18px; scroll-margin-top: 80px; }
.pv-st.is-ok { border-left-color: #3fb36b; } .pv-st.is-bad { border-left-color: #e0533f; background: var(--pv-red-bg); } .pv-st.is-warn { border-left-color: #e0b33f; }
.pv-st h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 4px; font-size: 1rem; }
.pv-st h3 b { margin-left: auto; font-size: .85rem; } .pv-st.is-ok h3 b { color: var(--pv-green); } .pv-st.is-bad h3 b { color: var(--pv-red); } .pv-st.is-warn h3 b { color: #8a6400; }
.pv-st p { margin: 4px 0 0; font-size: .85rem; color: var(--pv-muted); }
.pv-st ul { list-style: none; margin: 10px 0 0; padding: 0; font-size: .85rem; } .pv-st li { display: flex; gap: 8px; align-items: baseline; padding: 6px 0; border-top: 1px solid var(--pv-line); }
.pv-st li .pv-dot { position: relative; top: 1px; } .pv-st li small { display: block; color: var(--pv-muted); }
.pv-st .what { font-size: .8rem; color: var(--pv-faint); margin-top: 8px; }

/* Buttons that are links (<a class="pv-btn pv-btn-primary">): "body.pv a { color: inherit }" is more specific
   than a single class, so the text came out black on black. These keep each button's own text colour. */
body.pv a.pv-btn-primary, body.pv a.pv-btn-primary:hover, body.pv a.pv-btn-primary i,
body.pv a.pv-btn-gold, body.pv a.pv-btn-gold:hover, body.pv a.pv-btn-gold i,
body.pv a.pv-btn-live, body.pv a.pv-btn-live:hover, body.pv a.pv-btn-live i { color: #fff; }
body.pv a.pv-btn-danger, body.pv a.pv-btn-danger i { color: var(--pv-red); }
