/* Zagoffice 5.0 — interface web */
:root {
  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --line: #e3e7ee;
  --line-strong: #cfd6e1;
  --text: #17202e;
  --text-2: #4a5568;
  --muted: #6b7686;
  --brand: #14284b;
  --brand-2: #1d3a6b;
  --accent: #2563eb;
  --accent-soft: #e8f0fe;
  --gold: #b88a2e;
  --ok: #15803d;
  --ok-soft: #e7f6ec;
  --warn: #b45309;
  --warn-soft: #fdf3e3;
  --danger: #c0262d;
  --danger-soft: #fdecec;
  --side-bg: #0f1f3a;
  --side-text: #c9d3e3;
  --side-muted: #8696b0;
  --side-active: #1f3a68;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 32px rgba(16, 24, 40, .16);
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --side-w: 248px;
  --top-h: 60px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d131d; --surface: #141c28; --surface-2: #19222f; --line: #253042; --line-strong: #33415a;
    --text: #e6ebf2; --text-2: #b7c1d0; --muted: #8b97a8; --brand: #c9d7f2; --brand-2: #a9bfe9;
    --accent: #5b8ef5; --accent-soft: #1b2a45; --ok: #4ade80; --ok-soft: #12291c; --warn: #f5b454; --warn-soft: #2d2212;
    --danger: #f87171; --danger-soft: #2f1517; --side-bg: #0a101a; --side-active: #18294a;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d131d; --surface: #141c28; --surface-2: #19222f; --line: #253042; --line-strong: #33415a;
  --text: #e6ebf2; --text-2: #b7c1d0; --muted: #8b97a8; --brand: #c9d7f2; --brand-2: #a9bfe9;
  --accent: #5b8ef5; --accent-soft: #1b2a45; --ok: #4ade80; --ok-soft: #12291c; --warn: #f5b454; --warn-soft: #2d2212;
  --danger: #f87171; --danger-soft: #2f1517; --side-bg: #0a101a; --side-active: #18294a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body.modal-open { overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
h1 { font-size: 1.45rem; } h2 { font-size: 1.1rem; } h3 { font-size: .98rem; }
p { margin: 0 0 .6em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); font-size: .92em; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.ico { width: 18px; height: 18px; flex: none; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: var(--side-w) 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; padding: 14px 12px; gap: 6px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; border-bottom: 1px solid rgba(255, 255, 255, .07); margin-bottom: 8px; }
.brand-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, #d6ad55, #9b7224); display: grid; place-items: center; color: #10203c; font-weight: 800; font-size: 15px; flex: none; }
.brand-text { line-height: 1.15; overflow: hidden; }
.brand-text strong { display: block; color: #fff; font-size: 15px; letter-spacing: .01em; }
.brand-text span { font-size: 11.5px; color: var(--side-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--side-muted); padding: 12px 10px 4px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; color: var(--side-text); font-weight: 500; text-decoration: none; white-space: nowrap; }
.nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav a.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 #d6ad55; }
.nav a .ico { width: 19px; height: 19px; opacity: .9; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .07); padding-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.side-foot button { all: unset; display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--side-text); }
.side-foot button:hover { background: rgba(255, 255, 255, .06); color: #fff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 20; height: var(--top-h); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 0 22px; }
.top .menu-btn { display: none; }
.global-search { position: relative; flex: 1; max-width: 560px; }
.global-search input { width: 100%; padding-left: 38px; background: var(--surface-2); }
.global-search .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.timer-pill { display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); max-width: 340px; cursor: pointer; }
.timer-pill.running { border-color: color-mix(in srgb, var(--ok) 45%, var(--line)); background: var(--ok-soft); }
.timer-pill .t-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; max-width: 170px; }
.timer-pill .t-time { font-family: var(--mono); font-weight: 600; font-size: 13px; }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 999px; cursor: pointer; border: 1px solid transparent; background: none; color: inherit; font: inherit; }
.user-chip:hover { background: var(--surface-2); border-color: var(--line); }
.user-chip .u-name { font-weight: 600; max-width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content { padding: 24px 28px 48px; width: 100%; max-width: 1480px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head .sub { color: var(--muted); margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .88rem; margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* ---------- controls ---------- */
input, select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); padding: 8px 11px; min-height: 38px; width: 100%; transition: border-color .12s, box-shadow .12s; }
textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
input[type=checkbox], input[type=radio] { width: 17px; height: 17px; min-height: 0; accent-color: var(--accent); padding: 0; }
label.field { display: flex; flex-direction: column; gap: 5px; font-weight: 550; font-size: .88rem; color: var(--text-2); }
label.field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; cursor: pointer; padding: 8px 0; }
.check small { display: block; color: var(--muted); font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.form-error { color: var(--danger); font-weight: 500; margin-right: auto; font-size: .9rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 38px; padding: 0 15px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .12s, border-color .12s, transform .05s; text-decoration: none !important; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn.dark { background: var(--brand); border-color: var(--brand); color: #fff; }
:root[data-theme="dark"] .btn.dark { color: #0d131d; }
.btn.success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 31px; padding: 0 10px; font-size: .86rem; }
.btn .ico { width: 17px; height: 17px; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--line); color: var(--text); }
.icon-btn.sm { width: 30px; height: 30px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 7px 13px; font: inherit; font-weight: 550; color: var(--text-2); cursor: pointer; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--accent-soft); color: var(--accent); }

/* ---------- cards & layout ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-head h2, .card-head h3 { display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.hub { grid-template-columns: minmax(0, 1.65fr) minmax(320px, 1fr); align-items: start; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stat { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat .k { color: var(--muted); font-size: .82rem; font-weight: 550; text-transform: uppercase; letter-spacing: .04em; display: flex; align-items: center; gap: 6px; }
.stat .v { font-size: 1.6rem; font-weight: 700; letter-spacing: -.02em; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .76rem; font-weight: 650; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.blue { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.green { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.amber { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.red { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge.gold { background: color-mix(in srgb, var(--gold) 16%, transparent); color: var(--gold); border-color: transparent; }
.notice { display: flex; gap: 10px; padding: 11px 14px; border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--text); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); }
.notice.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.notice.danger { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.notice .ico { margin-top: 2px; }

/* ---------- avatars & presence ---------- */
.avatar { --h: 215; display: inline-grid; place-items: center; border-radius: 50%; background: hsl(var(--h) 45% 88%); color: hsl(var(--h) 45% 28%); font-weight: 700; flex: none; overflow: hidden; }
:root[data-theme="dark"] .avatar { background: hsl(var(--h) 30% 26%); color: hsl(var(--h) 60% 86%); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.xs { width: 24px; height: 24px; font-size: 10px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.avatar.md { width: 42px; height: 42px; font-size: 15px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.xl { width: 104px; height: 104px; font-size: 34px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; background: #a0a9b8; box-shadow: 0 0 0 2px var(--surface); }
.dot.st-trabalhando { background: #16a34a; }
.dot.st-pausado { background: #eab308; }
.dot.st-online { background: #3b82f6; }
.dot.st-ausente { background: #f59e0b; }
.dot.st-offline { background: #a0a9b8; }
.av-wrap { position: relative; display: inline-flex; }
.av-wrap .dot { position: absolute; right: 0; bottom: 1px; width: 11px; height: 11px; }

/* ---------- office room (hub) ---------- */
.room { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.desk { position: relative; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); display: flex; flex-direction: column; gap: 10px; transition: box-shadow .15s, transform .15s; cursor: pointer; }
.desk:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.desk.st-trabalhando { border-color: color-mix(in srgb, #16a34a 40%, var(--line)); background: linear-gradient(180deg, color-mix(in srgb, #16a34a 6%, var(--surface)), var(--surface)); }
.desk.st-offline { opacity: .72; }
.desk.me { outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.desk .who { display: flex; gap: 11px; align-items: center; }
.desk .who strong { display: block; line-height: 1.2; }
.desk .who span { color: var(--muted); font-size: .82rem; }
.desk .doing { font-size: .88rem; background: var(--surface-2); border-radius: 7px; padding: 8px 10px; min-height: 52px; }
.desk .doing .act { font-weight: 600; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.desk .doing .cli { color: var(--muted); font-size: .8rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.desk .foot { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--muted); }
.desk .elapsed { font-family: var(--mono); font-weight: 650; color: var(--ok); }
.timer-card { padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.timer-card .clock { font-family: var(--mono); font-size: 2.3rem; font-weight: 650; letter-spacing: .02em; line-height: 1; }
.timer-card .now { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.open-list { display: flex; flex-direction: column; gap: 6px; }
.open-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; }
.open-item .grow strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 11px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; }
.feed-item .txt { font-size: .9rem; color: var(--text-2); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.welcome { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 22px; background: linear-gradient(120deg, var(--side-bg), #1d3a6b); color: #fff; border-radius: var(--radius); margin-bottom: 18px; flex-wrap: wrap; }
.welcome h1 { color: #fff; }
.welcome .sub { color: #b9c7de; margin-top: 4px; }
.welcome .kpis { display: flex; gap: 26px; flex-wrap: wrap; }
.welcome .kpi .v { font-size: 1.35rem; font-weight: 700; }
.welcome .kpi .k { font-size: .78rem; color: #b9c7de; text-transform: uppercase; letter-spacing: .05em; }

/* ---------- tables & lists ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.toolbar .search { position: relative; flex: 1; min-width: 220px; }
.toolbar .search input { padding-left: 36px; }
.toolbar .search .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar select { width: auto; min-width: 150px; max-width: 280px; }
.table-wrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; }
table.list th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 650; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; }
table.list td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list tr:last-child td { border-bottom: 0; }
table.list tbody tr.click { cursor: pointer; }
table.list tbody tr.click:hover td { background: var(--surface-2); }
table.list td .name { font-weight: 600; color: var(--text); }
table.list td.primary-cell { min-width: 220px; }
table.list td.clip { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.list td .sub { color: var(--muted); font-size: .82rem; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; flex-wrap: wrap; }
.list-items { display: flex; flex-direction: column; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item.click { cursor: pointer; }
.list-item.click:hover { background: var(--surface-2); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 38px 18px; color: var(--muted); text-align: center; }
.empty .ico { width: 34px; height: 34px; opacity: .55; }
.empty strong { color: var(--text-2); }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px; color: var(--muted); }
.spin { width: 18px; height: 18px; border: 2.5px solid var(--line-strong); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- client file ---------- */
.file-head { display: flex; gap: 18px; align-items: flex-start; padding: 20px; flex-wrap: wrap; }
.file-head .ident { flex: 1; min-width: 260px; }
.file-head h1 { font-size: 1.55rem; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 10px; color: var(--text-2); }
.facts span { display: inline-flex; align-items: center; gap: 6px; }
.facts .ico { color: var(--muted); width: 16px; height: 16px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 12px 14px; cursor: pointer; border-bottom: 2.5px solid transparent; display: inline-flex; gap: 7px; align-items: center; white-space: nowrap; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.tabs .count { font-size: .74rem; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 0 7px; }
.composer { padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; }
.composer textarea { min-height: 74px; background: var(--surface); }
.composer .row select, .composer .row input { width: auto; }
.timeline { padding: 6px 0; }
.t-year { position: sticky; top: var(--top-h); z-index: 2; background: color-mix(in srgb, var(--surface) 94%, transparent); padding: 6px 18px; font-weight: 700; color: var(--muted); font-size: .8rem; letter-spacing: .06em; border-bottom: 1px solid var(--line); }
.t-item { display: grid; grid-template-columns: 112px 1fr; gap: 14px; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.t-item:hover { background: var(--surface-2); }
.t-item .when { color: var(--muted); font-size: .84rem; }
.t-item .when strong { display: block; color: var(--text-2); font-size: .9rem; }
.t-item .body { min-width: 0; }
.t-item .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 4px; font-size: .84rem; }
.t-item .meta .author { font-weight: 650; color: var(--text); }
.t-item .text { white-space: pre-wrap; word-wrap: break-word; color: var(--text); }
.t-item .text .mask { font-family: var(--mono); background: var(--warn-soft); color: var(--warn); padding: 0 4px; border-radius: 4px; }
.t-item .actions { opacity: 0; transition: opacity .12s; }
.t-item:hover .actions { opacity: 1; }
mark { background: color-mix(in srgb, #facc15 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.vault-item { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.vault-item:last-child { border-bottom: 0; }
.vault-item .svc { font-weight: 650; display: flex; align-items: center; gap: 8px; }
.secret-box { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 12px; align-items: center; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: 8px; padding: 10px 12px; margin-top: 8px; width: 100%; }
.secret-box .lbl { color: var(--muted); font-size: .82rem; }
.secret-box .val { font-family: var(--mono); font-size: 1rem; word-break: break-all; }
.doc-item { display: flex; align-items: center; gap: 12px; padding: 11px 18px; border-bottom: 1px solid var(--line); }
.doc-item:last-child { border-bottom: 0; }
.doc-ext { width: 38px; height: 44px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: .66rem; font-weight: 800; text-transform: uppercase; flex: none; }
.drop { border: 2px dashed var(--line-strong); border-radius: var(--radius); padding: 22px; text-align: center; color: var(--muted); cursor: pointer; margin: 14px 18px; }
.drop.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 8px 14px; }
.kv dt { color: var(--muted); font-size: .86rem; }
.kv dd { margin: 0; word-break: break-word; }
.origin { white-space: pre-wrap; font-family: var(--mono); font-size: .84rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: var(--text-2); }

/* ---------- profile ---------- */
.profile-hero { display: flex; gap: 20px; align-items: center; padding: 22px; flex-wrap: wrap; }
.avatar-edit { position: relative; cursor: pointer; }
.avatar-edit .cam { position: absolute; right: 2px; bottom: 2px; background: var(--accent); color: #fff; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 3px solid var(--surface); }
.perm-list { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 12px; }

/* ---------- reports ---------- */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding: 10px 4px 0; }
.bars .b { flex: 1; min-width: 4px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 60%, transparent)); border-radius: 4px 4px 0 0; position: relative; }
.bars .b:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--text); color: var(--surface); font-size: .75rem; padding: 3px 7px; border-radius: 5px; white-space: nowrap; margin-bottom: 4px; }
.meter { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* ---------- login ---------- */
.login-page { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.login-art { background: radial-gradient(1200px 500px at -10% -10%, #2a4a85 0, transparent 60%), linear-gradient(150deg, #0f1f3a, #14284b 60%, #0f1f3a); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art h1 { font-size: 2.2rem; color: #fff; max-width: 460px; line-height: 1.15; }
.login-art p { color: #b9c7de; max-width: 440px; font-size: 1.02rem; }
.login-art ul { list-style: none; padding: 0; margin: 26px 0 0; display: flex; flex-direction: column; gap: 12px; color: #d8e1f0; }
.login-art li { display: flex; align-items: center; gap: 10px; }
.login-form { display: grid; place-items: center; padding: 32px 20px; background: var(--surface); }
.login-form form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 16px; }
.login-form h2 { font-size: 1.5rem; }

/* ---------- toasts & modal ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 36px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 9px; background: var(--text); color: var(--surface); box-shadow: var(--shadow-lg); animation: up .2s ease; font-weight: 500; }
.toast.error { background: var(--danger); color: #fff; }
.toast.out { opacity: 0; transform: translateY(6px); transition: .25s; }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }
.modal-back { position: fixed; inset: 0; background: rgba(10, 16, 28, .5); z-index: 80; display: grid; place-items: center; padding: 18px; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 36px); display: flex; flex-direction: column; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.modal.wide { max-width: 860px; }
.modal header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 18px 20px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.modal footer { display: flex; justify-content: flex-end; align-items: center; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 14px 14px; flex-wrap: wrap; }
.menu { position: absolute; z-index: 60; min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 6px; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; border: 0; background: none; font: inherit; color: var(--text); cursor: pointer; text-decoration: none; }
.menu button:hover, .menu a:hover { background: var(--surface-2); }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 5px 0; }
.search-pop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; max-height: min(70vh, 560px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 50; }
.modal .search-pop { position: static !important; margin-top: 6px; box-shadow: none; max-height: 260px; }
.search-pop h4 { margin: 0; padding: 10px 14px 4px; font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.search-pop .list-item { padding: 9px 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.hub { grid-template-columns: 1fr; }
}
@media (max-width: 1100px) {
  :root { --side-w: 72px; }
  .side { padding: 14px 10px; align-items: center; }
  .brand { padding: 4px 0 12px; justify-content: center; }
  .brand-text, .nav-label, .nav a span, .side-foot button span { display: none; }
  .nav a, .side-foot button { justify-content: center; padding: 11px; }
  .nav a.active { box-shadow: inset 0 -3px 0 #d6ad55; }
  .content { padding: 20px 20px 40px; }
  .timer-pill .t-name { max-width: 110px; }
}
@media (max-width: 860px) {
  .grid.cols-3, .grid.cols-2 { grid-template-columns: 1fr; }
  .user-chip .u-name { display: none; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 270px; align-items: stretch; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
  .side.open { transform: none; }
  .side .brand-text, .side .nav-label, .side .nav a span, .side .side-foot button span { display: initial; }
  .side .brand { justify-content: flex-start; }
  .side .nav a, .side .side-foot button { justify-content: flex-start; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 25; }
  .top { padding: 0 10px; gap: 8px; }
  .top .menu-btn { display: inline-grid; }
  .timer-pill .t-name { display: none; }
  .content { padding: 16px 14px 40px; }
  .page-head h1 { font-size: 1.25rem; }
  .form-grid { grid-template-columns: 1fr; }
  .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .t-item { grid-template-columns: 1fr; gap: 4px; }
  .t-item .actions { opacity: 1; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .login-page { grid-template-columns: 1fr; }
  .login-art { display: none; }
  table.list.responsive, table.list.responsive tbody { display: block; width: 100%; }
  table.list.responsive thead { display: none; }
  table.list.responsive tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  table.list.responsive td { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; border: 0; padding: 3px 14px; text-align: right !important; min-width: 0; max-width: none; white-space: normal; overflow-wrap: anywhere; }
  table.list.responsive td::before { content: attr(data-label); color: var(--muted); font-size: .8rem; text-align: left; flex: none; }
  table.list.responsive td.primary-cell { display: block; text-align: left !important; min-width: 0; }
  table.list.responsive td:empty { display: none; }
  .global-search input::placeholder { color: transparent; }
  table.list.responsive td.primary-cell::before { content: none; }
  .welcome { padding: 16px; }
  .welcome .kpis { gap: 16px; }
  .modal-back { padding: 0; place-items: end stretch; }
  .modal { max-height: 92vh; border-radius: 14px 14px 0 0; }
}
@media print {
  .side, .top, .page-actions, .composer, .t-item .actions, .tabs { display: none !important; }
  .shell { display: block; }
  .card { box-shadow: none; border: 0; }
}
