:root {
    /* Brand palette — near-black + warm gold, matching the VIG | HUB logo
       and rentvisuals.ch (dark theme, gold pill buttons/accents). */
    --vig-black: #0a0a0b;
    --vig-black-light: #1c1c1f;
    --vig-gold: #c9a227;
    --vig-gold-light: #e3c878;
    --vig-green: #34c281;
    --vig-amber: #d9a536;
    --vig-red: #ff6b61;
    --vig-grey: #9aa0ab;

    /* Surfaces — dark theme throughout, mirroring the main site */
    --bg: #0a0a0b;
    --card-bg: #16161a;
    --field-bg: #1e1e23;
    --text: #f2f3f5;
    --text-dim: #9aa0ab;
    --border: #29292f;
    --border-light: #333339;
    --radius: 14px;
    --radius-pill: 999px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--vig-gold-light); text-decoration: none; }
a:hover { color: var(--vig-gold); text-decoration: underline; }

.topbar {
    background: var(--vig-black);
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid var(--border);
}
.topbar-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 20px;
    height: 56px;
    flex-wrap: wrap;
}
.brand { display: flex; align-items: center; }
.brand-logo { height: 26px; width: auto; display: block; }
.main-nav { display: flex; gap: 4px; flex-wrap: wrap; flex: 1; }
.main-nav a {
    color: #cfd8e3;
    font-size: 0.86rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 7px 12px;
    border-radius: var(--radius-pill);
}
.main-nav a:hover { color: var(--vig-gold-light); text-decoration: none; background: rgba(255, 255, 255, 0.06); }
.main-nav a.is-active {
    color: var(--vig-black);
    background: var(--vig-gold);
    font-weight: 600;
}
.main-nav a.is-active:hover { color: var(--vig-black); background: var(--vig-gold-light); }
.topbar-user { display: flex; align-items: center; font-size: 0.9rem; color: #cfd8e3; }

.account-menu { position: relative; }
.account-menu-trigger {
    display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none;
    color: #fff; padding: 7px 14px; border: 1px solid var(--border-light); border-radius: var(--radius-pill);
    user-select: none;
}
.account-menu-trigger::-webkit-details-marker { display: none; }
.account-menu-trigger:hover { color: var(--vig-gold-light); border-color: var(--vig-gold); }
.account-menu-chevron { font-size: 0.7rem; transition: transform 0.15s ease; }
.account-menu[open] .account-menu-chevron { transform: rotate(180deg); }

.account-menu-panel {
    position: absolute; top: calc(100% + 8px); right: 0; z-index: 30;
    background: var(--card-bg); color: var(--text);
    border: 1px solid var(--border-light); border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    min-width: 220px; padding: 6px 0; display: flex; flex-direction: column;
}
.account-menu-info {
    display: flex; flex-direction: column; gap: 2px;
    padding: 10px 14px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px;
}
.account-menu-info strong { font-size: 0.95rem; }
.account-menu-info span { font-size: 0.8rem; color: var(--text-dim); }
.account-menu-role { text-transform: capitalize; }
.account-menu-panel a { color: var(--text); padding: 9px 14px; font-size: 0.9rem; }
.account-menu-panel a:hover { background: var(--field-bg); text-decoration: none; }

/* Administration menu — a second topbar dropdown, same pattern as the
   account menu (see js-dropdown in app.js) but sitting inline in the nav
   row and opening left-aligned under its own trigger rather than the
   right-aligned account menu. */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
    color: #cfd8e3; font-size: 0.86rem; font-weight: 500; letter-spacing: 0.02em;
    padding: 7px 12px; border-radius: var(--radius-pill); user-select: none;
}
.nav-dropdown-trigger::-webkit-details-marker { display: none; }
.nav-dropdown-trigger:hover { color: var(--vig-gold-light); background: rgba(255, 255, 255, 0.06); }
.nav-dropdown-trigger.is-active { color: var(--vig-black); background: var(--vig-gold); font-weight: 600; }
.nav-dropdown-trigger.is-active:hover { color: var(--vig-black); background: var(--vig-gold-light); }
.nav-dropdown[open] .nav-dropdown-trigger .account-menu-chevron { transform: rotate(180deg); }

.nav-dropdown-panel {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 30;
    background: var(--card-bg); color: var(--text);
    border: 1px solid var(--border-light); border-radius: var(--radius);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    min-width: 180px; padding: 6px 0; display: flex; flex-direction: column;
}
.nav-dropdown-panel a { color: var(--text); padding: 9px 14px; font-size: 0.9rem; }
.nav-dropdown-panel a:hover { background: var(--field-bg); text-decoration: none; }

.page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}

.breadcrumb {
    display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
    font-size: 0.78rem; color: var(--text-dim); margin: 14px 0 6px;
}
.breadcrumb a { color: var(--text-dim); }
.breadcrumb a:hover { color: var(--vig-gold-light); }
.breadcrumb .sep { color: var(--border-light); }
.breadcrumb .current { color: var(--text); font-weight: 600; }

h1 { font-size: 1.55rem; margin: 0 0 4px; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 1.05rem; margin: 26px 0 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--vig-gold-light); }
.subtitle { color: var(--text-dim); margin: 0 0 20px; }

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
}

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .value { font-size: 1.8rem; font-weight: 700; color: var(--vig-gold); }
.stat .label { color: var(--text-dim); font-size: 0.85rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--text-dim); font-weight: 600; font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.05em; }
tr:hover td { background: var(--field-bg); }
.table-wrap { overflow-x: auto; }

.badge { display: inline-block; padding: 3px 11px; border-radius: var(--radius-pill); font-size: 0.75rem; font-weight: 600; }
.badge-green { background: rgba(52, 194, 129, 0.15); color: var(--vig-green); }
.badge-amber { background: rgba(217, 165, 54, 0.16); color: var(--vig-gold-light); }
.badge-red { background: rgba(255, 107, 97, 0.15); color: var(--vig-red); }
.badge-grey { background: rgba(255, 255, 255, 0.08); color: var(--text-dim); }

.btn {
    display: inline-block;
    background: var(--vig-gold);
    color: var(--vig-black);
    border: 1px solid var(--vig-gold);
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}
.btn:hover { background: var(--vig-gold-light); border-color: var(--vig-gold-light); text-decoration: none; }
.btn-secondary { background: transparent; color: var(--text); border: 1px solid var(--border-light); font-weight: 500; }
.btn-secondary:hover { background: var(--field-bg); border-color: var(--vig-gold); color: var(--vig-gold-light); }
.btn-sm { padding: 6px 14px; font-size: 0.82rem; }

form.stacked label { display: block; font-size: 0.85rem; color: var(--text-dim); margin: 12px 0 4px; }
form.stacked input, form.stacked select, form.stacked textarea {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border-light); border-radius: 8px; font-size: 0.95rem;
    background: var(--field-bg); color: var(--text);
}
form.stacked input::placeholder, form.stacked textarea::placeholder { color: var(--text-dim); }
form.stacked input:focus, form.stacked select:focus, form.stacked textarea:focus {
    outline: none; border-color: var(--vig-gold); box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
}
form.stacked textarea { min-height: 90px; resize: vertical; }
.form-actions { margin-top: 18px; display: flex; gap: 10px; }

.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 16px; font-size: 0.92rem; }
.flash-success { background: rgba(52, 194, 129, 0.14); color: var(--vig-green); }
.flash-error { background: rgba(255, 107, 97, 0.14); color: var(--vig-red); }

.login-wrap { max-width: 420px; margin: 60px auto; padding: 0 16px; }
.login-panel {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
    margin-bottom: 16px;
}
.login-hero { background: var(--vig-black); padding: 30px 20px 22px; text-align: center; }
.login-hero-logo { max-width: 260px; width: 100%; height: auto; display: block; margin: 0 auto; }
.login-panel .card { border: none; border-radius: 0; margin-bottom: 0; box-shadow: none; }
.login-tagline { text-align: center; }

.site-footer { text-align: center; color: var(--text-dim); font-size: 0.8rem; padding: 20px 0; border-top: 1px solid var(--border); }

.empty-state { color: var(--text-dim); padding: 30px 0; text-align: center; }

.pagination { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.pagination-summary { color: var(--text-dim); font-size: 0.85rem; }
.pagination-links { display: flex; gap: 8px; }

.bulk-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--border); font-size: 0.88rem; }
.bulk-bar strong { font-variant-numeric: tabular-nums; color: var(--vig-gold-light); }
.bulk-move-controls { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.bulk-move-controls select { padding: 7px 9px; border: 1px solid var(--border-light); border-radius: 8px; font-size: 0.85rem; background: var(--field-bg); color: var(--text); }
.btn-link { background: none; border: none; padding: 0; margin: 0; color: var(--vig-gold-light); text-decoration: underline; cursor: pointer; font-size: 0.85rem; font-family: inherit; }
.btn-link:hover { color: var(--vig-gold); }
table input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--vig-gold); }

.label-preview { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.label-preview-qr svg { width: 110px; height: 110px; display: block; background: #fff; border-radius: 8px; padding: 6px; }
.label-preview-barcode { flex: 1; min-width: 200px; }
.label-preview-barcode svg { width: 100%; height: 60px; display: block; background: #fff; border-radius: 8px; padding: 6px; }

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; margin-bottom: 4px; }
.photo-thumb { position: relative; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; aspect-ratio: 1; background: var(--field-bg); }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-thumb form { position: absolute; top: 4px; right: 4px; margin: 0; }
.photo-delete-btn {
    width: 22px; height: 22px; border-radius: 50%; border: none; cursor: pointer;
    background: rgba(10, 10, 11, 0.78); color: #fff; font-size: 0.9rem; line-height: 1; padding: 0;
}
.photo-delete-btn:hover { background: var(--vig-red); }

#scanner-video { width: 100%; max-width: 480px; border-radius: var(--radius); background: #000; }

/* Asset picker (client/bookings.php) — search + checklist multi-select,
   see initAssetPickers() in assets/js/app.js. */
.asset-picker-summary { font-size: 0.85rem; color: var(--vig-gold-light); margin: 8px 0; font-weight: 600; }
.asset-picker-list {
    max-height: 260px; overflow-y: auto; border: 1px solid var(--border-light); border-radius: 8px;
    background: var(--field-bg); padding: 4px;
}
.asset-picker-row {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 6px;
    font-size: 0.88rem; cursor: pointer; margin: 0;
}
.asset-picker-row:hover { background: rgba(255, 255, 255, 0.04); }
.asset-picker-row input[type="checkbox"] { width: auto; flex-shrink: 0; }
.asset-picker-row-general { border-bottom: 1px solid var(--border-light); margin-bottom: 4px; padding-bottom: 10px; font-weight: 600; }
.asset-picker-empty { padding: 14px; text-align: center; color: var(--text-dim); font-size: 0.85rem; }

/* Jobs calendar (client/jobs_calendar.php) — plain CSS-grid month view, no
   JS library. A day just lists the jobs whose date range touches it, as
   small pills reusing the existing .badge colours for status at a glance. */
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-dow { text-align: center; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); padding-bottom: 6px; }
.cal-day {
    min-height: 92px; border: 1px solid var(--border); border-radius: 8px; padding: 6px;
    display: flex; flex-direction: column; gap: 4px; background: var(--field-bg);
}
.cal-day-out { opacity: 0.4; }
.cal-day-today { border-color: var(--vig-gold); box-shadow: inset 0 0 0 1px var(--vig-gold); }
.cal-day-num { font-size: 0.78rem; color: var(--text-dim); font-weight: 600; }
.cal-job-pill {
    display: block; font-size: 0.68rem; font-weight: 600; padding: 2px 7px; line-height: 1.35;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 640px) {
    .cal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
    .cal-day { min-height: 56px; padding: 3px; }
    .cal-job-pill { font-size: 0.6rem; padding: 1px 4px; }
}

@media (max-width: 640px) {
    .topbar-inner { height: auto; padding: 10px 16px; }
    .main-nav { order: 3; width: 100%; gap: 6px; }
    table, thead, tbody, th, td, tr { display: block; }
    thead { display: none; }
    tr { border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; padding: 6px 8px; }
    td { border: none; padding: 6px 4px; display: flex; justify-content: space-between; gap: 10px; }
    td::before { content: attr(data-label); color: var(--text-dim); font-size: 0.78rem; }
}

/* Print pages (asset_label.php) render on white paper, independent of the
   app's dark theme — see their own <style> blocks. */
