/* Hostiva design system — translated one-for-one from the Hostiva mockups
   (panel-home, server-home, email-accounts, webmail, icons). Every inline
   style in the mockups lives here as a class so templates carry zero
   inline styling (CSP style-src 'self'). Fonts are self-hosted.

   Palette: navy #0E1A2E · primary #2156D9 · logo #E8590C · bg #F4F6F9
   Type: Plus Jakarta Sans · JetBrains Mono. */

@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/assets/fonts/plus-jakarta-sans.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/assets/fonts/jetbrains-mono.woff2') format('woff2');
}

:root {
  --bg: #F4F6F9;
  --card: #FFFFFF;
  --border: #E4E7EC;
  --border-soft: #EEF1F6;
  --border-strong: #D0D5DD;
  --text: #101828;
  --text-mid: #5D6B82;
  --text-body: #344054;
  --text-soft: #667085;
  --primary: #2156D9;
  --primary-dark: #1A44AE;
  --primary-soft: #EBF1FF;
  --logo: #E8590C;
  --nav-bg: #0E1A2E;
  --nav-bg-2: #13233D;
  --nav-bg-3: #18294A;
  --nav-bg-4: #152440;
  --nav-active: #1F3358;
  --nav-border: #22355A;
  --nav-text: #C9D3E3;
  --nav-dim: #8A9AB5;
  --nav-faint: #AFBCD2;
  --accent-bar: #5B8CFF;
  --ok-bg: #E7F6EE; --ok-text: #0F6B41; --ok-dot: #12A15E;
  --warn-bg: #FFF1D6; --warn-text: #7A4300;
  --err-bg: #FDECEC; --err-text: #A32020;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --sans: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.45;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
.server-scope a:focus-visible, .server-scope button:focus-visible,
.server-scope input:focus-visible {
  outline-color: #5B8CFF;
}
input::placeholder, textarea::placeholder { color: var(--text-soft); }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
[hidden] { display: none !important; }

/* ---- shell layout -------------------------------------------------- */

.shell { min-height: 100vh; background: var(--bg); display: flex; flex-wrap: wrap; }

.nav {
  flex: 1 1 248px; max-width: 100%;
  background: var(--nav-bg); color: var(--nav-text);
  padding: 20px 14px;
  display: flex; flex-direction: column; gap: 22px;
}
.nav.wide { flex-basis: 280px; gap: 16px; }
.server-scope .nav { gap: 16px; flex-basis: 280px; }

.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; }

/* ---- panel nav ------------------------------------------------------ */

.nav-logo { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }
.nav-logo-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--logo);
  display: flex; align-items: center; justify-content: center; flex: none;
}
.nav-logo-mark.blue { background: var(--primary); }
.nav-logo-stack { display: flex; flex-direction: column; }
.nav-logo-name { font-size: 19px; font-weight: 800; color: #FFFFFF; letter-spacing: -0.01em; }
.nav-logo-sub { font-size: 12px; color: var(--nav-dim); font-weight: 500; }
.nav-logo-link { display: flex; align-items: center; gap: 12px; padding: 4px 8px; }

.nav-switch {
  display: flex; align-items: center; gap: 10px; min-height: 48px;
  padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--nav-border); background: var(--nav-bg-2);
  color: #E4EAF3; font: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; text-align: left; width: 100%;
}
.nav-switch:hover { background: var(--nav-bg-3); color: #FFFFFF; }
.nav-switch-icon {
  width: 28px; height: 28px; border-radius: 8px; background: var(--nav-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #FFFFFF;
}
.nav-switch-main { flex: 1; display: flex; flex-direction: column; }
.nav-switch-sub { font-size: 12px; color: var(--nav-dim); font-weight: 500; }

.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label {
  font-size: 12px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--nav-dim); padding: 0 12px 8px;
}
.nav-a {
  display: flex; align-items: center; gap: 12px; min-height: 44px;
  padding: 0 12px; border-radius: 10px; color: var(--nav-text);
  font-size: 14px; font-weight: 500;
}
.nav-a svg { flex: none; }
.nav-a:hover { background: var(--nav-bg-3); color: #FFFFFF; }
.nav-a[aria-current="page"] { background: var(--nav-active); color: #FFFFFF; font-weight: 600; }

.nav-quota {
  margin-top: auto; background: var(--nav-bg-2);
  border: 1px solid var(--nav-border); border-radius: 14px;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
}
.nav-quota-head { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; color: #E4EAF3; }
.nav-quota-bar { height: 6px; border-radius: 99px; background: var(--nav-border); overflow: hidden; }
.nav-quota-fill { height: 100%; background: var(--accent-bar); border-radius: 99px; }
.nav-quota-fill.q0 { width: 0%; }
.nav-quota-fill.q1 { width: 21%; }
.nav-quota-fill.q2 { width: 45%; }
.nav-quota-fill.q3 { width: 70%; background: #D97706; }
.nav-quota-fill.q4 { width: 92%; background: #C23030; }
.nav-quota-sub { font-size: 12px; color: var(--nav-dim); }

/* ---- server nav (tree) ---------------------------------------------- */

.tree-search {
  display: flex; align-items: center; gap: 10px; height: 44px;
  padding: 0 12px; border-radius: 12px;
  background: var(--nav-bg-2); border: 1px solid var(--nav-border);
  color: var(--nav-dim);
}
.tree-search input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  font: inherit; font-size: 14px; color: #FFFFFF; outline: none;
}
.tree-search input::placeholder { color: var(--nav-dim); }

.side-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.side-b {
  height: 40px; border-radius: 10px;
  border: 1px solid var(--nav-border); background: var(--nav-bg-2);
  color: #E4EAF3; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.side-b:hover { background: var(--nav-border); }

.tree {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 2px;
}
.tree-b {
  width: 100%; display: flex; align-items: center; gap: 12px;
  min-height: 42px; padding: 0 10px; border: 0; border-radius: 10px;
  background: transparent; color: var(--nav-text);
  font: inherit; font-size: 14px; font-weight: 500;
  text-align: left; cursor: pointer;
}
.tree-b:hover { background: var(--nav-bg-3); color: #FFFFFF; }
.tree-b svg { flex: none; }
.tree-b .chev { flex: none; transition: transform 0.15s; }
.tree-b[aria-expanded="true"] .chev { transform: rotate(90deg); }

.tree-kids {
  list-style: none; margin: 2px 0 8px 19px; padding: 0 0 0 12px;
  border-left: 1px solid var(--nav-border);
  display: flex; flex-direction: column;
}
.tree-a {
  display: flex; align-items: center; min-height: 36px;
  padding: 0 10px; border-radius: 8px;
  color: var(--nav-faint); font-size: 13px; font-weight: 500;
}
.tree-a:hover { color: #FFFFFF; background: var(--nav-bg-4); }

.tree-empty { margin: 0; padding: 12px; font-size: 13px; color: var(--nav-faint); }

/* ---- headers ---------------------------------------------------------- */

.header {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 14px 32px; background: var(--card);
  border-bottom: 1px solid var(--border);
}
.header-search {
  flex: 1 1 320px; max-width: 560px;
  display: flex; align-items: center; gap: 10px; height: 44px;
  padding: 0 14px; border: 1px solid var(--border-strong);
  border-radius: 12px; background: #F9FAFB; color: var(--text-mid);
}
.header-search input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  font: inherit; font-size: 14px; color: var(--text); outline: none;
}
.kbd {
  font-family: var(--mono); font-size: 12px; color: var(--text-mid);
  border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 1px 6px; background: var(--card);
}
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.trial-btn {
  display: inline-flex; align-items: center; height: 40px; padding: 0 16px;
  border-radius: 10px; background: var(--ok-bg); color: var(--ok-text);
  font-size: 14px; font-weight: 600;
}

.icon-btn {
  position: relative; width: 44px; height: 44px; border-radius: 12px;
  border: 0; background: transparent; color: var(--text-body);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font: inherit;
}
.icon-btn:hover { background: var(--border-soft); }
.icon-btn .dot {
  position: absolute; top: 10px; right: 11px; width: 8px; height: 8px;
  border-radius: 99px; background: var(--logo); border: 2px solid #FFFFFF;
}
.icon-btn .dot.red { background: #D92D20; }

.avatar-btn {
  display: flex; align-items: center; gap: 10px; height: 44px;
  padding: 0 10px 0 6px; border-radius: 12px; border: 0;
  background: transparent; font: inherit; cursor: pointer; color: var(--text);
}
.avatar-btn:hover { background: var(--border-soft); }
.avatar-face {
  width: 32px; height: 32px; border-radius: 99px; background: var(--primary-soft);
  color: var(--primary); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.avatar-face.dark { background: var(--text); color: #FFFFFF; }
.avatar-btn .name { font-size: 14px; font-weight: 600; }
.avatar-btn .chev { color: var(--text-mid); }

/* server info strip header */
.info-strip {
  margin: 0; display: flex; flex-wrap: wrap; gap: 8px 32px;
  padding: 12px 32px; border-bottom: 1px solid var(--border-soft); font-size: 13px;
}
.is-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.is-item.push { margin-left: auto; }
.is-dt { color: var(--text-mid); font-size: 12px; font-weight: 600; }
.is-dd { margin: 0; font-weight: 600; }
.is-dd.mono { font-family: var(--mono); }
.is-dd.loadavg { display: flex; gap: 10px; font-family: var(--mono); }

.open-panel-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 40px;
  padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); color: var(--text);
  font-size: 14px; font-weight: 600;
}

/* ---- content ---------------------------------------------------------- */

.content { padding: 0; }
.content > .notice { margin: 24px 32px 0; }
.tools-main {
  padding: 32px; display: flex; flex-wrap: wrap; gap: 24px;
  align-items: flex-start; width: 100%; max-width: 1360px;
}
.page-col {
  flex: 999 1 560px; min-width: 0;
  display: flex; flex-direction: column; gap: 20px;
}
.page-aside {
  flex: 1 1 300px; min-width: 0;
  display: flex; flex-direction: column; gap: 16px;
}
.page-main {
  padding: 32px; display: flex; flex-direction: column; gap: 20px;
  width: 100%; max-width: 1240px;
}
.content-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.content-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.h1 {
  margin: 0; font-size: 32px; line-height: 1.15;
  font-weight: 800; letter-spacing: -0.02em;
}
.page-sub { margin: 0; font-size: 15px; color: var(--text-mid); }

/* ---- buttons ----------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px; border: 0;
  background: var(--primary); color: #FFFFFF; font: inherit;
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.btn:hover { background: var(--primary-dark); color: #FFFFFF; }
.btn.small { height: 40px; padding: 0 14px; border-radius: 10px; font-weight: 600; }
.btn.ghost {
  background: transparent; color: var(--text-body); font-weight: 600;
  border: 0; height: 40px; border-radius: 10px;
}
.btn.ghost:hover { background: var(--border-soft); }
.btn.out {
  background: var(--card); color: var(--text); font-weight: 600;
  border: 1px solid var(--border-strong);
}
.btn.out:hover { border-color: #98A2B3; background: #F9FAFB; }
.btn.secondary { background: var(--text); color: #FFFFFF; }
.btn.secondary:hover { background: #000000; }
.btn.danger { background: #C23030; }
.btn.danger:hover { background: #A32020; }
.btn.on-dark { background: #FFFFFF; color: var(--nav-bg); }
.btn.on-dark:hover { background: #E8EDF5; color: #000000; }
.inline-form { display: inline-flex; }

.act-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 40px;
  padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--card);
  color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer;
}
.act-btn:hover { border-color: #98A2B3; background: #F9FAFB; }

/* ---- notices / toasts --------------------------------------------------- */

.notice {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: 14px;
  font-size: 14px; font-weight: 600;
}
.notice.ok { background: var(--ok-bg); border: 1px solid #B5E3C9; color: #0F5A37; }
.notice.err { background: #FFF6E5; border: 1px solid #F5D9A6; color: #5C3300; }
.notice.info { background: var(--primary-soft); border: 1px solid #C7D9F7; color: #1E4FC4; }

.toast {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; border-radius: 14px;
  font-size: 14px; font-weight: 600;
}
.toast.ok { background: var(--ok-bg); border: 1px solid #B5E3C9; color: #0F5A37; }
.toast.err { background: #FFF6E5; border: 1px solid #F5D9A6; color: #5C3300; }

/* ---- cards & sections ---------------------------------------------------- */

.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; padding: 20px;
  display: flex; flex-direction: column; gap: 14px;
}
.sec {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden;
  display: flex; flex-direction: column;
}
.sec-body { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.sec-h {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 16px 20px;
  border-bottom: 1px solid var(--border-soft);
}
.sec-h.plain { border-bottom: 0; }
.sec-h:hover { background: #FAFBFD; }
.sec-b { padding: 14px 20px 20px; display: flex; flex-direction: column; gap: 14px; }
.sec-title { margin: 0; font-size: 16px; font-weight: 700; }
.sec-title.lg { font-size: 15px; font-weight: 700; }
.sec-sub { font-size: 13px; color: var(--text-mid); font-weight: 500; }

/* ---- tables ---------------------------------------------------------------- */

.table-wrap { overflow-x: auto; }
.table {
  width: 100%; min-width: 720px; border-collapse: collapse; font-size: 14px;
}
.table th {
  text-align: left; color: var(--text-mid); font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.06em;
  padding: 12px 20px; font-weight: 700;
  border-bottom: 1px solid var(--border-soft);
}
.table td { padding: 14px 20px; border-top: 1px solid var(--border-soft); vertical-align: middle; }
.table tbody tr:hover { background: #FAFBFD; }
.table td.actions, .table th.actions { text-align: right; }
.table-actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.table-tools {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--border-soft);
}
.search-box {
  flex: 1 1 260px; max-width: 420px;
  display: flex; align-items: center; gap: 10px; height: 44px;
  padding: 0 14px; border: 1px solid var(--border-strong);
  border-radius: 12px; color: var(--text-mid);
}
.search-box input {
  flex: 1; min-width: 0; border: 0; background: transparent;
  font: inherit; font-size: 14px; color: var(--text); outline: none;
}
.domain-filter { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-mid); font-weight: 500; }
.shown-count { margin-left: auto; font-size: 13px; color: var(--text-mid); font-weight: 500; }
.no-rows { margin: 0; padding: 32px 20px; text-align: center; color: var(--text-mid); font-size: 14px; }

/* ---- forms ------------------------------------------------------------------ */

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.form-row { display: flex; flex-direction: column; gap: 8px; }
.form-row.row { flex-direction: row; }

/* manage popover (email accounts table) */
.manage-details { position: relative; display: inline-block; }
.manage-details > summary { list-style: none; cursor: pointer; }
.manage-details > summary::-webkit-details-marker { display: none; }
.manage-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20;
  width: 420px; max-width: 82vw;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: 0 12px 32px rgba(16, 24, 40, 0.14);
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
}
.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; }
.field-label { font-size: 14px; font-weight: 600; }
.field-hint { font-size: 13px; color: var(--text-mid); font-weight: 500; }
.input, .select, .textarea {
  height: 44px; padding: 0 12px; border-radius: 12px;
  border: 1px solid var(--border-strong); background: var(--card);
  font: inherit; font-size: 14px; color: var(--text);
}
.textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
.select { padding-right: 24px; }
.input-join {
  display: flex; align-items: center; height: 44px;
  border: 1px solid var(--border-strong); border-radius: 12px;
  overflow: hidden; background: var(--card);
}
.input-join input {
  flex: 1; min-width: 0; height: 100%; border: 0; padding: 0 12px;
  font: inherit; font-size: 14px; font-weight: 500; color: var(--text); outline: none;
}
.input-suffix {
  padding: 0 12px; height: 100%; display: flex; align-items: center;
  background: #F4F6F9; border-left: 1px solid var(--border-strong);
  color: var(--text-mid); font-weight: 500;
}
.kv { display: grid; grid-template-columns: minmax(140px, auto) 1fr; gap: 8px 16px; font-size: 14px; }
.kv .k { color: var(--text-mid); }

/* ---- login ------------------------------------------------------------------- */

.login-wrap {
  min-height: 100vh; background: var(--nav-bg);
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.login-card {
  width: 100%; max-width: 420px; background: var(--card);
  border: 1px solid var(--border); border-radius: 18px; padding: 28px;
  display: flex; flex-direction: column; gap: 18px;
}
.login-logo { display: flex; align-items: center; gap: 12px; }
.login-title { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.login-sub { margin: 0; font-size: 14px; color: var(--text-mid); }

/* ---- stats & meters -------------------------------------------------------------- */

.stat-grid { display: flex; flex-direction: column; gap: 14px; }
.stat { display: flex; flex-direction: column; gap: 6px; }
.stat-label { font-size: 13px; font-weight: 600; color: var(--text-mid); }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.stat-value small { font-size: 14px; font-weight: 600; color: var(--text-mid); }

.usage-bar { height: 6px; border-radius: 99px; background: var(--border-soft); overflow: hidden; }
.usage-fill { height: 100%; border-radius: 99px; background: var(--primary); }
.usage-fill.q0 { width: 0%; }
.usage-fill.q1 { width: 21%; }
.usage-fill.q2 { width: 45%; }
.usage-fill.q3 { width: 70%; background: #D97706; }
.usage-fill.q4 { width: 92%; background: #C23030; }

.meter-row { display: flex; flex-direction: column; gap: 6px; }
.meter-top { display: flex; justify-content: space-between; font-size: 13px; }
.meter-top .label { font-weight: 600; }
.meter-top .value { color: var(--text-mid); }
.meter { height: 6px; border-radius: 99px; background: var(--border-soft); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 99px; background: var(--primary); }
.meter-fill.q0 { width: 0%; }
.meter-fill.q1 { width: 21%; }
.meter-fill.q2 { width: 45%; }
.meter-fill.q3 { width: 70%; background: #D97706; }
.meter-fill.q4 { width: 92%; background: #C23030; }

.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.stat-card {
  padding: 18px; border-radius: 16px; background: var(--card);
  border: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px;
}
.stat-card .label { font-size: 13px; font-weight: 600; color: var(--text-mid); }
.stat-card .num { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }

/* ---- info lists (aside cards) ------------------------------------------------------ */

.info-dl { margin: 0; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.info-row { display: flex; justify-content: space-between; gap: 12px; }
.info-row.stack { flex-direction: column; gap: 4px; }
.info-dl dt { color: var(--text-mid); }
.info-dl dt.small { font-size: 13px; font-weight: 600; }
.info-dl dd { margin: 0; font-weight: 600; }
.info-dl dd.mono { font-family: var(--mono); font-size: 13px; }
.info-dl dd.wrap { font-family: var(--mono); font-size: 12px; overflow-wrap: anywhere; }

.pill {
  display: inline-flex; align-items: center; height: 24px;
  padding: 0 10px; border-radius: 99px;
  font-size: 12px; font-weight: 700;
}
.pill.ok { background: var(--ok-bg); color: var(--ok-text); }
.pill.warn { background: var(--warn-bg); color: var(--warn-text); }
.pill.err { background: var(--err-bg); color: var(--err-text); }
.pill.planned { background: #EEF0F4; color: #344054; }

/* ---- chips ------------------------------------------------------------------------- */

.chip {
  display: inline-flex; align-items: center; height: 40px; padding: 0 16px;
  border-radius: 99px; background: var(--card); color: var(--text-body);
  border: 1px solid var(--border-strong);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.chip:hover { border-color: #98A2B3; }
.chip.on { background: var(--text); color: #FFFFFF; border-color: var(--text); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip.small {
  height: 24px; padding: 0 10px; border-radius: 99px;
  font-size: 12px; font-weight: 700; border: 0; cursor: default;
}
.chip.small.info { background: var(--primary-soft); color: var(--primary); }
.chip.small.ok { background: var(--ok-bg); color: var(--ok-text); }
.chip.small.warn { background: var(--warn-bg); color: var(--warn-text); }
.chip.small.err { background: var(--err-bg); color: var(--err-text); }

/* ---- quick action cards (home) ------------------------------------------------------- */

.qa-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.qa {
  display: flex; flex-direction: column; gap: 14px; padding: 18px;
  border-radius: 16px; background: var(--card);
  border: 1px solid var(--border); color: var(--text);
}
.qa:hover { border-color: #BFCDEB; background: #FBFCFF; }
.qa-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft); color: var(--primary);
}
.qa-icon.warn { background: #FFF3DC; color: #9A5B00; }
.qa-icon.ok { background: var(--ok-bg); color: var(--ok-text); }
.qa-stack { display: flex; flex-direction: column; gap: 2px; }
.qa-title { font-size: 15px; font-weight: 700; }
.qa-sub { font-size: 13px; color: var(--text-mid); }

/* ---- risk banner (home) ---------------------------------------------------------------- */

.risk-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 16px;
  padding: 16px 20px; border-radius: 16px;
  background: #FFF6E5; border: 1px solid #F5D9A6;
}
.risk-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: #FFE8BD; color: #8A4B00;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.risk-body { flex: 1 1 280px; display: flex; flex-direction: column; gap: 2px; }
.risk-title { font-size: 15px; color: #5C3300; font-weight: 800; }
.risk-sub { font-size: 14px; color: #6B4510; }

/* ---- tools hub sections ------------------------------------------------------------------ */

.sections-stack { display: flex; flex-direction: column; gap: 20px; }
.tsec {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; overflow: hidden;
}
.tsec-head {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 14px 20px; min-height: 68px; border: 0; background: transparent;
  cursor: pointer; font: inherit; text-align: left; color: var(--text);
}
.tsec-head:hover { background: #FAFBFD; }
.tsec-tile {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.tsec-name { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tsec-title { font-size: 16px; font-weight: 700; }
.tsec-count { font-size: 13px; color: var(--text-mid); font-weight: 500; }
.tsec-head .chev { flex: none; transition: transform 0.15s; }
.tsec-head[aria-expanded="true"] .chev { transform: rotate(180deg); }

.tool-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: 6px; padding: 0 14px 14px;
}
.tool {
  display: flex; align-items: center; gap: 12px; min-height: 52px;
  padding: 8px 10px; border: 1px solid transparent; border-radius: 12px;
  color: var(--text); font: inherit; font-size: 14px;
  text-align: left; width: 100%;
}
.tool:hover { background: #F5F8FF; border-color: #D5DFF3; color: var(--text); }
.tool-link { font-weight: 600; }
.tool-btn { background: transparent; font-weight: 500; cursor: pointer; }
.tool-icon {
  width: 34px; height: 34px; border-radius: 10px; flex: none;
  display: flex; align-items: center; justify-content: center;
}
.tool .name { flex: 1; }
.tool .chev-go { flex: none; color: var(--primary); }

/* group tints (panel tool tiles) */
.t-email    { background: #EBF1FF; color: #2156D9; }
.t-files    { background: #FFF3DC; color: #9A5B00; }
.t-db       { background: #E3F6F7; color: #0E7C86; }
.t-domains  { background: #F0EBFF; color: #6B3FD4; }
.t-metrics  { background: #FDEBF2; color: #B4235B; }
.t-security { background: #E7F6EE; color: #127A4B; }
.t-software { background: #EEF0F4; color: #344054; }
.t-advanced { background: #EEF0F4; color: #344054; }

.empty-tools {
  padding: 48px 24px; text-align: center;
  background: var(--card); border: 1px dashed var(--border-strong);
  border-radius: 18px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.empty-tools .msg { font-size: 16px; font-weight: 700; }

/* ---- promo card (aside) -------------------------------------------------------------------- */

.promo-card {
  background: var(--nav-bg); border-radius: 18px; padding: 20px;
  display: flex; flex-direction: column; gap: 12px; color: var(--nav-text);
}
.promo-icon {
  width: 40px; height: 40px; border-radius: 12px;
  background: var(--nav-active); color: #9DB8FF;
  display: flex; align-items: center; justify-content: center;
}
.promo-title { margin: 0; font-size: 16px; font-weight: 700; color: #FFFFFF; }
.promo-text { margin: 0; font-size: 14px; line-height: 1.5; }

/* ---- page head with large icon tile (email accounts) ------------------------------------------ */

.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text-mid); }
.crumbs a { color: var(--text-mid); font-weight: 500; }
.crumbs .sep { color: var(--text-mid); display: inline-flex; }
.crumbs .here { color: var(--text); font-weight: 600; }

.page-head-lg { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.ph-title-row { display: flex; align-items: center; gap: 16px; }
.icon-tile {
  width: 52px; height: 52px; border-radius: 14px;
  background: var(--primary-soft); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex: none;
}

/* ---- email accounts table ---------------------------------------------------------------------- */

.acct-cell { display: flex; align-items: center; gap: 12px; }
.avatar-dot {
  width: 36px; height: 36px; border-radius: 99px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.tint0 { background: #EBF1FF; color: #2156D9; }
.tint1 { background: #F0EBFF; color: #6B3FD4; }
.tint2 { background: #E3F6F7; color: #0E7C86; }
.tint3 { background: #FFF3DC; color: #9A5B00; }
.tint4 { background: #FDEBF2; color: #B4235B; }
.tint5 { background: #E7F6EE; color: #127A4B; }
.acct-stack { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.acct-mail { font-weight: 600; }
.acct-note { font-size: 13px; color: var(--text-mid); }

.badge {
  display: inline-flex; align-items: center; height: 26px;
  padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 700;
}
.badge.ok { background: var(--ok-bg); color: var(--ok-text); }
.badge.warn { background: #FFF1D6; color: #7A4300; }
.badge.err { background: var(--err-bg); color: var(--err-text); }

.storage-cell { display: flex; flex-direction: column; gap: 6px; }
.storage-text { font-size: 13px; color: var(--text-body); }
.storage-bar { height: 6px; border-radius: 99px; background: var(--border-soft); overflow: hidden; display: block; }
.storage-fill { display: block; height: 100%; border-radius: 99px; background: var(--primary); }
.storage-fill.q0 { width: 2%; }
.storage-fill.q1 { width: 25%; }
.storage-fill.q2 { width: 50%; }
.storage-fill.q3 { width: 75%; }
.storage-fill.q4 { width: 96%; background: #C23030; }
.storage-fill.hot { background: #C23030; }

/* ---- create form card ----------------------------------------------------------------------------- */

.create-form {
  background: var(--card); border: 1px solid #9DB8FF;
  box-shadow: 0 0 0 4px var(--primary-soft);
  border-radius: 18px; padding: 24px;
  display: none; flex-direction: column; gap: 20px;
}
.create-form.open { display: flex; }
.cf-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.cf-title { margin: 0; font-size: 18px; font-weight: 800; }
.cf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.quota-row { display: flex; gap: 8px; }
.quota-btn {
  height: 44px; padding: 0 14px; border-radius: 12px;
  background: var(--card); color: var(--text-body);
  border: 1px solid var(--border-strong);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.quota-btn.on { background: var(--text); color: #FFFFFF; border-color: var(--text); }
.check-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; color: var(--text-body); min-height: 44px;
}
.check-label input { width: 18px; height: 18px; accent-color: var(--primary); }
.cf-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.legend-label { padding: 0 0 8px; font-size: 14px; font-weight: 600; }

/* ---- server home -------------------------------------------------------------------------------------- */

.banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 20px;
  padding: 20px 24px; border-radius: 18px;
  background: var(--nav-bg); color: var(--nav-text);
}
.banner-icon {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--logo); color: #FFFFFF;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.banner-body { flex: 1 1 320px; display: flex; flex-direction: column; gap: 4px; }
.banner-title { font-size: 17px; color: #FFFFFF; font-weight: 800; }
.banner-sub { font-size: 14px; line-height: 1.5; }
.banner-close {
  width: 44px; height: 44px; border-radius: 12px;
  border: 1px solid var(--nav-border); background: transparent;
  color: var(--nav-text); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.banner-close:hover { background: var(--nav-border); }

.favorites { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.fav-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.fav-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}
.fav {
  display: flex; flex-direction: column; gap: 14px; padding: 20px;
  border-radius: 18px; background: var(--card);
  border: 1px solid var(--border); color: var(--text);
  position: relative;
}
.fav:hover { border-color: #BFCDEB; background: #FBFCFF; }
.fav-tile {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.fav-title { font-size: 16px; font-weight: 700; }
.fav-sub { font-size: 14px; line-height: 1.5; color: var(--text-mid); }
.fav.start-here { border-color: #9DB8FF; box-shadow: 0 0 0 4px var(--primary-soft); }
.fav-badge {
  position: absolute; top: 16px; right: 16px; height: 24px; padding: 0 10px;
  border-radius: 99px; background: var(--primary); color: #FFFFFF;
  font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center;
}
.fav-stack { display: flex; flex-direction: column; gap: 6px; }

.quick-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.qa-pill {
  display: inline-flex; align-items: center; gap: 10px; height: 44px;
  padding: 0 16px; border-radius: 12px;
  background: var(--card); border: 1px solid var(--border);
  color: var(--text); font-size: 14px; font-weight: 600;
}
.qa-pill:hover { border-color: #BFCDEB; background: #FBFCFF; color: var(--text); }
.qa-pill svg { color: var(--primary); flex: none; }
.sub-h { margin: 16px 0 0; font-size: 20px; font-weight: 800; letter-spacing: -0.01em; }
.favorites .h1 { margin: 0; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.page-split { display: flex; flex-wrap: wrap; gap: 24px; align-items: flex-start; }

.svc-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px; font-size: 14px;
}
.svc { display: flex; align-items: center; justify-content: space-between; }
.svc-status {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ok-text); font-weight: 600; font-size: 13px;
}
.svc-status .dot-ok { width: 8px; height: 8px; border-radius: 99px; background: var(--ok-dot); }
.svc-status.down { color: var(--err-text); }
.svc-status.down .dot-ok { background: #D92D20; }
.svc-status.partial { color: #7A4300; }
.svc-status.partial .dot-ok { background: #F2A516; }

/* ---- charts ------------------------------------------------------------------------------------------ */

.bar-chart {
  display: flex; align-items: flex-end; gap: 4px; height: 160px;
  padding: 8px 0; border-bottom: 1px solid var(--border);
}
.bar-col {
  flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; gap: 2px;
  justify-content: flex-end; height: 100%;
}
.bar-col .fill { background: var(--primary); border-radius: 3px 3px 0 0; width: 100%; }
.bar-col .cap { font-size: 10px; color: var(--text-mid); text-align: center; overflow: hidden; white-space: nowrap; }

/* ---- misc ---------------------------------------------------------------------------------------------- */

.muted { color: var(--text-mid); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 99px; background: var(--ok-dot); display: inline-block; }
.empty-note { padding: 24px; text-align: center; color: var(--text-mid); font-size: 14px; }
.panel-body { padding: 0 32px 32px; }

/* responsive: at narrow widths the nav collapses to a full-width bar */
@media (max-width: 900px) {
  .nav, .nav.wide, .server-scope .nav { flex-basis: 100%; }
  .tools-main, .page-main { padding: 20px; }
  .header, .info-strip { padding-left: 20px; padding-right: 20px; }
  .table { min-width: 640px; }
}
