/* InnsPOS — Stylesheet
   Design tokens live in :root (light) and [data-theme="dark"]. Components only
   reference tokens, so the theme switch in Settings is a single attribute flip
   on <html>. Radii are deliberately tight (3–6px) for a sharp, professional look. */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ─── Tokens: light (default) ─── */
:root {
    color-scheme: light;

    /* Surfaces */
    --bg: #f3f4f6;
    --card: #ffffff;
    --card-soft: #f8f9fb;
    --surface: #0f172a;
    --surface-2: #1e293b;
    --input-bg: #ffffff;

    /* Text */
    --text: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;

    /* Lines */
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    /* Brand + semantic. Solid colours carry white text; *-soft/-text pairs
       are for tinted chips and inline text so they stay legible on any bg. */
    --primary: #2563eb;  --primary-dark: #1d4ed8;  --primary-soft: #eff6ff;  --primary-border: #bfdbfe;  --primary-text: #1d4ed8;
    --success: #16a34a;  --success-dark: #15803d;  --success-soft: #f0fdf4;  --success-border: #bbf7d0;  --success-text: #166534;
    --danger:  #dc2626;  --danger-dark:  #b91c1c;  --danger-soft:  #fef2f2;  --danger-border:  #fecaca;  --danger-text:  #991b1b;
    --warning: #d97706;  --warning-dark: #b45309;  --warning-soft: #fffbeb;  --warning-border: #fde68a;  --warning-text: #92400e;
    --info:    #0284c7;  --info-dark:    #0369a1;  --info-soft:    #f0f9ff;  --info-border:    #bae6fd;  --info-text:    #075985;
    --neutral: #64748b;  --neutral-dark: #475569;  --neutral-soft: #f1f5f9;  --neutral-border: #e2e8f0;  --neutral-text: #475569;
    --star: #f59e0b;
    --star-empty: #cbd5e1;

    /* Chrome */
    --nav-bg: #0f172a;
    --nav-border: #1e293b;
    --nav-text: rgba(255,255,255,0.62);
    --nav-text-active: #ffffff;
    --nav-hover-bg: rgba(255,255,255,0.05);

    /* Room status blocks (white text on top) */
    --status-available: #15803d;
    --status-occupied: #b91c1c;
    --status-cleaning: #b45309;

    /* Effects */
    --shadow: 0 1px 2px rgba(15,23,42,0.06);
    --shadow-md: 0 2px 6px rgba(15,23,42,0.08);
    --shadow-lg: 0 12px 32px rgba(15,23,42,0.14);
    --focus-ring: 0 0 0 3px rgba(37,99,235,0.18);
    --radius: 4px;
    --radius-sm: 3px;
    --radius-lg: 6px;
    --transition: 0.15s ease;

    /* Navigation */
    --sidebar-w: 200px;
    --sidebar-w-collapsed: 52px;
}

/* ─── Tokens: dark ─── */
[data-theme="dark"] {
    color-scheme: dark;

    --bg: #0b1120;
    --card: #111a2e;
    --card-soft: #172136;
    --surface: #0b1120;
    --surface-2: #172136;
    --input-bg: #0f172a;

    --text: #e2e8f0;
    --text-secondary: #cbd5e1;
    --text-muted: #8b98ad;

    --border: #243049;
    --border-strong: #334561;

    --primary: #3b82f6;  --primary-dark: #2563eb;  --primary-soft: rgba(59,130,246,0.14);  --primary-border: rgba(59,130,246,0.45);  --primary-text: #7db3ff;
    --success: #16a34a;  --success-dark: #15803d;  --success-soft: rgba(34,197,94,0.14);   --success-border: rgba(34,197,94,0.45);   --success-text: #4ade80;
    --danger:  #dc2626;  --danger-dark:  #b91c1c;  --danger-soft:  rgba(239,68,68,0.14);   --danger-border:  rgba(239,68,68,0.45);   --danger-text:  #f87171;
    --warning: #d97706;  --warning-dark: #b45309;  --warning-soft: rgba(245,158,11,0.14);  --warning-border: rgba(245,158,11,0.45);  --warning-text: #fbbf24;
    --info:    #0284c7;  --info-dark:    #0369a1;  --info-soft:    rgba(56,189,248,0.14);  --info-border:    rgba(56,189,248,0.45);  --info-text:    #38bdf8;
    --neutral: #475569;  --neutral-dark: #334155;  --neutral-soft: rgba(148,163,184,0.12); --neutral-border: rgba(148,163,184,0.35); --neutral-text: #cbd5e1;
    --star-empty: #334561;

    --nav-bg: #0f172a;
    --nav-border: #1e293b;
    --nav-text: rgba(226,232,240,0.6);
    --nav-text-active: #ffffff;
    --nav-hover-bg: rgba(255,255,255,0.04);

    --status-available: #166534;
    --status-occupied: #991b1b;
    --status-cleaning: #92400e;

    --shadow: 0 1px 2px rgba(0,0,0,0.5);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.5);
    --shadow-lg: 0 16px 40px rgba(0,0,0,0.65);
    --focus-ring: 0 0 0 3px rgba(59,130,246,0.3);
}

/* ─── Base ─── */
html { background: var(--bg); }
body {
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { color: var(--text); line-height: 1.25; }
a { color: var(--primary-text); }
code { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 0.92em; }
strong { font-weight: 600; }

/* Base form controls. Kept at low specificity and declared early so component
   rules further down (and inline styles) always win. */
input, select, textarea, button { font-family: inherit; }
input[type="text"], input[type="number"], input[type="password"], input[type="email"],
input[type="search"], input[type="tel"], input[type="url"], input[type="date"],
input[type="time"], input[type="datetime-local"], select, textarea {
    color: var(--text);
    background: var(--input-bg);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.4;
    padding: 8px 10px;
    transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }
input[readonly] { color: var(--text-muted); background: var(--card-soft); }
input::placeholder, textarea::placeholder { color: var(--text-muted); opacity: 0.8; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); }
input[type="file"] { color: var(--text-secondary); font-size: 13px; }

/* ─── Top bar ───
   Pages navigate from the sidebar below; this keeps the inn name, the shift
   pill and the account controls. */
.navbar {
    display: flex;
    align-items: center;
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    padding: 0 16px;
    height: 52px;
    gap: 14px;
    /* Fixed rather than sticky so the bar spans the full width above the
       sidebar instead of starting where the page content does. */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
}
body { padding-top: 52px; }
.nav-brand a {
    color: var(--nav-text-active);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: -0.2px;
}
.nav-spacer { flex: 1; }
.nav-action a { text-decoration: none; }
.nav-action .btn { padding: 5px 12px; font-size: 12px; }
.nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: none;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--nav-text);
    cursor: pointer;
    transition: var(--transition);
}
.nav-toggle:hover { background: var(--nav-hover-bg); color: var(--nav-text-active); }
.nav-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }

/* ─── Sidebar ─── */
.sidebar {
    position: fixed;
    top: 52px;
    left: 0;
    bottom: 0;
    width: var(--sidebar-w);
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 8px 0;
    background: var(--nav-bg);
    border-right: 1px solid var(--nav-border);
    overflow-y: auto;
    overscroll-behavior: contain;
    z-index: 90;
    transition: width var(--transition), transform var(--transition);
}
body.has-sidebar { padding-left: var(--sidebar-w); transition: padding-left var(--transition); }
.side-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: var(--nav-text);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    border-left: 2px solid transparent;
    transition: var(--transition);
}
.side-link:hover { color: var(--nav-text-active); background: var(--nav-hover-bg); }
.side-link.active { color: var(--nav-text-active); background: var(--nav-hover-bg); border-left-color: var(--primary); }
.side-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.nav-badge {
    background: #dc2626;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: 2px;
    margin-left: auto;
}
.nav-badge-amber { background: #d97706; }
.side-section {
    padding: 14px 16px 4px;
    color: var(--nav-text);
    opacity: 0.7;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
}
.side-section:first-child { padding-top: 6px; }
/* Settings and Help sit at the foot of the sidebar, as on the desktop rail. */
.side-foot { flex: 1 0 12px; }
.sidebar-backdrop { display: none; }

/* Collapsed: icons only, with the label as a tooltip and badges tucked in. */
html.sidebar-collapsed .sidebar { width: var(--sidebar-w-collapsed); }
html.sidebar-collapsed body.has-sidebar { padding-left: var(--sidebar-w-collapsed); }
html.sidebar-collapsed .side-label { display: none; }
html.sidebar-collapsed .side-link { justify-content: center; padding: 10px 0; gap: 0; }
html.sidebar-collapsed .nav-badge { position: absolute; top: 3px; right: 5px; margin: 0; padding: 0 4px; }
/* No room for the heading words: a thin rule still separates the groups. */
html.sidebar-collapsed .side-section { height: 1px; margin: 8px 12px; padding: 0; overflow: hidden; color: transparent; background: var(--nav-border); opacity: 1; }
html.sidebar-collapsed .side-section:first-child { display: none; }

/* ─── Container ─── */
.container { max-width: 1240px; margin: 0 auto; padding: 24px 20px; }

/* Phones: the sidebar slides in over the page instead of squeezing it. */
@media (max-width: 900px) {
    body.has-sidebar { padding-left: 0; }
    .sidebar, html.sidebar-collapsed .sidebar { width: var(--sidebar-w); transform: translateX(-100%); }
    html.sidebar-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    html.sidebar-collapsed .side-label { display: inline; }
    html.sidebar-collapsed .side-link { justify-content: flex-start; padding: 9px 14px; gap: 10px; }
    html.sidebar-collapsed .nav-badge { position: static; margin-left: auto; padding: 1px 5px; }
    html.sidebar-collapsed .side-section { height: auto; margin: 0; padding: 14px 16px 4px; overflow: visible; color: var(--nav-text); background: none; opacity: 0.7; }
    html.sidebar-collapsed .side-section:first-child { display: block; padding-top: 6px; }
    html.sidebar-open .sidebar-backdrop {
        display: block;
        position: fixed;
        inset: 52px 0 0 0;
        background: rgba(0, 0, 0, 0.45);
        z-index: 85;
    }
}

/* ─── Page Header ─── */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 12px; }
.page-header h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.4px; }
.filter-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-bar select, .filter-bar input {
    padding: 7px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--input-bg);
    color: var(--text);
}
.filter-bar select:focus, .filter-bar input:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }

/* ─── Buttons ─── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    transition: var(--transition);
}
.btn:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-lg { padding: 10px 20px; font-size: 14px; }
.btn-xs { padding: 3px 8px; font-size: 11px; }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--neutral); color: #fff; }
.btn-secondary:hover { background: var(--neutral-dark); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-dark); }
.btn-warning { background: var(--warning); color: #fff; }
.btn-warning:hover { background: var(--warning-dark); }
.btn-warning-outline { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,0.45); padding: 4px 10px; font-size: 11px; font-weight: 600; border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); }
.btn-warning-outline:hover { background: rgba(255,255,255,0.14); }
.btn-light { background: var(--card); color: var(--text); border-color: var(--border-strong); }
.btn-light:hover { background: var(--card-soft); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: var(--success-dark); }

/* ─── Pills (tinted chips) ─── */
.summary-pills { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
}
.pill-green { background: var(--success-soft); color: var(--success-text); border-color: var(--success-border); }
.pill-red { background: var(--danger-soft); color: var(--danger-text); border-color: var(--danger-border); }
.pill-orange { background: var(--warning-soft); color: var(--warning-text); border-color: var(--warning-border); }
.pill-blue { background: var(--info-soft); color: var(--info-text); border-color: var(--info-border); }

/* ─── Summary Cards ─── */
.summary-cards { display: flex; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.summary-card {
    flex: 1;
    min-width: 180px;
    padding: 18px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: var(--radius);
    color: var(--text);
    box-shadow: var(--shadow);
}
.card-green { border-top-color: var(--success); }
.card-red { border-top-color: var(--danger); }
.card-blue { border-top-color: var(--info); }
.card-green .card-value { color: var(--success-text); }
.card-red .card-value { color: var(--danger-text); }
.card-blue .card-value { color: var(--info-text); }
.card-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.card-value { font-size: 28px; font-weight: 700; margin-top: 6px; letter-spacing: -0.6px; font-variant-numeric: tabular-nums; }

/* ─── KPI change chips ─── */
.card-change { font-size: 12px; font-weight: 600; margin-top: 4px; }
.card-change.up { color: var(--success-text); }
.card-change.down { color: var(--danger-text); }
.card-change.flat { color: var(--text-muted); }
.kpi-note { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

/* ─── Room Grid ─── */
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 14px; }
.room-card {
    border-radius: var(--radius);
    padding: 16px;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #fff;
    box-shadow: var(--shadow);
    transition: var(--transition);
}
.room-card:hover { filter: brightness(1.06); box-shadow: var(--shadow-md); }
.room-card.status-available { background: var(--status-available); }
.room-card.status-occupied { background: var(--status-occupied); }
.room-card.status-cleaning { background: var(--status-cleaning); }
.room-card.overdue { animation: pulse 2s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.65; } }
.room-card-header { display: flex; justify-content: space-between; align-items: center; }
.room-number { font-size: 20px; font-weight: 700; letter-spacing: -0.4px; }
/* Housekeeping condition badge on a room card; the card itself is tinted by
   sale status, so this uses a light chip rather than another background. */
.hk-badge { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.88); border-radius: 10px; padding: 1px 7px; white-space: nowrap; }
.room-rate { font-size: 12px; opacity: 0.8; font-weight: 500; }
.room-name { font-size: 12px; opacity: 0.7; }
.room-card-body { flex: 1; display: flex; flex-direction: column; gap: 8px; justify-content: flex-end; }
.room-status { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; opacity: 0.9; }
.room-guest { font-size: 13px; opacity: 0.95; }
.room-time { font-size: 18px; font-weight: 700; letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }
.overdue-text { color: #fecaca; }
.unpaid-chip { color: #b91c1c; text-decoration: none; }
.room-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.extend-row { margin-top: 6px; }
.extend-input { width: 50px; padding: 4px 8px; border: 1px solid rgba(255,255,255,0.3); border-radius: var(--radius-sm); background: rgba(0,0,0,0.25); color: #fff; font-size: 12px; }
.extend-input:focus { border-color: rgba(255,255,255,0.7); box-shadow: none; }
.quick-extend { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }

/* ─── Tables ─── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.data-table th {
    background: var(--card-soft);
    color: var(--text-muted);
    padding: 10px 12px;
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border);
}
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; color: var(--text); vertical-align: middle; }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--card-soft); }
.data-table tr.status-cancelled { color: var(--text-muted); }
/* A table wider than its column scrolls sideways instead of spilling over */
.table-scroll { overflow-x: auto; }
.table-scroll .data-table { min-width: max-content; }
.text-right { text-align: right; }
.text-green { color: var(--success-text); font-weight: 600; }
.text-red { color: var(--danger-text); font-weight: 600; }
.text-muted { color: var(--text-muted); }

/* ─── Badges (tinted, uppercase) ─── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid var(--neutral-border);
    border-radius: var(--radius-sm);
    background: var(--neutral-soft);
    color: var(--neutral-text);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.5;
    white-space: nowrap;
}
.badge-active, .badge-occupied, .badge-expense, .badge-unpaid { background: var(--danger-soft); color: var(--danger-text); border-color: var(--danger-border); }
.badge-completed, .badge-available, .badge-income { background: var(--success-soft); color: var(--success-text); border-color: var(--success-border); }
.badge-cancelled { background: var(--neutral-soft); color: var(--neutral-text); border-color: var(--neutral-border); }
.badge-info { background: var(--info-soft); color: var(--info-text); border-color: var(--info-border); }
.badge-cleaning { background: var(--warning-soft); color: var(--warning-text); border-color: var(--warning-border); }

/* ─── Forms ─── */
.form-section {
    background: var(--card);
    padding: 22px 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}
.form-section h3 { margin-bottom: 14px; font-size: 15px; font-weight: 600; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.form-field { display: flex; flex-direction: column; gap: 5px; }
.form-field label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.form-field small { font-size: 12px; color: var(--text-muted); }
.form-field input, .form-field select, .form-field textarea {
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--input-bg);
    color: var(--text);
}
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select {
    padding: 8px 10px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-size: 13px;
    background: var(--input-bg);
    color: var(--text);
}
.inline-form input:focus, .inline-form select:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }
.inline-form label { font-size: 13px; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 6px; }
.form-actions { display: flex; gap: 10px; margin-top: 16px; }

/* ─── Add-ons in booking form ─── */
.addon-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.addon-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); transition: var(--transition); }
.addon-item:hover { border-color: var(--primary); }
.addon-item label { flex: 1; font-size: 13px; }
.addon-qty { width: 60px; padding: 5px 6px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }

/* ─── Price Preview ─── */
.price-preview { background: var(--primary-soft); padding: 16px 20px; border: 1px solid var(--primary-border); border-radius: var(--radius); text-align: center; margin: 16px 0; font-size: 14px; }
.price-line { color: var(--text-secondary); }
.price-total { font-weight: 700; font-size: 22px; color: var(--primary-text); letter-spacing: -0.4px; font-variant-numeric: tabular-nums; }

/* ─── Empty State ─── */
.empty-state { text-align: center; padding: 64px 20px; color: var(--text-muted); border: 1px dashed var(--border-strong); border-radius: var(--radius); background: var(--card); }
.empty-state h2 { margin-bottom: 8px; font-weight: 600; color: var(--text); font-size: 18px; }
.empty-state a { color: var(--primary-text); font-weight: 600; }

/* ─── Charts ─── */
.chart-grid { display: flex; flex-direction: column; gap: 20px; }
.chart-container { background: var(--card); padding: 20px 22px; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.chart-container h3 { margin-bottom: 12px; font-size: 15px; font-weight: 600; }
.chart-container canvas { max-height: 320px; }

/* ─── Receipt ─── */
.receipt-container { max-width: 420px; margin: 0 auto; }
.receipt { background: var(--card); padding: 28px; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); font-family: "SF Mono", Menlo, "Courier New", monospace; color: var(--text); }
.receipt-inn { text-align: center; margin-bottom: 10px; }
.receipt-table { width: 100%; }
.receipt-table td { padding: 4px 0; font-size: 13px; }
.receipt-total { font-size: 15px; border-top: 2px solid var(--text); }
.receipt-footer { text-align: center; font-size: 12px; color: var(--text-muted); }
.receipt-meta { text-align: center; font-size: 11px; color: var(--text-muted); margin-top: 6px; }
.text-center { text-align: center; }
hr { border: none; border-top: 1px dashed var(--border-strong); margin: 10px 0; }

/* Toolbar under receipts, folios and shift reports. Lives outside the paper
   column so the 72mm thermal preview never squeezes the buttons. */
.receipt-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 640px; margin: 20px auto 0; }
.receipt-actions .btn { min-width: 150px; }
@media (max-width: 520px) {
    .receipt-actions { flex-direction: column; align-items: stretch; }
    .receipt-actions .btn { min-width: 0; }
}

/* 80mm thermal layout: 72mm printable width, tight spacing, no chrome.
   Applied on screen too (when Settings > Receipt Paper is 80mm thermal) so
   the preview matches the paper. */
.receipt-container.thermal { max-width: 72mm; }
.receipt-container.thermal .receipt { padding: 4mm 2mm; border: none; box-shadow: none; border-radius: 0; font-size: 12px; line-height: 1.25; }
.receipt-container.thermal .receipt-inn { font-size: 16px; margin-bottom: 4px; }
.receipt-container.thermal .receipt-table td { padding: 1px 0; font-size: 11.5px; vertical-align: top; }
.receipt-container.thermal .receipt-total { font-size: 13px; }
.receipt-container.thermal hr { margin: 5px 0; border-top-style: dashed; }
.receipt-container.thermal .receipt-footer, .receipt-container.thermal .receipt-meta { font-size: 10.5px; }

/* Guest folio */
.folio { max-width: 820px; margin: 0 auto; }
.folio-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; }
.folio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }
.folio-box { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.folio-box h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-secondary); }
.folio-box .receipt-table td { vertical-align: top; }
.table-compact td, .table-compact th { padding: 5px 8px; font-size: 13px; }
.folio-balance { font-size: 22px; font-weight: 700; }
.folio-balance-due { color: var(--danger-text); }
.folio-sign { display: none; grid-template-columns: repeat(3, 1fr); gap: 32px; margin: 36px 0 12px; font-size: 12px; text-align: center; }
.sign-line { border-bottom: 1px solid #000; height: 28px; margin-bottom: 4px; }

/* ─── Shift pill in the navbar ─── */
a.shift-pill { text-decoration: none; font-size: 11px; }
a.shift-pill:hover { filter: brightness(0.95); }
.shift-open-card { border-left: 4px solid var(--success); }

/* ─── Room Service ─── */
.room-number-link { color: #fff; font-size: 20px; font-weight: 700; letter-spacing: -0.4px; }
.details-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 8px; }
.detail-item { display: flex; justify-content: space-between; padding: 10px 14px; background: var(--card-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); align-items: center; gap: 12px; }
.detail-label { color: var(--text-muted); font-size: 12px; white-space: nowrap; flex-shrink: 0; }
.detail-value { font-weight: 600; font-size: 13px; text-align: right; word-break: break-word; }
.detail-total { background: var(--surface); border-color: var(--surface); color: #fff; }
.detail-total .detail-label, .detail-total .detail-value { color: #fff; font-size: 15px; }
.action-buttons { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.service-category { margin-bottom: 16px; }
.service-category h3 { font-size: 13px; margin-bottom: 8px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.service-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 8px; }
.service-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--card); transition: var(--transition); }
.service-item:hover { border-color: var(--primary); }
.service-item-label { flex: 1; display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13px; }
.service-item-label input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--primary); }
.service-item-name { font-weight: 600; }
.service-item-desc { font-size: 12px; color: var(--text-muted); }
.service-item-price { margin-left: auto; font-weight: 600; color: var(--success-text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.service-qty { width: 50px; padding: 5px 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 13px; }
.service-qty:disabled { opacity: 0.4; }

/* ─── Stock & Page Actions ─── */
.stock-badge { font-size: 0.8em; color: var(--text-muted); font-weight: 500; }
.stock-out { color: var(--danger-text); font-weight: 600; font-size: 0.8em; }
.stock-low { color: var(--warning-text); font-size: 0.8em; }
.page-actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }

/* ─── Star Picker ─── */
.star-picker { display: inline-flex; align-items: center; gap: 2px; }
.star-btn { background: none; border: none; cursor: pointer; font-size: 18px; padding: 0 1px; line-height: 1; transition: transform 0.15s; }
.star-btn:hover { transform: scale(1.2); }
.star-filled { color: var(--star); }
.star-empty { color: var(--star-empty); }
.star-clear { background: none; border: none; cursor: pointer; color: var(--danger-text); font-size: 13px; padding: 0 2px; margin-left: 2px; }
.star-count { color: var(--text-muted); font-size: 13px; margin-left: 6px; }

/* ─── Auth & Navbar User ─── */
.nav-user { display: flex; align-items: center; gap: 10px; color: var(--nav-text); font-size: 13px; white-space: nowrap; }
.nav-user-name { font-weight: 600; color: var(--nav-text-active); }
.nav-user .badge { text-transform: none; }
.nav-user form { display: inline; }
.nav-user .btn-secondary { background: transparent; color: var(--nav-text); border-color: rgba(255,255,255,0.18); }
.nav-user .btn-secondary:hover { color: var(--nav-text-active); border-color: rgba(255,255,255,0.4); background: var(--nav-hover-bg); }
/* The top bar is dark in both themes, so the Update pill is a solid accent
   rather than the tinted chips used on page backgrounds. */
.nav-update { gap: 6px; background: var(--primary); color: #fff; border-color: var(--primary); font-family: inherit; cursor: pointer; transition: var(--transition); }
.nav-update::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.nav-update:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.nav-update:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ─── Updating page ─── */
.update-wait { max-width: 560px; margin: 48px auto; text-align: center; }
.update-wait h1 { margin-bottom: 12px; }
.update-wait p { color: var(--text-secondary); margin-bottom: 10px; }
.update-wait .update-note { color: var(--text-muted); font-size: 13px; }
.update-state { display: inline-flex; align-items: center; gap: 8px; margin: 14px 0; font-weight: 600; color: var(--primary-text); }
.update-state[hidden] { display: none; }
.update-spinner { width: 14px; height: 14px; border: 2px solid var(--primary-border); border-top-color: var(--primary); border-radius: 50%; animation: update-spin 0.9s linear infinite; }
@keyframes update-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .update-spinner { animation: none; } }

/* ─── Flash Banners ─── */
.flash { max-width: 1240px; margin: 16px auto 0; padding: 10px 16px; border: 1px solid; border-left-width: 3px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; }
.flash-error { background: var(--danger-soft); color: var(--danger-text); border-color: var(--danger-border); border-left-color: var(--danger); }
.flash-success { background: var(--success-soft); color: var(--success-text); border-color: var(--success-border); border-left-color: var(--success); }

/* ─── Alerts ─── */
.alert { padding: 10px 16px; border: 1px solid; border-left-width: 3px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 500; margin-bottom: 12px; }
.alert-error, .alert-danger { background: var(--danger-soft); color: var(--danger-text); border-color: var(--danger-border); border-left-color: var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success-text); border-color: var(--success-border); border-left-color: var(--success); }
.alert-info { background: var(--info-soft); color: var(--info-text); border-color: var(--info-border); border-left-color: var(--info); }
.alert-warning { background: var(--warning-soft); color: var(--warning-text); border-color: var(--warning-border); border-left-color: var(--warning); }

/* ─── Login ─── */
.login-wrap { display: flex; justify-content: center; align-items: center; min-height: calc(100vh - 52px); padding: 40px 20px; }
.login-card {
    background: var(--card);
    padding: 36px 40px;
    border: 1px solid var(--border);
    border-top: 3px solid var(--primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.login-card h1 { text-align: center; font-size: 22px; font-weight: 700; letter-spacing: -0.5px; margin: 0; color: var(--text); }
.login-sub { text-align: center; color: var(--text-muted); font-size: 13px; margin: -8px 0 8px; }
.login-inn-name { text-align: center; color: var(--text); font-size: 14px; font-weight: 600; margin: 0 0 2px; }
.login-inn { text-align: center; color: var(--text-muted); font-size: 12px; letter-spacing: 2px; font-weight: 600; margin: 0 0 4px; }
.login-btn { width: 100%; margin-top: 6px; padding: 11px; font-size: 14px; font-weight: 600; }
.login-hint { margin-top: 8px; padding: 12px 14px; background: var(--card-soft); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; color: var(--text-secondary); }
.login-hint ul { margin: 8px 0 0 18px; padding: 0; }
.login-hint code { background: var(--primary-soft); padding: 2px 6px; border-radius: var(--radius-sm); font-size: 12px; color: var(--primary-text); }
.license-banner { text-align: center; padding: 10px; border-radius: var(--radius-sm); margin-bottom: 4px; font-size: 13px; background: var(--card-soft); border: 1px solid var(--border); color: var(--text-secondary); }
.license-banner.license-expiring { background: var(--warning-soft); border-color: var(--warning-border); color: var(--warning-text); }

/* ─── Login Input Icons ─── */
.input-icon { position: relative; }
.input-icon-svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-muted); pointer-events: none; }
.input-icon input { padding-left: 40px; padding-right: 40px; width: 100%; }
.toggle-password { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; display: flex; align-items: center; transition: var(--transition); }
.toggle-password:hover { color: var(--text); }

/* ─── License Info ─── */
.license-card { max-width: 500px; padding: 24px 28px; border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.license-active { background: var(--success-soft); border: 1px solid var(--success-border); }
.license-expired { background: var(--danger-soft); border: 1px solid var(--danger-border); }
.license-card h2 { margin-bottom: 16px; color: var(--text); font-size: 18px; }
.license-status-badge { display: inline-block; padding: 3px 10px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 12px; }
.license-status-active { background: var(--success-dark); color: #fff; }
.license-status-expired { background: var(--danger); color: #fff; }
.text-danger { color: var(--danger-text); font-weight: 600; }

/* ─── Calendar ─── */
.cal-controls { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }
.cal-today, .cal-nav-btn { padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--card); color: var(--text); cursor: pointer; font-size: 13px; font-weight: 600; transition: var(--transition); }
.cal-today:hover, .cal-nav-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.cal-view-toggle { display: flex; gap: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); overflow: hidden; }
.cal-view-toggle button { padding: 6px 14px; border: none; background: var(--card); color: var(--text); cursor: pointer; font-size: 13px; font-weight: 600; transition: var(--transition); }
.cal-view-toggle button + button { border-left: 1px solid var(--border-strong); }
.cal-view-toggle button.active { background: var(--primary); color: #fff; }
.cal-range-label { font-weight: 600; font-size: 14px; min-width: 180px; text-align: center; }
.cal-room-toggles { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-room-toggle { padding: 3px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 12px; cursor: pointer; font-weight: 600; transition: var(--transition); background: var(--card); color: var(--text-secondary); }
.cal-room-toggle.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.cal-grid { overflow-x: auto; }
.cal-table { width: 100%; border-collapse: collapse; min-width: 700px; }
.cal-table th { background: var(--card-soft); color: var(--text-muted); padding: 8px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; position: sticky; top: 0; border-bottom: 1px solid var(--border); }
.cal-table td { border: 1px solid var(--border); padding: 0; vertical-align: top; height: 60px; width: 14.28%; }
.cal-day-header { text-align: center; font-weight: 600; font-size: 12px; color: var(--text-muted); padding: 4px; }
.cal-time-label { font-size: 10px; color: var(--text-muted); padding: 2px 4px; text-align: center; }
.cal-block { border-radius: var(--radius-sm); padding: 4px 6px; font-size: 11px; margin: 2px; cursor: pointer; transition: var(--transition); }
.cal-block:hover { filter: brightness(1.08); }
.cal-block-occupied { background: var(--danger); color: #fff; }
.cal-block-cleaning { background: var(--warning); color: #fff; }
.cal-block-scheduled { background: var(--info); color: #fff; }
.cal-now-line { border-top: 2px solid var(--danger); position: relative; }
.cal-now-line::after { content: ''; position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; background: var(--danger); }

/* ─── Chat ─── */
.chat-room { display: flex; gap: 0; height: 65vh; max-height: 580px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.chat-sidebar { width: 200px; background: var(--surface); padding: 12px; overflow-y: auto; flex-shrink: 0; }
.chat-sidebar h4 { color: rgba(255,255,255,0.5); font-size: 11px; font-weight: 600; margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.06em; }
.chat-user-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition); }
.chat-user-item:hover { background: rgba(255,255,255,0.06); }
.chat-user-item.active { background: rgba(59,130,246,0.3); }
.chat-user-name { color: #fff; font-size: 13px; font-weight: 500; }
.chat-user-status { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.chat-user-status.online { background: var(--success); }
.chat-user-status.offline { background: var(--neutral); }
.chat-main { flex: 1; display: flex; flex-direction: column; background: var(--bg); }
.chat-header { padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--border); font-weight: 600; font-size: 14px; }
.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.chat-bubble { max-width: 70%; padding: 8px 12px; border-radius: var(--radius); font-size: 13px; line-height: 1.45; }
.chat-bubble.received { background: var(--card); color: var(--text); align-self: flex-start; border: 1px solid var(--border); }
.chat-bubble.sent { background: var(--primary); color: #fff; align-self: flex-end; }
.chat-bubble-time { font-size: 10px; opacity: 0.65; margin-top: 4px; }
.chat-input-row { display: flex; gap: 8px; padding: 12px; background: var(--card); border-top: 1px solid var(--border); }
.chat-input-row input { flex: 1; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 13px; }

/* ─── Waitlist ─── */
.waitlist-queue { display: flex; flex-direction: column; gap: 8px; }
.waitlist-entry { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); transition: var(--transition); }
.waitlist-entry:hover { border-color: var(--border-strong); }
.waitlist-position { font-size: 20px; font-weight: 700; color: var(--primary-text); min-width: 30px; }
.waitlist-info { flex: 1; }
.waitlist-name { font-weight: 600; font-size: 14px; }
.waitlist-meta { font-size: 12px; color: var(--text-muted); }
.waitlist-wait-time { font-size: 12px; color: var(--info-text); font-weight: 600; }
.waitlist-alert { background: var(--success-soft); border: 1px solid var(--success-border); border-left: 3px solid var(--success); border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; color: var(--success-text); }

/* ─── Help ─── */
.help-search { position: sticky; top: 68px; z-index: 50; background: var(--card); padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-md); margin-bottom: 20px; }
.help-search input { width: 100%; padding: 10px 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 14px; }
.help-category { margin-bottom: 20px; }
.help-category h3 { font-size: 13px; font-weight: 600; margin-bottom: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.help-topic { background: var(--card); padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 8px; }
.help-topic h4 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.help-topic p { font-size: 13px; color: var(--text-secondary); line-height: 1.55; }
.help-topic code { background: var(--primary-soft); padding: 2px 6px; border-radius: var(--radius-sm); font-size: 12px; color: var(--primary-text); }
.help-tags { margin-top: 8px; display: flex; gap: 4px; flex-wrap: wrap; }
.help-tag { background: var(--card-soft); border: 1px solid var(--border); color: var(--text-muted); padding: 1px 7px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 600; }
mark { background: var(--primary-soft); color: var(--primary-text); padding: 1px 3px; border-radius: 2px; }

/* ─── Loyalty Card ─── */
.loyalty-card-display {
    width: 400px; max-width: 90vw; height: 230px;
    border-radius: var(--radius-lg);
    background: #0f172a;
    border: 1px solid rgba(255,255,255,0.08);
    border-left: 4px solid var(--primary);
    color: #fff;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}
.loyalty-card-inn { font-size: 15px; font-weight: 700; letter-spacing: -0.2px; }
.loyalty-card-code { font-family: "SF Mono", Menlo, "Courier New", monospace; font-size: 24px; font-weight: 700; letter-spacing: 4px; }
.loyalty-card-stars { font-size: 18px; color: var(--star); }
.loyalty-card-bottom { display: flex; justify-content: space-between; align-items: flex-end; }
.loyalty-card-label { font-size: 10px; color: rgba(255,255,255,0.5); text-transform: uppercase; letter-spacing: 0.1em; }
.loyalty-card-value { font-size: 13px; font-weight: 600; }

/* ─── Modal ─── */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(2,6,23,0.6); z-index: 1000; display: none; align-items: center; justify-content: center; }
.modal-content { background: var(--card); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 28px; box-shadow: var(--shadow-lg); }

/* ─── Misc ─── */
.detail-label { color: var(--text-muted); font-weight: 600; padding: 6px 16px 6px 0; white-space: nowrap; }
.detail-value { color: var(--text); padding: 6px 0; }

/* ─── Status banners (persistent, full-width, under the nav) ─── */
.banner {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 20px; font-size: 13px; font-weight: 500;
    border-bottom: 1px solid; line-height: 1.4;
}
.banner a { color: inherit; font-weight: 700; text-decoration: underline; }
.banner-icon { flex-shrink: 0; font-size: 13px; }
.banner-info { background: var(--info-soft); color: var(--info-text); border-color: var(--info-border); }
.banner-warning { background: var(--warning-soft); color: var(--warning-text); border-color: var(--warning-border); }
.banner-error { background: var(--danger-soft); color: var(--danger-text); border-color: var(--danger-border); }
.banner-offline {
    position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
    z-index: 1100; border: 1px solid var(--neutral-border); border-radius: var(--radius);
    background: var(--surface-2); color: #fff; box-shadow: var(--shadow-lg); padding: 8px 14px;
}
.banner-offline .banner-icon { color: var(--warning); }
.banner[hidden] { display: none; }

/* ─── License status badges ─── */
.license-badge {
    display: inline-block; padding: 3px 10px; border-radius: var(--radius-sm);
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; border: 1px solid;
}
.license-badge-valid { background: var(--success-soft); color: var(--success-text); border-color: var(--success-border); }
.license-badge-trial { background: var(--info-soft); color: var(--info-text); border-color: var(--info-border); }
.license-badge-expired { background: var(--danger-soft); color: var(--danger-text); border-color: var(--danger-border); }
.license-badge-offline { background: var(--neutral-soft); color: var(--neutral-text); border-color: var(--neutral-border); }
.license-badge-warning { background: var(--warning-soft); color: var(--warning-text); border-color: var(--warning-border); }

/* ─── LAN access URL list (Settings → Inn) ─── */
.lan-url-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.lan-url {
    display: flex; align-items: center; gap: 10px; padding: 8px 12px;
    background: var(--card-soft); border: 1px solid var(--border); border-radius: var(--radius);
}
.lan-url code { flex: 1; font-size: 13px; color: var(--primary-text); word-break: break-all; }
.lan-url-qr { display: inline-block; padding: 8px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); }
.lan-url-qr img { display: block; width: 160px; height: 160px; }

/* ─── Key/value status grid (sync status, license details) ─── */
.kv-table td:first-child { color: var(--text-muted); font-weight: 600; white-space: nowrap; width: 200px; }
.kv-table td { padding: 6px 12px 6px 0; vertical-align: top; font-size: 13px; }

/* ─── End of day ─── */
.eod-nav { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.eod-nav input[type="date"] { padding: 6px 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--input-bg); color: var(--text); font-size: 14px; }
.eod-section { margin-top: 24px; }
.eod-section h3 { margin-bottom: 10px; font-size: 15px; }
.eod-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }

/* ─── Print ─── */
@media print {
    :root, [data-theme="dark"] {
        color-scheme: light;
        --bg: #fff; --card: #fff; --card-soft: #f5f5f5; --input-bg: #fff;
        --text: #000; --text-secondary: #222; --text-muted: #555;
        --border: #bbb; --border-strong: #999;
        --shadow: none; --shadow-md: none; --shadow-lg: none;
    }
    .navbar, .sidebar, .sidebar-backdrop, .form-actions, .no-print, .banner, .flash, .eod-nav { display: none !important; }
    body.has-sidebar { padding-left: 0 !important; }
    body { padding-top: 0 !important; }
    .receipt-container { max-width: 100%; }
    .folio { max-width: 100%; }
    .folio-box { break-inside: avoid; border-color: #999; }
    .folio-sign { display: grid; }
    body { background: #fff; color: #000; }
    .container { max-width: 100% !important; padding: 0 !important; }
    .eod-grid { display: block; }
    .eod-section { break-inside: avoid; margin-top: 16px; }
    .summary-cards { display: flex !important; }
    .summary-card { border: 1px solid var(--border-strong) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .data-table { font-size: 11px; }
    .data-table th { background: #eee !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .receipt { border: none !important; box-shadow: none !important; }

    /* Thermal roll: 80mm wide, continuous length; margins are handled by
       the receipt padding so nothing is cut at the edges. */
    .receipt-container.thermal { max-width: 72mm !important; margin: 0 !important; }
    .receipt-container.thermal .receipt { padding: 2mm 1mm !important; color: #000; }
    .receipt-container.thermal .receipt-inn { color: #000; }
    .receipt-container.thermal .receipt-table td, .receipt-container.thermal .receipt-footer, .receipt-container.thermal .receipt-meta { color: #000; }
}

@media print {
    /* Only takes effect when the page holds a thermal layout; other pages
       keep the browser's default paper size. */
    body:has(.receipt-container.thermal) { width: 80mm; margin: 0; }
}
@page thermal { size: 80mm auto; margin: 3mm; }
.receipt-container.thermal { page: thermal; }

/* ── Pay-with-GCash popup (gcash.js) ──
   Everything but the popup is blurred, and the popup's own backdrop is
   near-opaque, so a photo of the screen shows only the QR code. */
html.gcash-open, html.gcash-open body { overflow: hidden; }
html.gcash-open body > *:not(#gcashOverlay) {
    filter: blur(24px);
    -webkit-filter: blur(24px);
    user-select: none;
    pointer-events: none;
}
.gcash-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(8, 12, 22, 0.94);
    -webkit-backdrop-filter: blur(28px);
    backdrop-filter: blur(28px);
    overflow-y: auto;
}
.gcash-overlay[hidden] { display: none; }
.gcash-card {
    background: var(--card);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    padding: 24px 28px;
    width: 100%;
    max-width: 380px;
    text-align: center;
}
.gcash-card h2 { margin: 0 0 12px; font-size: 20px; }
.gcash-amount { margin-bottom: 14px; }
.gcash-amount[hidden] { display: none; }
.gcash-amount-label { display: block; font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.gcash-amount-value { font-size: 28px; font-weight: 700; }
/* White behind the code in both themes: scanners need the contrast. */
.gcash-qr {
    display: block;
    width: min(280px, 70vw);
    height: auto;
    margin: 0 auto 12px;
    padding: 10px;
    background: #fff;
    border-radius: 6px;
}
.gcash-qr[hidden] { display: none; }
.gcash-qr-missing { color: var(--danger); font-size: 13px; margin: 0 0 12px; }
.gcash-account-name { font-weight: 600; font-size: 16px; }
.gcash-account-number { font-family: monospace; font-size: 15px; color: var(--text-muted); margin-top: 2px; }
.gcash-actions { display: flex; gap: 10px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.gcash-settings-qr {
    display: block;
    width: 180px;
    height: auto;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 4px;
}
