/* =====================================================================
   DBDON Office — application styles
   Light / dark themes, 4 text sizes, compact density, reduced motion.
   All sizes are in rem so the "Text size" preference scales everything.
   ===================================================================== */
:root {
  --orange: #F7941D; --orange-d: #d97a0b; --orange-l: #fff3e4; --orange-ink: #a65a00;
  --brown: #3E2415; --brown-2: #5a3a26;
  --bg: #f7f2ec; --surface: #ffffff; --surface-2: #fbf7f2; --surface-3: #f3ebe2;
  --line: #eadfd3; --line-2: #f3ebe2;
  --text: #2b1b10; --text-2: #5c4636; --muted: #8a7766;
  --heading: #3E2415; --link: #8a4b10;
  --green: #1b7a3a; --green-l: #e7f5ec; --red: #c62828; --red-l: #fdecea; --blue: #1d4fbf; --blue-l: #e9f0ff;
  --amber: #9a6a00; --amber-l: #fff6dc; --purple: #6b46c1; --purple-l: #f1ebff;
  --sidebar: #2c190e; --sidebar-2: #3E2415; --sidebar-text: #e9dccf; --sidebar-muted: #b49e8b;
  --accent: var(--orange); --accent-d: var(--orange-d); --accent-l: var(--orange-l);
  --radius: 14px; --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(62,36,21,.05), 0 8px 24px rgba(62,36,21,.07);
  --shadow-lg: 0 18px 50px rgba(30,15,5,.25);
  --sb-w: 252px; --tb-h: 60px;
  --pad: 1.15rem; --gap: 1rem;
  color-scheme: light;
}
html[data-accent="teal"] { --accent: #138a7a; --accent-d: #0e6e61; --accent-l: #e3f5f2; }
html[data-accent="blue"] { --accent: #2f6fd6; --accent-d: #2459ad; --accent-l: #e8f0fd; }
html[data-accent="purple"] { --accent: #7b4fc9; --accent-d: #6440a8; --accent-l: #f1eafd; }

/* ---------- dark theme ---------- */
html[data-theme="dark"] {
  --bg: #15100c; --surface: #201813; --surface-2: #261d17; --surface-3: #2f241d;
  --line: #3a2d24; --line-2: #2f241d;
  --text: #f1e7dd; --text-2: #d5c3b3; --muted: #a8927f; --heading: #fbe9d7; --link: #ffb25e;
  --green: #5fd38a; --green-l: #12301e; --red: #ff7b72; --red-l: #3a1715; --blue: #8fb3ff; --blue-l: #172440;
  --amber: #ffcf66; --amber-l: #33280f; --purple: #c4a8ff; --purple-l: #2a2040; --orange-l: #3a2610; --accent-l: #3a2610; --orange-ink: #ffb25e;
  --sidebar: #100b08; --sidebar-2: #1b130e;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    --bg: #15100c; --surface: #201813; --surface-2: #261d17; --surface-3: #2f241d;
    --line: #3a2d24; --line-2: #2f241d;
    --text: #f1e7dd; --text-2: #d5c3b3; --muted: #a8927f; --heading: #fbe9d7; --link: #ffb25e;
    --green: #5fd38a; --green-l: #12301e; --red: #ff7b72; --red-l: #3a1715; --blue: #8fb3ff; --blue-l: #172440;
    --amber: #ffcf66; --amber-l: #33280f; --purple: #c4a8ff; --purple-l: #2a2040; --orange-l: #3a2610; --accent-l: #3a2610; --orange-ink: #ffb25e;
    --sidebar: #100b08; --sidebar-2: #1b130e;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.3);
    color-scheme: dark;
  }
}
html[data-contrast="high"] { --muted: #5c4636; --line: #c9b39d; --text-2: #2b1b10; }
html[data-contrast="high"][data-theme="dark"] { --muted: #e0cbb8; --line: #6b5442; --text-2: #fff; }

/* ---------- text size & density ---------- */
html { font-size: 15px; }
html[data-text="sm"] { font-size: 13.5px; }
html[data-text="lg"] { font-size: 17px; }
html[data-text="xl"] { font-size: 19px; }
html[data-density="compact"] { --pad: .8rem; --gap: .7rem; }
html[data-motion="reduced"] *, html[data-motion="reduced"] *::before, html[data-motion="reduced"] *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: Verdana, Geneva, Tahoma, sans-serif; font-size: .875rem; color: var(--text); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; font-size: .875rem; color: var(--text); }
a { color: var(--link); }
h1, h2, h3, h4 { color: var(--heading); line-height: 1.25; }
h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; } h4 { font-size: .95rem; }
img { max-width: 100%; }
.muted { color: var(--muted); } .tiny { font-size: .75rem; } .small { font-size: .82rem; } .nowrap { white-space: nowrap; } .right { text-align: right; } .center { text-align: center; }
.mt0 { margin-top: 0 } .mb0 { margin-bottom: 0 } .mt { margin-top: var(--gap) } .mb { margin-bottom: var(--gap) }
.hide { display: none !important; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--accent); color: #fff; padding: 8px 14px; z-index: 999; border-radius: 0 0 8px 0; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

/* ---------- shell ---------- */
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sb-w); background: linear-gradient(180deg, var(--sidebar-2), var(--sidebar)); color: var(--sidebar-text); display: flex; flex-direction: column; z-index: 60; transition: width .2s, transform .25s; }
.sb-brand { display: flex; align-items: center; gap: .65rem; padding: .9rem 1rem; color: #fff; text-decoration: none; font-size: 1.05rem; white-space: nowrap; }
.sb-brand img { width: 40px; height: 40px; background: #fff; border-radius: 50%; padding: 2px; flex: none; }
.sb-brand b { color: var(--orange); }
.sb-search { display: flex; align-items: center; gap: .5rem; margin: 0 .8rem .6rem; padding: .5rem .7rem; border-radius: 10px; border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.06); color: var(--sidebar-muted); cursor: pointer; text-align: left; font-size: .8rem; }
.sb-search span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-search kbd { font-family: inherit; font-size: .65rem; background: rgba(255,255,255,.1); padding: 1px 5px; border-radius: 4px; }
.sb-search:hover { background: rgba(255,255,255,.1); color: #fff; }
.sb-nav { flex: 1; overflow-y: auto; padding: 0 .6rem 1rem; scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.15) transparent; }
.sb-sec { font-size: .66rem; text-transform: uppercase; letter-spacing: .09em; color: var(--sidebar-muted); padding: .9rem .6rem .3rem; white-space: nowrap; }
.sb-nav a { display: flex; align-items: center; gap: .7rem; padding: .48rem .65rem; border-radius: 9px; color: var(--sidebar-text); text-decoration: none; font-size: .83rem; white-space: nowrap; position: relative; transition: background .15s; }
.sb-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sb-nav a.active { background: var(--accent); color: #fff; box-shadow: 0 4px 14px rgba(247,148,29,.3); }
.sb-nav a .ic { flex: none; opacity: .9; }
.sb-nav a span { overflow: hidden; text-overflow: ellipsis; }
.pill { margin-left: auto; font-style: normal; background: var(--red); color: #fff; font-size: .65rem; padding: 0 6px; border-radius: 10px; font-weight: bold; }
.sb-foot { border-top: 1px solid rgba(255,255,255,.08); padding: .7rem .8rem; }
.sb-me { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--sidebar-text); }
.sb-me > span:not(.av) { display: flex; flex-direction: column; min-width: 0; }
.sb-me b { font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-me small { color: var(--sidebar-muted); font-size: .7rem; }
body.sb-collapsed { --sb-w: 68px; }
body.sb-collapsed .sb-brand span, body.sb-collapsed .sb-search span, body.sb-collapsed .sb-search kbd, body.sb-collapsed .sb-nav a span, body.sb-collapsed .sb-sec, body.sb-collapsed .sb-me span, body.sb-collapsed .pill { display: none; }
body.sb-collapsed .sb-nav a, body.sb-collapsed .sb-search { justify-content: center; }
body.sb-collapsed .sb-sec { height: .6rem; padding: 0; }

.topbar { position: sticky; top: 0; z-index: 50; height: var(--tb-h); margin-left: var(--sb-w); display: flex; align-items: center; gap: .8rem; padding: 0 1.25rem; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); transition: margin .2s; }
.tb-title { flex: 1; min-width: 0; }
.tb-title h1 { margin: 0; font-size: 1.12rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumbs { font-size: .72rem; color: var(--muted); display: flex; gap: .35rem; flex-wrap: wrap; }
.crumbs a { color: var(--muted); text-decoration: none; } .crumbs a:hover { color: var(--accent); }
.tb-actions { display: flex; align-items: center; gap: .35rem; }
.tb-here { display: flex; align-items: center; gap: .4rem; }
.tb-me { background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%; }
.bell { position: relative; }
.bell .dot { position: absolute; top: 2px; right: 0; background: var(--red); color: #fff; font-style: normal; font-size: .6rem; min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 3px; font-weight: bold; }
main.container { margin-left: var(--sb-w); padding: 1.4rem 1.5rem 6rem; max-width: calc(1400px + var(--sb-w)); transition: margin .2s; }
body.bare main.container { margin-left: 0; max-width: none; }
main.full { margin-left: var(--sb-w); }
.sb-scrim { display: none; }
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); --sb-w: 270px; width: 270px; }
  body.sb-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.sb-open .sb-scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 55; }
  .topbar, main.container, main.full { margin-left: 0 !important; }
  main.container { padding: 1rem .9rem 6rem; }
  .hide-sm { display: none; }
  body.sb-collapsed .sb-brand span, body.sb-collapsed .sb-nav a span, body.sb-collapsed .sb-sec, body.sb-collapsed .sb-me span, body.sb-collapsed .sb-search span { display: initial; }
}
@media (min-width: 961px) { .tb-menu { display: inline-grid; } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: .55rem 1rem; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); color: var(--heading); cursor: pointer; text-decoration: none; font-size: .83rem; white-space: nowrap; transition: transform .08s, background .15s, border-color .15s, box-shadow .15s; line-height: 1.2; }
.btn:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: bold; }
.btn-primary:hover { background: var(--accent-d); border-color: var(--accent-d); color: #fff; }
.btn-dark { background: var(--brown); border-color: var(--brown); color: #fff; }
.btn-dark:hover { background: var(--brown-2); color: #fff; }
html[data-theme="dark"] .btn-dark { background: #4a3122; border-color: #5a3a26; }
.btn-danger { color: var(--red); } .btn-danger:hover { background: var(--red-l); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; font-weight: bold; }
html[data-theme="dark"] .btn-success { color: #0c1f12; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { padding: .38rem .7rem; font-size: .76rem; border-radius: 8px; }
.btn-lg { padding: .8rem 1.4rem; font-size: .95rem; }
.btn-block { width: 100%; }
.btn .ic { flex: none; }
.icon-btn { width: 2.2rem; height: 2.2rem; display: inline-grid; place-items: center; border-radius: 10px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; font-size: .95rem; text-decoration: none; }
.icon-btn:hover { background: var(--surface-3); color: var(--heading); }
.icon-btn.danger:hover { background: var(--red-l); color: var(--red); }
.btn-row { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ---------- forms ---------- */
.field { display: block; margin-bottom: .85rem; }
.field > span, .label { display: block; font-size: .72rem; color: var(--muted); margin-bottom: .3rem; text-transform: uppercase; letter-spacing: .04em; }
.field > span b.req { color: var(--red); }
input:not([type]), input[type=text], input[type=email], input[type=date], input[type=datetime-local], input[type=time], input[type=number], input[type=search], input[type=password], input[type=url], input[type=tel], select, textarea {
  width: 100%; padding: .6rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s; color: var(--text);
}
select[multiple] { min-height: 6rem; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea { resize: vertical; min-height: 4.5rem; line-height: 1.5; }
.hint { font-size: .74rem; color: var(--muted); margin: -.45rem 0 .8rem; }
.hint.warn { color: var(--orange-ink); }
.row { display: flex; gap: .7rem; flex-wrap: wrap; }
.row > * { flex: 1 1 10rem; min-width: 0; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: var(--gap); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: var(--gap); }
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: var(--gap); }
@media (max-width: 1100px) { .grid4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .grid3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 720px) { .grid2, .grid3, .grid4 { grid-template-columns: 1fr; } }
.layout-side { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: var(--gap); align-items: start; }
@media (max-width: 1100px) { .layout-side { grid-template-columns: 1fr; } }
.check { display: flex; gap: .5rem; align-items: center; cursor: pointer; }
.check input { width: auto; }
.toggle { position: relative; display: inline-block; width: 2.6rem; height: 1.45rem; flex: none; }
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle span { position: absolute; inset: 0; background: var(--line); border-radius: 1rem; cursor: pointer; transition: .2s; }
.toggle span::before { content: ""; position: absolute; width: 1.05rem; height: 1.05rem; left: .2rem; top: .2rem; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.toggle input:checked + span { background: var(--accent); }
.toggle input:checked + span::before { transform: translateX(1.15rem); }
.trow { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .55rem 0; border-bottom: 1px dashed var(--line); }
.seg { display: inline-flex; background: var(--surface-3); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg label, .seg a, .seg button { padding: .35rem .75rem; border-radius: 8px; cursor: pointer; font-size: .78rem; color: var(--text-2); text-decoration: none; border: 0; background: none; }
.seg input { display: none; }
.seg input:checked + span, .seg a.active, .seg button.active { background: var(--surface); color: var(--heading); font-weight: bold; box-shadow: 0 1px 3px rgba(0,0,0,.1); padding: .35rem .75rem; border-radius: 8px; display: inline-block; }
.seg label:has(input:checked) { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.seg label span { display: inline-block; }

/* ---------- alerts ---------- */
.alert { padding: .7rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-size: .83rem; border: 1px solid transparent; }
.alert-error { background: var(--red-l); color: var(--red); border-color: color-mix(in srgb, var(--red) 25%, transparent); }
.alert-ok { background: var(--green-l); color: var(--green); border-color: color-mix(in srgb, var(--green) 25%, transparent); }
.alert-warn { background: var(--amber-l); color: var(--amber); border-color: color-mix(in srgb, var(--amber) 25%, transparent); }
.alert-info { background: var(--blue-l); color: var(--blue); border-color: color-mix(in srgb, var(--blue) 25%, transparent); }

/* ---------- cards / stats ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: var(--pad); margin-bottom: var(--gap); min-width: 0; }
.card > h3:first-child, .card-h { margin-top: 0; }
.card-h { display: flex; align-items: center; gap: .6rem; justify-content: space-between; margin-bottom: .8rem; flex-wrap: wrap; }
.card-h h3 { margin: 0; font-size: 1rem; display: flex; align-items: center; gap: .5rem; }
.card-h .btn-row { margin-left: auto; }
.card.flat { box-shadow: none; }
.card.accent { border-left: 4px solid var(--accent); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 1.45rem; }
.page-head p { margin: .3rem 0 0; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: var(--gap); margin-bottom: var(--gap); }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem 1.1rem; box-shadow: var(--shadow); position: relative; overflow: hidden; text-decoration: none; color: inherit; transition: transform .15s; display: block; }
a.stat:hover { transform: translateY(-2px); }
.stat::after { content: ""; position: absolute; right: -1.2rem; top: -1.2rem; width: 4.5rem; height: 4.5rem; border-radius: 50%; background: var(--accent-l); }
.stat.red::after { background: var(--red-l); } .stat.green::after { background: var(--green-l); } .stat.blue::after { background: var(--blue-l); } .stat.amber::after { background: var(--amber-l); }
.stat .k { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; position: relative; z-index: 1; }
.stat .v { font-size: 1.5rem; font-weight: bold; color: var(--heading); margin-top: .2rem; position: relative; z-index: 1; }
.stat .s { font-size: .74rem; color: var(--muted); position: relative; z-index: 1; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .big { font-size: 2.6rem; }
.empty h3 { margin: .4rem 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad); }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: normal; padding: .6rem .7rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: .65rem .7rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
table.list tr:hover td { background: var(--surface-2); }
table.list .num, table.list th.num { text-align: right; white-space: nowrap; }
table.list tfoot td { font-weight: bold; border-top: 2px solid var(--line); background: var(--surface-2); }
table.list a.strong { font-weight: bold; color: var(--heading); text-decoration: none; }
table.list a.strong:hover { color: var(--accent); }
table.list.compact td { padding: .4rem .55rem; }
table.list input, table.list select { padding: .35rem .5rem; }
tr.over td { background: var(--red-l) !important; }
.actions { display: flex; gap: .25rem; justify-content: flex-end; }

/* ---------- badges ---------- */
.badge { display: inline-block; padding: .15rem .6rem; border-radius: 20px; font-size: .7rem; font-weight: bold; white-space: nowrap; background: var(--surface-3); color: var(--text-2); }
.b-muted { background: var(--surface-3); color: var(--text-2); }
.b-amber { background: var(--amber-l); color: var(--amber); }
.b-green { background: var(--green-l); color: var(--green); }
.b-red { background: var(--red-l); color: var(--red); }
.b-blue { background: var(--blue-l); color: var(--blue); }
.b-brown { background: #efe2d6; color: #5a3a26; }
html[data-theme="dark"] .b-brown { background: #3a2a1f; color: #e8c9ad; }
.b-purple { background: var(--purple-l); color: var(--purple); }
.b-orange { background: var(--accent-l); color: var(--orange-ink); }
.tag { display: inline-flex; gap: .3rem; align-items: center; padding: .1rem .5rem; border-radius: 6px; background: var(--surface-3); font-size: .72rem; color: var(--text-2); }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--line); margin-bottom: var(--gap); overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: .65rem .95rem; text-decoration: none; color: var(--text-2); border-bottom: 3px solid transparent; white-space: nowrap; font-size: .84rem; display: flex; gap: .4rem; align-items: center; }
.tabs a:hover { color: var(--heading); }
.tabs a.active { color: var(--heading); border-color: var(--accent); font-weight: bold; }
.tabs a em { font-style: normal; font-size: .68rem; background: var(--surface-3); padding: 0 6px; border-radius: 10px; }
.toolbar { display: flex; gap: .6rem; align-items: center; margin-bottom: .9rem; flex-wrap: wrap; }
.toolbar .grow { flex: 1; }
.toolbar input[type=search] { max-width: 20rem; }

/* ---------- avatars ---------- */
.av { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: bold; overflow: hidden; flex: none; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); vertical-align: middle; letter-spacing: .02em; position: relative; }
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.more { background: var(--surface-3); color: var(--text-2); font-size: .7rem; }
.av.online::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 28%; height: 28%; min-width: 8px; min-height: 8px; border-radius: 50%; background: #2ecc71; border: 2px solid var(--surface); }
.av.idle::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: 28%; height: 28%; min-width: 8px; min-height: 8px; border-radius: 50%; background: #f1c40f; border: 2px solid var(--surface); }
.av-stack { display: inline-flex; align-items: center; }
.av-stack .av { margin-left: -.55rem; }
.av-stack .av:first-child { margin-left: 0; }
.av-stack .av:hover { transform: translateY(-2px); z-index: 2; }
.person { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; }
.person b { display: block; font-size: .83rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person small { display: block; color: var(--muted); font-size: .7rem; }

/* ---------- progress ---------- */
.bar { height: .5rem; background: var(--surface-3); border-radius: 1rem; overflow: hidden; min-width: 4rem; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 1rem; }
.bar.amber i { background: #e0a100; } .bar.red i { background: var(--red); } .bar.blue i { background: var(--blue); } .bar.orange i { background: var(--accent); }
.ring { --p: 0; --c: var(--accent); width: 3.4rem; height: 3.4rem; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--surface-3) 0); position: relative; font-size: .72rem; font-weight: bold; color: var(--heading); flex: none; }
.ring::before { content: ""; position: absolute; inset: .35rem; background: var(--surface); border-radius: 50%; }
.ring span { position: relative; }

/* ---------- dropdown ---------- */
.dd { position: relative; }
.dd-menu { position: absolute; top: calc(100% + 6px); left: 0; min-width: 14rem; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: .35rem; z-index: 80; display: none; max-height: 75vh; overflow: auto; }
.dd-menu.right { left: auto; right: 0; }
.dd.open .dd-menu { display: block; animation: pop .14s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.dd-menu a, .dd-menu button.dd-item { display: flex; gap: .6rem; align-items: center; padding: .5rem .7rem; border-radius: 8px; text-decoration: none; color: var(--text); font-size: .83rem; white-space: nowrap; width: 100%; border: 0; background: none; cursor: pointer; text-align: left; }
.dd-menu a:hover, .dd-menu button.dd-item:hover { background: var(--surface-3); }
.dd-head { padding: .5rem .7rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .3rem; }
.dd-head b { display: block; } .dd-head small { color: var(--muted); }
.notif-menu { width: min(24rem, 92vw); }
.notif-menu .n-item { display: flex; gap: .6rem; padding: .6rem .6rem; border-radius: 9px; text-decoration: none; color: var(--text); white-space: normal; }
.notif-menu .n-item:hover { background: var(--surface-3); }
.notif-menu .n-item.unread { background: var(--accent-l); }
.notif-menu .n-item b { display: block; font-size: .8rem; }
.notif-menu .n-item small { color: var(--muted); font-size: .72rem; }
.pad { padding: .8rem; }

/* ---------- modal ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(20,10,4,.5); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 1rem 2rem; z-index: 200; opacity: 0; transition: opacity .18s; overflow-y: auto; }
.modal-back.show { opacity: 1; }
.modal { background: var(--surface); border-radius: 16px; width: 100%; max-width: 34rem; box-shadow: var(--shadow-lg); transform: translateY(8px); transition: transform .18s; border: 1px solid var(--line); }
.modal-back.show .modal { transform: none; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem .4rem; }
.modal-head h3 { margin: 0; }
.modal-body { padding: .6rem 1.2rem 1rem; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .8rem 1.2rem 1.1rem; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(30rem, 100vw); background: var(--surface); box-shadow: var(--shadow-lg); z-index: 210; transform: translateX(100%); transition: transform .22s; display: flex; flex-direction: column; }
.drawer.show { transform: none; }

/* ---------- toasts ---------- */
#toasts { position: fixed; left: 50%; bottom: 1.4rem; transform: translateX(-50%); display: flex; flex-direction: column; gap: .5rem; z-index: 300; align-items: center; pointer-events: none; }
.toast { background: #2b1b10; color: #fff; padding: .7rem 1.1rem; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: .83rem; pointer-events: auto; animation: pop .18s ease-out; max-width: 90vw; }
.toast.ok { background: #1b7a3a; } .toast.err { background: #b3261e; } .toast.warn { background: #8a5a00; }

/* ---------- lists / timeline ---------- */
.list-plain { list-style: none; margin: 0; padding: 0; }
.li { display: flex; gap: .75rem; align-items: center; padding: .65rem 0; border-bottom: 1px solid var(--line-2); min-width: 0; }
.li:last-child { border-bottom: 0; }
.li .grow { flex: 1; min-width: 0; }
.li .t { font-weight: bold; color: var(--heading); text-decoration: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li a.t:hover { color: var(--accent); }
.li .m { font-size: .75rem; color: var(--muted); }
.datebox { width: 3.1rem; flex: none; text-align: center; border-radius: 10px; background: var(--accent-l); color: var(--orange-ink); padding: .25rem 0; line-height: 1.1; }
.datebox b { display: block; font-size: 1.15rem; color: var(--heading); }
.datebox small { font-size: .62rem; text-transform: uppercase; letter-spacing: .05em; }
.timeline { list-style: none; padding: 0 0 0 1rem; margin: 0; border-left: 2px solid var(--line); }
.timeline li { position: relative; padding: 0 0 .9rem .8rem; font-size: .82rem; }
.timeline li::before { content: ""; position: absolute; left: -1.42rem; top: .3rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); }
.timeline .when { font-size: .72rem; color: var(--muted); }

/* ---------- flow (proposal → results) ---------- */
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); gap: .5rem; counter-reset: fl; }
.flow a { position: relative; display: block; padding: .7rem .75rem .65rem 2.2rem; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); text-decoration: none; color: var(--text); font-size: .76rem; line-height: 1.3; min-height: 3.6rem; transition: border-color .15s, transform .15s; }
.flow a:hover { border-color: var(--accent); transform: translateY(-1px); }
.flow a::before { counter-increment: fl; content: counter(fl); position: absolute; left: .6rem; top: .7rem; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: var(--surface-3); color: var(--text-2); font-size: .66rem; display: grid; place-items: center; font-weight: bold; }
.flow a b { display: block; color: var(--heading); font-size: .8rem; }
.flow a small { color: var(--muted); }
.flow a.done { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); background: var(--green-l); }
.flow a.done::before { content: "✓"; background: var(--green); color: #fff; }
.flow a.now { border-color: var(--accent); background: var(--accent-l); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent); }
.flow a.now::before { background: var(--accent); color: #fff; }
.steps { display: flex; gap: 0; margin: .4rem 0 1rem; flex-wrap: wrap; }
.steps span { flex: 1 1 7rem; padding: .45rem .6rem; font-size: .72rem; text-align: center; border-top: 4px solid var(--line); color: var(--muted); }
.steps span.done { border-color: var(--green); color: var(--green); }
.steps span.now { border-color: var(--accent); color: var(--heading); font-weight: bold; }
.steps span.bad { border-color: var(--red); color: var(--red); }

/* ---------- project header ---------- */
.p-head { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.p-dot { width: 3.2rem; height: 3.2rem; border-radius: 14px; display: grid; place-items: center; color: #fff; font-weight: bold; font-size: 1.1rem; flex: none; }
.p-head h2 { margin: 0; font-size: 1.35rem; }
.p-meta { display: flex; gap: .4rem .9rem; flex-wrap: wrap; font-size: .78rem; color: var(--muted); margin-top: .25rem; }
.kv-grid { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; font-size: .83rem; }
.kv-grid dt { color: var(--muted); } .kv-grid dd { margin: 0; }

/* ---------- files ---------- */
.files .file-row { display: flex; gap: .6rem; align-items: center; padding: .5rem 0; border-bottom: 1px solid var(--line-2); }
.files .fi { font-size: 1.3rem; }
.files .fm { flex: 1; min-width: 0; }
.files .fm a { font-weight: bold; text-decoration: none; color: var(--heading); word-break: break-word; }
.files .fm small { display: block; color: var(--muted); font-size: .7rem; }
.files form { margin: 0; }
.upload-inline { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-top: .7rem; padding: .6rem; border: 1px dashed var(--line); border-radius: 10px; background: var(--surface-2); }
.upload-inline select { width: auto; flex: 1 1 10rem; }
.file-pick { position: relative; display: inline-flex; gap: .4rem; align-items: center; cursor: pointer; padding: .45rem .8rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); font-size: .8rem; }
.file-pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-pick em { font-style: normal; color: var(--muted); font-size: .72rem; }

/* ---------- people picker ---------- */
.pp { position: relative; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); padding: .3rem; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; min-height: 2.6rem; cursor: text; }
.pp:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.pp .chip-p { display: inline-flex; align-items: center; gap: .35rem; background: var(--surface-3); border-radius: 20px; padding: .12rem .5rem .12rem .15rem; font-size: .76rem; }
.pp .chip-p button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 0 .1rem; font-size: .8rem; }
.pp input { border: 0 !important; box-shadow: none !important; flex: 1; min-width: 8rem; padding: .3rem; background: transparent; }
.pp-list { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); max-height: 16rem; overflow: auto; z-index: 90; display: none; }
.pp.open .pp-list { display: block; }
.pp-list a { display: flex; gap: .5rem; align-items: center; padding: .45rem .6rem; text-decoration: none; color: var(--text); font-size: .8rem; }
.pp-list a:hover, .pp-list a.hl { background: var(--surface-3); }
.pp-list small { color: var(--muted); margin-left: auto; font-size: .7rem; }

/* ---------- people board (who works on what) ---------- */
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: var(--gap); }
.pcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem; display: flex; gap: .8rem; align-items: flex-start; box-shadow: var(--shadow); }
.pcard .grow { flex: 1; min-width: 0; }
.pcard b { color: var(--heading); }
.pcard .now { margin-top: .35rem; font-size: .78rem; background: var(--surface-2); border-radius: 8px; padding: .4rem .55rem; border-left: 3px solid var(--accent); }
.pcard .now a { color: var(--heading); text-decoration: none; font-weight: bold; }
.pcard.offline { opacity: .72; }
.cluster { border: 1px solid var(--line); border-radius: var(--radius); padding: .8rem; background: var(--surface); }
.cluster h4 { margin: 0 0 .5rem; font-size: .85rem; display: flex; justify-content: space-between; gap: .5rem; }

/* ---------- calendar (FullCalendar theming) ---------- */
.fc { --fc-border-color: var(--line); --fc-page-bg-color: var(--surface); --fc-neutral-bg-color: var(--surface-2); --fc-today-bg-color: var(--accent-l); --fc-button-bg-color: var(--surface); --fc-button-border-color: var(--line); --fc-button-text-color: var(--heading); --fc-button-hover-bg-color: var(--surface-3); --fc-button-hover-border-color: var(--line); --fc-button-active-bg-color: var(--accent); --fc-button-active-border-color: var(--accent); --fc-event-border-color: transparent; --fc-list-event-hover-bg-color: var(--surface-2); font-size: .8rem; }
.fc .fc-button { font-size: .78rem; border-radius: 8px !important; text-transform: capitalize; box-shadow: none !important; }
.fc .fc-button-primary:not(:disabled).fc-button-active { color: #fff; }
.fc .fc-toolbar-title { font-size: 1.15rem; color: var(--heading); }
.fc .fc-col-header-cell-cushion, .fc .fc-daygrid-day-number { color: var(--text-2); text-decoration: none; }
.fc-event { cursor: pointer; border-radius: 6px !important; padding: 1px 3px; }
.fc .fc-list-day-cushion { background: var(--surface-2); }
.cal-legend { display: flex; gap: .4rem .9rem; flex-wrap: wrap; font-size: .75rem; color: var(--text-2); }
.cal-legend i { display: inline-block; width: .7rem; height: .7rem; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }

/* ---------- chips ---------- */
.chips { display: flex; gap: .35rem; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 20px; cursor: pointer; font-size: .76rem; background: var(--surface); color: var(--text-2); text-decoration: none; }
.chip.on, .chip.active { background: var(--accent-l); border-color: var(--accent); color: var(--orange-ink); font-weight: bold; }
.chip input { display: none; }

/* ---------- search palette ---------- */
.palette { width: 100%; max-width: 38rem; }
.palette input { font-size: 1rem; padding: .85rem 1rem; }
.palette .results { max-height: 60vh; overflow: auto; margin-top: .6rem; }
.palette .results a { display: flex; gap: .7rem; align-items: center; padding: .55rem .7rem; border-radius: 9px; text-decoration: none; color: var(--text); }
.palette .results a.hl, .palette .results a:hover { background: var(--accent-l); }
.palette .results small { color: var(--muted); display: block; font-size: .72rem; }
.palette .grp { font-size: .66rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: .6rem .7rem .2rem; }

/* ---------- assistant ---------- */
.ai-fab { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 150; width: 3.6rem; height: 3.6rem; border-radius: 50%; border: 0; background: linear-gradient(135deg, var(--accent), #c25e00); color: #fff; box-shadow: 0 10px 28px rgba(194,94,0,.45); cursor: pointer; display: grid; place-items: center; transition: transform .2s; }
.ai-fab:hover { transform: scale(1.06); }
.ai-fab svg { width: 1.6rem; height: 1.6rem; }
.ai-fab .spark { position: absolute; top: -2px; right: -2px; background: #fff; color: var(--accent); font-size: .62rem; border-radius: 10px; padding: 1px 5px; font-weight: bold; box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.ai-panel { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 160; width: min(25rem, calc(100vw - 1.5rem)); height: min(38rem, calc(100vh - 2.5rem)); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; transform-origin: bottom right; transform: scale(.6); opacity: 0; pointer-events: none; transition: transform .2s, opacity .2s; }
.ai-panel.open { transform: none; opacity: 1; pointer-events: auto; }
.ai-head { display: flex; align-items: center; gap: .6rem; padding: .8rem .9rem; background: linear-gradient(135deg, var(--brown), #6b3d1e); color: #fff; }
.ai-head .av { border-color: transparent; box-shadow: none; background: #fff; }
.ai-head b { display: block; font-size: .9rem; } .ai-head small { color: #f3d9bf; font-size: .7rem; }
.ai-head .grow { flex: 1; }
.ai-head button { background: rgba(255,255,255,.12); border: 0; color: #fff; width: 2rem; height: 2rem; border-radius: 8px; cursor: pointer; }
.ai-body { flex: 1; overflow-y: auto; padding: .9rem; display: flex; flex-direction: column; gap: .55rem; background: var(--surface-2); }
.msg { display: flex; } .msg.me { justify-content: flex-end; }
.bub { max-width: 86%; padding: .55rem .8rem; border-radius: 14px; font-size: .83rem; line-height: 1.5; background: var(--surface); border: 1px solid var(--line); color: var(--text); word-wrap: break-word; }
.msg.me .bub { background: var(--accent); border-color: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.msg.bot .bub { border-bottom-left-radius: 4px; }
.bub a { color: var(--link); font-weight: bold; }
.msg.me .bub a { color: #fff; }
.bub ul { margin: .3rem 0; padding-left: 1.1rem; }
.bub .go { display: inline-flex; margin-top: .4rem; }
.qr { display: flex; gap: .35rem; flex-wrap: wrap; }
.qr button { border: 1px solid var(--accent); background: var(--surface); color: var(--orange-ink); border-radius: 16px; padding: .3rem .7rem; font-size: .75rem; cursor: pointer; }
.qr button:hover { background: var(--accent-l); }
.ai-foot { display: flex; gap: .4rem; padding: .6rem; border-top: 1px solid var(--line); background: var(--surface); }
.ai-foot input { border-radius: 20px; }
.ai-foot button { border-radius: 50%; width: 2.5rem; height: 2.5rem; flex: none; border: 0; background: var(--accent); color: #fff; cursor: pointer; font-size: 1rem; }
.typing i { display: inline-block; width: .4rem; height: .4rem; border-radius: 50%; background: var(--muted); margin: 0 1px; animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .2s; } .typing i:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.res-list a { display: block; padding: .35rem .5rem; margin: .2rem 0; border-radius: 8px; background: var(--surface-2); text-decoration: none; color: var(--text); font-weight: normal; border: 1px solid var(--line); }
.res-list a b { color: var(--heading); } .res-list small { color: var(--muted); display: block; font-size: .7rem; }

/* ---------- tour ---------- */
.tour-block { position: fixed; inset: 0; z-index: 400; }
.tour-mask { position: fixed; z-index: 401; border-radius: 12px; box-shadow: 0 0 0 9999px rgba(20,10,4,.6); transition: all .3s; pointer-events: none; }
.tour-pop { position: fixed; z-index: 402; width: min(21rem, calc(100vw - 2rem)); background: var(--surface); border-radius: 16px; padding: 1.1rem 1.2rem 1rem; box-shadow: var(--shadow-lg); border: 1px solid var(--line); transition: top .3s, left .3s; }
.tour-pop h4 { margin: 0 0 .4rem; font-size: 1rem; padding-right: 1.5rem; }
.tour-pop p { margin: 0 0 .9rem; font-size: .84rem; color: var(--text-2); }
.tour-pop .x { position: absolute; right: .6rem; top: .6rem; border: 0; background: none; cursor: pointer; color: var(--muted); font-size: 1rem; }
.tour-pop .tfoot { display: flex; align-items: center; gap: .4rem; }
.tour-pop .dots { flex: 1; display: flex; gap: 4px; flex-wrap: wrap; }
.tour-pop .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.tour-pop .dots i.on { background: var(--accent); width: 16px; border-radius: 3px; }
.tour-pop .skip { border: 0; background: none; color: var(--muted); cursor: pointer; font-size: .78rem; }
.tour-welcome { text-align: center; margin-bottom: .5rem; }
.tour-welcome img { width: 4.2rem; height: 4.2rem; border-radius: 50%; background: #fff; padding: 3px; box-shadow: var(--shadow); }

/* ---------- login ---------- */
body.login-page { background: radial-gradient(circle at 15% 20%, #5a3a26 0, #3E2415 40%, #24140a 100%); min-height: 100vh; }
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.login-card { width: 100%; max-width: 58rem; display: grid; grid-template-columns: 1fr 1.05fr; background: var(--surface); border-radius: 22px; overflow: hidden; box-shadow: 0 30px 80px rgba(0,0,0,.45); }
.login-art { background: linear-gradient(160deg, #F7941D, #c25e00); color: #fff; padding: 2.4rem 2.2rem; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.login-art::after { content: ""; position: absolute; width: 22rem; height: 22rem; border-radius: 50%; right: -9rem; bottom: -9rem; background: rgba(255,255,255,.12); }
.login-art img { width: 5rem; height: 5rem; border-radius: 50%; background: #fff; padding: 3px; }
.login-art h1 { color: #fff; font-size: 1.7rem; margin: 1rem 0 .4rem; }
.login-art p { opacity: .92; margin: 0 0 1.2rem; }
.login-art ul { list-style: none; padding: 0; margin: auto 0 0; position: relative; z-index: 1; }
.login-art li { padding: .3rem 0 .3rem 1.6rem; position: relative; font-size: .85rem; }
.login-art li::before { content: "✓"; position: absolute; left: 0; font-weight: bold; }
.login-form { padding: 2.4rem 2.3rem; }
.login-form h2 { margin: 0 0 .3rem; font-size: 1.5rem; }
.btn-google { width: 100%; display: flex; gap: .7rem; align-items: center; justify-content: center; padding: .75rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #3c4043; font-weight: bold; text-decoration: none; font-size: .9rem; transition: box-shadow .15s; }
.btn-google:hover { box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.btn-google.disabled { opacity: .55; pointer-events: none; }
.or { display: flex; align-items: center; gap: .7rem; color: var(--muted); font-size: .75rem; margin: 1.2rem 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
@media (max-width: 760px) { .login-card { grid-template-columns: 1fr; } .login-art { padding: 1.6rem; } .login-art ul { display: none; } .login-form { padding: 1.6rem; } }

/* ---------- misc ---------- */
.kanban { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: var(--gap); }
.col-h { font-size: .74rem; text-transform: uppercase; color: var(--muted); letter-spacing: .05em; margin: 0 0 .5rem; display: flex; justify-content: space-between; }
.task { display: flex; gap: .6rem; align-items: flex-start; padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); margin-bottom: .5rem; }
.task .grow { flex: 1; min-width: 0; }
.task.done { opacity: .6; } .task.done .t { text-decoration: line-through; }
.task.overdue { border-left: 3px solid var(--red); }
.cb { width: 1.15rem; height: 1.15rem; border-radius: 6px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; flex: none; margin-top: .1rem; display: grid; place-items: center; font-size: .7rem; color: #fff; padding: 0; }
.cb.on { background: var(--green); border-color: var(--green); }
.announce { border-left: 4px solid var(--accent); background: linear-gradient(90deg, var(--accent-l), var(--surface) 60%); }
.greet { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.greet h2 { margin: 0; font-size: 1.45rem; }
.alert-list .al { display: flex; gap: .7rem; align-items: center; padding: .6rem .7rem; border-radius: 10px; margin-bottom: .4rem; text-decoration: none; color: var(--text); background: var(--surface-2); border: 1px solid var(--line); }
.alert-list .al:hover { border-color: var(--accent); }
.alert-list .al.red { background: var(--red-l); border-color: transparent; }
.alert-list .al.amber { background: var(--amber-l); border-color: transparent; }
.alert-list .al .ico { font-size: 1.15rem; }
.alert-list .al .grow { flex: 1; min-width: 0; }
.alert-list .al b { display: block; font-size: .82rem; }
.alert-list .al small { color: var(--text-2); font-size: .74rem; }
.sticky-actions { position: sticky; bottom: 0; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(6px); padding: .8rem 0; border-top: 1px solid var(--line); display: flex; gap: .5rem; justify-content: flex-end; z-index: 5; flex-wrap: wrap; }
.mini-chart { display: flex; align-items: flex-end; gap: 3px; height: 4rem; }
.mini-chart i { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.doc-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: var(--gap); }
.doc-tile { display: flex; flex-direction: column; gap: .3rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--text); box-shadow: var(--shadow); transition: transform .15s, border-color .15s; position: relative; }
.doc-tile:hover { transform: translateY(-3px); border-color: var(--accent); }
.doc-tile .e { font-size: 1.8rem; }
.doc-tile b { color: var(--heading); font-size: .95rem; }
.doc-tile small { color: var(--muted); font-size: .74rem; }
.doc-tile .count { position: absolute; right: .8rem; top: .8rem; }
.print-only { display: none; }
@media print {
  .no-print, .sidebar, .topbar, .ai-fab, .ai-panel, #toasts, .tabs, .btn, .sticky-actions { display: none !important; }
  main.container { margin: 0 !important; padding: 0 !important; max-width: none; }
  body { background: #fff; color: #000; font-size: 11px; }
  .card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
  .print-only { display: block; }
  a { color: #000; text-decoration: none; }
}
/* button cells inside inline form rows never shrink */
.row > div:has(> .btn), .row > div[style*="flex:0"] { flex: none !important; }
