/* ADVITECS Support Portal — shared styles (client + admin) */
@import url("fonts.css");

:root {
  --navy: #0b1f3a;
  --navy-2: #132b4d;
  --accent: #0e7490;
  --accent-hover: #155e75;
  --accent-tint: #f0f8fa;
  --accent-line: #cde6ec;
  --ink: #111827;
  --ink-2: #1f2937;
  --muted: #5b6474;
  --soft: #7a8394;
  --ground: #f4f5f7;
  --surface: #ffffff;
  --line: #e3e6ec;
  --line-2: #eef0f3;
  --field: #cdd2da;

  --st-open: #1e40af;      --st-open-bg: #e7edfb;
  --st-progress: #92400e;  --st-progress-bg: #fcefd9;
  --st-waiting: #6b21a8;   --st-waiting-bg: #f2e8fb;
  --st-resolved: #166534;  --st-resolved-bg: #e3f4e8;
  --st-closed: #4b5563;    --st-closed-bg: #edeef1;
  --st-new: #0b1f3a;       --st-new-bg: #dceaf7;
  --danger: #991b1b;       --danger-bg: #fbe4e4;
  --warn: #9a3412;         --warn-bg: #fdebdd;
  --note-bg: #fff8e6;      --note-line: #f3dfa8; --note-ink: #854d0e;

  --f-display: "Space Grotesk", system-ui, sans-serif;
  --f-body: "IBM Plex Sans", system-ui, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, monospace;

  --radius: 12px;
  --radius-sm: 8px;
  --sidebar-w: 248px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 30px; letter-spacing: -0.02em; line-height: 1.15; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- icons (sprite injected by portal.js) ---------- */
.i { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i-sm { width: 15px; height: 15px; }
.i-lg { width: 20px; height: 20px; }

/* ---------- brand ---------- */
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.brand-logo { display: block; height: 26px; width: auto; flex-shrink: 0; }
.brand-divider { width: 2px; height: 16px; background: var(--accent); }
.brand-sub { font-family: var(--f-display); font-weight: 500; font-size: 15px; letter-spacing: .12em; }
.brand-light { color: #fff; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid transparent; font-size: 14px; font-weight: 600; line-height: 1.2;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, color .15s;
}
.btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.btn-lg { min-height: 48px; padding: 12px 20px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-dark { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-dark:hover { background: var(--navy-2); color: #fff; }
.btn-secondary { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { border-color: #c5cad3; color: var(--ink); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--line-2); color: var(--ink); }
.btn-link { background: none; border: 0; padding: 4px; font-size: 13px; font-weight: 600; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.icon-btn {
  position: relative; width: 44px; height: 44px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn-sm { width: 34px; height: 34px; }
.icon-btn .dot { position: absolute; top: 9px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: #b91c1c; border: 2px solid var(--surface); }

/* ---------- badges ---------- */
.status {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-new { color: var(--st-new); background: var(--st-new-bg); }
.status-open { color: var(--st-open); background: var(--st-open-bg); }
.status-progress { color: var(--st-progress); background: var(--st-progress-bg); }
.status-waiting { color: var(--st-waiting); background: var(--st-waiting-bg); }
.status-resolved { color: var(--st-resolved); background: var(--st-resolved-bg); }
.status-closed { color: var(--st-closed); background: var(--st-closed-bg); }

.prio { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.prio-urgent { color: var(--danger); background: var(--danger-bg); }
.prio-high { color: var(--warn); background: var(--warn-bg); }
.prio-normal { color: #374151; background: var(--line-2); }
.prio-low { color: var(--st-closed); background: var(--ground); }
.prio .i { width: 12px; height: 12px; stroke-width: 2.2; }

.tag { display: inline-block; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 6px; background: var(--ground); border: 1px solid var(--line); }
.role { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 6px; background: var(--ground); border: 1px solid var(--line); }
.staff-tag { font-size: 11px; font-weight: 600; letter-spacing: .06em; padding: 2px 6px; border-radius: 4px; background: var(--navy); color: #fff; }
.mono { font-family: var(--f-mono); font-weight: 500; font-size: 13px; color: var(--muted); white-space: nowrap; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.xs { font-size: 12px; }
.ok { color: var(--st-resolved); font-weight: 600; }
.warn { color: var(--warn); font-weight: 600; }
.bad { color: var(--danger); font-weight: 600; }
.paused { color: var(--soft); font-weight: 600; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; background: var(--st-new-bg); color: var(--navy);
}
.avatar-staff { background: var(--navy); color: #fff; }
.avatar-accent { background: var(--accent); color: #fff; }
.avatar-xs { width: 24px; height: 24px; font-size: 10px; }
.avatar-sm { width: 28px; height: 28px; font-size: 11px; }
.avatar-md { width: 36px; height: 36px; font-size: 13px; }
.avatar-lg { width: 48px; height: 48px; font-size: 17px; }

.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }

/* ---------- cards & layout ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.card-flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-flush .card-head { padding: 18px 20px; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex-grow: 1; min-width: 0; }
.divider { height: 1px; background: var(--line-2); border: 0; margin: 0; }

.grid-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.grid-stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.split-wide { grid-template-columns: minmax(0, 1fr) 420px; gap: 20px; }

.stat .value { font-family: var(--f-display); font-size: 30px; font-weight: 600; margin-top: 10px; line-height: 1.1; }
.stat .sub { font-size: 13px; color: var(--muted); margin-top: 6px; font-weight: 500; }

.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-2); font-size: 14px; }
.kv > span:first-child { color: var(--muted); }
.kv > span:last-child { font-weight: 500; text-align: right; }

.meter { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.meter-sm { height: 6px; }
.meter.over > span { background: #b91c1c; }

.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink); text-decoration: none;
}
.chip .count { font-family: var(--f-mono); font-size: 12px; font-weight: 500; opacity: .75; }
.chip[aria-pressed="true"], .chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.chip-round { border-radius: 999px; padding: 5px 12px; font-size: 13px; }

.banner { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: var(--radius); }
.banner-waiting { background: var(--st-waiting-bg); border: 1px solid #e0ccf5; }
.banner-waiting .title { color: #3b0764; font-weight: 600; }
.banner-waiting .text { color: #5b2a86; font-size: 14px; }
.banner-waiting .btn { background: var(--st-waiting); color: #fff; }
.banner-icon { width: 40px; height: 40px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.notice { display: flex; gap: 12px; padding: 16px; border-radius: var(--radius); background: var(--st-progress-bg); border: 1px solid #f3d9ae; color: #78350f; font-size: 14px; }

/* ---------- tables ---------- */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th {
  text-align: left; padding: 10px 16px; background: var(--ground); border-bottom: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--soft); text-transform: uppercase; letter-spacing: .05em; white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .1s; }
.table tbody tr:hover { background: #fafbfc; }
.table tbody tr.is-selected { background: var(--accent-tint); }
.table .num { text-align: right; white-space: nowrap; }
.table .subject { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-decoration: none; color: var(--ink); }
.table .subject strong { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 380px; }
.table .subject span { font-size: 13px; color: var(--muted); }
.table input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.table-foot { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line-2); }
.table-scroll { overflow-x: auto; }
.sla { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.assign-btn { font-size: 13px; font-weight: 600; color: var(--accent); background: transparent; border: 1px dashed #9cc9d4; border-radius: 6px; padding: 4px 8px; }
.person { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }

.bulkbar { display: none; align-items: center; gap: 8px; padding: 8px 16px; background: var(--navy); color: #fff; font-size: 14px; }
.bulkbar.is-visible { display: flex; }
.bulkbar button { background: transparent; border: 0; color: #fff; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 6px; font-weight: 500; }
.bulkbar button:hover { background: rgba(255,255,255,.1); }
.bulkbar .sep { opacity: .35; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; font-size: 14px; font-weight: 600; }
.field .hint { font-weight: 400; color: var(--muted); font-size: 13px; }
.field-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.field-label .optional { font-size: 12px; font-weight: 400; color: var(--soft); }
.input, .textarea, .select {
  width: 100%; min-height: 46px; padding: 10px 14px; border: 1px solid var(--field); border-radius: var(--radius-sm);
  background: var(--surface); font-size: 15px; font-weight: 400; color: var(--ink);
}
.textarea { line-height: 1.5; resize: vertical; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%235b6474' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 38px; }
.select-sm { min-height: 40px; font-size: 14px; }
.input:focus, .textarea:focus, .select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,116,144,.15); }
.input-icon { position: relative; }
.input-icon .i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--soft); }
.input-icon .input { padding-left: 44px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); font-weight: 400; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.choices-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.choice {
  position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s;
}
.choice:hover { border-color: #c5cad3; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.choice-icon { width: 40px; height: 40px; border-radius: 10px; background: var(--ground); color: var(--navy); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.choice:has(input:checked) .choice-icon { background: var(--accent); color: #fff; }
.choice-title { display: block; font-weight: 600; font-size: 14px; }
.choice-desc { display: block; font-size: 13px; color: var(--muted); line-height: 1.4; margin-top: 2px; }
.choice-radio { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--field); flex-shrink: 0; margin-top: 1px; }
.choice:has(input:checked) .choice-radio { border: 5px solid var(--accent); }
.choice-urgent .choice-title { color: var(--danger); }

.step-head { display: flex; align-items: center; gap: 12px; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: #fff; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step-title { font-family: var(--f-display); font-size: 18px; font-weight: 600; }

.dropzone {
  display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 96px; padding: 16px;
  border: 1.5px dashed #b6bdc9; border-radius: 10px; background: var(--ground); color: var(--muted); font-size: 14px; cursor: pointer; text-align: center;
}
.dropzone:hover, .dropzone.is-over { border-color: var(--accent); background: var(--accent-tint); }
.dropzone strong { color: var(--ink); }
.dropzone input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.file-list { display: flex; gap: 10px; flex-wrap: wrap; }
.file { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); font-size: 13px; }

/* ---------- ticket thread ---------- */
.thread { display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 14px; }
.msg-body { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 16px 18px; border-radius: var(--radius); background: var(--accent-tint); border: 1px solid var(--accent-line); }
.msg-staff .msg-body { background: var(--surface); border-color: var(--line); }
.msg-note .msg-body { background: var(--note-bg); border-color: var(--note-line); }
.msg-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.msg-meta .who { font-weight: 600; font-size: 14px; }
.msg-meta .when { margin-left: auto; color: var(--soft); }
.msg-text { color: var(--ink-2); line-height: 1.6; }
.note-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--note-ink); }
.event { display: flex; align-items: center; gap: 12px; padding-left: 8px; font-size: 13px; color: var(--muted); }
.event .dot-icon { width: 22px; height: 22px; border-radius: 50%; background: var(--line-2); display: flex; align-items: center; justify-content: center; }
.event .dot-icon .i { width: 13px; height: 13px; stroke-width: 2; }
.event strong { color: var(--ink); }

.composer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.composer.is-note { background: var(--note-bg); border-color: var(--note-line); }
.composer-tabs { display: flex; gap: 4px; padding: 6px 6px 0; border-bottom: 1px solid var(--line); }
.composer-tab { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border: 0; background: transparent; font-size: 14px; font-weight: 500; color: var(--muted); }
.composer-tab[aria-selected="true"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.composer.is-note .composer-tab[aria-selected="true"] { box-shadow: inset 0 -2px 0 #ca8a04; }
.composer textarea { display: block; width: 100%; border: 0; outline: 0; padding: 16px 18px; font-size: 15px; line-height: 1.5; resize: vertical; min-height: 110px; background: transparent; }
.composer-tools { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line-2); flex-wrap: wrap; }
.composer-tools .tool { height: 36px; min-width: 36px; padding: 0 10px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.composer-tools .tool:hover { background: var(--line-2); color: var(--ink); }
.composer-tools .end { margin-left: auto; display: flex; gap: 10px; align-items: center; }

.progress-list { display: flex; flex-direction: column; gap: 14px; list-style: none; margin: 0; padding: 0; }
.progress-list li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--soft); }
.progress-list .mark { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--line); display: flex; align-items: center; justify-content: center; }
.progress-list li.done { color: var(--ink); }
.progress-list li.done .mark { background: var(--st-resolved-bg); border-color: var(--st-resolved); color: var(--st-resolved); }
.progress-list .mark .i { width: 12px; height: 12px; stroke-width: 2.6; }

/* ================= CLIENT SHELL ================= */
.c-top { position: sticky; top: 0; z-index: 20; height: 64px; background: var(--surface); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 36px; padding: 0 40px; }
.c-nav { display: flex; gap: 28px; flex-grow: 1; }
.c-nav a { display: inline-flex; align-items: center; gap: 8px; height: 64px; padding: 0 2px; color: var(--muted); font-size: 14px; font-weight: 500; text-decoration: none; }
.c-nav a:hover { color: var(--ink); }
.c-nav a[aria-current="page"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.c-user { display: flex; align-items: center; gap: 10px; }
.c-user .name { font-size: 14px; font-weight: 600; display: block; line-height: 1.2; }
.c-user .org { font-size: 12px; color: var(--muted); display: block; }
.c-main { max-width: 1360px; margin: 0 auto; padding: 32px 40px 56px; display: flex; flex-direction: column; gap: 24px; }
.c-foot { border-top: 1px solid var(--line); background: var(--surface); padding: 16px 40px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.c-foot strong { color: var(--navy); letter-spacing: .06em; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head p { color: var(--muted); margin-top: 6px; }
.back { font-size: 14px; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.menu-toggle { display: none; }

.site-item { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; }
.site-icon { width: 36px; height: 36px; border-radius: var(--radius-sm); background: var(--ground); color: var(--navy); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.live-ok { color: var(--st-resolved); }
.live-dev { color: var(--st-progress); }

.link-list a { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line-2); font-size: 14px; text-decoration: none; color: var(--ink); }
.link-list a:first-child { border-top: 0; }
.link-list a:hover { color: var(--accent); }

.next-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; counter-reset: s; }
.next-steps li { display: flex; gap: 12px; counter-increment: s; }
.next-steps li::before { content: counter(s); width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--accent); color: var(--accent); font-size: 12px; font-weight: 600; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.next-steps strong { display: block; font-size: 14px; }
.next-steps span { font-size: 13px; color: var(--muted); }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 560px) minmax(0, 1fr); background: var(--surface); }
.auth-aside { position: relative; overflow: hidden; background: var(--navy); color: #fff; padding: 56px; display: flex; flex-direction: column; }
.auth-aside .rings { position: absolute; right: -200px; bottom: -180px; width: 520px; height: 520px; pointer-events: none; }
.auth-aside .pitch { margin-top: auto; position: relative; display: flex; flex-direction: column; gap: 20px; }
.auth-aside h1 { font-size: 44px; line-height: 1.08; }
.auth-aside p { color: #c6d0e0; font-size: 16px; line-height: 1.6; max-width: 400px; }
.auth-points { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-points li { display: flex; align-items: center; gap: 12px; font-size: 14px; color: #dce3ee; }
.auth-points .tick { width: 28px; height: 28px; border-radius: 50%; background: rgba(255,255,255,.1); display: flex; align-items: center; justify-content: center; }
.auth-points .tick .i { width: 15px; height: 15px; stroke-width: 2.4; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 22px; }
.auth-form h2 { font-size: 28px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--soft); font-size: 13px; }
.or::before, .or::after { content: ""; flex-grow: 1; height: 1px; background: var(--line); }
.auth-admin .auth-aside { background: #07152a; }

/* ================= ADMIN SHELL ================= */
.a-shell { min-height: 100vh; }
.a-side {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--navy); padding: 20px 16px;
  display: flex; flex-direction: column; gap: 24px; z-index: 30; overflow-y: auto;
}
.a-side .brand { padding: 4px 6px; }
.a-side .brand { gap: 8px; }
.a-side .brand-logo { height: 21px; }
.a-side .brand-sub { font-size: 12px; }
.a-nav { display: flex; flex-direction: column; gap: 4px; }
.a-nav a {
  display: flex; align-items: center; gap: 12px; padding: 0 14px; height: 44px; border-radius: var(--radius-sm);
  color: #b8c3d6; font-size: 14px; font-weight: 500; text-decoration: none;
}
.a-nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.a-nav a[aria-current="page"] { background: rgba(255,255,255,.08); color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 var(--accent); }
.a-nav .badge { margin-left: auto; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; }
.a-views .label { padding: 0 14px 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #7f8da6; }
.a-views a { display: flex; justify-content: space-between; padding: 8px 14px; color: #b8c3d6; font-size: 13px; text-decoration: none; border-radius: 6px; }
.a-views a:hover { color: #fff; background: rgba(255,255,255,.05); }
.a-views a span:last-child { font-family: var(--f-mono); }
.a-side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.a-me { display: flex; align-items: center; gap: 10px; padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.1); }
.a-me .name { color: #fff; font-size: 14px; font-weight: 600; display: block; line-height: 1.2; }
.a-me .role-line { color: #8fa0ba; font-size: 12px; display: block; }

.a-body { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.a-top {
  position: sticky; top: 0; z-index: 20; height: 68px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 20px; padding: 0 32px;
}
.a-top h1 { font-size: 22px; letter-spacing: -0.01em; white-space: nowrap; }
.a-search { flex-grow: 1; max-width: 460px; margin-left: 16px; position: relative; }
.a-search .i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--soft); }
.a-search input { width: 100%; height: 40px; padding: 0 52px 0 40px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--ground); font-size: 14px; }
.a-search input:focus { outline: none; border-color: var(--accent); background: var(--surface); }
.a-search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-family: var(--f-mono); font-size: 11px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); color: var(--soft); }
.a-top-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.a-main { padding: 28px 32px 48px; display: flex; flex-direction: column; gap: 24px; }

.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filters .select { width: auto; min-height: 36px; padding: 6px 34px 6px 12px; font-size: 13px; border-color: var(--line); }

.chart { display: flex; gap: 4px; align-items: flex-end; height: 200px; border-bottom: 1px solid var(--line); }
.chart .day { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; }
.chart .bars { display: flex; align-items: flex-end; gap: 3px; }
.chart .bar { width: 12px; border-radius: 3px 3px 0 0; background: var(--navy); }
.chart .bar.res { background: var(--accent); }
.chart-labels { display: flex; gap: 4px; }
.chart-labels span { flex: 1; text-align: center; font-family: var(--f-mono); font-size: 11px; color: var(--soft); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 2px; background: var(--navy); display: inline-block; }
.legend i.res { background: var(--accent); }

.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); text-decoration: none; color: var(--ink); }
.list-row:hover strong { color: var(--accent); }
.list-row strong { font-size: 14px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.prop-field { display: flex; flex-direction: column; gap: 6px; }
.prop-field > span { font-size: 12px; font-weight: 600; color: var(--soft); text-transform: uppercase; letter-spacing: .05em; }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.mini-stats div { padding: 12px; border-radius: 10px; background: var(--ground); }
.mini-stats .k { font-size: 12px; color: var(--muted); }
.mini-stats .v { font-family: var(--f-display); font-size: 20px; font-weight: 600; margin-top: 4px; }

/* ---------- index ---------- */
.hub { max-width: 980px; margin: 0 auto; padding: 64px 24px; display: flex; flex-direction: column; gap: 32px; }
.hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.hub .card ul { list-style: none; margin: 0; padding: 0; }
.hub .card li a { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-2); text-decoration: none; color: var(--ink); font-weight: 500; }
.hub .card li:first-child a { border-top: 0; }
.hub .card li a:hover { color: var(--accent); }

/* ================= RESPONSIVE ================= */
@media (max-width: 1180px) {
  .split, .split-wide { grid-template-columns: minmax(0, 1fr); }
  .grid-stats-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .c-nav { gap: 18px; }
}
@media (max-width: 960px) {
  .a-side { transform: translateX(-100%); transition: transform .2s; }
  .a-shell.nav-open .a-side { transform: none; box-shadow: 0 0 0 100vmax rgba(11,31,58,.4); }
  .a-body { margin-left: 0; }
  .a-search { display: none; }
  .menu-toggle { display: inline-flex; }
  .c-nav { display: none; }
  .c-top.nav-open .c-nav { display: flex; position: absolute; top: 64px; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); padding: 8px 24px; }
  .c-top.nav-open .c-nav a { height: 48px; box-shadow: none; }
  .auth { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
  .choices, .choices-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-stats, .grid-stats-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 14px; }
  h1 { font-size: 24px; }
  .c-top { padding: 0 16px; gap: 12px; }
  .c-top .c-new span, .c-user .who { display: none; }
  .c-top .brand-divider, .c-top .brand-sub { display: none; }
  .c-top .brand-logo { height: 22px; }
  .c-main { padding: 20px 16px 40px; }
  .c-foot { padding: 16px; }
  .a-top { padding: 0 16px; gap: 10px; }
  .a-top h1 { font-size: 18px; }
  .a-top .btn span { display: none; }
  .a-main { padding: 20px 16px 40px; }
  .choices, .choices-4, .form-grid { grid-template-columns: 1fr; }
  .banner { flex-wrap: wrap; }
  .table .hide-sm { display: none; }
}

/* ---------- solutions (client page, Add client) ---------- */
.sub-row { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.sub-row:last-of-type { border-bottom: 0; }
.solution-row { display: grid; grid-template-columns: minmax(0, 1fr) 200px; gap: 12px; align-items: center; }
@media (max-width: 640px) { .solution-row { grid-template-columns: 1fr; } }

/* ---------- contact rows (Add client) ---------- */
.section-note { font-size: 13px; color: var(--muted); text-align: right; }
.contacts { display: flex; flex-direction: column; gap: 10px; }
.contacts-head, .contact-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr) 150px 34px; gap: 12px; align-items: start; }
.contacts-head span { font-size: 13px; font-weight: 600; color: var(--muted); }
.contact-row .field { gap: 6px; min-width: 0; }
.contact-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.contact-remove { margin-top: 6px; }
.role-fixed { min-height: 46px; display: flex; align-items: center; padding: 0 14px; border: 1px dashed var(--field); border-radius: var(--radius-sm); font-size: 15px; font-weight: 500; color: var(--muted); }
.add-contact { align-self: flex-start; }
@media (max-width: 640px) {
  .contacts-head { display: none; }
  .contact-row { grid-template-columns: 1fr; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; position: relative; }
  .contact-row > span:empty { display: none; }
  .contact-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-size: 14px; font-weight: 600; }
  .contact-remove { position: absolute; top: 8px; right: 8px; margin: 0; }
}

/* ================= INTERACTIVE PROTOTYPE ADDITIONS ================= */
[hidden] { display: none !important; }
.clickable { cursor: pointer; }
.table tbody tr.clickable:hover { background: var(--accent-tint); }

/* dropdown menus */
.menu-wrap { position: relative; }
.menu {
  position: absolute; z-index: 60; top: calc(100% + 6px); right: 0; min-width: 220px; max-width: 360px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 6px;
  box-shadow: 0 12px 32px rgba(11,31,58,.14), 0 2px 6px rgba(11,31,58,.06);
}
.menu-left { right: auto; left: 0; }
.menu button, .menu a {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; background: transparent;
  border-radius: 6px; font-size: 14px; color: var(--ink); text-align: left; text-decoration: none;
}
.menu button:hover, .menu a:hover { background: var(--ground); color: var(--ink); }
.menu .danger { color: var(--danger); }
.menu .menu-label { padding: 8px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
.menu hr { border: 0; height: 1px; background: var(--line-2); margin: 6px 0; }
.menu .check-mark { margin-left: auto; color: var(--accent); }
.notif-menu { width: 360px; padding: 0; }
.notif-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.notif-list { max-height: 380px; overflow-y: auto; padding: 6px; }
.notif-item { display: flex !important; align-items: flex-start !important; gap: 10px; }
.notif-item .unread-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex-shrink: 0; }
.notif-item .read-dot { width: 8px; flex-shrink: 0; }
.notif-item .t { font-size: 13px; line-height: 1.4; }
.notif-item .w { font-size: 12px; color: var(--soft); }
.empty { padding: 32px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.empty .i { margin: 0 auto 10px; width: 28px; height: 28px; color: var(--soft); }

/* modal */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(11,31,58,.45);
  display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 24px; overflow-y: auto;
  animation: fade .15s ease-out;
}
.modal {
  width: 100%; max-width: 520px; background: var(--surface); border-radius: 14px;
  box-shadow: 0 24px 64px rgba(11,31,58,.28); animation: pop .18s ease-out;
}
.modal-lg { max-width: 720px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line-2); }
.modal-head h2 { font-size: 19px; }
.modal-body { padding: 20px 22px; display: flex; flex-direction: column; gap: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px; border-top: 1px solid var(--line-2); background: #fafbfc; border-radius: 0 0 14px 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* toast */
.toasts { position: fixed; z-index: 200; bottom: 24px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 16px; border-radius: 10px; background: var(--navy); color: #fff;
  font-size: 14px; font-weight: 500; box-shadow: 0 10px 30px rgba(11,31,58,.3); animation: pop .2s ease-out; pointer-events: auto;
}
.toast .i { color: #7dd3e8; }

/* field errors */
.field-error { color: var(--danger); font-size: 13px; font-weight: 500; }
.input.invalid, .textarea.invalid { border-color: #dc2626; }
.form-alert { padding: 10px 14px; border-radius: 8px; background: var(--danger-bg); color: var(--danger); font-size: 14px; font-weight: 500; }

/* stars */
.stars { display: inline-flex; gap: 4px; }
.stars button { background: none; border: 0; padding: 2px; color: #d1d5db; }
.stars button.on { color: #d97706; }
.stars button .i { width: 26px; height: 26px; }
.stars button.on .i { fill: currentColor; }
.stars-static .i { width: 14px; height: 14px; color: #d97706; fill: currentColor; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab { padding: 10px 14px; border: 0; background: transparent; font-size: 14px; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; gap: 8px; }
.tab[aria-selected="true"] { color: var(--ink); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }

/* switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 500; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: #cbd2dc; position: relative; transition: background .15s; flex-shrink: 0; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* tag remove */
.tag-x { display: inline-flex; align-items: center; gap: 4px; }
.tag-x button { border: 0; background: none; padding: 0 0 0 2px; color: var(--soft); font-size: 14px; line-height: 1; }
.tag-x button:hover { color: var(--danger); }

/* article */
.prose { font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.prose p { margin: 0 0 14px; }
.prose ol, .prose ul { margin: 0 0 14px; padding-left: 22px; }
.article-card { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--ink); transition: border-color .15s; }
.article-card:hover { border-color: var(--accent); color: var(--ink); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* big search */
.hero-search { position: relative; max-width: 620px; }
.hero-search .i { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--soft); }
.hero-search input { width: 100%; height: 52px; padding: 0 16px 0 48px; border: 1px solid var(--field); border-radius: 12px; font-size: 16px; background: var(--surface); }
.hero-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(14,116,144,.15); }

/* hbar */
.hbar { display: grid; grid-template-columns: 160px minmax(0, 1fr) 48px; gap: 12px; align-items: center; font-size: 14px; padding: 7px 0; }
.hbar .track { height: 10px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.hbar .track span { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.hbar .n { text-align: right; font-family: var(--f-mono); font-size: 13px; color: var(--muted); }

/* timer running */
.timer-live { color: var(--danger); font-family: var(--f-mono); font-weight: 600; font-size: 13px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #dc2626; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .3; } }

/* demo switcher */
.demo-bar {
  position: fixed; z-index: 90; right: 16px; bottom: 16px; display: flex; align-items: center; gap: 4px; padding: 5px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 8px 24px rgba(11,31,58,.15); font-size: 13px;
}
.demo-bar .lbl { padding: 0 8px 0 10px; font-weight: 600; color: var(--soft); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.demo-bar a, .demo-bar button { border: 0; background: transparent; padding: 7px 12px; border-radius: 999px; font-weight: 600; color: var(--ink); text-decoration: none; font-size: 13px; }
.demo-bar a:hover, .demo-bar button:hover { background: var(--ground); color: var(--ink); }
.demo-bar a.on { background: var(--navy); color: #fff; }

.pager { display: flex; gap: 6px; align-items: center; }
.drop-caret { display: inline-flex; align-items: center; gap: 6px; }
.status-select { font-weight: 600; }
.merged-note { padding: 12px 16px; border-radius: 10px; background: var(--ground); border: 1px dashed var(--line); font-size: 14px; color: var(--muted); }

@media (max-width: 960px) {
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-bar .lbl { display: none; }
}
@media (max-width: 640px) {
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .notif-menu { width: calc(100vw - 32px); }
  .hbar { grid-template-columns: 110px minmax(0, 1fr) 40px; }
  .demo-bar { left: 16px; right: 16px; justify-content: center; }
}
@media (max-width: 640px) { body { padding-bottom: 76px; } }

/* ================= REACT APP ADDITIONS ================= */
.btn-danger { background: #b91c1c; border-color: #b91c1c; color: #fff; }
.btn-danger:hover { background: #991b1b; border-color: #991b1b; color: #fff; }
.btn:disabled, .btn-link:disabled { opacity: .55; cursor: not-allowed; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.a-nav .a-nav-btn {
  display: flex; align-items: center; gap: 12px; padding: 0 14px; height: 44px; border-radius: var(--radius-sm);
  color: #b8c3d6; font-size: 14px; font-weight: 500; background: none; border: 0; width: 100%; text-align: left;
}
.a-nav .a-nav-btn:hover { background: rgba(255,255,255,.05); color: #fff; }
.c-user { background: none; border: 0; padding: 4px; border-radius: 8px; }
.c-user:hover { background: var(--ground); }
.notif-item { width: 100%; background: none; border: 0; text-align: left; padding: 9px 10px; border-radius: 6px; }
.notif-item:hover { background: var(--ground); }
.qr { width: 180px; height: 180px; border: 1px solid var(--line); border-radius: 12px; padding: 8px; background: #fff; }
.secret { font-family: var(--f-mono); font-size: 13px; letter-spacing: .08em; word-break: break-all; padding: 8px 10px; background: var(--ground); border-radius: 8px; }
.qr svg { display: block; width: 100%; height: 100%; }
.table button.subject { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.link-btn { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 600; cursor: pointer; font-size: inherit; }
.link-btn:hover { color: var(--accent-hover); text-decoration: underline; }

/* ================= LARAVEL / BLADE ADDITIONS ================= */
dialog.modal { padding: 0; border: 0; max-height: calc(100vh - 48px); overflow: auto; }
dialog.modal::backdrop { background: rgba(11,31,58,.45); }
details.menu-wrap { position: relative; display: inline-block; }
details.menu-wrap > summary { list-style: none; cursor: pointer; }
details.menu-wrap > summary::-webkit-details-marker { display: none; }
.menu form { margin: 0; }
.menu form button { width: 100%; }
.alert-success { padding: 10px 14px; border-radius: 8px; background: var(--st-resolved-bg); color: #14532d; font-size: 14px; font-weight: 500; }
.stars-radio { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.stars-radio input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars-radio label { cursor: pointer; color: #d1d5db; }
.stars-radio label .i { width: 28px; height: 28px; }
.stars-radio input:checked ~ label, .stars-radio label:hover, .stars-radio label:hover ~ label { color: #d97706; }
.stars-radio input:checked ~ label .i, .stars-radio label:hover .i, .stars-radio label:hover ~ label .i { fill: currentColor; }
.stars-radio input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.pagination-nav { display: flex; gap: 6px; }
.inline-form { display: inline; margin: 0; }
.composer .tool { cursor: pointer; }
.hidden { display: none !important; }
.prop-field > label > span { font-size: 12px; font-weight: 600; color: var(--soft); text-transform: uppercase; letter-spacing: .05em; }

/* ---------- Smart features: AI, automation, monitoring ---------- */
.settings-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.h-sub { font-size: 14px; font-weight: 600; margin: 20px 0 10px; }
.provider-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; border: 0; padding: 0; margin: 0 0 16px; }
.provider-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: #fff; }
.provider-card input { position: absolute; opacity: 0; }
.provider-card:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); background: #f0f8fa; }
.provider-card:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.tag-ok { background: var(--st-resolved-bg); border-color: #bfe3ca; color: var(--st-resolved); font-weight: 600; }
.tag-monitor { display: inline-flex; align-items: center; gap: 6px; background: var(--danger-bg); border-color: #f1c4c4; color: var(--danger); }
button.switch { background: none; border: 0; padding: 0; }
.day-picker { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0; }
.day-picker .chip { cursor: pointer; }
.day-picker input { position: absolute; opacity: 0; width: 1px; }
.day-picker .chip:has(input:checked) { background: var(--navy); border-color: var(--navy); color: #fff; }
.skill-box { width: 18px; height: 18px; accent-color: var(--accent); }

.rule-card { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-top: 1px solid var(--line-2); }
.rule-card.is-off { opacity: .55; }
.rule-sentence { margin: 4px 0; line-height: 1.8; }
.rule-sentence code { font-size: 12px; background: var(--ground); border: 1px solid var(--line); border-radius: 5px; padding: 1px 6px; }
.rule-kw { font-weight: 600; color: var(--accent); text-transform: uppercase; font-size: 11px; letter-spacing: .04em; }
.rule-rows { display: flex; flex-direction: column; gap: 8px; }
.rule-row { display: grid; grid-template-columns: 1.2fr 1fr 1.4fr; gap: 8px; }
.rule-row-action { grid-template-columns: 1fr 2.6fr; }
.input-sm { min-height: 40px; font-size: 14px; }
.rule-help { margin: 14px 0; }
.rule-help summary { cursor: pointer; }
.rule-help ul { margin: 8px 0 0; padding-left: 18px; line-height: 1.7; }

.ai-card { padding: 16px 18px; border-color: #cfe3ea; background: linear-gradient(180deg, #f5fbfc, #fff); }
.ai-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ai-head form { margin: 0; }
.ai-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: .04em; }
.ai-summary { margin: 10px 0 2px; font-size: 14px; line-height: 1.6; }
.ai-suggest { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.mood { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; }
.mood-calm { background: var(--st-resolved-bg); color: var(--st-resolved); }
.mood-neutral { background: var(--st-closed-bg); color: var(--st-closed); }
.mood-frustrated { background: var(--st-progress-bg); color: var(--st-progress); }
.mood-angry { background: var(--danger-bg); color: var(--danger); }
.mood-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.mood-dot.mood-frustrated { background: #d97706; }
.mood-dot.mood-angry { background: #dc2626; }
.notice-dup { background: var(--st-waiting-bg); border-color: #e0ccf5; color: #3b0764; }
.notice-dup form { margin: 0; }
.tool-ai { color: var(--accent); font-weight: 600; }
.tool-ai.is-busy { opacity: .7; cursor: progress; }
.tool-ai.is-busy .i { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.suggest-box { border: 1px solid #cfe3ea; background: #f5fbfc; border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 8px; }
.suggest-head { display: flex; align-items: center; gap: 8px; color: var(--accent); }
.suggest-answer { margin: 0; font-size: 14px; line-height: 1.6; white-space: pre-line; }

.uptime { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.uptime.up { color: var(--st-resolved); }
.uptime.down { color: var(--danger); }
.uptime .pulse { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.uptime.down .pulse { animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .3; } }

@media (max-width: 900px) {
  .settings-grid { grid-template-columns: 1fr; }
  .rule-row, .rule-row-action { grid-template-columns: 1fr; }
}

/* A checkbox that only shows state inside a button. */
.display-only { pointer-events: none; }

/* Error pages */
.error-page { max-width: 520px; margin: 18vh auto 0; padding: 0 16px; display: flex; flex-direction: column; gap: 12px; }

.rule-error { display: block; color: var(--danger); margin-top: 2px; }
