/* ============================================================
   TERSEA — Design System (RoomKiosk back-office + shared)
   Navy / slate corporate B2B. IBM Plex Sans + Mono.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* ---------- Tokens ---------- */
:root {
  /* Neutrals (cool, slight blue tint) */
  --bg:            #eceff4;
  --surface:       #ffffff;
  --surface-2:     #f6f8fb;
  --surface-3:     #eef2f7;
  --border:        #dde3ec;
  --border-strong: #c6cfdc;

  /* Text */
  --text:    #14233d;
  --text-2:  #4d5d76;
  --text-3:  #7e8aa0;

  /* Brand navy */
  --brand-ink:   #0c1a30;
  --brand-ink-2: #112443;
  --primary:        #1c4f9c;
  --primary-hover:  #173f7f;
  --primary-press:  #123a72;
  --primary-weak:   #e7eff8;
  --primary-weak-2: #d6e4f5;
  --focus:          #5b9bd5;

  /* Status */
  --ok:        #0f8a4f;
  --ok-weak:   #e2f2e9;
  --ok-ink:    #0a6c3e;
  --danger:    #c33630;
  --danger-weak:#fbe8e7;
  --danger-ink:#9c2823;
  --warn:      #b1730a;
  --warn-weak: #f6ecd9;
  --warn-ink:  #855507;
  --info:      #1b6fb0;
  --info-weak: #e3f0f8;

  /* Geometry */
  --r-xs: 5px;
  --r-sm: 7px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  --sh-sm: 0 1px 2px rgba(16,30,54,.06), 0 1px 1px rgba(16,30,54,.04);
  --sh-md: 0 4px 14px rgba(16,30,54,.08), 0 1px 3px rgba(16,30,54,.06);
  --sh-lg: 0 18px 48px rgba(11,26,48,.16);

  --font: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1,h2,h3,h4,p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
::selection { background: var(--primary-weak-2); }

/* ---------- Type helpers ---------- */
.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--primary);
}
.muted   { color: var(--text-2); }
.muted-2 { color: var(--text-3); }
.mono    { font-family: var(--mono); font-feature-settings: "tnum" 1; }
.t-num   { font-variant-numeric: tabular-nums; }

/* ============================================================
   BRAND MARK
   ============================================================ */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 32px; height: 32px; border-radius: 9px;
  background: linear-gradient(160deg, #2a64bf, #133a78);
  display: grid; place-items: center; flex: none;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12);
}
.brand-logo span {
  width: 12px; height: 12px; border-radius: 3px;
  background: #fff; position: relative;
}
.brand-logo span::after {
  content: ""; position: absolute; right: -6px; bottom: -6px;
  width: 7px; height: 7px; border-radius: 50%;
  background: #5fe0a0; box-shadow: 0 0 0 2px rgba(255,255,255,.25);
}
.brand-name { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name b { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.brand-name small { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); font-weight: 600; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  --bh: 38px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--bh); padding: 0 16px;
  border-radius: var(--r-sm); border: 1px solid transparent;
  font-size: 13.5px; font-weight: 600; letter-spacing: .005em;
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: background .14s ease, border-color .14s ease, box-shadow .14s ease, transform .04s ease;
}
.btn:active { transform: translateY(.5px); }
.btn svg { width: 16px; height: 16px; flex: none; }

.btn-primary { background: var(--primary); color: #fff; box-shadow: var(--sh-sm); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { background: var(--primary-press); }

.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--sh-sm); }
.btn-secondary:hover { background: var(--surface-2); border-color: #b4bfd0; }

.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-danger { background: var(--surface); color: var(--danger-ink); border-color: #ecc9c7; }
.btn-danger:hover { background: var(--danger-weak); }

.btn-sm { --bh: 30px; padding: 0 11px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-lg { --bh: 46px; padding: 0 22px; font-size: 15px; border-radius: var(--r-md); }
.btn-block { width: 100%; }
.btn[disabled], .btn:disabled { opacity: .5; pointer-events: none; }

/* ============================================================
   FORMS
   ============================================================ */
.field { display: grid; gap: 6px; }
.field > .label, .label {
  font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: .01em;
}
.input, .select, .textarea {
  height: 38px; width: 100%;
  padding: 0 12px;
  font-family: inherit; font-size: 13.5px; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  transition: border-color .14s ease, box-shadow .14s ease, background .14s ease;
}
.textarea { height: auto; padding: 10px 12px; resize: vertical; min-height: 84px; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover { border-color: #b4bfd0; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-weak);
}
.input.input-validation-error, .select.input-validation-error { border-color: var(--danger); }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237e8aa0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 34px; cursor: pointer;
}
.field-hint { font-size: 11.5px; color: var(--text-3); }
.input-mono { font-family: var(--mono); letter-spacing: .04em; }

.input-icon { position: relative; }
.input-icon svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 34px; }

/* ASP.NET validation */
.field-validation-error { font-size: 12px; color: var(--danger-ink); }
.field-validation-valid { display: none; }
.validation-summary-errors ul { color: var(--danger-ink); font-size: 13px; padding-left: 18px; margin: 0; }

/* ============================================================
   BADGES / STATUS
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 9px;
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em;
  border-radius: 999px; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.badge-ok     { background: var(--ok-weak);     color: var(--ok-ink); }
.badge-ok .dot{ background: var(--ok); }
.badge-danger { background: var(--danger-weak); color: var(--danger-ink); }
.badge-danger .dot{ background: var(--danger); }
.badge-warn   { background: var(--warn-weak);   color: var(--warn-ink); }
.badge-warn .dot{ background: var(--warn); }
.badge-info   { background: var(--info-weak);   color: var(--info); }
.badge-info .dot{ background: var(--info); }
.badge-neutral{ background: var(--surface-3);   color: var(--text-2); }
.badge-neutral .dot{ background: var(--text-3); }
.badge .dot-live { position: relative; }
.badge .dot-live::after {
  content:""; position:absolute; inset:-3px; border-radius:50%;
  border:1px solid currentColor; opacity:.4; animation: ping 1.8s ease-out infinite;
}
@keyframes ping { 0%{transform:scale(.6);opacity:.5} 80%,100%{transform:scale(1.5);opacity:0} }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding: 0 7px; border-radius: var(--r-xs);
  font-size: 11px; font-weight: 600; background: var(--surface-3); color: var(--text-2);
}
.kbd {
  font-family: var(--mono); font-size: 12px; font-weight: 500;
  background: var(--surface-3); border: 1px solid var(--border);
  border-radius: var(--r-xs); padding: 2px 7px; color: var(--text);
}

/* ============================================================
   CARDS / PANELS
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
}
.card-pad { padding: 20px; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 15px 18px; border-bottom: 1px solid var(--border);
}
.panel-head h2 { font-size: 14.5px; font-weight: 600; }
.panel-head .sub { font-size: 12px; color: var(--text-3); margin-top: 1px; }
.panel-body { padding: 18px; }

/* ============================================================
   TABLES (compact / dense)
   ============================================================ */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  position: sticky; top: 0;
  text-align: left; font-weight: 600; font-size: 11px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-3);
  padding: 9px 14px; background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.table tbody td {
  padding: 9px 14px; border-bottom: 1px solid var(--border);
  vertical-align: middle; color: var(--text);
}
.table tbody tr { transition: background .1s ease; }
.table tbody tr:hover { background: var(--surface-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .cell-strong { font-weight: 600; }
.table .cell-sub { display: block; font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.table .col-actions { text-align: right; white-space: nowrap; }
.table .row-links { display: inline-flex; gap: 6px; align-items: center; }
.table a.tlink { color: var(--primary); font-weight: 600; }
.table a.tlink:hover { text-decoration: underline; }
.table code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 2px 6px; border-radius: var(--r-xs); border: 1px solid var(--border); }
.row-actions { display: inline-flex; gap: 6px; justify-content: flex-end; }

/* Table toolbar */
.table-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--surface);
}
.table-toolbar .grow { flex: 1; }
.table-toolbar .input, .table-toolbar .select { height: 34px; font-size: 13px; }
.seg { display: inline-flex; background: var(--surface-3); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 2px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 11px; border-radius: var(--r-xs); font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--sh-sm); }

/* ============================================================
   ADMIN LAYOUT
   ============================================================ */
.admin-layout { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }

.sidebar {
  background: var(--brand-ink); color: #c7d2e3;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
  border-right: 1px solid #0a1526;
}
.sidebar-brand { padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.07); }
.sidebar-brand .brand-name b { color: #fff; }
.sidebar-brand .brand-name small { color: #7589a8; }

.nav-group { padding: 14px 12px; }
.nav-group + .nav-group { border-top: 1px solid rgba(255,255,255,.06); }
.nav-label { font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #6b7d9c; padding: 0 10px 8px; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: var(--r-sm); margin-bottom: 2px;
  font-size: 13.5px; font-weight: 500; color: #b7c4d8;
  transition: background .12s ease, color .12s ease;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .8; }
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.nav-item.active svg { opacity: 1; }
.nav-item .nav-badge { margin-left: auto; font-size: 11px; font-weight: 600; background: rgba(255,255,255,.12); color: #fff; border-radius: 999px; padding: 1px 7px; }
.nav-item.alert .nav-badge { background: var(--danger); }

.sidebar-foot { margin-top: auto; padding: 14px; border-top: 1px solid rgba(255,255,255,.07); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px; border-radius: var(--r-sm); }
.user-chip:hover { background: rgba(255,255,255,.06); }
.avatar { width: 32px; height: 32px; border-radius: 8px; background: linear-gradient(150deg,#2f64bf,#15407e); color:#fff; display: grid; place-items: center; font-size: 13px; font-weight: 700; flex: none; }
.user-chip .u-meta { line-height: 1.2; min-width: 0; }
.user-chip .u-meta b { display: block; font-size: 13px; color: #fff; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .u-meta small { font-size: 11px; color: #7589a8; }

/* Main column */
.admin-main { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px; height: 60px;
  background: rgba(255,255,255,.85); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar .crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.topbar .crumbs b { color: var(--text); font-weight: 600; }
.topbar .crumbs svg { width: 14px; height: 14px; }
.topbar .spacer { flex: 1; }
.topbar .clock { font-family: var(--mono); font-size: 13px; color: var(--text-2); }
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: var(--r-sm);
  background: var(--surface); color: var(--text-2); cursor: pointer; position: relative;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn .ind { position: absolute; top: 7px; right: 8px; width: 7px; height: 7px; border-radius: 50%; background: var(--danger); border: 2px solid var(--surface); }

.admin-content { padding: 24px; max-width: 1320px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.page-head .sub { font-size: 13.5px; color: var(--text-2); margin-top: 3px; }
.page-actions { display: flex; gap: 9px; align-items: center; }

/* ============================================================
   METRIC CARDS
   ============================================================ */
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.metric {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 16px; box-shadow: var(--sh-sm);
  position: relative; overflow: hidden;
}
.metric .m-top { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.metric .m-ico { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; flex: none; }
.metric .m-ico svg { width: 16px; height: 16px; }
.metric .m-ico.blue { background: var(--primary-weak); color: var(--primary); }
.metric .m-ico.green { background: var(--ok-weak); color: var(--ok-ink); }
.metric .m-ico.red { background: var(--danger-weak); color: var(--danger-ink); }
.metric .m-ico.amber { background: var(--warn-weak); color: var(--warn-ink); }
.metric .m-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.metric .m-value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.metric .m-foot { margin-top: 8px; font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.metric .m-foot .up { color: var(--ok-ink); font-weight: 600; }
.metric .m-foot .down { color: var(--danger-ink); font-weight: 600; }

/* Mini bar meter */
.meter { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin-top: 12px; }
.meter > i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.meter.ok > i { background: var(--ok); }
.meter.warn > i { background: var(--warn); }

/* ============================================================
   EMPTY / LOADING STATES
   ============================================================ */
.empty { text-align: center; padding: 48px 24px; color: var(--text-3); }
.empty .e-ico { width: 48px; height: 48px; border-radius: 12px; background: var(--surface-3); display: grid; place-items: center; margin: 0 auto 14px; color: var(--text-3); }
.empty h3 { font-size: 15px; color: var(--text); margin-bottom: 4px; }
.empty p { font-size: 13px; max-width: 360px; margin: 0 auto 16px; }
.skeleton { background: linear-gradient(90deg, var(--surface-3) 25%, var(--surface-2) 37%, var(--surface-3) 63%); background-size: 400% 100%; animation: sk 1.4s ease infinite; border-radius: var(--r-xs); }
@keyframes sk { 0%{background-position:100% 0} 100%{background-position:-100% 0} }

/* ============================================================
   LANDING / LAUNCHER
   ============================================================ */
.land {
  min-height: 100vh; display: flex; flex-direction: column;
  background:
    radial-gradient(1100px 520px at 82% -10%, rgba(31,77,156,.10), transparent 60%),
    radial-gradient(800px 500px at 0% 110%, rgba(15,138,79,.07), transparent 55%),
    var(--bg);
}
.land-nav { display: flex; align-items: center; justify-content: space-between; padding: 22px clamp(20px,5vw,56px); }
.land-nav .links { display: flex; gap: 6px; align-items: center; }
.land-main { flex: 1; display: grid; place-items: center; padding: 24px clamp(20px,5vw,56px) 64px; }
.land-inner { width: min(1080px, 100%); }
.land-hero { max-width: 640px; }
.land-hero h1 { font-size: clamp(34px, 5.4vw, 56px); font-weight: 700; letter-spacing: -.025em; line-height: 1.04; margin: 16px 0 16px; }
.land-hero p { font-size: clamp(15px,1.6vw,18px); color: var(--text-2); max-width: 540px; }
.land-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 40px; }
.launch {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--sh-sm); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
  display: flex; flex-direction: column; gap: 12px;
}
.launch:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--border-strong); }
.launch .l-ico { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; }
.launch .l-ico svg { width: 21px; height: 21px; }
.launch h3 { font-size: 16px; font-weight: 600; }
.launch p { font-size: 13px; color: var(--text-2); flex: 1; }
.launch .l-go { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--primary); }
.launch:hover .l-go svg { transform: translateX(3px); }
.launch .l-go svg { transition: transform .16s ease; width: 15px; height: 15px; }

/* ============================================================
   AUTH (login)
   ============================================================ */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-aside {
  background: linear-gradient(165deg, #122a52, var(--brand-ink));
  color: #dbe5f3; padding: 44px; display: flex; flex-direction: column; position: relative; overflow: hidden;
}
.auth-aside::after {
  content:""; position:absolute; right:-120px; bottom:-120px; width: 360px; height:360px; border-radius:50%;
  background: radial-gradient(circle, rgba(95,224,160,.18), transparent 65%);
}
.auth-aside .a-foot { margin-top: auto; }
.auth-aside h2 { color: #fff; font-size: 26px; font-weight: 700; letter-spacing: -.02em; max-width: 380px; line-height: 1.2; }
.auth-aside p { color: #9fb1ce; font-size: 14px; max-width: 380px; margin-top: 12px; }
.auth-aside .a-points { margin-top: 28px; display: grid; gap: 12px; }
.auth-aside .a-points div { display: flex; align-items: center; gap: 10px; font-size: 13.5px; color: #c7d4e7; }
.auth-aside .a-points svg { width: 18px; height: 18px; color: #5fe0a0; flex: none; }
.auth-main { display: grid; place-items: center; padding: 44px; background: var(--surface); }
.auth-card { width: min(380px, 100%); }
.auth-card h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.auth-card .sub { color: var(--text-2); font-size: 14px; margin: 6px 0 26px; }

/* ============================================================
   ALERTS / FEEDBACK
   ============================================================ */
.alert { display: flex; gap: 10px; padding: 11px 13px; border-radius: var(--r-sm); font-size: 13px; align-items: flex-start; }
.alert svg { width: 17px; height: 17px; flex: none; margin-top: 1px; }
.alert-error { background: var(--danger-weak); color: var(--danger-ink); border: 1px solid #efcecb; }
.alert-ok { background: var(--ok-weak); color: var(--ok-ink); border: 1px solid #c9e6d4; }
.alert-info { background: var(--info-weak); color: var(--info); border: 1px solid #c9e1f0; }
.feedback { min-height: 18px; font-size: 13px; color: var(--text-2); }
.feedback.error { color: var(--danger-ink); }

/* ============================================================
   UTILITIES
   ============================================================ */
.hidden { display: none !important; }
.stack { display: grid; gap: 20px; }
.stack-sm { display: grid; gap: 12px; }
.row { display: flex; gap: 10px; align-items: center; }
.row-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-form { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; align-items: end; }
.span-2 { grid-column: span 2; }
.divide { height: 1px; background: var(--border); }

/* ============================================================
   PROJECTION (self-service borne, light, ultra simple)
   ============================================================ */
body.project {
  background:
    radial-gradient(900px 500px at 50% -10%, rgba(31,77,156,.10), transparent 60%),
    var(--bg);
}

.pj { min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 28px 20px 40px; }
.pj-top { width: min(560px,100%); display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.pj-exit { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.pj-exit:hover { color: var(--text); }

.pj-card { width: min(560px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); box-shadow: var(--sh-lg); overflow: hidden; }
.pj-head { padding: 26px 32px 0; }
.pj-head .eyebrow { margin-bottom: 8px; }
.pj-head h1 { font-size: 25px; font-weight: 700; letter-spacing: -.01em; }
.pj-head p { font-size: 15px; color: var(--text-2); margin-top: 8px; }

/* Stepper */
.stepper { display: flex; align-items: center; gap: 0; padding: 22px 32px 4px; }
.stepper .st { display: flex; align-items: center; gap: 8px; flex: none; }
.stepper .st .num { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12.5px; font-weight: 700; background: var(--surface-3); color: var(--text-3); border: 1px solid var(--border); transition: all .2s ease; }
.stepper .st .lbl { font-size: 12.5px; font-weight: 600; color: var(--text-3); }
.stepper .bar { flex: 1; height: 2px; background: var(--border); margin: 0 8px; border-radius: 2px; min-width: 10px; }
.stepper .st.active .num { background: var(--primary); color: #fff; border-color: var(--primary); }
.stepper .st.active .lbl { color: var(--text); }
.stepper .st.done .num { background: var(--ok-weak); color: var(--ok-ink); border-color: #c9e6d4; }
.stepper .st.done .lbl { color: var(--text-2); }
.stepper .bar.fill { background: var(--ok); }

.pj-body { padding: 8px 32px 30px; }
.step-card .lede { font-size: 14.5px; color: var(--text-2); margin-bottom: 20px; }

.field-lg { display: grid; gap: 9px; margin-bottom: 18px; }
.field-lg .label { font-size: 13px; font-weight: 600; color: var(--text-2); }
.field-lg .input, .field-lg .select { height: 54px; font-size: 16px; border-radius: var(--r-md); padding: 0 16px; }
.field-lg .select { padding-right: 40px; background-position: right 14px center; }

/* big OTP-style code input */
#pairing-input {
  height: 76px; width: 100%; text-align: center;
  font-family: var(--mono); font-size: 40px; font-weight: 600; letter-spacing: .42em;
  color: var(--text); border: 1.5px solid var(--border-strong); border-radius: var(--r-lg);
  background: var(--surface-2); padding-left: .42em;
}
#pairing-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-weak); background: var(--surface); }

.code-hint { display:flex; align-items:center; gap:10px; padding:13px 15px; background:var(--info-weak); border:1px solid #cfe3f3; border-radius:var(--r-md); font-size:13.5px; color:var(--info); margin-bottom:18px; }
.code-hint svg { width:18px; height:18px; flex:none; }
#code-timer { font-size: 13px; color: var(--text-3); text-align: center; margin: 14px 0 4px; font-family: var(--mono); }

.room-chip { display: flex; align-items: center; gap: 13px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 22px; }
.room-chip .rc-ico { width: 40px; height: 40px; border-radius: 10px; background: var(--primary-weak); color: var(--primary); display: grid; place-items: center; flex: none; }
.room-chip .rc-ico svg { width: 20px; height: 20px; }
.room-chip .rc-meta b { font-size: 15px; font-weight: 600; display: block; }
.room-chip .rc-meta span { font-size: 13px; color: var(--text-3); }
.room-chip .rc-ok { margin-left: auto; }

#selected-room-label { font-size: 14px; color: var(--text-2); margin-bottom: 18px; }
#session-message, #projection-message { font-size: 15px; color: var(--text-2); margin-bottom: 20px; }

.pj-icon-lg { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; margin-bottom: 18px; }
.pj-icon-lg svg { width: 30px; height: 30px; }
.pj-icon-lg.green { background: var(--ok-weak); color: var(--ok-ink); }
.pj-icon-lg.blue { background: var(--primary-weak); color: var(--primary); }

#preview { width: 100%; aspect-ratio: 16/9; border-radius: var(--r-md); background: #0b1322; margin: 0 0 18px; object-fit: cover; border: 1px solid var(--border); }
.live-row { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; font-size: 13.5px; font-weight: 600; color: var(--danger-ink); }
.live-row .d { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); position: relative; }
.live-row .d::after { content:""; position:absolute; inset:-4px; border-radius:50%; border:1.5px solid var(--danger); opacity:.5; animation: ping 1.8s ease-out infinite; }

/* ---------- Step 0 — site / room card picker ---------- */
.site-picker { display:grid; gap:12px; margin-bottom:20px; }
.site-block { border:1px solid var(--border); border-radius:var(--r-md); background:var(--surface); overflow:hidden; transition:border-color .15s, box-shadow .15s; }
.site-block.open { border-color:var(--primary); box-shadow:0 0 0 3px var(--primary-weak); }
.site-head { display:flex; align-items:center; gap:14px; padding:15px 16px; cursor:pointer; user-select:none; }
.site-head:hover { background:var(--surface-2); }
.site-ico { width:44px; height:44px; border-radius:12px; background:var(--surface-3); color:var(--text-2); display:grid; place-items:center; flex:none; transition:background .15s, color .15s; }
.site-block.open .site-ico { background:var(--primary-weak); color:var(--primary); }
.site-ico svg { width:22px; height:22px; }
.site-meta { flex:1; min-width:0; }
.site-meta b { font-size:15px; font-weight:600; display:block; }
.site-meta span { font-size:13px; color:var(--text-3); }
.site-avail { font-size:12px; font-weight:600; color:var(--ok-ink); background:var(--ok-weak); padding:3px 10px; border-radius:999px; white-space:nowrap; }
.site-chev { color:var(--text-3); flex:none; transition:transform .2s, color .2s; }
.site-chev svg { width:18px; height:18px; display:block; }
.site-block.open .site-chev { transform:rotate(90deg); color:var(--primary); }
.room-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:4px 16px 16px; }
.site-block:not(.open) .room-grid { display:none; }
.room-card { display:flex; align-items:center; gap:11px; padding:12px 13px; border:1.5px solid var(--border); border-radius:var(--r-md); cursor:pointer; background:var(--surface-2); transition:border-color .14s, background .14s, transform .06s; }
.room-card:hover { border-color:var(--border-strong); background:var(--surface); }
.room-card:active { transform:scale(.99); }
.room-card.sel { border-color:var(--primary); background:var(--primary-weak); }
.rk-ico { width:34px; height:34px; border-radius:9px; background:var(--surface); border:1px solid var(--border); display:grid; place-items:center; color:var(--text-2); flex:none; transition:background .14s, border-color .14s, color .14s; }
.room-card.sel .rk-ico { background:var(--primary); border-color:var(--primary); color:#fff; }
.rk-ico svg { width:16px; height:16px; }
.rk-meta { min-width:0; flex:1; }
.rk-meta b { font-size:13.5px; font-weight:600; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rk-meta span { font-size:11.5px; color:var(--text-3); }
.rk-check { margin-left:auto; width:20px; height:20px; border-radius:50%; border:1.5px solid var(--border-strong); display:grid; place-items:center; flex:none; color:transparent; transition:all .14s; }
.room-card.sel .rk-check { background:var(--primary); border-color:var(--primary); color:#fff; }
.rk-check svg { width:11px; height:11px; }

/* ---------- Step 4 — live banner ---------- */
.live-banner { display:flex; align-items:center; gap:10px; padding:11px 14px; border-radius:var(--r-md); font-size:13.5px; font-weight:600; margin-bottom:16px; background:var(--info-weak); color:var(--info); border:1px solid #cfe3f3; }
.live-banner .d { width:9px; height:9px; border-radius:50%; background:currentColor; position:relative; flex:none; }
.live-banner .d::after { content:""; position:absolute; inset:-4px; border-radius:50%; border:1.5px solid currentColor; opacity:.5; animation:ping 1.8s ease-out infinite; }
.live-banner.me   { background:var(--ok-weak);    color:var(--ok-ink);  border-color:#c9e6d4; }
.live-banner.idle { background:var(--surface-3);  color:var(--text-2);  border-color:var(--border); }
.live-banner.idle .d::after { animation:none; }

/* ---------- Step 4 — self preview ---------- */
#preview { margin-bottom:0; }
.self-preview { position:relative; margin-bottom:18px; }
.sp-tag { position:absolute; left:10px; bottom:10px; font-size:11.5px; font-weight:600; color:#fff; background:rgba(0,0,0,.6); padding:3px 9px; border-radius:999px; }

/* ---------- Step 4 — action buttons ---------- */
.present-controls { display:grid; gap:10px; margin-bottom:16px; }

/* ---------- Step 4 — roster ---------- */
.roster { border:1px solid var(--border); border-radius:var(--r-md); margin-bottom:16px; overflow:hidden; }
.roster-head { display:flex; align-items:center; justify-content:space-between; padding:10px 14px; background:var(--surface-2); border-bottom:1px solid var(--border); }
.roster-head h3 { font-size:13px; font-weight:600; color:var(--text-2); }
.roster-count { font-size:12px; font-weight:600; color:var(--text-3); background:var(--surface-3); border-radius:999px; padding:1px 8px; }
#presenter-list { list-style:none; margin:0; padding:6px; display:grid; gap:2px; }
#presenter-list li { display:flex; align-items:center; gap:11px; padding:8px; border-radius:var(--r-sm); }
#presenter-list li.live { background:var(--info-weak); }
.p-av { width:34px; height:34px; border-radius:50%; display:grid; place-items:center; font-size:12.5px; font-weight:700; color:#fff; flex:none; }
.p-meta { min-width:0; flex:1; }
.p-name { font-size:14px; font-weight:600; }
.p-sub { font-size:12px; color:var(--text-3); }
.p-right { margin-left:auto; flex:none; }
.ppending { font-size:12.5px; color:var(--warn-ink); font-weight:600; display:inline-flex; align-items:center; gap:6px; }

/* ---------- Invite toast (incoming) ---------- */
.invite-toast { position:fixed; left:50%; top:18px; transform:translateX(-50%); z-index:90; width:min(420px,calc(100% - 28px)); background:var(--surface); border:1px solid var(--border); border-radius:var(--r-lg); box-shadow:var(--sh-lg); padding:15px 16px; display:flex; gap:13px; align-items:flex-start; animation:itin .25s ease; }
@keyframes itin { from{opacity:0;transform:translate(-50%,-14px);}to{opacity:1;transform:translate(-50%,0);} }
.it-av { width:42px; height:42px; border-radius:12px; display:grid; place-items:center; font-size:14px; font-weight:700; color:#fff; flex:none; }
.it-body { flex:1; }
.it-title { font-size:14px; font-weight:600; }
.it-title b { color:var(--primary); }
.it-body p { font-size:13px; color:var(--text-2); margin:2px 0 12px; }
.it-actions { display:flex; gap:8px; }

/* ---------- Mini toast ---------- */
.mini-toast { position:fixed; left:50%; bottom:24px; transform:translateX(-50%); z-index:88; background:var(--text); color:#fff; font-size:13px; font-weight:500; padding:10px 16px; border-radius:999px; box-shadow:var(--sh-lg); display:flex; align-items:center; gap:9px; animation:itin .2s ease; }
.mini-toast svg { width:15px; height:15px; color:var(--ok); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1080px) {
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .land-cards { grid-template-columns: 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}
@media (max-width: 860px) {
  .admin-layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: 248px; z-index: 60; transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; box-shadow: var(--sh-lg); }
  .grid-form { grid-template-columns: 1fr 1fr; }
  .scrim { position: fixed; inset: 0; background: rgba(8,16,30,.45); z-index: 55; }
  [style*="grid-template-columns:1fr 320px"] { grid-template-columns: 1fr !important; }
}
@media (max-width: 560px) {
  .metric-grid { grid-template-columns: 1fr; }
  .grid-2, .grid-form { grid-template-columns: 1fr; }
  .admin-content { padding: 16px; }
  .page-head { flex-direction: column; align-items: stretch; }
}
@media (max-width: 520px) {
  .stepper .st .lbl { display: none; }
  .pj-head, .pj-body, .stepper { padding-left: 22px; padding-right: 22px; }
}

/* menu toggle (mobile) */
.menu-toggle { display: none; }
@media (max-width: 860px) { .menu-toggle { display: grid; } }
