/* AdNet by Deltrolux — interface styles.
   Layout: dark "LED signage" look. Sidebar + working area on desktop; top bar + scrolling tab row on phones.
   Fonts are bundled (see assets/fonts, OFL): Outfit (display), Instrument Sans (body), IBM Plex Mono (figures). */

@font-face { font-family: "Outfit"; src: url("fonts/Outfit-Regular.ttf") format("truetype"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Outfit"; src: url("fonts/Outfit-Bold.ttf") format("truetype"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/InstrumentSans-Regular.ttf") format("truetype"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("fonts/InstrumentSans-Bold.ttf") format("truetype"); font-weight: 600 700; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("fonts/IBMPlexMono-Regular.ttf") format("truetype"); font-weight: 400 500; font-display: swap; }

:root {
  --bg: #0E1621; --surface: #16212E; --surface-2: #1C2938; --line: #2A394B; --field: #3A4B60;
  --ink: #EAF0F6; --ink-2: #C9D4E0; --muted: #9AABBD; --faint: #7A8CA0;
  --amber: #FFB547; --amber-ink: #1A1203; --amber-soft: #2A2213;
  --teal: #5CC8C2; --teal-soft: #15302F; --violet: #9AAAFF; --violet-soft: #1F2647;
  --ok: #6FD39A; --ok-soft: #173225; --warn: #F2B35B; --crit: #F2786B; --crit-soft: #3A1C1A;
  --paper: #F4F1E8; --paper-ink: #141B24; --paper-muted: #5A6575; --paper-line: #DCD7C9;
  --display: "Outfit", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  --r: 10px; --r-lg: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--body); -webkit-font-smoothing: antialiased; font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--amber); }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; margin: 0; text-wrap: balance; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- buttons and fields ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r); border: 1px solid var(--field); background: var(--surface-2); cursor: pointer; text-decoration: none; color: var(--ink); white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--amber); border-color: var(--amber); color: var(--amber-ink); font-family: var(--display); font-weight: 600; }
.btn.primary:hover { background: #FFC56E; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn.ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); }
.btn.danger { color: var(--crit); border-color: #5A2C29; }
.btn:disabled { opacity: .5; cursor: default; }
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); min-width: 0; }
input, select, textarea { min-height: 44px; padding: 8px 12px; background: var(--bg); border: 1px solid var(--field); border-radius: var(--r); width: 100%; min-width: 0; font-size: 15px; text-transform: none; letter-spacing: 0; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--amber); outline: none; }
input[type="checkbox"] { min-height: 0; width: 18px; height: 18px; accent-color: var(--amber); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 16px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side { border-right: 1px solid var(--line); padding: 22px 16px; display: flex; flex-direction: column; gap: 24px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 36px; height: 36px; flex: none; }
.brand-name { font-family: var(--display); font-weight: 700; font-size: 19px; letter-spacing: .06em; line-height: 1; }
.brand-sub { font-family: var(--mono); font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 12px; border-radius: var(--r); color: var(--ink-2); text-decoration: none; }
.nav a:hover { background: var(--surface); color: var(--ink); }
.nav a[aria-current="page"] { background: var(--amber-soft); color: var(--amber); font-weight: 600; }
.nav .ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.who { margin-top: auto; border-top: 1px solid var(--line); padding-top: 16px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.who .role { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--amber); }
.main { min-width: 0; padding: 32px max(24px, env(safe-area-inset-right, 0px)) 72px max(24px, env(safe-area-inset-left, 0px)); }
.main-inner { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }
.page-head { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: flex-end; }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--amber); }
.page-head h1 { font-size: 34px; line-height: 1.1; margin-top: 4px; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 65ch; }
.foot { color: var(--faint); font-size: 12px; text-align: center; padding-top: 24px; }

@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 14px 16px 0; gap: 12px; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 10px; }
  .nav a { white-space: nowrap; min-height: 40px; }
  .who { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; padding: 10px 0; margin: 0; }
  .main { padding: 24px max(16px, env(safe-area-inset-right, 0px)) 64px max(16px, env(safe-area-inset-left, 0px)); }
  .page-head h1 { font-size: 28px; }
}

/* ---------- panels, stats, tables ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.panel h2 { font-size: 22px; }
.panel.paper { background: var(--paper); color: var(--paper-ink); border-color: var(--paper); }
.panel.paper .muted { color: var(--paper-muted); }
.panel.paper input, .panel.paper select { background: #FFFFFF; border-color: #C9C3B3; color: var(--paper-ink); }
.panel.paper label.f { color: var(--paper-muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 18px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.stat .k { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.stat .v { font-family: var(--display); font-weight: 600; font-size: 30px; line-height: 1.15; overflow-wrap: anywhere; }
.stat .s { font-size: 13px; color: var(--muted); }
.stat.hero { background: var(--amber-soft); border-color: #4A3A18; }
.stat.hero .v { color: var(--amber); font-size: 38px; }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 8px; }
.bar > span { display: block; height: 100%; background: var(--amber); border-radius: 3px; }
.two { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 1020px) { .two { grid-template-columns: minmax(0, 1fr); } }
.table-wrap { overflow-x: auto; margin: 0 -4px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 500; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.total td { font-weight: 600; border-top: 1px solid var(--field); }
.name { font-weight: 600; }
td:first-child { min-width: 140px; }
.sub { font-size: 12.5px; color: var(--muted); }
.occ { display: flex; align-items: center; gap: 10px; min-width: 150px; }
.occ .bar { flex: 1; margin: 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.chip.quote { background: var(--violet-soft); color: var(--violet); }
.chip.active { background: var(--ok-soft); color: var(--ok); }
.chip.ended { color: var(--muted); }
.chip.cancelled { background: var(--crit-soft); color: var(--crit); }
.chip.archived { color: var(--muted); }
.tag { font-family: var(--mono); font-size: 11.5px; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); white-space: nowrap; }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--field); border-radius: var(--r-lg); }

/* ---------- rotation strip ---------- */
.cycle { display: grid; grid-template-columns: repeat(var(--n, 12), minmax(0, 1fr)); gap: 6px; }
.slot { height: 58px; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; background: var(--surface-2); border: 1px solid var(--amber); color: var(--amber); box-shadow: inset 0 0 18px rgba(255, 181, 71, .2); font-family: var(--mono); font-size: 12px; }
.slot small { font-size: 10.5px; opacity: .8; }
.slot.estate { border-color: var(--teal); color: var(--teal); box-shadow: inset 0 0 18px rgba(92, 200, 194, .2); }
.slot.dlx { border-color: var(--violet); color: var(--violet); box-shadow: inset 0 0 18px rgba(154, 170, 255, .2); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
@media (max-width: 560px) { .slot { height: 44px; font-size: 10px; } .slot small { display: none; } .cycle { gap: 3px; } }

/* ---------- quote ---------- */
.tiers { display: flex; flex-direction: column; gap: 4px; }
.tiers div { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 8px; font-size: 14px; color: var(--paper-muted); }
.tiers div.on { background: var(--paper-ink); color: var(--paper); font-weight: 600; }
.total-card { background: var(--paper-ink); color: var(--paper); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 6px; }
.total-card .big { font-family: var(--display); font-weight: 700; font-size: 48px; line-height: 1; color: var(--amber); overflow-wrap: anywhere; }
.total-card .k { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: #B7C2CF; }
.total-card .s { font-size: 13px; color: #B7C2CF; }
.picker td { padding: 8px 10px; }
.picker input { width: 96px; text-align: right; }

/* ---------- dialogs and toasts ---------- */
dialog { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); color: var(--ink); padding: 0; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 32px); }
dialog::backdrop { background: rgba(5, 9, 14, .7); }
dialog form { padding: 24px; display: flex; flex-direction: column; gap: 18px; }
dialog h2 { font-size: 24px; }
.error { color: var(--crit); font-size: 14px; min-height: 1em; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--paper); color: var(--paper-ink); padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); z-index: 50; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--crit); color: #1B0B09; }

/* ---------- sign-in ---------- */
.signin { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.signin-hero { padding: 48px; display: flex; flex-direction: column; justify-content: space-between; gap: 40px; background: radial-gradient(circle at 20% 80%, rgba(255, 181, 71, .08), transparent 55%), var(--bg); border-right: 1px solid var(--line); }
.signin-hero h1 { font-size: clamp(36px, 5vw, 60px); line-height: 1.02; max-width: 14ch; }
.signin-hero h1 em { font-style: normal; color: var(--amber); }
.signin-hero p { color: var(--muted); max-width: 46ch; font-size: 16px; }
.dots { display: grid; grid-template-columns: repeat(12, 14px); gap: 8px; }
.dots span { width: 14px; height: 14px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px rgba(255, 181, 71, .6); animation: pulse 2.4s ease-in-out infinite; }
.dots span.estate { background: var(--teal); box-shadow: 0 0 12px rgba(92, 200, 194, .6); }
.dots span.dlx { background: var(--violet); box-shadow: 0 0 12px rgba(154, 170, 255, .6); }
@keyframes pulse { 0%, 100% { opacity: .45; } 8% { opacity: 1; } 20% { opacity: .45; } }
.signin-form { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.signin-form form { width: min(380px, 100%); display: flex; flex-direction: column; gap: 18px; }
.signin-form h2 { font-size: 28px; }
@media (max-width: 820px) { .signin { grid-template-columns: minmax(0, 1fr); } .signin-hero { padding: 32px 20px; border-right: 0; border-bottom: 1px solid var(--line); } .signin-form { padding: 32px 16px; } .dots { grid-template-columns: repeat(12, 10px); gap: 6px; } .dots span { width: 10px; height: 10px; } }
