:root {
  --orange: #FA580B;
  --orange-dark: #D94700;
  --orange-bright: #FF6500;
  --blue: #0126A5;
  --blue-action: #208BFF;
  --navy-deep: #061A3D;
  --background: #061A38;
  --surface: #0B274F;
  --surface-raised: #0D2D5A;
  --surface-elevated: #0E315E;
  --border: #24527D;
  --border-bright: #3976A8;
  --text: #F8FAFF;
  --text-secondary: #A8B8CF;
  --text-muted: #7185A1;
  --navigation: #071A35;
  --navigation-muted: #9AACC4;
  --success: #65E66E;
  --success-mint: #C7FBD0;
  --danger: #FF3B30;
  --warning: #FFB000;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  --radius: 8px;
  --sidebar-width: 236px;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--background); }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--background);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: 0;
}

button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.5; }
button, input, select, textarea { outline: none; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { box-shadow: 0 0 0 3px rgba(32, 139, 255, 0.34); }
input, select, textarea { min-width: 0; }
.hidden { display: none !important; }
.wide { width: 100%; }
.align-right { text-align: right !important; }

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 18px; font-size: clamp(2.3rem, 5vw, 4.6rem); line-height: 0.98; max-width: 11ch; }
h2 { margin-bottom: 0; font-size: 1.5rem; line-height: 1.15; }
h3 { margin-bottom: 0; font-size: 1.08rem; line-height: 1.25; }

.eyebrow {
  margin-bottom: 5px;
  color: var(--orange);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.brand-lockup { display: flex; align-items: center; gap: 11px; }
.brand-lockup > strong { font-size: 1.04rem; }
.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  border-radius: 7px;
  background: var(--orange);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}

.button, .icon-button, .text-button {
  border: 0;
  border-radius: 6px;
  font-weight: 760;
  transition: background-color 140ms ease, border-color 140ms ease, transform 100ms ease;
}
.button:active:not(:disabled), .icon-button:active:not(:disabled), .text-button:active:not(:disabled) { transform: translateY(1px); }
.button { min-height: 42px; padding: 0 15px; }
.button.primary { background: var(--orange); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--orange-dark); }
.button.secondary { border: 1px solid var(--border-bright); background: var(--surface-raised); color: var(--text); }
.button.secondary:hover:not(:disabled) { background: var(--surface-elevated); border-color: #5c91bd; }
.button.ghost { border: 1px solid var(--border); background: transparent; color: var(--text-secondary); }
.button.ghost:hover:not(:disabled) { color: var(--text); border-color: var(--border-bright); }
.button.danger { background: var(--danger); color: #fff; }
.icon-button { min-width: 42px; min-height: 40px; padding: 0 11px; border: 1px solid var(--border); background: transparent; color: var(--text-secondary); font-size: 0.78rem; }
.icon-button:hover:not(:disabled) { color: var(--text); border-color: var(--border-bright); background: var(--surface-raised); }
.text-button { padding: 6px 0; background: transparent; color: var(--blue-action); font-size: 0.83rem; }
.text-button:hover:not(:disabled) { color: #65afff; }

.login-screen {
  min-height: 100vh;
  padding: 30px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #092E9A 0%, #082A82 21%, #061D4E 57%, #061A38 100%);
}
.login-shell {
  width: min(1080px, 100%);
  min-height: 600px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  overflow: hidden;
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  background: var(--navigation);
  box-shadow: var(--shadow);
}
.login-brand { padding: clamp(36px, 6vw, 74px); display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(145deg, rgba(1,38,165,.44), transparent 52%), var(--navigation); }
.login-brand > div:nth-child(2) { margin: 64px 0; }
.login-brand p:not(.eyebrow) { max-width: 560px; color: var(--text-secondary); font-size: 1.08rem; }
.login-capabilities { display: flex; flex-wrap: wrap; gap: 20px; color: var(--navigation-muted); font-size: 0.8rem; font-weight: 750; text-transform: uppercase; }
.login-card { padding: 48px 38px; display: flex; flex-direction: column; justify-content: center; gap: 19px; background: #FCFCFD; color: #101828; }
.login-card .eyebrow { color: var(--orange-dark); }
.login-card h2 { font-size: 1.6rem; }
.login-card .field > span { color: #475467; }
.login-card .field input { background: #fff; color: #101828; border-color: #E2E8F0; }
.login-card .field input:focus { border-color: #123BBD; box-shadow: 0 0 0 3px rgba(18,59,189,.12); }
.password-field { position: relative; }
.password-field input { padding-right: 68px; }
.field-action { position: absolute; right: 8px; bottom: 7px; height: 34px; padding: 0 8px; border: 0; background: transparent; color: #123BBD; font-size: 0.78rem; font-weight: 800; }
.login-card .field-action { color: #123BBD; }
.environment-line { display: flex; align-items: center; gap: 8px; color: #667085; font-size: 0.78rem; overflow-wrap: anywhere; }
.status-dot { width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #16a34a; box-shadow: 0 0 0 4px rgba(22,163,74,.12); }
.form-error { margin: -4px 0 0; padding: 10px 12px; border-radius: 6px; background: #fee4e2; color: #b42318; font-size: 0.84rem; }

.field { display: grid; gap: 7px; }
.field > span, .payment-choice legend { color: var(--text-secondary); font-size: 0.78rem; font-weight: 750; }
.field small { color: var(--text-muted); font-weight: 500; }
.field input, .field select, .field textarea, .search-control, .date-control, .cinema-picker select, .show-filter-row select, .compact-actions select {
  width: 100%;
  min-height: 40px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #071F42;
  color: var(--text);
}
.field textarea { resize: vertical; min-height: 60px; }
.field input::placeholder, .field textarea::placeholder, .search-control::placeholder { color: var(--text-muted); }
.field input:focus, .field select:focus, .field textarea:focus, .search-control:focus, .date-control:focus, .cinema-picker select:focus { border-color: var(--blue-action); }
.field-grid { display: grid; gap: 12px; }
.field-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack-form { display: grid; gap: 13px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: 100vh; padding: 19px 14px; display: flex; flex-direction: column; background: var(--navigation); border-right: 1px solid var(--border); z-index: 30; }
.sidebar-brand { min-height: 48px; padding: 0 6px; }
.sidebar-brand small { display: block; color: var(--navigation-muted); font-size: 0.7rem; font-weight: 600; }
.venue-identity { margin: 18px 6px 14px; padding: 12px; border: 1px solid var(--border); border-radius: 6px; background: rgba(11,39,79,.7); }
.venue-identity small { display: block; margin-bottom: 4px; color: var(--navigation-muted); font-size: 0.7rem; }
.venue-identity strong { display: block; overflow: hidden; color: var(--text); font-size: 0.85rem; text-overflow: ellipsis; white-space: nowrap; }
.nav-list { display: grid; gap: 5px; }
.nav-item { width: 100%; min-height: 44px; padding: 0 11px; display: flex; align-items: center; gap: 11px; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--navigation-muted); text-align: left; font-size: 0.88rem; font-weight: 720; }
.nav-item:hover { color: var(--text); background: rgba(11,39,79,.65); }
.nav-item.active { color: var(--text); background: var(--surface); border-color: var(--border); }
.nav-icon { width: 25px; color: var(--text-muted); font-size: 0.66rem; font-variant-numeric: tabular-nums; }
.nav-item.active .nav-icon { color: var(--orange); }
.sidebar-footer { margin-top: auto; display: grid; gap: 13px; }
.staff-chip { padding: 10px 6px; display: flex; align-items: center; gap: 9px; min-width: 0; }
.staff-chip > span { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 34px; border-radius: 50%; background: var(--surface-raised); color: var(--success-mint); font-size: 0.72rem; font-weight: 850; }
.staff-chip div { min-width: 0; }
.staff-chip strong, .staff-chip small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-chip strong { font-size: 0.8rem; }
.staff-chip small { color: var(--navigation-muted); font-size: 0.68rem; text-transform: capitalize; }

.main-shell { min-width: 0; }
.topbar { min-height: 76px; padding: 13px 22px; display: flex; align-items: center; justify-content: space-between; gap: 20px; position: sticky; top: 0; z-index: 20; background: rgba(6,26,56,.96); border-bottom: 1px solid var(--border); backdrop-filter: blur(14px); }
.topbar-title, .topbar-actions, .compact-actions { display: flex; align-items: center; gap: 10px; }
.topbar-title .eyebrow { color: var(--text-muted); }
.menu-button { display: none; }
.topbar-actions { justify-content: flex-end; }
.network-state { min-width: 70px; display: inline-flex; align-items: center; gap: 7px; color: var(--text-secondary); font-size: 0.74rem; }
.network-state i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.network-state.offline i { background: var(--danger); }
.cinema-picker { display: flex; align-items: center; gap: 8px; }
.cinema-picker > span { color: var(--text-muted); font-size: 0.72rem; font-weight: 750; }
.cinema-picker select { width: min(240px, 25vw); }

.view { display: none; min-height: calc(100vh - 76px); }
.view.active { display: block; }
.booking-workspace { min-height: calc(100vh - 76px); display: grid; grid-template-columns: 260px minmax(440px, 1fr) 350px; }
.show-rail, .seat-workspace, .checkout-panel, .catalog-section, .cart-panel, .scanner-stage, .scan-result-panel, .report-section, .system-section { min-width: 0; }
.show-rail { padding: 18px 14px; border-right: 1px solid var(--border); background: #071F42; }
.seat-workspace { padding: 18px; }
.checkout-panel { padding: 18px; border-left: 1px solid var(--border); background: #071F42; }
.section-head { min-height: 46px; margin-bottom: 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head.compact { min-height: 38px; }
.section-head .eyebrow { margin-bottom: 3px; color: var(--text-muted); }
.date-control { width: 128px; min-height: 36px; font-size: 0.78rem; }
.show-filter-row { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; margin-bottom: 12px; }
.show-filter-row select { min-height: 40px; padding: 0 9px; }
.show-list { display: grid; gap: 8px; max-height: calc(100vh - 215px); overflow: auto; padding-right: 2px; }
.show-card { width: 100%; padding: 11px; display: grid; gap: 7px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); text-align: left; }
.show-card:hover { border-color: var(--border-bright); background: var(--surface-raised); }
.show-card.active { border-color: var(--orange); box-shadow: inset 3px 0 0 var(--orange); }
.show-card strong { font-size: 0.88rem; line-height: 1.25; }
.show-card .show-time { color: var(--text); font-size: 1.06rem; font-weight: 850; }
.show-card .show-details { display: flex; flex-wrap: wrap; gap: 5px 10px; color: var(--text-secondary); font-size: 0.69rem; }
.selection-badge, .mode-chip { padding: 6px 9px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-secondary); font-size: 0.72rem; font-weight: 750; white-space: nowrap; }

.seat-stage { min-height: 520px; padding: 12px 5px 24px; overflow: auto; }
.screen { width: min(78%, 640px); height: 34px; margin: 0 auto 40px; display: grid; place-items: center; position: relative; border-top: 3px solid #72b6ff; border-radius: 50%; color: var(--text-muted); font-size: 0.67rem; font-weight: 800; text-transform: uppercase; }
.screen::after { content: ""; position: absolute; inset: 0 12%; background: linear-gradient(180deg, rgba(32,139,255,.14), transparent); filter: blur(8px); }
.seat-map { min-width: 430px; display: grid; gap: 8px; justify-content: center; }
.seat-row { display: grid; grid-template-columns: 30px auto; gap: 9px; align-items: center; }
.row-label { color: var(--text-muted); font-size: 0.72rem; font-weight: 800; text-align: center; }
.seat-row-items { display: flex; justify-content: center; gap: 7px; }
.seat { width: 31px; height: 29px; padding: 0; border: 1px solid var(--border-bright); border-radius: 5px 5px 3px 3px; background: transparent; color: var(--text-secondary); font-size: 0.65rem; font-weight: 800; }
.seat:hover:not(:disabled) { border-color: var(--success); color: var(--text); background: rgba(101,230,110,.12); }
.seat.selected { border-color: var(--orange); background: var(--orange); color: #fff; }
.seat.held { border-color: rgba(255,176,0,.5); background: rgba(255,176,0,.15); color: var(--warning); }
.seat.booked { border-color: #334d6b; background: #203853; color: var(--text-muted); }
.seat.couple { width: 43px; }
.seat.premium { border-bottom: 3px solid var(--blue-action); }
.seat.sofa { width: 43px; border-bottom: 3px solid var(--warning); }
.seat-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 16px; color: var(--text-secondary); font-size: 0.72rem; }
.seat-legend span { display: inline-flex; align-items: center; gap: 6px; }
.seat-key { width: 15px; height: 13px; border: 1px solid var(--border-bright); border-radius: 3px; }
.seat-key.selected { background: var(--orange); border-color: var(--orange); }
.seat-key.held { background: rgba(255,176,0,.15); border-color: var(--warning); }
.seat-key.booked { background: #203853; border-color: #334d6b; }

.selected-seats { min-height: 48px; margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 7px; }
.selected-seat-chip { padding: 7px 9px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border-bright); border-radius: 5px; background: var(--surface); font-size: 0.75rem; }
.selected-seat-chip button { width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: var(--surface-elevated); color: var(--text-secondary); }
.payment-choice { margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; border: 0; }
.payment-choice legend { margin-bottom: 7px; }
.payment-choice label { min-width: 0; }
.payment-choice input { position: absolute; opacity: 0; pointer-events: none; }
.payment-choice span { min-height: 38px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 5px; color: var(--text-secondary); font-size: 0.76rem; font-weight: 750; }
.payment-choice input:checked + span { border-color: var(--orange); background: rgba(250,88,11,.12); color: var(--text); }
.totals { padding: 12px 0; display: grid; gap: 7px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.totals > div { display: flex; justify-content: space-between; gap: 10px; color: var(--text-secondary); font-size: 0.8rem; }
.totals strong { color: var(--text); }
.totals .grand-total { align-items: baseline; color: var(--text); font-size: 0.9rem; }
.totals .grand-total strong { font-size: 1.18rem; }
.totals small { color: var(--text-muted); font-size: 0.67rem; }
.transaction-result { margin-top: 14px; padding: 13px; border: 1px solid var(--border-bright); border-radius: 6px; background: var(--surface); }
.transaction-result.good { border-color: rgba(101,230,110,.55); }
.transaction-result.warn { border-color: rgba(255,176,0,.6); }
.result-title { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.result-title p { margin-bottom: 0; color: var(--text-secondary); font-size: 0.74rem; }
.result-actions { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 7px; }

.empty-state { min-height: 150px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--text-muted); text-align: center; }
.empty-state.small { min-height: 44px; align-items: flex-start; }
.empty-state strong { color: var(--text-secondary); }
.empty-state span { font-size: 0.78rem; }
.loading-lines { min-height: 120px; display: grid; place-items: center; color: var(--text-muted); font-size: 0.8rem; }

.ledger-section { padding: 22px; border-top: 1px solid var(--border); background: #071F42; }
.search-control { width: min(260px, 35vw); }
.table-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
table { width: 100%; min-width: 850px; border-collapse: collapse; background: var(--surface); }
th, td { padding: 11px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { position: sticky; top: 0; z-index: 1; background: var(--surface-raised); color: var(--text-muted); font-size: 0.67rem; font-weight: 800; text-transform: uppercase; }
td { color: var(--text-secondary); font-size: 0.78rem; }
td strong { color: var(--text); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(14,49,94,.72); }
.table-actions { display: flex; justify-content: flex-end; gap: 6px; }
.table-actions button { min-height: 30px; padding: 0 9px; border: 1px solid var(--border); border-radius: 5px; background: transparent; color: var(--text-secondary); font-size: 0.69rem; font-weight: 750; }
.table-actions button:hover { border-color: var(--border-bright); color: var(--text); }
.status-chip { display: inline-flex; padding: 4px 7px; border: 1px solid var(--border); border-radius: 999px; color: var(--text-secondary); font-size: 0.65rem; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.status-chip.good { border-color: rgba(101,230,110,.35); background: rgba(101,230,110,.09); color: var(--success); }
.status-chip.warn { border-color: rgba(255,176,0,.4); background: rgba(255,176,0,.09); color: var(--warning); }
.status-chip.bad { border-color: rgba(255,59,48,.4); background: rgba(255,59,48,.09); color: #ff827a; }

.concession-workspace { min-height: calc(100vh - 76px); display: grid; grid-template-columns: minmax(0,1fr) 370px; }
.catalog-section { padding: 22px; }
.cart-panel { padding: 22px; border-left: 1px solid var(--border); background: #071F42; }
.category-tabs { margin-bottom: 15px; display: flex; gap: 5px; overflow: auto; }
.category-tabs button { min-height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: transparent; color: var(--text-secondary); font-size: 0.72rem; font-weight: 760; white-space: nowrap; }
.category-tabs button.active { border-color: var(--orange); background: rgba(250,88,11,.12); color: var(--text); }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px,1fr)); gap: 10px; }
.product-card { min-height: 126px; padding: 13px; display: flex; flex-direction: column; align-items: stretch; justify-content: space-between; gap: 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); text-align: left; }
.product-card:hover { border-color: var(--border-bright); background: var(--surface-raised); }
.product-card.inactive { opacity: .55; }
.product-add { min-height: 58px; padding: 0; display: block; border: 0; background: transparent; color: inherit; text-align: left; }
.product-card .product-category { color: var(--text-muted); font-size: 0.64rem; font-weight: 800; text-transform: uppercase; }
.product-card strong { display: block; margin-top: 4px; font-size: 0.9rem; }
.product-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-card-footer b { font-size: 0.92rem; }
.product-card-footer span { color: var(--text-muted); font-size: 0.68rem; }
.cart-list { min-height: 140px; max-height: 43vh; margin-bottom: 14px; overflow: auto; }
.cart-item { padding: 10px 0; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; border-bottom: 1px solid var(--border); }
.cart-item strong, .cart-item small { display: block; }
.cart-item strong { font-size: 0.82rem; }
.cart-item small { color: var(--text-muted); font-size: 0.69rem; }
.stepper { display: grid; grid-template-columns: 30px 34px 30px; align-items: center; border: 1px solid var(--border); border-radius: 5px; }
.stepper button { width: 30px; height: 30px; padding: 0; border: 0; background: transparent; color: var(--text); font-size: 1rem; }
.stepper span { text-align: center; color: var(--text-secondary); font-size: 0.76rem; }

.scanner-workspace { min-height: calc(100vh - 76px); display: grid; grid-template-columns: minmax(470px, .95fr) minmax(360px, 1.05fr); }
.scanner-stage { padding: 22px; border-right: 1px solid var(--border); background: #071F42; }
.scan-result-panel { padding: 28px; display: grid; place-items: center; }
.camera-frame { width: min(100%, 720px); aspect-ratio: 16 / 10; margin: 0 auto 14px; position: relative; overflow: hidden; border: 1px solid var(--border-bright); border-radius: 7px; background: #020a16; }
.camera-frame video { width: 100%; height: 100%; display: none; object-fit: cover; }
.camera-frame.active video { display: block; }
.camera-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--text-muted); }
.camera-placeholder strong { color: var(--text-secondary); }
.camera-placeholder span { font-size: 0.78rem; }
.camera-frame.active .camera-placeholder { display: none; }
.scan-guide { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; pointer-events: none; }
.camera-frame.active .scan-guide { display: flex; }
.scan-guide i { width: min(48%, 260px); aspect-ratio: 1; border: 3px solid rgba(255,255,255,.9); border-radius: 8px; box-shadow: 0 0 0 999px rgba(0,0,0,.34); }
.scan-guide span { position: absolute; bottom: 20px; padding: 7px 10px; border-radius: 4px; background: rgba(0,0,0,.65); color: #fff; font-size: 0.72rem; }
.scanner-controls { display: flex; gap: 8px; }
.file-button { display: inline-grid; place-items: center; }
.manual-scan { margin-top: 18px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; align-items: end; }
.support-text { margin: 10px 0 0; color: var(--text-muted); font-size: 0.7rem; }
.scan-empty { text-align: center; color: var(--text-secondary); }
.scan-empty-mark { width: 74px; height: 74px; margin: 0 auto 18px; display: grid; place-items: center; border: 2px dashed var(--border-bright); border-radius: 8px; color: var(--text-muted); font-size: 1.1rem; font-weight: 900; }
.scan-empty p { margin: 7px 0 0; color: var(--text-muted); font-size: 0.82rem; }
.scan-result { width: min(580px,100%); border: 1px solid var(--border-bright); border-radius: 8px; overflow: hidden; background: var(--surface); }
.scan-result.valid { border-color: rgba(101,230,110,.7); }
.scan-result.invalid, .scan-result.expired { border-color: rgba(255,59,48,.7); }
.scan-result.already_scanned { border-color: rgba(255,176,0,.7); }
.scan-result-banner { padding: 18px; display: flex; justify-content: space-between; align-items: center; gap: 14px; background: var(--surface-raised); }
.scan-result.valid .scan-result-banner { background: rgba(101,230,110,.11); }
.scan-result.invalid .scan-result-banner, .scan-result.expired .scan-result-banner { background: rgba(255,59,48,.11); }
.scan-result.already_scanned .scan-result-banner { background: rgba(255,176,0,.11); }
.scan-result-banner strong { font-size: 1.25rem; }
.scan-result-body { padding: 20px; }
.scan-ticket-title { margin-bottom: 18px; }
.scan-ticket-title h3 { font-size: 1.45rem; }
.scan-ticket-title p { margin: 4px 0 0; color: var(--text-secondary); }
.scan-ticket-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.scan-ticket-grid div { padding: 12px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.scan-ticket-grid div:nth-child(2n) { border-right: 0; }
.scan-ticket-grid span, .scan-ticket-grid strong { display: block; }
.scan-ticket-grid span { color: var(--text-muted); font-size: 0.67rem; text-transform: uppercase; }
.scan-ticket-grid strong { margin-top: 3px; overflow-wrap: anywhere; }
.scan-seat { font-size: 1.55rem !important; color: var(--orange); }
.scan-result-actions { margin-top: 16px; display: flex; gap: 8px; }
.scan-stats { display: flex; align-items: center; gap: 15px; color: var(--text-secondary); font-size: 0.74rem; }
.scan-stats strong { color: var(--text); }

.report-toolbar { padding: 18px 22px; display: flex; align-items: end; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--border); background: #071F42; }
.report-toolbar .field-grid { width: min(430px,70vw); }
.metric-grid { padding: 22px; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; background: var(--border); }
.metric-grid article { min-height: 120px; padding: 18px; display: flex; flex-direction: column; justify-content: center; background: var(--surface); }
.metric-grid span, .metric-grid small { color: var(--text-muted); font-size: 0.72rem; }
.metric-grid strong { margin: 5px 0 3px; font-size: 1.5rem; }
.report-grid { padding: 0 22px 22px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.report-section { padding: 18px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.bar-chart { min-height: 250px; display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: minmax(90px,150px) minmax(100px,1fr) auto; gap: 10px; align-items: center; color: var(--text-secondary); font-size: 0.73rem; }
.bar-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 9px; overflow: hidden; border-radius: 2px; background: #071F42; }
.bar-fill { height: 100%; min-width: 2px; background: var(--orange); }
.bar-row.hour .bar-fill { background: var(--blue-action); }

.system-grid { padding: 22px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
.system-section { padding: 20px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.system-section dl { margin: 18px 0 0; }
.system-section dl div { padding: 10px 0; display: grid; grid-template-columns: 140px minmax(0,1fr); gap: 12px; border-bottom: 1px solid var(--border); }
.system-section dl div:last-child { border-bottom: 0; }
.system-section dt { color: var(--text-muted); font-size: 0.75rem; }
.system-section dd { margin: 0; overflow-wrap: anywhere; color: var(--text-secondary); font-size: 0.78rem; }
.permission-section { grid-column: 1 / -1; }
.permission-list { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 7px; }
.permission-list span { padding: 6px 8px; border: 1px solid var(--border); border-radius: 4px; color: var(--text-secondary); font-size: 0.68rem; }

.modal { width: min(560px,calc(100vw - 28px)); padding: 0; border: 1px solid var(--border-bright); border-radius: 8px; background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.modal::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(3px); }
.modal-shell { padding: 20px; display: grid; gap: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.switch-field { min-height: 40px; padding: 9px 10px; display: flex; align-items: center; gap: 9px; align-self: end; border: 1px solid var(--border); border-radius: 6px; color: var(--text-secondary); font-size: 0.78rem; font-weight: 700; }
.switch-field input { accent-color: var(--orange); }

.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; }
.toast { width: min(390px,calc(100vw - 36px)); padding: 12px 14px; border: 1px solid var(--border-bright); border-left: 4px solid var(--blue-action); border-radius: 6px; background: var(--navigation); box-shadow: var(--shadow); }
.toast strong, .toast span { display: block; }
.toast strong { font-size: 0.82rem; }
.toast span { margin-top: 3px; color: var(--text-secondary); font-size: 0.74rem; }
.toast.success { border-left-color: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.warn { border-left-color: var(--warning); }
.sidebar-scrim { position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.58); }

@media (max-width: 1280px) {
  :root { --sidebar-width: 210px; }
  .booking-workspace { grid-template-columns: 230px minmax(410px,1fr) 320px; }
  .field-grid.two { grid-template-columns: 1fr; }
  .checkout-panel .field-grid.two { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 1080px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { width: min(280px,86vw); position: fixed; left: 0; transform: translateX(-102%); transition: transform 160ms ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: translateX(0); }
  .menu-button { display: inline-block; }
  .booking-workspace { grid-template-columns: 230px minmax(430px,1fr); }
  .checkout-panel { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--border); }
  .checkout-panel .stack-form { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: end; }
  .checkout-panel .totals, .checkout-panel .button.wide, .checkout-panel .transaction-result { grid-column: 1 / -1; }
  .concession-workspace { grid-template-columns: minmax(0,1fr) 340px; }
  .metric-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}

@media (max-width: 820px) {
  .login-screen { padding: 0; }
  .login-shell { min-height: 100vh; grid-template-columns: 1fr; border: 0; border-radius: 0; }
  .login-brand { min-height: 300px; padding: 30px; }
  .login-brand > div:nth-child(2) { margin: 40px 0; }
  .login-card { padding: 34px 28px; }
  .topbar { padding: 11px 13px; align-items: flex-start; }
  .topbar-actions { flex-wrap: wrap; }
  .network-state { display: none; }
  .cinema-picker > span { display: none; }
  .cinema-picker select { width: min(220px,46vw); }
  .booking-workspace, .concession-workspace, .scanner-workspace { min-height: auto; grid-template-columns: 1fr; }
  .show-rail, .checkout-panel, .cart-panel, .scanner-stage { border: 0; border-bottom: 1px solid var(--border); }
  .show-list { max-height: 270px; grid-template-columns: repeat(auto-fill,minmax(170px,1fr)); }
  .seat-workspace { min-height: 620px; }
  .checkout-panel .stack-form { grid-template-columns: 1fr; }
  .checkout-panel .totals, .checkout-panel .button.wide, .checkout-panel .transaction-result { grid-column: auto; }
  .scanner-stage { border-right: 0; }
  .scan-result-panel { min-height: 440px; }
  .report-grid, .system-grid { grid-template-columns: 1fr; }
  .permission-section { grid-column: auto; }
  .section-head { align-items: flex-start; }
  .compact-actions { flex-wrap: wrap; justify-content: flex-end; }
}

@media (max-width: 580px) {
  body { font-size: 15px; }
  h1 { font-size: 2.35rem; }
  .login-brand { min-height: 280px; }
  .login-capabilities { gap: 10px 16px; }
  .topbar-title .eyebrow { display: none; }
  .topbar h2 { font-size: 1.12rem; }
  .topbar-actions .icon-button { display: none; }
  .cinema-picker select { width: 45vw; }
  .show-rail, .seat-workspace, .checkout-panel, .catalog-section, .cart-panel, .scanner-stage, .scan-result-panel, .ledger-section, .report-toolbar, .system-grid { padding: 14px; }
  .seat-stage { margin: 0 -14px; padding-left: 14px; padding-right: 14px; }
  .seat-map { justify-content: start; }
  .product-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .product-card { min-height: 118px; }
  .section-head { flex-direction: column; }
  .section-head .compact-actions { width: 100%; justify-content: flex-start; }
  .search-control { width: 100%; }
  .manual-scan { grid-template-columns: 1fr; }
  .scanner-controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .scan-ticket-grid { grid-template-columns: 1fr; }
  .scan-ticket-grid div, .scan-ticket-grid div:nth-child(2n) { border-right: 0; }
  .metric-grid { padding: 14px; grid-template-columns: 1fr 1fr; }
  .metric-grid article { min-height: 104px; padding: 13px; }
  .metric-grid strong { font-size: 1.2rem; }
  .report-grid { padding: 0 14px 14px; grid-template-columns: 1fr; }
  .report-toolbar { align-items: stretch; flex-direction: column; }
  .report-toolbar .field-grid { width: 100%; grid-template-columns: repeat(2,minmax(0,1fr)); }
  .bar-row { grid-template-columns: 92px minmax(70px,1fr) auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
