/* Intranet – same visual family as test-web (navy, mono accents), system fonts only (offline). */
:root {
  --bg: #060b14;
  --bg-2: #0b1422;
  --panel: #0e1828;
  --panel-2: #132033;
  --fg: #cdd8e5;
  --fg-strong: #eef3f8;
  --dim: #6c8096;
  --rule: #1a2638;
  --rule-2: #24344b;
  --accent: #22d3ee;
  --accent-ink: #04222a;
  --accent-soft: rgba(34, 211, 238, .12);
  --ok: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --radius: 10px;
  --mono: ui-monospace, 'JetBrains Mono', 'Cascadia Code', 'SF Mono', Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --bg: #eef2f7; --bg-2: #e4eaf2; --panel: #ffffff; --panel-2: #f3f6fa;
    --fg: #23364a; --fg-strong: #0d1b28; --dim: #66788a; --rule: #d3dde8; --rule-2: #bfccda;
    --accent: #0891b2; --accent-ink: #ffffff; --accent-soft: rgba(8, 145, 178, .1);
    --ok: #059669; --warn: #b45309; --bad: #dc2626;
    color-scheme: light;
  }
}
/* explicit choice from the day/night toggle */
:root[data-theme='light'] {
    --bg: #eef2f7; --bg-2: #e4eaf2; --panel: #ffffff; --panel-2: #f3f6fa;
    --fg: #23364a; --fg-strong: #0d1b28; --dim: #66788a; --rule: #d3dde8; --rule-2: #bfccda;
    --accent: #0891b2; --accent-ink: #ffffff; --accent-soft: rgba(8, 145, 178, .1);
    --ok: #059669; --warn: #b45309; --bad: #dc2626;
    color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 15px/1.5 var(--sans);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { color: var(--fg-strong); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.45rem; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .9em; }
.dim { color: var(--dim); }
.small { font-size: .85rem; }
[hidden] { display: none !important; }

/* ── Top bar ── */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 16px;
  padding: 10px max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg-strong); font-family: var(--mono); font-weight: 600; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink); font-size: 13px; font-weight: 700;
}
.nav { display: flex; gap: 4px; margin-left: 8px; flex-wrap: wrap; }
.nav a { color: var(--dim); padding: 6px 9px; border-radius: 7px; font-size: .9rem; }
.nav a:hover { color: var(--fg-strong); background: var(--panel); text-decoration: none; }
.nav a.active { color: var(--fg-strong); background: var(--panel-2); }
.topbar .spacer { flex: 1; }
.who { display: flex; align-items: center; gap: 10px; font-size: .9rem; color: var(--dim); }
.who form { margin: 0; }

.page { max-width: 1180px; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-left)) 64px; }
.page.narrow { max-width: 760px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head h1 { margin: 0; }

/* ── Buttons & forms ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 .92rem var(--sans); color: var(--fg-strong);
  background: var(--panel-2); border: 1px solid var(--rule-2); border-radius: 8px;
  padding: 9px 14px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); text-decoration: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { border-color: var(--bad); }
.btn-sm { padding: 5px 10px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; }
.btn[disabled] { opacity: .55; cursor: progress; }

label { display: block; font-size: .85rem; color: var(--dim); margin-bottom: 6px; font-weight: 500; }
input[type='text'], input[type='password'], input[type='email'], input[type='url'], input[type='number'], input[type='search'], input[type='date'], input[type='time'], input[type='datetime-local'], select, textarea {
  width: 100%; font: 1rem var(--sans); color: var(--fg-strong);
  background: var(--bg-2); border: 1px solid var(--rule-2); border-radius: 8px; padding: 10px 12px;
}
input::placeholder { color: var(--dim); opacity: .7; }
input.code { font-family: var(--mono); font-size: 1.4rem; letter-spacing: .35em; text-align: center; }
.field { margin-bottom: 16px; }
.row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.check { display: flex; align-items: center; gap: 8px; color: var(--fg); font-size: .92rem; margin: 6px 0; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline { display: inline; margin: 0; }

/* ── Panels, tables, flash ── */
.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; margin-bottom: 18px; }
.panel h2 { margin-bottom: 14px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 500; color: var(--dim); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
.tag { display: inline-block; font: 500 .72rem var(--mono); padding: 2px 7px; border-radius: 5px; border: 1px solid var(--rule-2); color: var(--dim); white-space: nowrap; }
.tag.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.tag.bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.tag.accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.flash { border-radius: 8px; padding: 11px 14px; margin-bottom: 18px; font-size: .92rem; border: 1px solid; }
.flash.error { color: var(--bad); background: color-mix(in srgb, var(--bad) 9%, transparent); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.flash.success { color: var(--ok); background: color-mix(in srgb, var(--ok) 9%, transparent); border-color: color-mix(in srgb, var(--ok) 35%, transparent); }
.flash.info { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }

/* ── Login ── */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-bottom: 26px; text-align: center; }
.auth-brand .brand-mark { width: 44px; height: 44px; border-radius: 12px; font-size: 20px; }
.auth-brand h1 { margin: 0; font-family: var(--mono); font-size: 1.25rem; }
.auth-panel { background: var(--panel); border: 1px solid var(--rule); border-radius: 14px; padding: 26px; }
.auth-panel h2 { font-size: 1rem; margin-bottom: 18px; }
.identity {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: var(--bg-2); border: 1px solid var(--rule); border-radius: 999px; padding: 6px 6px 6px 14px; margin-bottom: 20px;
}
.identity .name { font-family: var(--mono); font-size: .92rem; color: var(--fg-strong); overflow: hidden; text-overflow: ellipsis; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--dim); font-size: .78rem; margin: 18px 0; text-transform: uppercase; letter-spacing: .08em; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--rule-2); }
.stack { display: grid; gap: 10px; }
.auth-foot { text-align: center; margin-top: 18px; color: var(--dim); font-size: .8rem; font-family: var(--mono); }

/* ── Portal ── */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.search { position: relative; min-width: 240px; flex: 1; max-width: 360px; }
.search input { padding-left: 36px; }
.search::before { content: '⌕'; position: absolute; left: 12px; top: 50%; transform: translateY(-52%); color: var(--dim); font-size: 1.15rem; }
.cat { margin-bottom: 30px; }
.cat-title { display: flex; align-items: center; gap: 10px; font: 500 .78rem var(--mono); color: var(--dim); text-transform: uppercase; letter-spacing: .09em; margin: 0 0 12px; }
.cat-title::after { content: ''; flex: 1; height: 1px; background: var(--rule); }
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.tile {
  position: relative; display: flex; gap: 14px; align-items: flex-start;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 15px 16px; color: var(--fg); transition: border-color .12s, transform .12s, background .12s;
}
.tile:hover { text-decoration: none; border-color: var(--accent); background: var(--panel-2); transform: translateY(-1px); }
.tile-icon {
  flex: none; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center;
  background: var(--bg-2); border: 1px solid var(--rule); font-size: 22px; overflow: hidden;
}
.tile-icon img { width: 28px; height: 28px; object-fit: contain; }
.tile-icon .initials { font: 700 .95rem var(--mono); color: var(--accent); }
.tile-body { min-width: 0; flex: 1; }
.tile-title { display: flex; align-items: center; gap: 8px; color: var(--fg-strong); font-weight: 600; }
.tile-desc { color: var(--dim); font-size: .86rem; margin-top: 2px; }
.tile-host { font: .74rem var(--mono); color: var(--dim); opacity: .8; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rule-2); flex: none; }
.dot.up { background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 20%, transparent); }
.dot.error { background: var(--warn); }
.dot.down { background: var(--bad); }
.lock { font-size: .7rem; }
.empty { text-align: center; padding: 48px 16px; color: var(--dim); border: 1px dashed var(--rule-2); border-radius: var(--radius); }

/* ── MFA setup ── */
.qr { background: #fff; padding: 10px; border-radius: 10px; width: 240px; max-width: 100%; }
.mfa-grid { display: grid; gap: 22px; grid-template-columns: auto 1fr; align-items: start; }
@media (max-width: 620px) { .mfa-grid { grid-template-columns: 1fr; } .topbar .nav { order: 3; width: 100%; margin: 0; } .topbar { flex-wrap: wrap; } }
.secret { font-family: var(--mono); word-break: break-all; background: var(--bg-2); border: 1px solid var(--rule); border-radius: 8px; padding: 10px 12px; color: var(--fg-strong); }

/* ── v1.2 modules ── */
.tile-icon.avatar { border-radius: 50%; background: var(--accent-soft); border-color: transparent; }
.news { border-left: 3px solid var(--accent); }
.news.success { border-left-color: var(--ok); }
.news.warning { border-left-color: var(--warn); }
.news.outage { border-left-color: var(--bad); background: color-mix(in srgb, var(--bad) 6%, var(--panel)); }
.news h3 { font-size: 1rem; margin: 0 0 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.news .meta { color: var(--dim); font-size: .8rem; margin-bottom: 8px; }
.news .body p { margin: 0 0 .6em; }
.news .body p:last-child { margin: 0; }
.home-grid { display: grid; gap: 18px; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); margin-bottom: 26px; }
@media (max-width: 860px) { .home-grid { grid-template-columns: 1fr; } }
.mini { list-style: none; margin: 0; padding: 0; }
.mini li { display: flex; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: .9rem; }
.mini li:last-child { border-bottom: 0; }
.cal { border-collapse: separate; border-spacing: 0; font-size: .78rem; }
.cal th, .cal td { padding: 0; border-bottom: 1px solid var(--rule); text-align: center; min-width: 26px; height: 30px; }
.cal th.name, .cal td.name { text-align: left; padding: 0 10px 0 0; min-width: 150px; white-space: nowrap; position: sticky; left: 0; background: var(--panel); z-index: 1; }
.cal th { font-weight: 500; text-transform: none; letter-spacing: 0; }
.cal .we { background: color-mix(in srgb, var(--dim) 9%, transparent); }
.cal .today { background: var(--accent-soft); }
.cal th.today { color: var(--accent); font-weight: 700; }
.cal .ab { display: block; height: 18px; margin: 0 1px; border-radius: 4px; opacity: .85; }
.cal .ab.pending { opacity: .35; }
.legend { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: .8rem; color: var(--dim); margin-top: 12px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 5px; vertical-align: -2px; }
.check-item { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.check-item:last-child { border-bottom: 0; }
.check-item.done .ci-title { text-decoration: line-through; color: var(--dim); }
.check-item form { margin: 0; }
.progress { height: 6px; background: var(--rule); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--ok); }
.bars { display: flex; gap: 2px; align-items: stretch; height: 28px; }
.bars span { flex: 1; border-radius: 2px; background: var(--rule-2); min-width: 3px; }
.bars span.ok { background: var(--ok); }
.bars span.partial { background: var(--warn); }
.bars span.bad { background: var(--bad); }
.day-grid { position: relative; }
.slot-table td.res { white-space: nowrap; font-weight: 600; }
.booking { display: inline-block; font-size: .78rem; padding: 3px 7px; border-radius: 6px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); margin: 2px 4px 2px 0; }
.booking.mine { background: color-mix(in srgb, var(--ok) 15%, transparent); border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
details.menu { position: relative; }
details.menu > summary { list-style: none; cursor: pointer; color: var(--dim); padding: 6px 10px; border-radius: 7px; font-size: .9rem; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > summary, details.menu > summary:hover { color: var(--fg-strong); background: var(--panel); }
details.menu .menu-pop { position: absolute; top: 100%; left: 0; margin-top: 6px; background: var(--panel); border: 1px solid var(--rule-2); border-radius: 10px; padding: 6px; min-width: 210px; display: grid; z-index: 20; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
details.menu .menu-pop a { padding: 7px 10px; border-radius: 6px; color: var(--fg); font-size: .9rem; }
details.menu .menu-pop a:hover { background: var(--panel-2); text-decoration: none; }

.tag.wrap { white-space: normal; line-height: 1.35; }
input[type='date'], input[type='time'], input[type='datetime-local'] { min-height: 42px; }

.theme-toggle { width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--rule-2); background: var(--panel); color: var(--fg-strong); cursor: pointer; font-size: 16px; line-height: 1; display: inline-grid; place-items: center; }
.theme-toggle:hover { border-color: var(--accent); }
.corner-toggle { position: fixed; top: 14px; right: 14px; z-index: 30; }
.brand-logo { width: 26px; height: 26px; object-fit: contain; border-radius: 6px; }
.auth-brand .brand-logo { width: 52px; height: 52px; }
.site-foot { max-width: 1180px; margin: 0 auto; padding: 18px max(16px, env(safe-area-inset-left)) 28px; color: var(--dim); font-size: .78rem; font-family: var(--mono); display: flex; gap: 14px; flex-wrap: wrap; justify-content: space-between; border-top: 1px solid var(--rule); }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 5px; vertical-align: -4px; margin-right: 6px; border: 1px solid var(--rule-2); }
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.statbar { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.statbar div { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; opacity: .85; }
.statbar div.v2 { background: var(--ok); }

/* ── e-mail campaigns (1.4) ── */
.kpi { font-size: 1.8rem; font-weight: 700; color: var(--fg-strong); }
.grid-2 { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); align-items: start; }
.grid-2 > .panel { margin: 0 0 18px; }
.toolbar .spacer, .actions .spacer { flex: 1; }
fieldset { border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 16px 14px; margin: 16px 0 0; }
fieldset[hidden] { display: none; }
legend { padding: 0 6px; color: var(--fg-strong); font-weight: 600; }
.stack { display: grid; gap: 6px; }
.mail-preview { width: 100%; height: 640px; border: 1px solid var(--rule); border-radius: var(--radius); background: #fff; }
.statbar div { position: relative; }
.statbar .reply-dot { position: absolute; top: -9px; left: 50%; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%; background: var(--ok); }
td form.inline { display: inline-flex; gap: 6px; align-items: center; }
td form.inline select { width: auto; min-width: 0; padding: 4px 8px; font-size: .85rem; }
