/* ATH Availability – Asset Tree Homes brand: navy #28316F, gold #F4AA1C, grey #4E4E4E */
:root {
  --navy: #28316F; --navy-2: #1E2557; --navy-3: #3A4590; --navy-soft: #E7E9F4; --navy-tint: #F1F2F9;
  --gold: #F4AA1C; --gold-2: #D98F00; --gold-soft: #FEF3DA; --gold-ink: #6E4700;
  --grey: #4E4E4E;
  --bg: #F4F5FA; --surface: #FFFFFF; --surface-2: #EEF0F7; --line: #DCDFEE; --line-2: #C9CDE2;
  --ink: #1B1F3B; --muted: #5E6380;
  --avail: #1E8A4C; --avail-bg: #E2F3E9; --avail-ink: #0E5A2E;
  --booked-bg: #ECEEF5; --booked-ink: #6B7090; --hatch: #DDE0EC;
  --warn: #C2362B; --warn-bg: #FBE7E5;
  --radius: 12px; --radius-sm: 8px;
  --shadow-1: 0 1px 2px rgba(27,31,59,.06), 0 1px 1px rgba(27,31,59,.04);
  --shadow-2: 0 8px 24px rgba(27,31,59,.10), 0 2px 6px rgba(27,31,59,.06);
  --shadow-3: 0 24px 60px rgba(20,24,60,.28);
  --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.2,.7,.2,1);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 400 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; text-wrap: balance; }
a { color: var(--navy); }
.num, td, .kpi b, .pcard .cnt, .tile { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: var(--navy); color: #fff; box-shadow: 0 2px 10px rgba(20,24,60,.25); }
.topbar::after { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--gold), #FFC85A 50%, var(--gold)); background-size: 200% 100%; animation: goldflow 8s linear infinite; }
.topbar .in { max-width: 1480px; margin: 0 auto; padding: 10px max(16px, 2.5vw); display: flex; align-items: center; gap: 14px 20px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; text-decoration: none; color: inherit; }
.brand img { height: 38px; width: auto; display: block; }
.brand .ttl { display: grid; line-height: 1.2; border-left: 1px solid rgba(255,255,255,.25); padding-left: 14px; }
.brand .ttl b { font-size: 16px; font-weight: 600; }
.brand .ttl small { font-size: 11.5px; color: rgba(255,255,255,.72); }
.topbar .grow { flex: 1; }
.search { position: relative; }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); opacity: .7; pointer-events: none; }
.search input { width: min(300px, 70vw); padding: 8px 12px 8px 34px; border-radius: 999px; border: 1px solid rgba(255,255,255,.22); background: rgba(255,255,255,.1); color: #fff; outline: none; transition: background .2s, border-color .2s, width .3s var(--ease); }
.search input::placeholder { color: rgba(255,255,255,.65); }
.search input:focus { background: #fff; color: var(--ink); border-color: var(--gold); }
.search input:focus + .kbd { opacity: 0; }
.search .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 11px; padding: 1px 6px; border-radius: 5px; border: 1px solid rgba(255,255,255,.3); color: rgba(255,255,255,.7); pointer-events: none; transition: opacity .2s; }
.search input:focus ~ svg { color: var(--navy); }
.me { display: flex; align-items: center; gap: 8px; }
.me .who { display: grid; text-align: right; line-height: 1.2; font-size: 12.5px; }
.me .who small { color: rgba(255,255,255,.7); font-size: 11px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--gold); color: var(--navy-2); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.role { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; }
.role.admin { background: var(--gold); color: var(--navy-2); }
.role.crm { background: #8FE3B0; color: #0B4424; }
.role.viewer { background: rgba(255,255,255,.18); color: #fff; }
.tbtn { border: 1px solid rgba(255,255,255,.28); background: transparent; color: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: 12.5px; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; transition: background .2s, border-color .2s; white-space: nowrap; }
.tbtn:hover { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.5); }
.tbtn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy-2); font-weight: 600; }
.tbtn.gold:hover { background: #FFBE45; }

/* ---------- layout ---------- */
.wrap { max-width: 1480px; margin: 0 auto; padding: 18px max(16px, 2.5vw) 48px; display: grid; gap: 16px; }
.live { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: 12.5px; color: var(--muted); }
.live b { color: var(--ink); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--avail); margin-right: 7px; vertical-align: 1px; position: relative; }
.dot::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid var(--avail); opacity: 0; animation: ping 2.4s var(--ease) infinite; }
.dot.warn { background: var(--gold); } .dot.warn::after { border-color: var(--gold); }
.dot.off { background: #A6AAC0; } .dot.off::after { display: none; }
.viewonly { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: var(--navy-soft); color: var(--navy); font-weight: 500; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; display: grid; gap: 1px; box-shadow: var(--shadow-1); position: relative; overflow: hidden; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--navy); opacity: .9; }
.kpi span { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.kpi b { font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.kpi small { color: var(--muted); font-size: 11.5px; }
.kpi.k-avail::before { background: var(--avail); } .kpi.k-avail b { color: var(--avail); }
.kpi.k-gold::before { background: var(--gold); }
.kpi.k-warn::before { background: var(--warn); } .kpi.k-warn b { color: var(--warn); }
.kpi a { color: inherit; }

/* ---------- project cards ---------- */
.pcards { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 10px; }
.pcard { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 11px 12px 12px; cursor: pointer; display: grid; gap: 3px; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s, background .2s; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms + 150ms); }
.pcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.pcard[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; box-shadow: 0 10px 24px rgba(40,49,111,.3); }
.pcard .nm { font-weight: 600; font-size: 13.5px; line-height: 1.25; }
.pcard .kd { font-size: 11px; color: var(--muted); }
.pcard[aria-pressed="true"] .kd, .pcard[aria-pressed="true"] .cnt { color: rgba(255,255,255,.8); }
.pcard .cnt { font-size: 12px; color: var(--muted); margin-top: 4px; }
.pcard .cnt b { color: var(--avail); font-size: 15px; font-weight: 600; }
.pcard[aria-pressed="true"] .cnt b { color: #8FE3B0; }
.bar { display: flex; height: 6px; border-radius: 99px; overflow: hidden; background: var(--surface-2); margin-top: 4px; }
.bar i { display: block; height: 100%; transform-origin: left; animation: grow .9s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms + 300ms); }
.bar .b-a { background: var(--avail); } .bar .b-m { background: var(--gold); } .bar .b-b { background: #B5BAD3; }
.pcard[aria-pressed="true"] .bar { background: rgba(255,255,255,.18); }
.pcard[aria-pressed="true"] .bar .b-b { background: rgba(255,255,255,.4); }

/* ---------- filters ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; box-shadow: var(--shadow-1); }
.fg { display: flex; align-items: center; gap: 8px; }
.lbl, .fg label { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 9px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 5px 10px; border-radius: 7px; cursor: pointer; font-size: 12.5px; color: var(--muted); transition: background .2s, color .2s, box-shadow .2s; white-space: nowrap; }
.seg button:hover { color: var(--ink); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--navy); font-weight: 600; box-shadow: var(--shadow-1); }
select, .inp { border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--radius-sm); padding: 7px 10px; font-size: 13px; outline: none; transition: border-color .2s, box-shadow .2s; min-width: 0; }
select:focus, .inp:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(40,49,111,.14); }
.clear { border: 0; background: none; color: var(--navy); text-decoration: underline; cursor: pointer; font-size: 12.5px; padding: 4px; }
.fg.view { margin-left: auto; }

/* ---------- buttons ---------- */
.btn { border: 1px solid var(--navy); background: var(--navy); color: #fff; border-radius: 9px; padding: 9px 15px; cursor: pointer; font-weight: 500; font-size: 13px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; transition: transform .15s var(--ease), box-shadow .2s, background .2s; text-decoration: none; }
.btn:hover { background: var(--navy-3); box-shadow: 0 6px 16px rgba(40,49,111,.25); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: var(--navy-2); }
.btn.gold:hover { background: #FFBE45; box-shadow: 0 6px 16px rgba(244,170,28,.35); }
.btn.ghost { background: var(--surface); color: var(--navy); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--navy-tint); box-shadow: none; }
.btn.danger { background: var(--surface); color: var(--warn); border-color: #EBC0BB; }
.btn.danger:hover { background: var(--warn-bg); box-shadow: none; }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn .spin { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.lnk { border: 0; background: none; padding: 0; color: var(--navy); text-decoration: underline; cursor: pointer; font: inherit; }

/* ---------- main layout ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 16px; align-items: start; }
.main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; min-width: 0; }
.panel { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 14px; box-shadow: var(--shadow-1); scrollbar-width: thin; }
.panel > * { animation: fadein .35s var(--ease) both; }
.panel > *:nth-child(2) { animation-delay: 40ms; } .panel > *:nth-child(3) { animation-delay: 80ms; } .panel > *:nth-child(4) { animation-delay: 120ms; }
.panel .close-sheet { display: none; }

/* project section */
.psec { min-width: 0; max-width: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px 16px; box-shadow: var(--shadow-1); animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
.psec > header { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.psec h2 { font-size: 17px; color: var(--navy); }
.psec .meta { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.psec .meta b { color: var(--avail); }
.psettings { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 10px; }
.psettings span { font-size: 11.5px; background: var(--navy-tint); color: var(--navy); border-radius: 999px; padding: 2px 9px; }
.psettings .ns { background: transparent; color: var(--muted); padding: 0; }
.psettings span:has(.ns) { background: var(--surface-2); }
.scroll { overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }

/* elevation grid */
.elev { display: grid; gap: 6px; align-items: stretch; width: max-content; }
.colh { text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; }
.fl { font-size: 11px; color: var(--muted); align-self: center; white-space: nowrap; }
.gap { border-radius: 8px; background: repeating-linear-gradient(45deg, transparent 0 5px, var(--surface-2) 5px 6px); min-height: 56px; }
.ground { grid-column: 2 / -1; height: 5px; border-radius: 3px; background: linear-gradient(90deg, var(--navy), var(--navy-3)); opacity: .8; }
.blocks { display: flex; flex-wrap: wrap; gap: 18px 28px; }
.blk h3 { font-size: 13px; margin-bottom: 6px; color: var(--ink); }
.blk h3 small { font-weight: 400; color: var(--muted); font-size: 11.5px; margin-left: 4px; }
.plots { display: grid; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); gap: 6px; }

/* tiles */
.tile { position: relative; width: 74px; min-height: 56px; border-radius: 8px; border: 1px solid transparent; padding: 5px 6px 4px; display: grid; align-content: start; gap: 0; text-align: left; cursor: pointer; font-size: 10.5px; line-height: 1.25;
  transition: transform .18s var(--ease), box-shadow .18s, opacity .25s, filter .25s; animation: tilein .4s var(--ease) both; animation-delay: calc(var(--d, 0) * 8ms); }
.plots .tile { width: auto; }
.tile .tu { font-weight: 600; font-size: 13px; }
.tile .tm, .tile .ts { opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile:hover { transform: translateY(-2px) scale(1.03); box-shadow: var(--shadow-2); z-index: 2; }
.tile.st-AVAILABLE { background: var(--avail-bg); border-color: #9ED4B3; color: var(--avail-ink); }
.tile.st-AVAILABLE::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 0 3px 3px 0; background: var(--avail); }
.tile.st-BOOKED { background: var(--booked-bg) repeating-linear-gradient(135deg, transparent 0 6px, rgba(255,255,255,.55) 6px 8px); border-color: var(--line); color: var(--booked-ink); }
.tile.st-BLOCKED { background: var(--gold-soft); border-color: #F4C76B; color: var(--gold-ink); }
.tile.verify { outline: 2px dashed var(--warn); outline-offset: 1px; }
.tile.dim { opacity: .22; filter: saturate(.3); }
.tile.dim:hover { opacity: .7; }
.tile.sel { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--navy); transform: translateY(-2px); z-index: 3; }
.tile .tag { position: absolute; top: 3px; right: 3px; font-size: 8.5px; font-weight: 700; letter-spacing: .03em; padding: 1px 4px; border-radius: 4px; background: var(--gold); color: var(--navy-2); }
.tile .tag.nov { background: var(--navy); color: #fff; }
.tile.flash { animation: flash 1.6s var(--ease) 2; }

/* legend */
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 13px; height: 13px; border-radius: 4px; vertical-align: -2px; margin-right: 6px; border: 1px solid transparent; }
.l-a { background: var(--avail-bg); border-color: #9ED4B3 !important; } .l-b { background: var(--booked-bg); border-color: var(--line) !important; }
.l-m { background: var(--gold-soft); border-color: #F4C76B !important; } .l-n { background: var(--navy); } .l-v { outline: 2px dashed var(--warn); outline-offset: -2px; }

/* ---------- panel content ---------- */
.eyebrow { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); font-weight: 600; }
.muted { color: var(--muted); font-size: 12.5px; margin: 0; }
.panel h3 { font-size: 18px; color: var(--navy); }
.back { border: 0; background: none; color: var(--navy); cursor: pointer; padding: 0; font-size: 12.5px; justify-self: start; display: inline-flex; gap: 6px; align-items: center; }
.back:hover { text-decoration: underline; }
.unit-head { display: grid; gap: 4px; padding: 12px 14px; border-radius: 10px; background: linear-gradient(135deg, var(--navy), var(--navy-3)); color: #fff; position: relative; overflow: hidden; }
.unit-head::after { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 24px; background: var(--gold); opacity: .18; transform: rotate(20deg); }
.unit-head .eyebrow { color: rgba(255,255,255,.75); }
.unit-head .big { font-size: 28px; font-weight: 600; line-height: 1.1; }
.unit-head .sub { font-size: 12.5px; color: rgba(255,255,255,.82); }
.pill { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.pill.st-AVAILABLE { background: var(--avail-bg); color: var(--avail-ink); border-color: #9ED4B3; }
.pill.st-BOOKED { background: var(--booked-bg); color: var(--booked-ink); border-color: var(--line); }
.pill.st-BLOCKED { background: var(--gold-soft); color: var(--gold-ink); border-color: #F4C76B; }
.pill.chk { background: var(--warn-bg); color: var(--warn); }
.pill.navy { background: var(--navy-soft); color: var(--navy); }
.unit-head .pill { border-color: rgba(255,255,255,.4); }
.note { font-size: 12.5px; background: var(--warn-bg); color: #8A231B; border-radius: 9px; padding: 9px 11px; border-left: 3px solid var(--warn); }
.note.info { background: var(--navy-tint); color: var(--navy); border-left-color: var(--navy); }
.note.gold { background: var(--gold-soft); color: var(--gold-ink); border-left-color: var(--gold); }
.price { display: grid; gap: 6px; }
.price > .v { font-size: 26px; font-weight: 600; color: var(--navy); letter-spacing: -.02em; }
.cost { display: grid; grid-template-columns: 1fr auto; gap: 7px 12px; font-size: 13px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--navy-tint); }
.cost .k small { display: block; color: var(--muted); font-size: 11.5px; }
.cost .v { text-align: right; white-space: nowrap; }
.cost .tot { font-weight: 700; padding-top: 7px; border-top: 1px solid var(--line-2); color: var(--navy); font-size: 14px; }
.cost .ns { color: var(--muted); font-style: italic; }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; margin: 0; font-size: 13px; }
.specs dt { color: var(--muted); } .specs dd { margin: 0; font-weight: 500; }
.bkinfo { display: grid; gap: 2px; font-size: 12.5px; padding: 9px 11px; border-radius: 9px; background: var(--surface-2); border-left: 3px solid var(--navy); }
.bkinfo.cx { opacity: .7; border-left-color: var(--warn); }
.bkinfo .acts { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.mix { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.mix th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11.5px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.mix td { padding: 4px 0; border-bottom: 1px solid var(--surface-2); }
.mix .ph td { font-weight: 600; color: var(--navy); padding-top: 9px; }
.r { text-align: right; }

/* forms */
.form { display: grid; gap: 9px; padding: 13px; border-radius: 11px; border: 1px solid var(--line); background: var(--surface); }
.form.crm { border-color: #9ED4B3; background: linear-gradient(180deg, #F2FAF5, var(--surface) 60%); }
.form.adm { border-color: #F4C76B; background: linear-gradient(180deg, #FFFAEE, var(--surface) 60%); }
.form h4 { font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
.form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.hint { font-size: 11.5px; color: var(--muted); margin: 0; }
details.form > summary { cursor: pointer; list-style: none; font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; }
details.form > summary::-webkit-details-marker { display: none; }
details.form > summary::after { content: "▸"; margin-left: auto; transition: transform .2s; color: var(--muted); }
details.form[open] > summary::after { transform: rotate(90deg); }
details.form[open] > summary { margin-bottom: 4px; }
.chg { display: grid; grid-template-columns: 1.5fr 1fr .9fr auto auto; gap: 6px; align-items: center; animation: fadein .25s var(--ease); }
.chg .gstbox { display: flex; gap: 4px; align-items: center; font-size: 12px; color: var(--muted); white-space: nowrap; }
.iconbtn { border: 1px solid var(--line); background: var(--surface); border-radius: 7px; padding: 6px 9px; cursor: pointer; font-size: 12px; color: var(--warn); }
.sec-h { font-weight: 600; font-size: 12.5px; margin-top: 4px; color: var(--ink); }
.stpick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.stpick button { border: 1.5px solid var(--line); background: var(--surface); border-radius: 9px; padding: 8px 6px; cursor: pointer; font-size: 12.5px; font-weight: 600; transition: all .18s var(--ease); }
.stpick button[data-v="AVAILABLE"][aria-pressed="true"] { background: var(--avail-bg); border-color: var(--avail); color: var(--avail-ink); }
.stpick button[data-v="BOOKED"][aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.stpick button[data-v="BLOCKED"][aria-pressed="true"] { background: var(--gold-soft); border-color: var(--gold); color: var(--gold-ink); }
.stpick button:disabled { opacity: .45; cursor: not-allowed; }
.stpick button.cur::after { content: " · now"; font-weight: 400; opacity: .7; }
.bkfields { display: grid; gap: 9px; animation: fadein .3s var(--ease); }
.check { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--ink); }
.check input { margin-top: 3px; }

/* ---------- tables ---------- */
.tablewrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); max-height: 70vh; box-shadow: var(--shadow-1); }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
thead th { position: sticky; top: 0; background: var(--navy); color: #fff; font-weight: 500; text-align: left; white-space: nowrap; z-index: 1; padding: 0; }
thead th button { border: 0; background: none; color: inherit; padding: 9px 10px; cursor: pointer; font: inherit; width: 100%; text-align: inherit; }
thead th.r button { text-align: right; }
thead th[aria-sort] { background: var(--navy-3); }
tbody td { padding: 8px 10px; border-bottom: 1px solid var(--surface-2); vertical-align: top; }
tbody tr { transition: background .15s; }
tbody tr[data-act] { cursor: pointer; }
tbody tr:hover { background: var(--navy-tint); }
tbody tr.sel { background: var(--gold-soft); }
tbody tr.cx td { opacity: .6; text-decoration: line-through; text-decoration-color: rgba(194,54,43,.5); }
tbody tr.cx td:last-child { text-decoration: none; }
td.sub, .sub { color: var(--muted); }
td .u { font-weight: 600; color: var(--navy); }
td.nw { white-space: nowrap; }
.foot { font-size: 11.5px; color: var(--muted); margin: 0; line-height: 1.55; }
.empty { padding: 28px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); }

/* ---------- sections below ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 12px; box-shadow: var(--shadow-1); }
.card > header { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; }
.card h2 { font-size: 17px; color: var(--navy); }
.card .tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tallies { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--ink); }
.chip:first-child { background: transparent; color: var(--muted); padding-left: 0; }
.chip b { color: var(--navy); }
.eff { font-size: 12px; color: var(--muted); }
.eff.chg { color: var(--avail); font-weight: 600; }
.eff.warn { color: var(--warn); font-weight: 600; }
.checks ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13px; }
.checks li { padding-left: 4px; }
.checks li.done { color: var(--muted); text-decoration: line-through; }
.checks .kind { margin-right: 6px; }

/* ---------- toast & dialogs ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 160%); opacity: 0; visibility: hidden; transition: transform .35s var(--ease), opacity .25s, visibility .35s; background: var(--navy-2); color: #fff; padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow-3); z-index: 100; font-size: 13.5px; max-width: min(560px, 92vw); display: flex; gap: 10px; align-items: center; border-left: 4px solid var(--gold); }
.toast.on { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.toast.err { border-left-color: #FF7A6E; }
.toast.ok { border-left-color: #43C07B; }
.dlg { position: fixed; inset: 0; background: rgba(20,24,60,.48); backdrop-filter: blur(3px); display: none; place-items: center; z-index: 80; padding: 16px; }
.dlg.on { display: grid; animation: fadein .2s ease both; }
.dlg > div { background: var(--surface); border-radius: 16px; padding: 20px; width: min(620px, 100%); max-height: 90vh; overflow: auto; display: grid; gap: 12px; box-shadow: var(--shadow-3); animation: pop .3s var(--ease) both; }
.dlg textarea { width: 100%; min-height: 220px; font: 12px/1.5 ui-monospace, Menlo, monospace; border: 1px solid var(--line-2); border-radius: 8px; padding: 8px; }
.dlg h3 { font-size: 17px; color: var(--navy); }

/* ---------- skeleton ---------- */
.sk { background: linear-gradient(90deg, var(--surface-2) 25%, #F8F9FD 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s linear infinite; border-radius: 10px; }

/* ---------- sign-in ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: radial-gradient(1200px 600px at 10% -10%, #3A4590 0%, transparent 60%), radial-gradient(900px 500px at 110% 110%, rgba(244,170,28,.35) 0%, transparent 55%), var(--navy-2); position: relative; overflow: hidden; }
.auth .grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(circle at 50% 40%, #000 0%, transparent 70%); animation: drift 30s linear infinite; }
.auth .blocks-bg { position: absolute; left: 0; right: 0; bottom: 0; height: 38vh; display: flex; align-items: flex-end; justify-content: center; gap: 10px; opacity: .22; pointer-events: none; }
.auth .blocks-bg i { display: block; width: 46px; background: linear-gradient(180deg, #fff, rgba(255,255,255,.3)); border-radius: 6px 6px 0 0; transform-origin: bottom; animation: build 1.4s var(--ease) both; animation-delay: calc(var(--i) * 90ms); }
.auth .blocks-bg i.g { background: linear-gradient(180deg, var(--gold), rgba(244,170,28,.3)); }
.authcard { position: relative; width: min(420px, 100%); background: var(--surface); border-radius: 20px; padding: 28px 26px 24px; box-shadow: var(--shadow-3); display: grid; gap: 16px; animation: pop .55s var(--ease) both; }
.authcard::before { content: ""; position: absolute; left: 24px; right: 24px; top: 0; height: 4px; border-radius: 0 0 4px 4px; background: var(--gold); }
.authcard img { height: 54px; justify-self: start; }
.authcard h1 { font-size: 21px; color: var(--navy); }
.authcard p { margin: 0; color: var(--muted); font-size: 13px; }
.authcard label { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.authcard .inp { padding: 11px 13px; font-size: 14.5px; border-radius: 10px; }
.authcard .btn { padding: 12px; font-size: 14px; border-radius: 10px; }
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input { text-align: center; font-size: 22px; font-weight: 600; padding: 10px 0; border-radius: 10px; border: 1.5px solid var(--line-2); outline: none; transition: border-color .15s, box-shadow .15s, transform .15s; width: 100%; }
.otp input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(40,49,111,.15); transform: translateY(-1px); }
.otp.shake { animation: shake .4s; }
.otp.good input { border-color: var(--avail); background: var(--avail-bg); }
.auth .msg { font-size: 12.5px; min-height: 18px; }
.auth .msg.err { color: var(--warn); }
.auth .msg.ok { color: var(--avail); }
.auth .alt { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.auth .foot2 { text-align: center; color: rgba(255,255,255,.6); font-size: 11.5px; position: absolute; bottom: 14px; left: 0; right: 0; }
.step { animation: slidein .35s var(--ease) both; display: grid; gap: 14px; }

/* loader */
.loader { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 90; transition: opacity .4s; }
.loader.out { opacity: 0; pointer-events: none; }
.loader .lg { display: grid; justify-items: center; gap: 14px; }
.loader img { height: 56px; animation: breathe 1.6s ease-in-out infinite; }
.loader .bars { display: flex; gap: 5px; align-items: flex-end; height: 26px; }
.loader .bars i { width: 7px; background: var(--navy); border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.loader .bars i:nth-child(2) { animation-delay: .12s; background: var(--navy-3); } .loader .bars i:nth-child(3) { animation-delay: .24s; background: var(--gold); } .loader .bars i:nth-child(4) { animation-delay: .36s; }

/* ---------- animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fadein { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes slidein { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: none; } }
@keyframes tilein { from { opacity: 0; transform: translateY(6px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes ping { 0% { opacity: .7; transform: scale(.6); } 80%, 100% { opacity: 0; transform: scale(1.8); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes flash { 0%, 100% { box-shadow: 0 0 0 0 rgba(244,170,28,0); } 30% { box-shadow: 0 0 0 4px rgba(244,170,28,.85), 0 8px 18px rgba(244,170,28,.35); transform: scale(1.06); } }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@keyframes goldflow { to { background-position: -200% 0; } }
@keyframes drift { to { background-position: 44px 44px, 44px 44px; } }
@keyframes build { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes breathe { 50% { transform: scale(1.05); opacity: .85; } }
@keyframes eq { 0%, 100% { height: 8px; } 50% { height: 26px; } }
@keyframes countpulse { 50% { color: var(--gold-2); } }
.bump { animation: countpulse .8s ease; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- responsive ---------- */
@media (max-width: 1280px) { .pcards { grid-template-columns: repeat(4, minmax(0, 1fr)); } .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1060px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; max-height: none; }
  body.unit-open .panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; max-height: 86vh; z-index: 60; border-radius: 18px 18px 0 0; box-shadow: var(--shadow-3); animation: sheet .35s var(--ease) both; padding-top: 10px; }
  body.unit-open .panel .close-sheet { display: block; justify-self: center; width: 44px; height: 5px; border-radius: 3px; background: var(--line-2); border: 0; cursor: pointer; padding: 0; }
  body.unit-open::after { content: ""; position: fixed; inset: 0; background: rgba(20,24,60,.35); z-index: 55; animation: fadein .25s both; }
}
@keyframes sheet { from { transform: translateY(100%); } to { transform: none; } }
@media (max-width: 760px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pcards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi b { font-size: 21px; }
  .brand .ttl small { display: none; }
  .brand img { height: 30px; }
  .me .who { display: none; }
  .topbar .search { order: 5; width: 100%; } .search input { width: 100%; }
  .fg.view { margin-left: 0; }
  .form .row { grid-template-columns: 1fr; }
  .chg { grid-template-columns: 1fr 1fr; }
  .filters { padding: 10px; }
}
@media print {
  .topbar, .filters, .panel, .toast, .live { display: none !important; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  body { background: #fff; }
}

/* after the first paint, live refreshes should not replay entrance animations */
.calm .tile:not(.flash), .calm .psec, .calm .kpi, .calm .pcard, .calm .bar i { animation: none; }

/* ---------- admin panel ---------- */
.adm-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: calc(100vh - 61px); }
.side { background: var(--surface); border-right: 1px solid var(--line); padding: 16px 10px; display: grid; align-content: start; gap: 2px; position: sticky; top: 61px; height: calc(100vh - 61px); overflow: auto; }
.side button { border: 0; background: none; text-align: left; padding: 9px 12px; border-radius: 9px; cursor: pointer; font-size: 13.5px; color: var(--muted); display: flex; gap: 10px; align-items: center; transition: background .15s, color .15s; position: relative; }
.side button:hover { background: var(--navy-tint); color: var(--ink); }
.side button[aria-current="page"] { background: var(--navy); color: #fff; font-weight: 500; }
.side button[aria-current="page"]::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--gold); }
.side .ic { width: 18px; text-align: center; }
.side .badge { margin-left: auto; font-size: 11px; background: var(--warn-bg); color: var(--warn); border-radius: 999px; padding: 0 7px; font-weight: 600; }
.side button[aria-current="page"] .badge { background: var(--gold); color: var(--navy-2); }
.side hr { border: 0; border-top: 1px solid var(--line); margin: 10px 4px; }
.side .sidefoot { font-size: 11px; color: var(--muted); padding: 8px 12px; }
.adm-main { padding: 20px max(16px, 2.2vw) 48px; display: grid; gap: 16px; align-content: start; min-width: 0; }
.adm-main > * { animation: rise .4s var(--ease) both; }
.adm-main > *:nth-child(2) { animation-delay: 50ms; } .adm-main > *:nth-child(3) { animation-delay: 100ms; } .adm-main > *:nth-child(4) { animation-delay: 150ms; }
.pagehead { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: end; justify-content: space-between; }
.pagehead h1 { font-size: 22px; color: var(--navy); }
.pagehead p { margin: 2px 0 0; color: var(--muted); font-size: 13px; max-width: 80ch; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.switch { display: flex; gap: 14px; align-items: flex-start; padding: 12px 0; border-bottom: 1px solid var(--surface-2); }
.switch:last-of-type { border-bottom: 0; }
.switch .txt { flex: 1; display: grid; gap: 2px; }
.switch .txt b { font-weight: 500; }
.switch .txt span { font-size: 12.5px; color: var(--muted); }
.tog { position: relative; width: 44px; height: 24px; flex: none; }
.tog input { opacity: 0; width: 0; height: 0; position: absolute; }
.tog i { position: absolute; inset: 0; background: #C9CDE2; border-radius: 99px; transition: background .2s; cursor: pointer; }
.tog i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; background: #fff; border-radius: 50%; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .25s var(--ease); }
.tog input:checked + i { background: var(--avail); }
.tog input:checked + i::after { transform: translateX(20px); }
.tog input:focus-visible + i { outline: 2px solid var(--gold); outline-offset: 2px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.inline-form label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
.feed { display: grid; gap: 0; }
.feed .it { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: start; padding: 10px 0; border-bottom: 1px solid var(--surface-2); font-size: 13px; }
.feed .it:last-child { border-bottom: 0; }
.feed .it .avatar { width: 30px; height: 30px; font-size: 11.5px; }
.feed .when { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.statline { display: flex; gap: 6px; flex-wrap: wrap; }
.warnbox { background: var(--gold-soft); border: 1px solid #F4C76B; color: var(--gold-ink); border-radius: var(--radius); padding: 12px 14px; font-size: 13px; }
.warnbox code { background: rgba(255,255,255,.7); padding: 1px 6px; border-radius: 5px; }
.rolesel { padding: 4px 8px; font-size: 12.5px; }
@media (max-width: 900px) {
  .adm-shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; }
  .side hr, .side .sidefoot { display: none; }
  .side button { white-space: nowrap; }
  .side button[aria-current="page"]::before { display: none; }
  .grid2 { grid-template-columns: 1fr; }
}

/* ---------- AI ---------- */
.tbtn.ai { background: linear-gradient(135deg, rgba(244,170,28,.25), rgba(255,255,255,.08)); border-color: rgba(244,170,28,.7); position: relative; overflow: hidden; }
.tbtn.ai::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.35) 50%, transparent 70%); transform: translateX(-100%); animation: sheen 3.6s ease-in-out infinite; }
@keyframes sheen { 60%, 100% { transform: translateX(100%); } }
.aidlg { width: min(680px, 100%) !important; }
.aiask { display: flex; gap: 8px; }
.aiask .inp { flex: 1; padding: 11px 13px; font-size: 14.5px; border-radius: 10px; }
.aichips { display: flex; flex-wrap: wrap; gap: 6px; }
.aichips .chip { border: 1px solid var(--line); background: var(--surface); cursor: pointer; padding: 4px 11px; font-size: 12px; color: var(--navy); transition: background .15s, border-color .15s; }
.aichips .chip:first-child { padding-left: 11px; color: var(--navy); }
.aichips .chip:hover { background: var(--navy-tint); border-color: var(--line-2); }
.aians { display: grid; gap: 12px; padding: 14px; border-radius: 12px; background: linear-gradient(135deg, #F6F7FC, #FFFBF1); border: 1px solid var(--line); animation: fadein .35s var(--ease) both; }
.aitxt { font-size: 14px; line-height: 1.6; white-space: pre-wrap; }
.aiunits { display: flex; flex-wrap: wrap; gap: 6px; }
.aiu { display: grid; text-align: left; gap: 0; border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; cursor: pointer; background: var(--surface); font-size: 12px; transition: transform .15s var(--ease), box-shadow .15s; animation: tilein .3s var(--ease) both; }
.aiu:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.aiu span { color: var(--muted); font-size: 11px; }
.aiu.st-AVAILABLE { border-left: 3px solid var(--avail); } .aiu.st-BOOKED { border-left: 3px solid #B5BAD3; } .aiu.st-BLOCKED { border-left: 3px solid var(--gold); }
.aipick { font-size: 12.5px; background: var(--gold-soft); color: var(--gold-ink); border: 1px solid #F4C76B; padding: 4px 10px; border-radius: 999px; }
.aibox { display: grid; gap: 8px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
.aitext { width: 100%; font: 13px/1.5 var(--font); resize: vertical; min-height: 120px; }
.insights { background: linear-gradient(135deg, #FFFFFF 0%, #FFFBF1 100%); border-color: #F4D58F; }
.ins-head { font-size: 16px; font-weight: 600; color: var(--navy); }
.ins-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.ins { display: grid; gap: 4px; padding: 11px 13px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--gold); font-size: 12.5px; animation: rise .4s var(--ease) both; animation-delay: calc(var(--i) * 70ms); }
.ins b { color: var(--navy); font-size: 13px; }
.ins span { color: var(--ink); }

.mix thead th { position: static; background: none; color: var(--muted); font-weight: 500; font-size: 11.5px; padding: 4px 0; }
.mix thead th.r { text-align: right; }

/* fixes after visual review */
.form label.check, label.check { display: flex; gap: 8px; align-items: flex-start; font-size: 12.5px; color: var(--ink); font-weight: 400; }
.brand .ttl small { max-width: 380px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search input { width: min(260px, 70vw); }
.topbar .in { flex-wrap: nowrap; }
@media (max-width: 1280px) { .brand .ttl small { max-width: 240px; } .me .who { display: none; } }
@media (max-width: 1060px) { .topbar .in { flex-wrap: wrap; } .tbtn.gold { display: none; } }
.card { align-content: start; }
.grid2 { align-items: start; }

/* ===== v4: banners, activity, units, controls ===== */
.banners { display: grid; gap: 8px; }
.banners:empty { display: none; }
.banner { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 10px 14px; border-radius: var(--radius); font-size: 13.5px; border: 1px solid var(--line); background: var(--navy-tint); color: var(--navy); animation: rise .45s var(--ease) both; position: relative; overflow: hidden; }
.banner.gold { background: var(--gold-soft); color: var(--gold-ink); border-color: #F4C76B; }
.banner.gold::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.55) 50%, transparent 70%); transform: translateX(-100%); animation: sheen 3.6s ease-in-out 1s infinite; pointer-events: none; }
.banner.warn { background: var(--warn-bg); color: #8A231B; border-color: #F0B4AE; }
.banner.ok { background: var(--avail-bg); color: var(--avail-ink); border-color: #9ED4B3; }
.banner .bic { font-size: 18px; }
.banner .bx { border: 0; background: transparent; color: inherit; opacity: .6; cursor: pointer; font-size: 14px; padding: 4px 6px; border-radius: 6px; }
.banner .bx:hover { opacity: 1; background: rgba(0,0,0,.06); }
.banner .sub { color: inherit; opacity: .75; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 4px; display: grid; gap: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 17px; top: 6px; bottom: 6px; width: 2px; background: linear-gradient(var(--line), var(--surface-2)); }
.timeline li { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 8px 0; font-size: 13px; position: relative; animation: slidein .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 35ms); }
.timeline .ti { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); border: 2px solid var(--line); font-size: 12px; z-index: 1; color: var(--navy); }
.timeline .tw { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.timeline .tw .sub { margin-left: auto; font-size: 11.5px; }
.timeline .dev { font-size: 11px; margin-top: 2px; }
.timeline.big li { padding: 10px 0; border-bottom: 1px solid var(--surface-2); }
.timeline li.st-AVAILABLE .ti, .timeline li.g-change .ti { border-color: var(--avail); color: var(--avail); }
.timeline li.st-BLOCKED .ti { border-color: var(--gold); color: var(--gold-2); }
.timeline li.st-BOOKED .ti { border-color: var(--navy); }
.timeline li.g-security .ti { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }
.timeline li.g-access .ti { border-color: var(--navy-3); }
.timeline li.g-downloads .ti, .timeline li.g-shares .ti { border-color: var(--gold); }
.timeline li.g-ai .ti { border-color: #8B6CE0; background: #F2EEFD; }
.timeline li.view .ti, .timeline li.g-views .ti { border-color: var(--line-2); color: var(--muted); }
.timeline li.seed .ti, .timeline li.g-seed .ti { border-style: dashed; color: var(--muted); }

.card .role.viewer, table .role.viewer, .timeline .role.viewer, .leader .role.viewer, .lr .role.viewer { background: var(--navy-soft); color: var(--navy); }
.card .role, table .role, .timeline .role { font-size: 9.5px; padding: 1px 6px; vertical-align: 1px; }

.today .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.stat { border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 10px 12px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; text-align: left; cursor: pointer; font: inherit; color: var(--ink); animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--navy-3); }
.stat .ic { grid-row: span 2; font-size: 18px; align-self: center; }
.stat b { font-size: 22px; font-weight: 600; line-height: 1.1; color: var(--navy); }
.stat small { font-size: 11.5px; color: var(--muted); }
.bump { animation: countpulse .7s ease; }

.vchart { width: 100%; height: auto; display: block; }
.vchart text { font-size: 10px; fill: var(--muted); font-family: inherit; }
.vchart .vb rect { transform-box: fill-box; transform-origin: bottom; animation: build .7s var(--ease) both; animation-delay: calc(var(--i, 0) * 30ms + 150ms); transition: opacity .15s; }
.vchart .vb:hover rect { opacity: .78; }
.vchart .r-a { fill: var(--navy); } .vchart .r-c { fill: var(--gold); }
.vlegend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.vlegend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.vlegend i.r-a { background: var(--navy); } .vlegend i.r-c { background: var(--gold); }

.leader { display: grid; gap: 4px; }
.lr { display: grid; grid-template-columns: 32px 1fr auto; gap: 10px; align-items: center; border: 0; background: transparent; padding: 7px 6px; border-radius: 10px; text-align: left; font: inherit; color: var(--ink); cursor: pointer; animation: slidein .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 50ms); transition: background .2s; }
.lr:hover { background: var(--navy-tint); }
.lr .avatar { width: 30px; height: 30px; font-size: 11px; }
.lr .bar { margin-top: 5px; }
.lr .sub { text-align: right; font-size: 11.5px; }

.feed.live .it { grid-template-columns: 28px 1fr auto; animation: slidein .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.feed .gi { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--navy-tint); font-size: 12px; }
.feed .g-security .gi { background: var(--warn-bg); } .feed .g-change .gi { background: var(--avail-bg); } .feed .g-downloads .gi, .feed .g-shares .gi { background: var(--gold-soft); }

.bulkbar { position: sticky; top: 64px; z-index: 5; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; background: var(--navy); color: #fff; padding: 10px 14px; border-radius: var(--radius); box-shadow: var(--shadow-2); margin-bottom: 10px; transform: translateY(-8px); opacity: 0; pointer-events: none; max-height: 0; overflow: hidden; padding-block: 0; transition: all .3s var(--ease); }
.bulkbar.on { transform: none; opacity: 1; pointer-events: auto; max-height: 120px; padding-block: 10px; }
.bulkbar .inp { background: #fff; }
table.units tr.sel td { background: var(--gold-soft); }
table.units tr { transition: background .2s; }

.card.frozen { border-color: var(--warn); box-shadow: 0 0 0 3px rgba(200,60,50,.08); }
.grid2.tight { gap: 4px 18px; }
.seg.wrap { flex-wrap: wrap; }
.seg button small { opacity: .65; font-weight: 500; margin-left: 2px; }
label.lbl { display: grid; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
textarea.inp { width: 100%; resize: vertical; font: inherit; padding: 8px 10px; }
.tile .tag { font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .timeline li, .stat, .lr, .feed.live .it, .vchart .vb rect, .banner, .banner.gold::after { animation: none !important; } }

/* ===== v5: sub-admin, office network, MCP ===== */
.role.subadmin { background: #C9D2FF; color: var(--navy-2); }
.role.office { background: rgba(255,255,255,.18); color: #fff; }
.card .role.office, table .role.office, .timeline .role.office, .lr .role.office { background: var(--gold-soft); color: var(--gold-ink); }
.officebadge { display: flex; align-items: center; gap: 8px; background: var(--avail-bg); color: var(--avail-ink); border: 1px solid #9ED4B3; border-radius: 10px; padding: 9px 12px; font-size: 13px; font-weight: 500; animation: rise .4s var(--ease) both; }
.officebadge .dot { margin-right: 0; }
.step label small { color: var(--muted); font-weight: 400; }
.ipnow { font-size: 13px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--line-2); }
.ipnow.yes { background: var(--avail-bg); border-color: #9ED4B3; color: var(--avail-ink); }
.card.office.off { opacity: .92; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important; font-size: 12.5px !important; }
.copyrow { display: flex; gap: 8px; } .copyrow .inp { flex: 1; }
ol.steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13px; }
.card.mcp { border-top: 3px solid var(--navy); }

/* ===== v6: authenticator step ===== */
.step.totp p { font-size: 13px; line-height: 1.5; }
.totp-ic { font-size: 30px; text-align: center; animation: pop .4s var(--ease) both; }
.qrwrap { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; background: var(--navy-tint); border-radius: 12px; padding: 10px; animation: rise .4s var(--ease) both; }
.qr { width: 168px; height: 168px; background: #fff; border-radius: 8px; padding: 6px; box-shadow: var(--shadow-1); display: grid; place-items: center; font-size: 12px; color: var(--muted); }
.qr img, .qr canvas { width: 156px !important; height: 156px !important; }
.qrside { display: grid; gap: 6px; font-size: 12px; }
.qrside .key { font: 600 12.5px/1.5 ui-monospace, Menlo, Consolas, monospace; background: #fff; border: 1px dashed var(--line-2); border-radius: 8px; padding: 6px 8px; word-break: break-all; color: var(--navy); }
@media (max-width: 420px) { .qrwrap { grid-template-columns: 1fr; justify-items: center; } }

/* ===== v6: chat & assistant dock ===== */
.fab { position: fixed; right: 20px; bottom: 20px; z-index: 70; width: 58px; height: 58px; border-radius: 50%; border: 0; cursor: pointer; background: linear-gradient(140deg, var(--navy-3), var(--navy)); color: #fff; box-shadow: 0 10px 28px rgba(40,49,111,.38), 0 0 0 4px rgba(244,170,28,.0); display: grid; place-items: center; transition: transform .25s var(--ease), box-shadow .25s; animation: pop .5s var(--ease) .6s both; }
.fab:hover { transform: translateY(-3px) scale(1.04); box-shadow: 0 14px 32px rgba(40,49,111,.45), 0 0 0 4px rgba(244,170,28,.35); }
.fab.on { transform: rotate(-8deg) scale(.94); }
.fab-ic { font-size: 24px; }
.fab-badge, .tab-badge, .ubadge { background: var(--gold); color: var(--navy-2); font-weight: 700; font-size: 11px; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; }
.fab-badge { position: absolute; top: -2px; right: -2px; box-shadow: 0 0 0 2px #fff; animation: pop .35s var(--ease) both; }
.tab-badge { margin-left: 6px; min-width: 18px; height: 18px; font-size: 10px; }
.pdock { position: fixed; right: 20px; bottom: 90px; z-index: 71; width: 390px; height: min(640px, calc(100vh - 120px)); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-3); display: grid; grid-template-rows: auto 1fr; overflow: hidden; transform-origin: bottom right; animation: dockin .28s var(--ease) both; }
.pdock.out { animation: dockout .2s ease both; }
@keyframes dockin { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes dockout { to { opacity: 0; transform: translateY(10px) scale(.97); } }
.pd-head { display: flex; align-items: center; gap: 8px; padding: 10px 10px 0; background: linear-gradient(180deg, var(--navy), var(--navy-2)); }
.pd-tabs { display: flex; gap: 4px; flex: 1; }
.pd-tabs button { border: 0; background: transparent; color: rgba(255,255,255,.7); padding: 9px 14px 11px; border-radius: 10px 10px 0 0; font: 600 13px/1 inherit; cursor: pointer; display: inline-flex; align-items: center; transition: background .2s, color .2s; }
.pd-tabs button[aria-selected="true"] { background: var(--surface); color: var(--navy); }
.pd-x { border: 0; background: rgba(255,255,255,.12); color: #fff; width: 30px; height: 30px; border-radius: 8px; cursor: pointer; margin-bottom: 6px; }
.pd-body { min-height: 0; display: flex; flex-direction: column; }
.pd-body > * { flex: 1; min-height: 0; }
.pd-list { overflow: auto; padding: 8px 6px 12px; }
.pd-search { display: flex; gap: 6px; padding: 2px 6px 6px; position: sticky; top: -8px; background: var(--surface); z-index: 1; }
.pd-search .inp { flex: 1; }
.pd-sec { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 4px; }
.pd-row { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: transparent; padding: 8px 10px; border-radius: 12px; cursor: pointer; text-align: left; font: inherit; color: var(--ink); animation: slidein .3s var(--ease) both; animation-delay: calc(var(--i, 0) * 25ms); transition: background .15s; }
.pd-row:hover, .pd-main-btn:hover { background: var(--navy-tint); }
.pd-row.person { padding: 0 4px 0 0; cursor: default; }
.pd-main-btn { flex: 1; display: flex; align-items: center; gap: 10px; border: 0; background: transparent; padding: 8px 10px; border-radius: 12px; cursor: pointer; text-align: left; font: inherit; color: var(--ink); min-width: 0; }
.pd-main { flex: 1; min-width: 0; display: grid; }
.pd-main b { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-main small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pd-meta { display: grid; justify-items: end; gap: 3px; font-size: 11px; color: var(--muted); }
.pav { width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--navy-soft); color: var(--navy); display: grid; place-items: center; font-weight: 600; font-size: 13px; position: relative; }
.pav.on::after { content: ""; position: absolute; right: 0; bottom: 0; width: 11px; height: 11px; border-radius: 50%; background: var(--avail); box-shadow: 0 0 0 2px var(--surface); }
.pd-call { border: 0; background: var(--avail-bg); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 15px; flex: none; transition: transform .2s; }
.pd-call:hover:not(:disabled) { transform: scale(1.1); }
.pd-call:disabled { opacity: .35; cursor: not-allowed; background: var(--surface-2); }
.pd-empty { padding: 30px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.pd-empty.sm { padding: 14px; }
.pd-room { display: grid; grid-template-rows: auto 1fr auto auto auto; min-height: 0; }
.pd-roomhead { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid var(--surface-2); }
.pd-back { border: 0; background: transparent; font-size: 26px; line-height: 1; cursor: pointer; color: var(--navy); padding: 0 4px; }
.pd-msgs { overflow: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; background: radial-gradient(circle at 20% 0, var(--navy-tint), transparent 60%), var(--surface); }
.pm { display: flex; flex-direction: column; align-items: flex-start; max-width: 82%; animation: msgin .25s var(--ease) both; }
.pm.me { align-self: flex-end; align-items: flex-end; }
@keyframes msgin { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
.pm-who { font-size: 11px; color: var(--navy-3); margin: 6px 0 2px 6px; font-weight: 600; }
.pm-b { background: var(--surface-2); border-radius: 14px 14px 14px 4px; padding: 7px 10px 5px; font-size: 13.5px; line-height: 1.45; word-wrap: break-word; overflow-wrap: anywhere; position: relative; }
.pm.me .pm-b { background: var(--navy); color: #fff; border-radius: 14px 14px 4px 14px; }
.pm.me .pm-b a { color: var(--gold); }
.pm-t { display: block; text-align: right; font-size: 10px; opacity: .6; margin-top: 2px; }
.pm-img { max-width: 220px; max-height: 220px; border-radius: 10px; display: block; margin-bottom: 2px; }
.pm-file { display: flex; gap: 6px; align-items: center; color: inherit; text-decoration: none; font-weight: 500; }
.pm-file small { opacity: .65; }
.pm audio { width: 220px; height: 36px; }
.pm.sys { align-self: center; max-width: 92%; }
.pm.sys span { font-size: 11.5px; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 3px 10px; }
.pm.sys.call span { background: var(--avail-bg); color: var(--avail-ink); }
.pm-day { align-self: center; margin: 8px 0 4px; } .pm-day span { font-size: 11px; color: var(--muted); }
.pd-compose { display: flex; gap: 6px; align-items: flex-end; padding: 8px; border-top: 1px solid var(--surface-2); }
.pd-compose textarea { flex: 1; resize: none; border: 1px solid var(--line-2); border-radius: 18px; padding: 8px 12px; font: 13.5px/1.4 inherit; max-height: 120px; outline: none; }
.pd-compose textarea:focus { border-color: var(--navy-3); box-shadow: 0 0 0 3px var(--navy-soft); }
.pd-ib { border: 0; background: var(--surface-2); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 15px; flex: none; transition: transform .15s, background .2s; }
.pd-ib:hover { transform: scale(1.06); }
.pd-ib.live { background: var(--warn); animation: breathe 1s ease-in-out infinite; }
.pd-send { border: 0; background: var(--gold); color: var(--navy-2); width: 38px; height: 38px; border-radius: 50%; cursor: pointer; font-size: 16px; flex: none; transition: transform .15s; }
.pd-send:hover:not(:disabled) { transform: scale(1.08) rotate(-8deg); }
.pd-send:disabled { opacity: .5; }
.pd-note { font-size: 10.5px; color: var(--muted); text-align: center; padding: 0 8px 6px; margin: 0; }
.pd-rec { display: flex; align-items: center; gap: 8px; padding: 10px; border-top: 1px solid var(--surface-2); font-size: 13px; }
.recdot { width: 10px; height: 10px; border-radius: 50%; background: var(--warn); animation: breathe .9s ease-in-out infinite; }
#pdrect { font-variant-numeric: tabular-nums; font-weight: 600; }
.pd-rec .btn:first-of-type { margin-left: auto; }
.pd-group { position: absolute; inset: 52px 8px auto 8px; z-index: 3; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-3); padding: 12px; animation: pop .25s var(--ease) both; flex: none !important; }
.pd-group form { display: grid; gap: 8px; }
.pg-list { max-height: 220px; overflow: auto; display: grid; gap: 2px; }
.pg-list small { color: var(--muted); }
/* assistant */
.pd-ai { display: grid; grid-template-rows: 1fr auto auto; min-height: 0; }
.ai-msgs { overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.ai-hello { text-align: center; display: grid; gap: 6px; justify-items: center; padding: 14px 4px; animation: rise .4s var(--ease) both; }
.ai-hello p { font-size: 13px; color: var(--muted); margin: 0; }
.ai-orb { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: conic-gradient(from 0deg, var(--gold), #fff3d6, var(--navy-3), var(--gold)); animation: spin 6s linear infinite; box-shadow: 0 8px 24px rgba(244,170,28,.35); }
.ai-sugg { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 6px; }
.ai-sugg button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 11px; font-size: 12px; cursor: pointer; color: var(--navy); transition: background .2s, transform .2s; }
.ai-sugg button:hover { background: var(--navy-tint); transform: translateY(-1px); }
.am { display: flex; animation: msgin .3s var(--ease) both; }
.am.me { justify-content: flex-end; }
.am-b { max-width: 88%; background: var(--navy-tint); border-radius: 14px 14px 14px 4px; padding: 9px 12px; font-size: 13.5px; line-height: 1.5; }
.am.me .am-b { background: var(--navy); color: #fff; border-radius: 14px 14px 4px 14px; }
.am-b p { margin: 0 0 4px; } .am-b ul { margin: 2px 0 4px; padding-left: 18px; } .am-b li { margin: 1px 0; }
.ai-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.uchip { border: 1px solid #F4C76B; background: var(--gold-soft); color: var(--gold-ink); border-radius: 999px; padding: 3px 9px; font-size: 11.5px; font-weight: 600; cursor: pointer; transition: transform .15s; }
.uchip:hover { transform: translateY(-1px); }
.typing { display: inline-flex; gap: 4px; padding: 12px 14px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--navy-3); animation: bounce 1.2s infinite ease-in-out; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .4; } 40% { transform: translateY(-5px); opacity: 1; } }
.ai-lang { border: 1px solid var(--line-2); border-radius: 10px; font-size: 11px; padding: 0 4px; height: 36px; background: var(--surface); }
/* call */
.callbox { position: fixed; z-index: 90; left: 50%; top: 18px; transform: translateX(-50%); width: min(420px, calc(100vw - 24px)); background: linear-gradient(135deg, var(--navy-2), var(--navy-3)); color: #fff; border-radius: 22px; padding: 14px 16px; display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; box-shadow: 0 18px 40px rgba(20,24,60,.45); animation: callin .35s var(--ease) both; }
.callbox.out { animation: callout .25s ease both; }
@keyframes callin { from { opacity: 0; transform: translate(-50%, -16px) scale(.96); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes callout { to { opacity: 0; transform: translate(-50%, -12px); } }
.cb-av { width: 50px; height: 50px; border-radius: 50%; background: var(--gold); color: var(--navy-2); display: grid; place-items: center; font-weight: 700; position: relative; }
.cb-av .ripple { position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--gold); animation: ping 1.8s var(--ease) infinite; }
.cb-av .ripple.r2 { animation-delay: .9s; }
.cb-txt { display: grid; } .cb-txt b { font-size: 15px; } .cb-txt small { opacity: .8; font-variant-numeric: tabular-nums; }
.cb-btns { display: flex; gap: 8px; }
.cbtn { width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer; font-size: 18px; transition: transform .15s; }
.cbtn:hover { transform: scale(1.08); }
.cbtn.ok { background: #22B35E; animation: breathe 1.2s ease-in-out infinite; }
.cbtn.no { background: #E5483D; color: #fff; }
.cbtn.mute { background: rgba(255,255,255,.16); } .cbtn.mute.on { background: #fff; }
@media (max-width: 560px) {
  .pdock { right: 0; left: 0; bottom: 0; width: 100%; height: calc(100vh - 56px); border-radius: 18px 18px 0 0; }
  .fab { right: 14px; bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) { .fab, .pdock, .pm, .am, .pd-row, .ai-orb, .callbox, .cbtn.ok, .cb-av .ripple { animation: none !important; } }
@media print { .fab, .pdock, .callbox { display: none !important; } }
/* dock: never grow wider than the panel */
.pdock { grid-template-columns: minmax(0, 1fr); }
.pd-body, .pd-body > *, .pd-ai, .pd-room, .ai-msgs, .pd-msgs { min-width: 0; }
.pd-compose textarea { min-width: 0; width: 100%; }
.am-b, .pm-b { overflow-wrap: anywhere; }
