/* Theme: dark navy navigation + light data workspace (inspired by the sample "Indian Company People" screen) */
:root {
  --nav-bg: #00141e;
  --side-bg: #001828;
  --side-hover: #002b42;
  --side-text: #b0c4d0;
  --primary: #01579b;
  --primary-dark: #054b6f;
  --accent: #40c4ff;
  --accent-soft: #ccedfb;
  --danger: #f44336;
  --danger-soft: #f9ccc9;
  --success: #46a35e;
  --success-soft: #dff1e3;
  --warn: #ef8f00;
  --warn-soft: #fdebc8;
  --bg: #f4f6f8;
  --card: #ffffff;
  --border: #e0e0e0;
  --border-soft: #eef0f2;
  --head-bg: #f7f9fa;
  --text: #1d2a33;
  --muted: #6b7a86;
  --row-hover: #f2f9fd;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(0, 20, 30, 0.06), 0 1px 6px rgba(0, 20, 30, 0.04);
  font-family: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); font-size: 14px; line-height: 1.45; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
code, pre, .mono { font-family: 'Cascadia Code', Consolas, 'SFMono-Regular', monospace; font-size: 12.5px; }
h1, h2, h3 { margin: 0; font-weight: 700; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }

/* ------------------------------ shell ------------------------------ */
.shell { display: grid; grid-template-columns: 220px 1fr; grid-template-rows: 52px 1fr; height: 100vh; }
.topbar {
  grid-column: 1 / -1; background: var(--nav-bg); color: #fff; display: flex; align-items: center; gap: 16px; padding: 0 16px;
  position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 #002b42;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; letter-spacing: 0.2px; width: 188px; color: #fff; }
.brand img { width: 26px; height: 26px; }
.brand span b { color: var(--accent); font-weight: 700; }
.topsearch { flex: 1; max-width: 560px; position: relative; }
.topsearch input[type='search'] {
  width: 100%; background: #0b2533; border: 1px solid #12384d; color: #fff; border-radius: 4px; padding: 7px 12px 7px 32px; font: inherit;
}
.topsearch input[type='search']::placeholder { color: #7e98a8; }
.topsearch svg { position: absolute; left: 10px; top: 9px; width: 15px; height: 15px; fill: #7e98a8; }
.topbar .spacer { flex: 1; }
.usermenu { display: flex; align-items: center; gap: 10px; font-size: 13px; color: #cfdbe2; }
.usermenu .avatar-sm { background: var(--primary); }
.usermenu button { background: transparent; border: 1px solid #23465a; color: #cfdbe2; border-radius: 4px; padding: 4px 10px; cursor: pointer; font: inherit; }
.usermenu button:hover { border-color: var(--accent); color: #fff; }
.menu-toggle { display: none; background: none; border: 0; color: #fff; font-size: 20px; cursor: pointer; }

.sidebar { background: var(--side-bg); color: var(--side-text); overflow-y: auto; padding: 10px 0 24px; }
.sidebar .sect { text-transform: uppercase; font-size: 11px; letter-spacing: 0.8px; color: #5f7d8e; padding: 16px 20px 6px; font-weight: 600; }
.sidebar a {
  display: flex; align-items: center; gap: 10px; padding: 8px 20px; color: var(--side-text); font-weight: 600; font-size: 13.5px;
  border-left: 3px solid transparent;
}
.sidebar a svg { width: 17px; height: 17px; fill: currentColor; opacity: 0.85; flex: none; }
.sidebar a:hover { background: var(--side-hover); color: #fff; text-decoration: none; }
.sidebar a.active { background: var(--side-hover); color: var(--accent); border-left-color: var(--accent); }
.sidebar .count { margin-left: auto; font-size: 11px; background: #0b2c3f; color: #9fc0d1; padding: 0 7px; border-radius: 10px; }

.main { overflow-y: auto; padding: 20px 24px 40px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 2px; }
.page-head .actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }

/* ------------------------------ controls ----------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--border); background: #fff; color: var(--text);
  padding: 7px 14px; border-radius: 4px; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: #b8c4cc; text-decoration: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #00141e; }
.btn.danger { color: var(--danger); border-color: var(--danger-soft); }
.btn.danger:hover { background: var(--danger); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 10px; font-size: 12.5px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; fill: currentColor; }

input[type='text'], input[type='email'], input[type='tel'], input[type='password'], input[type='url'], input[type='number'], input[type='search'], select, textarea {
  border: 1px solid var(--border); border-radius: 4px; padding: 7px 10px; font: inherit; color: var(--text); background: #fff; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { width: 100%; resize: vertical; }
label.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
label.field input, label.field select, label.field textarea { font-weight: 400; color: var(--text); font-size: 14px; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { margin-top: 3px; accent-color: var(--primary); }
.check small { display: block; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.span2 { grid-column: span 2; }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.toolbar .search { flex: 1 1 240px; max-width: 360px; }
.toolbar .search input { width: 100%; }
.toolbar .grow { flex: 1; }
.result-count { font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 14px 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; background: var(--accent-soft); color: var(--primary-dark); border-radius: 14px;
  padding: 2px 6px 2px 10px; font-size: 12.5px; font-weight: 600;
}
.chip button { border: 0; background: transparent; cursor: pointer; color: var(--primary-dark); font-size: 14px; line-height: 1; padding: 0 2px; }

/* ------------------------------- cards ------------------------------ */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.card-head .actions { margin-left: auto; display: flex; gap: 8px; }
.card-body { padding: 16px; }
.cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cols > .card + .card, .grid2 > .card + .card, .grid3 > .card + .card { margin-top: 0; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.tile .label { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.tile .value { font-size: 26px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tile .hint { font-size: 12.5px; color: var(--muted); }
.tile.accent { border-top: 3px solid var(--accent); }

.bars { display: flex; flex-direction: column; gap: 8px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-row .track { grid-column: 1 / -1; height: 6px; background: var(--border-soft); border-radius: 3px; overflow: hidden; margin-top: -4px; }
.bar-row .fill { height: 100%; background: var(--primary); border-radius: 3px; }
.bar-row .n { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

/* ------------------------------- tables ------------------------------ */
.table-wrap { overflow: auto; }
table.data { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
table.data th {
  position: sticky; top: 0; background: var(--head-bg); text-align: left; font-weight: 700; color: #33434e; padding: 9px 12px;
  border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 12.5px; z-index: 1;
}
table.data th.sortable { cursor: pointer; user-select: none; }
table.data th.sortable:hover { color: var(--primary); }
table.data th .dir { color: var(--accent); font-size: 10px; }
table.data td { padding: 8px 12px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
table.data tbody tr:hover td { background: var(--row-hover); }
table.data tr.clickable { cursor: pointer; }
table.data td.trunc { max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }
.empty { padding: 40px 16px; text-align: center; color: var(--muted); }

.who { display: flex; align-items: center; gap: 10px; min-width: 180px; }
.who .name { font-weight: 600; color: var(--text); }
.who .meta { font-size: 12px; color: var(--muted); }
.avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: none; background: var(--border-soft); }
.avatar-sm { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; }
.logo { width: 32px; height: 32px; border-radius: 6px; object-fit: contain; background: #fff; border: 1px solid var(--border); flex: none; }
.logo.lg { width: 72px; height: 72px; border-radius: 10px; padding: 6px; }
.avatar.lg { width: 72px; height: 72px; }

.pager { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.pager .grow { flex: 1; }

.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 700; background: var(--border-soft); color: #44525c; white-space: nowrap; }
.badge.blue { background: var(--accent-soft); color: var(--primary-dark); }
.badge.green { background: var(--success-soft); color: #2c7a42; }
.badge.red { background: var(--danger-soft); color: #b3261e; }
.badge.amber { background: var(--warn-soft); color: #8a5300; }
.tag { display: inline-block; background: #eef3f6; color: #3d5361; border-radius: 3px; padding: 0 6px; font-size: 12px; margin: 1px 2px 1px 0; }
.dash { color: #b0b0b0; }

/* ------------------------------ details ------------------------------ */
.profile-head { display: flex; gap: 18px; align-items: center; }
.profile-head .title { font-size: 22px; font-weight: 700; }
.profile-head .links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 4px; font-size: 13px; }
dl.kv { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 8px 14px; margin: 0; font-size: 13.5px; }
dl.kv dt { color: var(--muted); font-weight: 600; }
dl.kv dd { margin: 0; word-break: break-word; }

/* ------------------------------ wizard ------------------------------ */
.steps { display: flex; gap: 0; margin-bottom: 16px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.step { flex: 1; padding: 11px 16px; display: flex; align-items: center; gap: 10px; color: var(--muted); font-weight: 600; border-right: 1px solid var(--border); }
.step:last-child { border-right: 0; }
.step .n { width: 24px; height: 24px; border-radius: 50%; border: 2px solid currentColor; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.step.active { color: var(--primary); background: #f0f8fd; box-shadow: inset 0 -3px 0 var(--accent); }
.step.done { color: var(--success); }
.step.done .n { background: var(--success); border-color: var(--success); color: #fff; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.tabs button { background: none; border: 0; padding: 9px 14px; font: inherit; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--primary); border-bottom-color: var(--accent); }

.dropzone {
  display: block; border: 2px dashed #b9cfdc; border-radius: 8px; padding: 36px 16px; text-align: center; background: #fafcfd; cursor: pointer; transition: 0.15s;
}
.dropzone.over { border-color: var(--accent); background: #effaff; }
.dropzone svg { width: 40px; height: 40px; fill: #7fa6bd; }
.dropzone .big { font-size: 16px; font-weight: 600; margin-top: 6px; }
.filepill { display: inline-flex; gap: 8px; align-items: center; margin-top: 10px; background: var(--accent-soft); color: var(--primary-dark); padding: 4px 12px; border-radius: 14px; font-weight: 600; }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 4px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer; color: var(--muted); border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--primary); color: #fff; }

table.map td { vertical-align: top; }
table.map tr.ignored td { opacity: 0.55; }
table.map tr.ignored td:last-child { opacity: 1; }
table.map select { width: 100%; min-width: 190px; }
.samples { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; color: #44525c; max-width: 320px; }
.samples span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fill { width: 70px; height: 5px; background: var(--border-soft); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.fill i { display: block; height: 100%; background: var(--success); }
.colname { font-weight: 700; }
.auto { font-size: 11px; color: var(--success); font-weight: 700; }
.custom-input { margin-top: 6px; width: 100%; }

.summary-bar { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.summary-bar b { font-variant-numeric: tabular-nums; }
.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px 20px; }
.progress { height: 10px; border-radius: 5px; background: var(--border-soft); overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.3s; }
.sticky-actions { position: sticky; bottom: -40px; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 10px; display: flex; gap: 8px; justify-content: flex-end; z-index: 5; }

/* --------------------------- modal / toast --------------------------- */
.modal-back { position: fixed; inset: 0; background: rgba(0, 20, 30, 0.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 100; overflow-y: auto; }
.modal { background: #fff; border-radius: 8px; width: 100%; max-width: 640px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25); }
.modal.wide { max-width: 860px; }
.modal-head { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.modal-head h2 { flex: 1; }
.modal-head .x { border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); line-height: 1; }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); background: var(--head-bg); border-radius: 0 0 8px 8px; }

#toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast { background: #00141e; color: #fff; padding: 10px 16px; border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25); max-width: 380px; border-left: 4px solid var(--accent); animation: slide 0.2s ease-out; }
.toast.error { border-left-color: var(--danger); }
.toast.ok { border-left-color: var(--success); }
@keyframes slide { from { transform: translateY(10px); opacity: 0; } }

.keybox { display: flex; gap: 8px; align-items: center; background: #00141e; color: #9fe2ff; padding: 10px 12px; border-radius: 6px; word-break: break-all; }
.keybox code { flex: 1; color: #9fe2ff; }
.alert { padding: 10px 14px; border-radius: 6px; background: var(--warn-soft); color: #6d4300; font-size: 13.5px; }
.alert.info { background: #e8f5fd; color: #0d4a6e; }
.alert.error { background: var(--danger-soft); color: #8c1d18; }

/* ------------------------------ api docs ----------------------------- */
.endpoint { border: 1px solid var(--border); border-radius: 6px; margin-bottom: 10px; overflow: hidden; background: #fff; }
.endpoint summary { list-style: none; display: flex; gap: 10px; align-items: center; padding: 10px 14px; cursor: pointer; }
.endpoint summary::-webkit-details-marker { display: none; }
.endpoint[open] summary { border-bottom: 1px solid var(--border); background: var(--head-bg); }
.method { font-weight: 700; font-size: 11.5px; padding: 2px 8px; border-radius: 3px; color: #fff; background: var(--primary); min-width: 50px; text-align: center; }
.method.post { background: var(--success); }
.endpoint .path { font-family: Consolas, monospace; font-weight: 600; }
.endpoint .body { padding: 14px; }
pre.code { background: #00141e; color: #d6eef9; padding: 12px 14px; border-radius: 6px; overflow: auto; margin: 8px 0 0; max-height: 420px; }

/* ------------------------------- login ------------------------------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login-art { background: radial-gradient(circle at 30% 20%, #054b6f, #00141e 70%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.login-art h1 { font-size: 32px; line-height: 1.2; }
.login-art p { color: #b8d4e3; max-width: 440px; font-size: 15px; }
.login-art ul { color: #cfe6f2; padding-left: 18px; margin: 0; display: grid; gap: 6px; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 32px 16px; }
.login-form form { width: 100%; max-width: 360px; display: flex; flex-direction: column; gap: 14px; }

/* ------------------------------ responsive ---------------------------- */
@media (max-width: 960px) {
  .cols { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 52px; left: 0; bottom: 0; width: 240px; z-index: 60; transform: translateX(-100%); transition: transform 0.2s; }
  .shell.nav-open .sidebar { transform: none; }
  .menu-toggle { display: block; }
  .brand { width: auto; }
  .topsearch { display: none; }
  .usermenu .who-name { display: none; }
  .brand span { white-space: nowrap; }
  .main { padding: 16px; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .steps .step span.lbl { display: none; }
  dl.kv { grid-template-columns: 1fr; gap: 2px; }
  dl.kv dd { margin-bottom: 8px; }
}

/* --------------------- multi-value emails / phones --------------------- */
.contact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.contact-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.more { cursor: help; border-bottom: 1px dotted var(--muted); }
.cp-editor { border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; background: var(--head-bg); }
.cp-head { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 8px; }
.cp-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.cp-row { display: grid; grid-template-columns: 20px minmax(0, 1fr) 130px 32px; gap: 6px; align-items: center; }
.cp-row input[type='radio'] { accent-color: var(--primary); margin: 0; }
.cp-row .cp-value { width: 100%; }
@media (max-width: 760px) { .cp-row { grid-template-columns: 20px minmax(0, 1fr) 96px 32px; } }

/* ------------------------------- data tables ------------------------------ */
.dt-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.dt-search { flex: 1 1 220px; max-width: 340px; }
.dt-search input { width: 100%; }
.dt-grow { flex: 1; }
.dt-count { white-space: nowrap; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--primary-dark); }
.dt-menu { position: relative; }
.dt-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 270px; max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 10px 30px rgba(0, 20, 30, 0.2); padding: 10px 12px; }
.dt-pop-sec { margin: 6px 0; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.dt-pop .check { margin: 4px 0; }
.dt-cols { list-style: none; margin: 0 0 8px; padding: 0; }
.dt-cols li { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.dt-mv button { border: 0; background: none; cursor: pointer; color: var(--muted); padding: 2px 5px; border-radius: 3px; }
.dt-mv button:hover:not(:disabled) { background: var(--border-soft); color: var(--text); }
.dt-mv button:disabled { opacity: 0.25; cursor: default; }
.dt-pop-foot { display: flex; gap: 8px; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border-soft); }
.dt-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 14px 0; align-items: center; }
.dt-chips:empty { display: none; }
.dt-bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 14px; margin-top: 8px; background: var(--accent-soft); color: var(--primary-dark); }

.dt-wrap { position: relative; overflow: auto; max-height: calc(100vh - 300px); min-height: 160px; }
table.dt-table { table-layout: fixed; min-width: 100%; width: max-content; }
table.dt-table th, table.dt-table td { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.dt-table thead th { position: sticky; top: 0; z-index: 3; }
table.dt-table thead tr.dt-filters th { top: var(--dt-head-h, 37px); z-index: 3; background: #fff; padding: 5px 8px; border-bottom: 1px solid var(--border); }
table.dt-table.dt-table thead tr.dt-filters input, table.dt-table thead tr.dt-filters select { width: 100%; padding: 4px 6px; font-size: 12.5px; font-weight: 400; }
table.dt-table th { position: relative; }
.dt-th { display: flex; align-items: center; min-width: 0; padding-right: 8px; }
.dt-sortbtn, .dt-lbl { cursor: pointer; user-select: none; overflow: hidden; text-overflow: ellipsis; }
.dt-lbl { cursor: grab; }
.dt-sortbtn:hover { color: var(--primary); }
.dt-sortbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.dt-dir { margin-left: 5px; font-size: 10px; color: #b7c3cb; }
th.sorted .dt-dir { color: var(--primary); }
th.sorted { background: #edf5fa; }
.dt-sortbtn sup { color: var(--primary); font-weight: 700; margin-left: 2px; }
.dt-rs { position: absolute; right: 0; top: 0; bottom: 0; width: 8px; cursor: col-resize; touch-action: none; z-index: 5; }
.dt-rs::after { content: ''; position: absolute; right: 3px; top: 25%; bottom: 25%; width: 2px; background: var(--border); border-radius: 1px; }
.dt-rs:hover::after { background: var(--accent); }
body.dt-resizing { cursor: col-resize; user-select: none; }
th.drop { box-shadow: inset 3px 0 0 var(--accent); }
.dt-chk { text-align: center; padding-left: 0 !important; padding-right: 0 !important; }
tr.is-selected td { background: #e9f6fe !important; }
table.dt-table tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.dt.compact table.dt-table td { padding-top: 3px; padding-bottom: 3px; font-size: 13px; }
.dt.compact .avatar, .dt.compact .logo { width: 24px; height: 24px; }
.dt.compact .who { gap: 8px; min-width: 0; }
.dt .who { min-width: 0; }
.dt .who > div { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
/* frozen first column */
.dt.freeze table.dt-table .frz { position: sticky; z-index: 2; background: #fff; }
.dt.freeze table.dt-table thead .frz { z-index: 4; background: var(--head-bg); }
.dt.freeze table.dt-table tbody tr:hover td.frz { background: var(--row-hover); }
.dt.freeze table.dt-table td.frz:not(.dt-chk), .dt.freeze table.dt-table th.frz:not(.dt-chk) { box-shadow: 1px 0 0 var(--border); }
.dt-overlay { position: absolute; inset: 0; display: flex; align-items: flex-start; justify-content: center; padding-top: 70px; background: rgba(255, 255, 255, 0.6); z-index: 10; color: var(--muted); gap: 10px; pointer-events: none; }
.dt-spin { width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: dtspin 0.7s linear infinite; margin-top: 2px; }
@keyframes dtspin { to { transform: rotate(360deg); } }

.dt-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.dt-size select, .dt-goto input { padding: 3px 6px; font-size: 13px; }
.dt-goto input { width: 64px; }
.dt-pager { display: inline-flex; gap: 2px; align-items: center; }
.dt-pg { min-width: 30px; height: 30px; padding: 0 6px; border: 1px solid transparent; border-radius: 4px; background: none; cursor: pointer; font: inherit; color: var(--text); font-variant-numeric: tabular-nums; }
.dt-pg:hover:not(:disabled):not(.on) { background: var(--border-soft); }
.dt-pg.on { background: var(--primary); color: #fff; font-weight: 700; }
.dt-pg:disabled { opacity: 0.35; cursor: default; }
.dt-gap { padding: 0 4px; }
@media (max-width: 760px) { .dt-pop { right: auto; left: 0; } .dt-wrap { max-height: calc(100vh - 240px); } }
/* On phones a frozen first column would leave no room for the rest of the table */
@media (max-width: 760px) {
  .dt.freeze table.dt-table tbody td.frz { position: static; box-shadow: none; }
  .dt.freeze table.dt-table thead .frz { left: auto !important; box-shadow: none; }
}

/* ------------------------------ record merge dialog ------------------------------ */
.mg-table td, .mg-table th { white-space: normal; vertical-align: top; }
.mg-picked { background: #e9f6fe; }
.mg-opt { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; word-break: break-word; }
.mg-opt input { margin-top: 3px; accent-color: var(--primary); }
.mg-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

/* --------------------------------- channels --------------------------------- */
.ch-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.ch-extra { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.kv-copy { display: flex; gap: 10px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.kv-copy span { color: var(--muted); font-weight: 600; min-width: 100px; }
.kv-copy code { background: var(--head-bg); border: 1px solid var(--border); padding: 3px 8px; border-radius: 4px; word-break: break-all; flex: 1; min-width: 200px; }

/* -------------------------------- templates -------------------------------- */
.att-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; margin-bottom: 6px; background: var(--head-bg); }
.prev-subj { padding: 8px 10px; background: var(--head-bg); border: 1px solid var(--border); border-bottom: 0; border-radius: 6px 6px 0 0; }
.prev-frame { width: 100%; height: 520px; border: 1px solid var(--border); border-radius: 0 0 6px 6px; background: #fff; }
.prev-frame.small { height: 220px; border-radius: 6px; }
.wa-bubble, .wa-preview { background: #dcf8c6; border-radius: 8px; padding: 10px 12px; white-space: pre-wrap; max-width: 420px; box-shadow: 0 1px 1px rgba(0,0,0,.12); }
.wa-preview { background: var(--head-bg); border: 1px solid var(--border); box-shadow: none; max-width: none; }
.wa-param { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; flex-wrap: wrap; }
.wa-param code { background: var(--accent-soft); padding: 2px 8px; border-radius: 4px; min-width: 52px; text-align: center; }

/* -------------------------------- campaigns -------------------------------- */
.choice-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.choice { display: flex; flex-direction: column; gap: 2px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; cursor: pointer; background: #fff; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { font-size: 12px; color: var(--muted); }
.choice.on { border-color: var(--primary); background: #eef7fd; box-shadow: inset 0 0 0 1px var(--primary); }
.aud-big { text-align: center; padding: 8px 0 4px; }
.aud-big .value { font-size: 40px; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .choice-row { grid-template-columns: 1fr; } }

/* ---------------------------------- leads ---------------------------------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 12px; align-items: start; }
.kb-col { background: #eef2f5; border-radius: 8px; display: flex; flex-direction: column; max-height: calc(100vh - 360px); min-height: 160px; border: 2px solid transparent; }
.kb-col.over { border-color: var(--accent); background: #e6f4fb; }
.kb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 10px 12px; text-transform: capitalize; background: #fff; border-radius: 8px 8px 0 0; font-size: 13px; }
.kb-body { padding: 8px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.kb-card { background: #fff; border: 1px solid var(--border); border-radius: 6px; padding: 10px 12px; cursor: grab; box-shadow: var(--shadow); }
.kb-card:hover { border-color: var(--accent); }
.kb-card.dragging { opacity: 0.4; }
.kb-title { font-weight: 600; margin-bottom: 2px; }
.kb-meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 6px; }
.kb-foot { display: flex; justify-content: space-between; align-items: center; }
.kb-empty { color: var(--muted); font-size: 12.5px; text-align: center; padding: 18px 0; }
.timeline { max-height: 360px; overflow-y: auto; border: 1px solid var(--border-soft); border-radius: 6px; padding: 6px 10px; }
.tl-item { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border-soft); }
.tl-item:last-child { border-bottom: 0; }
.tl-ic { width: 22px; text-align: center; flex: none; }

/* ---------------------------------- inbox ---------------------------------- */
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); height: calc(100vh - 170px); min-height: 460px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; overflow: hidden; box-shadow: var(--shadow); }
.ib-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.ib-filters { padding: 10px; border-bottom: 1px solid var(--border); }
.ib-filters input[type='search'] { width: 100%; }
.ib-convs { overflow-y: auto; flex: 1; }
.ib-conv { display: flex; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--border-soft); cursor: pointer; align-items: center; }
.ib-conv:hover { background: var(--row-hover); }
.ib-conv.on { background: #e9f6fe; box-shadow: inset 3px 0 0 var(--accent); }
.ib-name { display: flex; justify-content: space-between; gap: 6px; }
.ib-snip { color: var(--muted); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-snip.unread { color: var(--text); font-weight: 600; }
.ib-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: #f6f8fa; }
.ib-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--border); }
.ib-msgs { flex: 1; overflow-y: auto; padding: 14px 16px; }
.bub-row { display: flex; margin: 6px 0; }
.bub-row.out { justify-content: flex-end; }
.bub { max-width: min(560px, 78%); padding: 8px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--border); box-shadow: 0 1px 1px rgba(0,0,0,.05); word-wrap: break-word; }
.bub.out { background: #d9efff; border-color: #bfe0f7; }
.bub.err { background: #fdeceb; border-color: #f4b9b4; }
.bub-text { white-space: pre-wrap; }
.bub-subj { font-weight: 700; margin-bottom: 3px; }
.bub-meta { font-size: 11px; color: var(--muted); margin-top: 4px; text-align: right; }
.bub-err { font-size: 12px; color: #b3261e; margin-top: 4px; }
.tick { letter-spacing: -2px; margin-left: 4px; } .tick.read { color: #1e88e5; }
.day-sep { text-align: center; margin: 12px 0 6px; } .day-sep span { background: #e3e9ee; color: #5b6b76; font-size: 11.5px; padding: 2px 10px; border-radius: 10px; }
.att-chip { display: inline-flex; gap: 6px; align-items: center; background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 2px 10px; font-size: 12.5px; margin: 4px 4px 0 0; }
.att-chip button { border: 0; background: none; cursor: pointer; color: var(--muted); }
.ib-compose { background: #fff; border-top: 1px solid var(--border); padding: 10px 14px; }
.ib-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.ib-tab { border: 1px solid var(--border); background: #fff; border-radius: 16px; padding: 3px 12px; font: inherit; cursor: pointer; }
.ib-tab.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.ib-tab:disabled { opacity: 0.45; cursor: not-allowed; }
.ib-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
@media (max-width: 860px) { .inbox { grid-template-columns: 1fr; height: auto; } .ib-list { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--border); } .ib-thread { min-height: 480px; } }

.consent-rows { display: flex; flex-direction: column; gap: 6px; }
.consent-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* ---------------------------- API connections ---------------------------- */
.alert.ok { background: var(--success-soft); color: #1f5d33; }
.req-line { display: flex; gap: 8px; }
.req-line select { width: 92px; flex: none; font-weight: 700; }
.req-line input { flex: 1; min-width: 0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; }
.kv { display: flex; flex-direction: column; gap: 6px; margin: 6px 0; }
.kv-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 6px; }
.kv-row input { min-width: 0; }
.api-editor textarea#body { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 12.5px; }
.sample-scroll { overflow: auto; max-height: 260px; border: 1px solid var(--border); border-radius: 6px; margin-top: 6px; }
table.sample { border-collapse: collapse; font-size: 12px; width: max-content; min-width: 100%; }
table.sample th, table.sample td { padding: 4px 8px; border-bottom: 1px solid var(--border-soft); text-align: left; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
table.sample th { background: #f6f9fb; position: sticky; top: 0; }
@media (max-width: 760px) {
  .kv-row { grid-template-columns: 1fr 1fr auto; }
  .req-line { flex-wrap: wrap; }
}

/* ============================ Tasks ============================ */
.tile.warn { border-top: 3px solid var(--warn); }
.tile.warn .value { color: #b3261e; }
.task-group { padding: 8px 16px; font-weight: 700; font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted); background: var(--head-bg); border-bottom: 1px solid var(--border-soft); }
.task-group.overdue { color: #b3261e; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--border-soft); }
.task-row:hover { background: var(--row-hover); }
.task-row .task-check { width: 18px; height: 18px; flex: none; cursor: pointer; }
.task-main { flex: 1; min-width: 0; }
.task-title { border: 0; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-title:hover { color: var(--primary); text-decoration: underline; }
.task-row.is-done .task-title { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.task-due { font-size: 12.5px; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
.task-due.overdue { color: #b3261e; font-weight: 700; }
.task-due.today { color: #8a5300; font-weight: 700; }
.task-due.soon { color: var(--primary); font-weight: 600; }
.task-list.compact { border: 1px solid var(--border-soft); border-radius: 6px; max-height: 220px; overflow-y: auto; }
.task-list.compact .task-row { padding: 7px 10px; }
.task-list .empty.small { padding: 14px; font-size: 13px; }
.badge.red { background: var(--danger-soft); color: #b3261e; }
.count.alert-count { background: var(--danger); color: #fff; }

/* ============================ Global search ============================ */
.gsearch { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: #fff; color: var(--text); border-radius: 8px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.28); z-index: 90; max-height: 70vh; overflow-y: auto; padding: 4px 0; }
.gs-label { padding: 8px 14px 3px; font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); }
.gs-item { display: flex; flex-direction: column; padding: 6px 14px; cursor: pointer; }
.gs-item:hover, .gs-item.active { background: var(--row-hover); }
.gs-item.active { box-shadow: inset 3px 0 0 var(--accent); }
.gs-empty { padding: 16px 14px; color: var(--muted); }
.gs-foot { padding: 8px 14px; border-top: 1px solid var(--border-soft); font-size: 12px; color: var(--muted); }

/* ============================ Duplicates ============================ */
.dup-group { border-bottom: 1px solid var(--border); }
.dup-head { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--head-bg); flex-wrap: wrap; }
.dup-head .grow { flex: 1; }
.dup-recs { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding: 12px 16px 14px; }
.dup-rec { border: 1px solid var(--border-soft); border-radius: 6px; padding: 8px 10px; min-width: 0; overflow-wrap: anywhere; }
.toolbar .grow { flex: 1; }

/* ============================ Dashboard analytics ============================ */
.attention { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.att { display: flex; align-items: baseline; gap: 8px; background: var(--card); border: 1px solid var(--border); border-left: 4px solid var(--accent); border-radius: var(--radius); padding: 9px 14px; color: var(--text); box-shadow: var(--shadow); }
.att:hover { text-decoration: none; border-color: var(--primary); }
.att b { font-size: 20px; font-variant-numeric: tabular-nums; }
.att span { color: var(--muted); font-size: 13px; }
.att.bad { border-left-color: var(--danger); }
.att.bad b { color: #b3261e; }
.dash-row { align-items: stretch; margin-top: 0; }
.dash-row .card + .card { margin-top: 0; }
.funnel { display: flex; flex-direction: column; gap: 6px; }
.fn-row { display: grid; grid-template-columns: 78px 1fr 44px 92px; gap: 10px; align-items: center; color: var(--text); font-size: 13px; }
.fn-row:hover { text-decoration: none; background: var(--row-hover); }
.fn-lbl { text-transform: capitalize; font-weight: 600; }
.fn-track { height: 14px; background: var(--border-soft); border-radius: 3px; overflow: hidden; }
.fn-fill { display: block; height: 100%; border-radius: 3px; }
.fn-n { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
.fn-v { font-size: 12px; text-align: right; font-variant-numeric: tabular-nums; }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 16px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-soft); }
.kpis b { display: block; font-size: 19px; font-variant-numeric: tabular-nums; }
.kpis span { color: var(--muted); font-size: 12.5px; }
.kpis i { font-style: normal; font-weight: 700; }
.kpis i.up { color: #2c7a42; }
.kpis i.down { color: #b3261e; }
svg.trend { width: 100%; height: auto; display: block; }
.tr-grid { stroke: var(--border-soft); stroke-width: 1; }
.tr-axis { fill: var(--muted); font-size: 10px; }
.tr-hit { fill: transparent; }
.tr-hit:hover { fill: rgba(1, 87, 155, 0.07); }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
.legend b { color: var(--text); }
.bad-n { color: #b3261e; font-weight: 700; }
.q-head { display: flex; gap: 18px; align-items: center; margin-bottom: 14px; }
svg.ring { width: 96px; height: 96px; flex: none; }
.ring-n { font-size: 26px; font-weight: 700; fill: var(--text); }
.q-links { margin-top: 6px; font-size: 13px; }
.q-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 28px; }
.q-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 40px; gap: 10px; align-items: center; font-size: 13px; padding: 3px 0; }
.q-row b { text-align: right; font-variant-numeric: tabular-nums; }
.q-bar { height: 7px; background: var(--border-soft); border-radius: 4px; overflow: hidden; }
.q-bar span { display: block; height: 100%; border-radius: 4px; }
.q-issues { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border-soft); }
@media (max-width: 900px) {
  .dash-row.grid2 { grid-template-columns: minmax(0, 1fr); }
  .q-cols { grid-template-columns: minmax(0, 1fr); }
}

/* ============================ Favourites, flags, forms ============================ */
div.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
div.field input { font-weight: 400; color: var(--text); font-size: 14px; }
.form-sect { margin-top: 6px; padding-bottom: 4px; border-bottom: 1px solid var(--border-soft); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--primary); }
.mk { display: inline-flex; align-items: center; gap: 4px; vertical-align: middle; }
.mk button { border: 0; background: none; cursor: pointer; padding: 2px; line-height: 1; }
.mk-heart { font-size: 18px; color: #b0bcc5; }
.mk-heart:hover { color: #e0245e; }
.mk-heart.on { color: #e0245e; }
.mk.lg .mk-heart { font-size: 24px; margin-left: 6px; }
.mk-flag { display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 2px solid #b0bcc5; background: transparent; padding: 0; flex: none; box-sizing: border-box; }
button.mk-flag { width: 17px; height: 17px; padding: 0; }
.mk.lg button.mk-flag { width: 22px; height: 22px; }
.mk-flag.red { background: #f44336; border-color: #f44336; }
.mk-flag.amber { background: #ef8f00; border-color: #ef8f00; }
.mk-flag.green { background: #46a35e; border-color: #46a35e; }
.mk-pop { position: fixed; z-index: 120; background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 28px rgba(0, 20, 30, 0.25); padding: 4px; min-width: 130px; }
.mk-pop button { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; padding: 7px 10px; font: inherit; cursor: pointer; text-align: left; border-radius: 5px; }
.mk-pop button:hover, .mk-pop button.on { background: var(--row-hover); }
.seg-radio { display: flex; flex-wrap: wrap; gap: 6px 16px; font-weight: 400; color: var(--text); font-size: 14px; padding-top: 2px; }
.seg-radio label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.link-list { max-height: 46vh; overflow-y: auto; border: 1px solid var(--border-soft); border-radius: 6px; }
.link-list:empty { display: none; }
.link-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border-soft); cursor: pointer; }
.link-row:hover { background: var(--row-hover); }
.link-row:last-child { border-bottom: 0; }
.link-row .avatar { width: 30px; height: 30px; }
.lk-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---- Storage monitor ---- */
.stor-top { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; margin-bottom: 18px; }
.stor-pct { font-size: 44px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.stor-nums { display: flex; gap: 28px; flex: 1; flex-wrap: wrap; }
.stor-nums b { display: block; font-size: 20px; font-variant-numeric: tabular-nums; }
.stor-nums span { color: var(--muted); font-size: 12.5px; }
.stor-gauge { position: relative; height: 22px; background: var(--border-soft); border: 1px solid var(--border); border-radius: 11px; overflow: visible; }
.stor-fill { height: 100%; border-radius: 10px; transition: width .6s ease, background .3s; min-width: 4px; }
.stor-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text); opacity: .55; }
.stor-mark i { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 2px; font-style: normal; font-size: 11px; color: var(--muted); }
.stor-scale { display: flex; justify-content: space-between; margin-top: 20px; color: var(--muted); font-size: 11.5px; }
.stor-mini { height: 8px; background: var(--border-soft); border-radius: 4px; overflow: hidden; }
.stor-mini div { height: 100%; background: var(--primary); }
.stor-alerts { max-height: 340px; overflow: auto; }
.stor-alert { display: flex; align-items: center; gap: 12px; padding: 9px 16px; border-bottom: 1px solid var(--border-soft); }
.stor-alert .msg { flex: 1; min-width: 0; }
.stor-alert.seen .msg { color: var(--muted); }
.alert.warn { background: var(--warn-soft); color: #6d4300; }
.count.stor-warn { background: var(--warn); color: #fff; }
