/* Imoth Email & Records Portal — corporate theme */
:root {
  --navy: #0b2a5b;
  --navy-2: #123a78;
  --blue: #1f4fd1;
  --blue-600: #1a43b3;
  --blue-50: #eef3fe;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --border: #e2e7ef;
  --border-strong: #cfd7e4;
  --text: #0f1b2d;
  --muted: #5b6b82;
  --faint: #8a97aa;
  --green: #127a4a; --green-bg: #e7f6ee;
  --red: #b42318; --red-bg: #fdecea;
  --amber: #9a5b00; --amber-bg: #fff4e0;
  --purple: #5b3cc4; --purple-bg: #f0ecfd;
  --teal: #0d6e7a; --teal-bg: #e3f5f7;
  --grey-bg: #eef1f5;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(15, 27, 45, .05), 0 1px 3px rgba(15, 27, 45, .06);
  --shadow-lg: 0 10px 30px rgba(15, 27, 45, .16);
  --sidebar: 248px;
  --font: "Segoe UI", "Inter", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 14px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; color: var(--text); }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 16px; font-weight: 650; }
h3 { font-size: 14px; font-weight: 650; }
p { margin: 0 0 12px; }
code, .mono { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 12.5px; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: middle; }
.icon-sm { width: 15px; height: 15px; }
.icon-lg { width: 22px; height: 22px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt { margin-top: 16px; } .mt-sm { margin-top: 8px; } .mb { margin-bottom: 16px; } .mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1; }

/* ---------- App shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar); background: var(--navy); color: #c9d6ee; position: fixed; inset: 0 auto 0 0; z-index: 40;
  display: flex; flex-direction: column; transition: transform .2s ease;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 18px 18px 16px; color: #fff; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand img { width: 38px; height: 38px; }
.brand-name { font-weight: 700; letter-spacing: .06em; font-size: 15px; }
.brand-sub { font-size: 11px; color: #9fb3d6; line-height: 1.2; }
.nav { padding: 12px 10px; overflow-y: auto; flex: 1; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; color: #7f95bd; padding: 14px 10px 6px; }
.nav a {
  display: flex; align-items: center; gap: 11px; color: #c9d6ee; padding: 9px 12px; border-radius: 8px; font-weight: 500; margin-bottom: 2px;
}
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav a.active { background: var(--blue); color: #fff; }
.nav .count { margin-left: auto; background: #f59e0b; color: #1b1300; font-size: 11px; font-weight: 700; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.sidebar-foot { padding: 14px 18px; font-size: 11.5px; color: #7f95bd; border-top: 1px solid rgba(255,255,255,.08); }

.main { flex: 1; margin-left: var(--sidebar); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 62px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 14px;
  padding: 0 24px; position: sticky; top: 0; z-index: 30;
}
.topbar .menu-btn { display: none; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 8px;
  color: var(--muted); border: 1px solid transparent; background: transparent; cursor: pointer;
}
.icon-btn:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.dot { position: absolute; top: 5px; right: 4px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 99px; background: var(--red); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center; }
.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; padding: 4px 8px 4px 4px; border-radius: 8px; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--bg); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--blue-50); color: var(--blue); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; flex: none; }
.user-meta { line-height: 1.2; }
.user-meta strong { display: block; font-size: 13px; }
.user-meta span { font-size: 11.5px; color: var(--muted); }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); min-width: 200px; padding: 6px; z-index: 50;
}
.menu-pop a, .menu-pop button { display: flex; width: 100%; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 6px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; text-align: left; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--bg); text-decoration: none; }

.content { padding: 24px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.crumbs { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--muted); }
.backdrop { display: none; }

/* ---------- Cards / panels ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-body { padding: 18px; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); background: #fafbfd; border-radius: 0 0 var(--radius) var(--radius); }

.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; color: inherit; }
a.stat:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: 0 4px 14px rgba(15,27,45,.08); }
.stat-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex: none; }
.stat-label { color: var(--muted); font-size: 12.5px; font-weight: 500; }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1.15; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tone-blue { background: var(--blue-50); color: var(--blue); }
.tone-amber { background: var(--amber-bg); color: var(--amber); }
.tone-green { background: var(--green-bg); color: var(--green); }
.tone-red { background: var(--red-bg); color: var(--red); }
.tone-purple { background: var(--purple-bg); color: var(--purple); }
.tone-teal { background: var(--teal-bg); color: var(--teal); }
.tone-grey { background: var(--grey-bg); color: var(--muted); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; }
.grid-halves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-bottom: 20px; }
.quick a { display: flex; gap: 12px; align-items: center; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); font-weight: 600; }
.quick a:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.quick .stat-icon { width: 34px; height: 34px; border-radius: 8px; }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: 600 13.5px/1 var(--font); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--bg); text-decoration: none; }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid rgba(31,79,209,.3); outline-offset: 1px; }
.btn-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-600); }
.btn-navy { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-2); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-success:hover { background: #0e6a3f; }
.btn-danger { background: var(--surface); border-color: #f1b8b2; color: var(--red); }
.btn-danger:hover { background: var(--red-bg); }
.btn-danger-solid { background: var(--red); border-color: var(--red); color: #fff; }
.btn-danger-solid:hover { background: #971c12; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; height: 42px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-group { display: flex; flex-wrap: wrap; gap: 8px; }

label, .label { display: block; font-weight: 600; font-size: 12.5px; color: #34435a; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=number], input[type=tel], select, textarea {
  width: 100%; height: 38px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 0 11px; font: 14px var(--font);
  color: var(--text); background: var(--surface);
}
textarea { height: auto; min-height: 88px; padding: 9px 11px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(31,79,209,.14); }
input[readonly], input:disabled, select:disabled, textarea:disabled, textarea[readonly] { background: #f7f9fc; color: #3a4a62; }
.field { margin-bottom: 14px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-grid .span-2 { grid-column: 1 / -1; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: 13.5px; color: var(--text); margin-bottom: 10px; cursor: pointer; }
.check input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--blue); flex: none; }
.check small { display: block; color: var(--muted); font-weight: 400; }
.auto-tag { display: inline-block; margin-left: 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--teal); background: var(--teal-bg); border-radius: 4px; padding: 0 5px; vertical-align: 1px; }

/* ---------- Filters ---------- */
.filters { padding: 14px 18px; border-bottom: 1px solid var(--border); background: #fafbfd; }
.filters-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px 12px; align-items: end; }
.filters label { font-size: 11.5px; margin-bottom: 3px; color: var(--muted); }
.filters input, .filters select { height: 34px; font-size: 13px; }
.filters .btn { height: 34px; }
details.filter-toggle > summary { display: none; }

/* ---------- Tables ---------- */
.table-wrap { position: relative; overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfd; padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #f8faff; }
.table .subject { font-weight: 600; color: var(--text); display: block; max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .sub { display: block; font-size: 12px; color: var(--muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .cb { width: 36px; }
.table input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--blue); }
.empty { padding: 44px 18px; text-align: center; color: var(--muted); }
.empty .icon { width: 36px; height: 36px; color: var(--faint); margin-bottom: 8px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.pager .btn-group a, .pager .btn-group span { min-width: 34px; }
.bulk-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 18px; background: var(--blue-50); border-bottom: 1px solid #d5e0fb; }
.bulk-bar select { width: auto; min-width: 200px; height: 32px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 20px; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .8; }
.badge-new { background: var(--blue-50); color: var(--blue); }
.badge-pending-review { background: var(--amber-bg); color: var(--amber); }
.badge-assigned { background: var(--purple-bg); color: var(--purple); }
.badge-approved { background: var(--green-bg); color: var(--green); }
.badge-rejected { background: var(--red-bg); color: var(--red); }
.badge-duplicate { background: var(--grey-bg); color: #4a5870; }
.badge-closed { background: #e9edf3; color: #3b4658; }
.badge-unauthorised-sender, .badge-held { background: #fff0e6; color: #a2410b; }
.badge-dismissed { background: var(--grey-bg); color: var(--muted); }
.badge-active { background: var(--green-bg); color: var(--green); }
.badge-inactive { background: var(--grey-bg); color: var(--muted); }
.badge-locked { background: var(--red-bg); color: var(--red); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 4px; font-size: 11.5px; font-weight: 600; background: var(--grey-bg); color: #3b4658; }
.pill-blue { background: var(--blue-50); color: var(--blue); }

/* ---------- Alerts ---------- */
.flash-stack { margin-bottom: 18px; display: grid; gap: 8px; }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 11px 14px; border-radius: 8px; border: 1px solid; font-size: 13.5px; }
.alert .icon { margin-top: 1px; }
.alert-success { background: var(--green-bg); border-color: #b8e2cb; color: #0c5a36; }
.alert-error { background: var(--red-bg); border-color: #f4c3bd; color: #8a1a12; }
.alert-warning { background: var(--amber-bg); border-color: #f5d7a1; color: #6f4200; }
.alert-info { background: var(--blue-50); border-color: #cddafa; color: #193f9e; }
.alert ul { margin: 4px 0 0; padding-left: 18px; }
.alert .grow > :last-child { margin-bottom: 0; }

/* ---------- Detail page ---------- */
.detail { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.meta-list { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px 12px; font-size: 13.5px; margin: 0; }
.meta-list dt { color: var(--muted); font-weight: 500; }
.meta-list dd { margin: 0; overflow-wrap: anywhere; }
.email-frame { width: 100%; height: 460px; border: 1px solid var(--border); border-radius: 8px; background: #fff; display: block; }
.attachments { display: grid; gap: 8px; }
.attachment { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; }
.attachment .file-icon { width: 36px; height: 36px; border-radius: 8px; background: var(--red-bg); color: var(--red); display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; flex: none; }
.attachment .grow { min-width: 0; }
.attachment strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.sticky-actions { position: sticky; top: 74px; }
.action-bar { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: #fafbfd; }
.notes { display: grid; gap: 12px; }
.note { padding: 12px 14px; border: 1px solid var(--border); border-radius: 8px; background: #fbfcfe; }
.note-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.note-head strong { color: var(--text); }
.note p { white-space: pre-wrap; margin: 0; }
.status-line { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- Activity / timeline ---------- */
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.feed li:last-child { border-bottom: 0; }
.feed .avatar { width: 30px; height: 30px; font-size: 11.5px; }
.feed .what { font-size: 13.5px; }
.feed .when { font-size: 12px; color: var(--muted); }
.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 18px 18px; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 2px solid var(--blue); }
.timeline .details { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- Charts (CSS bars) ---------- */
.bars { display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: 140px minmax(0, 1fr) 60px; gap: 10px; align-items: center; font-size: 13px; }
.bar-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 10px; background: var(--grey-bg); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--blue); border-radius: 99px; transition: width .4s ease; }
.cols { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; align-items: end; height: 170px; padding-top: 10px; }
.col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; font-size: 10.5px; color: var(--muted); }
.col .col-bar { width: 100%; max-width: 28px; background: var(--blue); border-radius: 4px 4px 0 0; min-height: 2px; height: 0; transition: height .4s ease; }
.col .col-val { font-weight: 700; color: var(--text); font-size: 11px; }

/* ---------- Modal ---------- */
dialog.modal { border: 0; border-radius: 12px; padding: 0; width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow-lg); color: var(--text); }
dialog.modal::backdrop { background: rgba(11, 23, 45, .5); }
.modal-head { padding: 18px 20px 0; display: flex; gap: 12px; align-items: flex-start; }
.modal-body { padding: 10px 20px 4px; color: var(--muted); }
.modal-foot { padding: 14px 20px 18px; display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.modal-icon { width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }

/* ---------- Auth pages ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.auth-side {
  background: linear-gradient(160deg, var(--navy) 0%, #0f3a82 60%, var(--blue) 130%); color: #dbe5f7; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-side::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255,255,255,.05); }
.auth-side .brand { padding: 0; border: 0; }
.auth-side .brand img { width: 48px; height: 48px; }
.auth-side .brand-name { font-size: 20px; }
.auth-side .brand-sub { font-size: 12.5px; }
.auth-side h2 { color: #fff; font-size: 28px; font-weight: 650; max-width: 420px; margin-bottom: 14px; }
.auth-points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; max-width: 420px; }
.auth-points li { display: flex; gap: 10px; align-items: flex-start; }
.auth-points .icon { color: #8fb0ff; margin-top: 1px; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-box h1 { font-size: 24px; margin-bottom: 6px; }
.auth-box .lead { color: var(--muted); margin-bottom: 24px; }
.auth-mobile-brand { display: none; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--blue); font: 600 12px var(--font); cursor: pointer; padding: 6px; }
.otp-input { font-size: 22px !important; letter-spacing: .4em; text-align: center; height: 50px !important; font-family: Consolas, monospace !important; }
.qr { display: flex; gap: 18px; align-items: center; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 18px; }
.qr img { width: 150px; height: 150px; flex: none; }
.secret { font-family: Consolas, monospace; font-size: 13px; background: var(--bg); padding: 6px 8px; border-radius: 6px; word-break: break-all; display: inline-block; }
.codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; padding: 14px; background: var(--bg); border-radius: var(--radius); margin: 16px 0; font-family: Consolas, monospace; font-size: 15px; text-align: center; }
.secure-note { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 12px; color: var(--faint); margin-top: 26px; }
.one-time { border: 2px dashed #f5c26b; background: #fffaf0; border-radius: var(--radius); padding: 16px 18px; }
.one-time .secret { font-size: 17px; padding: 8px 12px; background: #fff; border: 1px solid var(--border); }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .grid-2, .detail { grid-template-columns: minmax(0, 1fr); }
  .sticky-actions { position: static; }
}
@media (max-width: 960px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.nav-open .sidebar { transform: translateX(0); }
  body.nav-open .backdrop { display: block; position: fixed; inset: 0; background: rgba(11,23,45,.45); z-index: 35; }
  .main { margin-left: 0; }
  .topbar .menu-btn { display: inline-flex; }
  .user-meta { display: none; }
  .grid-halves { grid-template-columns: minmax(0, 1fr); }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-side { display: none; }
  .auth-mobile-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 28px; }
  .auth-mobile-brand img { width: 40px; height: 40px; }
}
@media (max-width: 720px) {
  .content { padding: 16px; }
  .topbar { padding: 0 12px; gap: 8px; }
  h1 { font-size: 19px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 12px; gap: 10px; flex-direction: column; }
  .stat-value { font-size: 22px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .card-body { padding: 14px; }
  .meta-list { grid-template-columns: 80px minmax(0, 1fr); }
  .email-frame { height: 360px; }
  .bar-row { grid-template-columns: 100px minmax(0, 1fr) 44px; }
  details.filter-toggle > summary { display: flex; align-items: center; gap: 8px; padding: 12px 14px; cursor: pointer; font-weight: 600; border-bottom: 1px solid var(--border); list-style: none; }
  details.filter-toggle > summary::-webkit-details-marker { display: none; }
  details.filter-toggle:not([open]) > .filters { display: none; }

  /* Tables become stacked cards */
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { padding: 12px 14px; border-bottom: 1px solid var(--border); }
  .table.responsive td { border: 0; padding: 3px 0; display: flex; gap: 12px; justify-content: space-between; align-items: center; text-align: right; }
  .table.responsive td::before { content: attr(data-label); font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; text-align: left; flex: none; }
  .table.responsive td.primary { display: block; text-align: left; padding-bottom: 6px; }
  .table.responsive td.primary::before { display: none; }
  .table.responsive td.cb { position: absolute; right: 14px; width: auto; }
  .table.responsive tr { position: relative; }
  .table.responsive td:empty { display: none; }
  .table .subject, .table .sub { max-width: 100%; }
}
@media print {
  .sidebar, .topbar, .action-bar, .btn, form { display: none !important; }
  .main { margin: 0; }
}
.center { justify-content: center; text-align: center; }
.small-value { font-size: 18px; }
.feed .stat-icon { width: 30px; height: 30px; border-radius: 8px; }
.feed li > .icon { color: var(--green); margin-top: 2px; }
.feed li.unread { background: #f7f9ff; }
a.bar-row { color: inherit; }
a.bar-row:hover { text-decoration: none; background: var(--bg); border-radius: 6px; }
.badge.tone-blue::before, .badge.tone-green::before, .badge.tone-red::before, .badge.tone-grey::before { display: none; }
.tone-amber.modal-icon { background: var(--amber-bg); color: var(--amber); }
.detail > *, .grid-2 > *, .grid-halves > *, .stack > * { min-width: 0; }
.attachment .grow > span { display: block; }
.attachments > * { min-width: 0; }

/* ---------- Super Admin dashboard (form collection) ---------- */
.tone-orange { background: #fff1e6; color: #c2410c; }
.mb-lg { margin-bottom: 24px; }
.dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.dash-head h1 { font-size: 24px; letter-spacing: -.01em; }
.dash-head p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }
.dash-head-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.status-chip { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px; border-radius: 99px; font-size: 13px; font-weight: 600; border: 1px solid; white-space: nowrap; }
.status-chip-ok { background: var(--green-bg); color: var(--green); border-color: #b8e2cb; }
.status-chip-off { background: var(--grey-bg); color: var(--muted); border-color: var(--border-strong); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-chip-ok .status-dot { box-shadow: 0 0 0 3px rgba(18, 122, 74, .18); }

.kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpis.cover-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis.dashboard-kpis { grid-template-columns: repeat(10, minmax(0, 1fr)); grid-auto-rows: 1fr; }
.dashboard-kpis > .cover-kpis { display: contents; }
.dashboard-kpis .kpi { grid-column: span 2; min-width: 0; }
.dashboard-kpis > .cover-kpis > .kpi:first-child { grid-column: 2 / span 2; }
@media (max-width: 1100px) {
  .kpis.dashboard-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dashboard-kpis .kpi, .dashboard-kpis > .cover-kpis > .kpi:first-child { grid-column: auto; }
}
@media (max-width: 720px) { .kpis.dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .kpis.dashboard-kpis { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1100px) { .kpis.cover-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .kpis.cover-kpis { grid-template-columns: minmax(0, 1fr); } }
.kpi { display: flex; flex-direction: column; padding: 20px; color: inherit; border-radius: 12px; height: 100%; transition: box-shadow .15s, border-color .15s, transform .15s; }
a.kpi:hover { text-decoration: none; border-color: var(--border-strong); box-shadow: 0 6px 18px rgba(15, 27, 45, .08); transform: translateY(-1px); }
.kpi-icon { width: 42px; height: 42px; border-radius: 12px; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.kpi-label { font-size: 13px; font-weight: 600; color: #34435a; }
.kpi-value { font-size: 32px; font-weight: 700; line-height: 1.15; margin-top: 4px; font-variant-numeric: tabular-nums; color: var(--text); }
.kpi-note { font-size: 12px; color: var(--faint); margin-top: auto; padding-top: 6px; }

.card-head-lg { padding: 18px 22px; }
.card-head-lg h2 { margin-bottom: 2px; }
.table-roomy th { padding: 11px 22px; }
.table-roomy td { padding: 14px 22px; }
.table-compact th { padding: 10px 16px; }
.table-compact td { padding: 11px 16px; }
.ref-link { font-family: Consolas, "SFMono-Regular", Menlo, monospace; font-size: 13px; font-weight: 700; color: var(--navy-2); white-space: nowrap; }
.subject-sm { max-width: 240px; font-weight: 500 !important; }
.assignee { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.avatar-xs { width: 26px; height: 26px; font-size: 10.5px; }
.badge-pending { background: #fff1e6; color: #c2410c; }
.badge-completed { background: var(--green-bg); color: var(--green); }
.btn-outline-primary { border-color: #b9c9f5; color: var(--blue); background: var(--surface); }
.btn-outline-primary:hover { background: var(--blue-50); border-color: var(--blue); }

.row-menu { position: relative; display: inline-block; }
.row-menu > summary { list-style: none; }
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu[open] > summary { background: var(--bg); color: var(--text); }
.row-menu .menu-pop { min-width: 190px; text-align: left; }
.action-cell { width: 64px; }

.dash-panels > .card { display: flex; flex-direction: column; }
.week-chart { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; height: 240px; }
.wc-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.wc-val { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.wc-track { flex: 1; width: 100%; max-width: 46px; display: flex; align-items: flex-end; background: var(--grey-bg); border-radius: 8px; overflow: hidden; }
.wc-bar { width: 100%; height: 0; min-height: 3px; background: #8eaaf0; border-radius: 8px 8px 0 0; transition: height .5s ease; }
.wc-col.is-today .wc-bar { background: var(--blue); }
.wc-day { font-size: 12px; font-weight: 600; color: #34435a; }
.wc-col.is-today .wc-day { color: var(--blue); }
.wc-date { font-size: 11px; color: var(--faint); margin-top: -4px; white-space: nowrap; }

/* Only tables that fit may let menus overflow; wider tables must scroll locally. */
@media (min-width: 721px) { .table-wrap.menu-safe.sticky-table-wrap { overflow: visible; } }
@media (max-width: 1320px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .kpi { padding: 14px; }
  .kpi-icon { width: 36px; height: 36px; margin-bottom: 10px; }
  .kpi-value { font-size: 26px; }
  .dash-head h1 { font-size: 20px; }
  .dash-head-actions { width: 100%; }
  .table-roomy td, .table-compact td { padding: 3px 0; }
  .week-chart { height: 200px; gap: 6px; }
  .wc-date { display: none; }
  .subject-sm { max-width: 100%; }
}

/* Fixed column layouts so long subjects truncate instead of widening the page */
@media (min-width: 721px) {
  .table-roomy, .table-compact { table-layout: fixed; }
  .table-roomy .subject, .table-compact .subject { max-width: 100%; }
  .table-roomy .sub { max-width: 100%; }
  .table-roomy th:nth-child(1) { width: 150px; }
  .table-roomy th:nth-child(2) { width: 130px; }
  .table-roomy th:nth-child(4) { width: 130px; }
  .table-roomy th:nth-child(5) { width: 84px; }
  .table-compact th:nth-child(1) { width: 128px; }
  .table-compact th:nth-child(2) { width: 118px; }
  .table-compact th:nth-child(4) { width: 146px; }
  .assignee { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 1100px) and (min-width: 721px) {
  .table-roomy th:nth-child(1) { width: 128px; }
  .table-roomy th:nth-child(2) { width: 112px; }
  .table-roomy th:nth-child(4) { width: 116px; }
  .table-roomy th:nth-child(5) { width: 64px; }
  .table-roomy th, .table-roomy td { padding-left: 14px; padding-right: 14px; }
}
.dash-panels { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
@media (max-width: 1280px) { .dash-panels { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Gmail status, settings tiles, live updates ---------- */
.status-chip-warn { background: var(--amber-bg); color: var(--amber); border-color: #f5d7a1; }
.status-chip-error { background: var(--red-bg); color: var(--red); border-color: #f4c3bd; }
.status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.status-tile { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 18px 20px; border-radius: 12px; min-width: 0; }
.status-tile-label { font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.status-tile-value { font-size: 16px; font-weight: 700; color: var(--text); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-tile-note { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.status-tile .status-chip { height: 30px; white-space: normal; text-align: left; }
.meta-list-wide { grid-template-columns: 120px minmax(0, 1fr); }
@media (max-width: 1180px) { .status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .status-grid { grid-template-columns: minmax(0, 1fr); } }

.live-pill { display: inline-flex; align-items: center; gap: 6px; margin-left: 8px; padding: 1px 8px; border-radius: 99px; font-size: 11px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; color: var(--green); background: var(--green-bg); vertical-align: 2px; }
.live-pill[hidden] { display: none; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: live-pulse 1.8s ease-in-out infinite; }
@keyframes live-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.kpi-value.bumped { animation: kpi-bump 1.2s ease; }
@keyframes kpi-bump { 0% { color: var(--blue); transform: scale(1.12); } 100% { color: var(--text); transform: scale(1); } }
.kpi-value { display: inline-block; transform-origin: left center; }
tr.row-new { animation: row-new 2.4s ease; }
@keyframes row-new { 0%, 40% { background: #eaf1ff; } 100% { background: transparent; } }

.toast-stack { position: fixed; right: 20px; bottom: 20px; display: grid; gap: 10px; z-index: 60; width: min(360px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--blue); border-radius: 10px; box-shadow: var(--shadow-lg); font-size: 13.5px; animation: toast-in .25s ease; }
.toast .icon { color: var(--blue); margin-top: 1px; }
.toast strong { display: block; }
.toast a { font-weight: 600; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .live-dot, .kpi-value.bumped, tr.row-new, .toast { animation: none; } }

/* ---------- Settings: entry approval ---------- */
.approval-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.approval-bulk { padding: 16px 18px; border: 1px solid var(--border); border-radius: 10px; background: #fafbfd; }
.approval-bulk p { margin: 4px 0 12px; }
@media (max-width: 900px) { .approval-grid { grid-template-columns: minmax(0, 1fr); } }
.soft-rule { border: 0; border-top: 1px solid var(--border); margin: 16px 0 14px; }

/* ---------- Records page ---------- */
.records-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.records-toolbar select, .records-toolbar input { height: 38px; font-size: 13.5px; }
.tb-search { position: relative; flex: 1 1 320px; min-width: 240px; }
.tb-search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.tb-search input { padding-left: 36px; background: var(--bg); }
.tb-search input:focus { background: var(--surface); }
.tb-field select { width: auto; min-width: 150px; }
.tb-range { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 8px 0 10px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); }
.tb-range .icon { color: var(--faint); }
.tb-range select, .tb-range input { border: 0; height: 34px; padding: 0 4px; background: transparent; box-shadow: none; }
.tb-range select:focus, .tb-range input:focus { box-shadow: none; }
.tb-range .tb-range-field { width: auto; font-weight: 600; color: #34435a; padding-right: 2px; }
.tb-range input[type=date] { width: 132px; }
.tb-range-sep { color: var(--faint); }
.tb-clear { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; white-space: nowrap; }

.records-table { table-layout: fixed; }
.records-table th { font-size: 11px; letter-spacing: .06em; padding: 11px 12px; }
.records-table td { padding: 12px; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.records-table td.mono { font-size: 12.5px; }
.records-table td.c-action { overflow: visible; }
.records-table th:first-child, .records-table td:first-child { padding-left: 20px; }
.rt-client { display: block; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt-client:hover { color: var(--blue); }
.rt-ref { display: block; font-size: 12px; color: var(--muted); margin-top: 1px; }
.records-table .c-policy { width: 168px; }
.records-table .c-cert { width: 110px; }
.records-table .c-reg { width: 96px; }
.records-table .c-insurer { width: 104px; }
.records-table .c-cover { width: 108px; }
.records-table .c-start, .records-table .c-expiry { width: 104px; }
.records-table .c-status { width: 96px; }
.records-table .c-action { width: 56px; }
.badge-active-policy { background: var(--green-bg); color: var(--green); }
.badge-expired { background: var(--red-bg); color: var(--red); }
.menu-pop .menu-danger { color: var(--red); }
.menu-pop .menu-danger:hover { background: var(--red-bg); }
.menu-pop .menu-disabled { display: flex; gap: 10px; align-items: center; padding: 9px 10px; color: var(--faint); cursor: default; }
.menu-pop form { margin: 0; }

/* Drop the least-needed columns before the table would scroll sideways. */
@media (max-width: 720px) {
  .records-toolbar { padding: 14px; }
  .tb-field, .tb-field select { width: 100%; }
  .tb-range { width: 100%; }
  .tb-range input[type=date] { flex: 1; width: auto; min-width: 0; }
  .records-table td { white-space: normal; }
  .records-table td.c-action { position: absolute; right: 8px; top: 8px; width: auto; }
  .records-table th:first-child, .records-table td:first-child { padding-left: 0; }
  .rt-client { white-space: normal; padding-right: 40px; }
}
/* Records page sizing refinements */
.records-table .c-cover { width: 124px; }
.records-table .c-status { width: 112px; }
.records-table .c-policy { width: 160px; }
.records-table td.c-status { overflow: visible; }
.tb-field select { min-width: 136px; }
.tb-range input[type=date] { width: 122px; }
.tb-search input::placeholder { font-size: 13px; }
/* Records table: final column balance (client name and policy number get priority) */
.records-table td { font-size: 13px; }
.records-table td.mono { font-size: 12px; }
.records-table .c-policy { width: 176px; }
.records-table .c-cert { width: 106px; }
.records-table .c-reg { width: 92px; }
.records-table .c-insurer { width: 96px; }
.records-table .c-cover { width: 118px; }
.records-table .c-start, .records-table .c-expiry { width: 102px; }
.records-table .c-status { width: 104px; }
.records-table .c-action { width: 52px; }
@media (max-width: 720px) {
  .table.responsive td.mono::before { font-family: var(--font); font-size: 11.5px; }
  .tb-range { flex-wrap: wrap; height: auto; padding: 6px 10px; row-gap: 2px; }
  .tb-range .tb-range-field { flex: 1 1 60%; }
  .tb-range input[type=date] { flex: 1 1 40%; }
}

/* ---------- Collapsible sidebar (desktop) ---------- */
:root { --sidebar-rail: 76px; }
.sidebar, .main { transition: width .2s ease, margin-left .2s ease; }
.topbar .menu-btn { display: inline-flex; }
.sidebar-foot { display: flex; flex-direction: column; gap: 10px; }
.collapse-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 1px solid rgba(255,255,255,.12); border-radius: 8px;
  background: transparent; color: #c9d6ee; font: 600 12.5px var(--font); cursor: pointer; }
.collapse-btn:hover { background: rgba(255,255,255,.08); color: #fff; }
.collapse-btn .icon { transition: transform .2s ease; }
@media (min-width: 961px) {
  body.sidebar-collapsed .sidebar { width: var(--sidebar-rail); }
  body.sidebar-collapsed .main { margin-left: var(--sidebar-rail); }
  body.sidebar-collapsed .brand { justify-content: center; padding-left: 0; padding-right: 0; }
  body.sidebar-collapsed .brand > div,
  body.sidebar-collapsed .nav a > span,
  body.sidebar-collapsed .sidebar-foot-text,
  body.sidebar-collapsed .collapse-btn span { display: none; }
  body.sidebar-collapsed .nav { padding: 12px 10px; }
  body.sidebar-collapsed .nav-label { height: 1px; padding: 0; margin: 12px 8px; background: rgba(255,255,255,.12); overflow: hidden; color: transparent; }
  body.sidebar-collapsed .nav a { justify-content: center; padding: 11px 0; position: relative; }
  body.sidebar-collapsed .nav a .count { position: absolute; top: 4px; right: 8px; margin: 0; padding: 0 5px; font-size: 10px; line-height: 16px; }
  body.sidebar-collapsed .sidebar-foot { padding: 14px 10px; }
  body.sidebar-collapsed .collapse-btn { justify-content: center; padding: 8px 0; }
  body.sidebar-collapsed .collapse-btn .icon { transform: rotate(180deg); }
}
@media (max-width: 960px) { .collapse-btn { display: none; } }
@media (prefers-reduced-motion: reduce) { .sidebar, .main, .collapse-btn .icon { transition: none; } }
/* Records table columns adapt to the card's own width (so collapsing the sidebar shows more columns). */
.records-card { container-type: inline-size; }
/* Shared scrolling navigation for every signed-in page. */
.content .card { --records-toolbar-height: 0px; }
@media screen {
  .content .pager {
    position: sticky; bottom: 0; z-index: 22; background: var(--surface);
    box-shadow: 0 -3px 10px rgba(15, 35, 65, .08);
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
}
@media screen and (min-width: 721px) {
  .content > .page-head, .content > .dash-head {
    position: sticky; top: var(--records-top, 62px); z-index: 24;
    background: var(--bg); padding: 12px 0; margin-bottom: 0;
  }
  .content .records-toolbar, .content .filter-toggle, .content .card > .filters {
    position: sticky; top: calc(var(--records-top, 62px) + var(--records-heading-height, 90px));
    z-index: 23; background: var(--surface);
  }
  .content .table-wrap.sticky-table-wrap { overflow: visible; }
  .content .sticky-table-wrap .table th {
    position: sticky;
    top: calc(var(--records-top, 62px) + var(--records-heading-height, 90px) + var(--records-toolbar-height, 0px));
    z-index: 21; box-shadow: 0 1px 0 var(--border);
  }
  .content .sticky-actions {
    top: calc(var(--records-top, 62px) + var(--records-heading-height, 90px) + 12px);
  }
}
@container (max-width: 1130px) { .records-table .c-cert, .records-table .c-start { display: none; } }
.records-table .c-period { width: 92px; }
@container (max-width: 1250px) { .records-table .c-insurer { display: none; } }
@container (max-width: 910px) { .records-table .c-period, .records-table .c-cover { display: none; } }
@media (max-width: 720px) { .records-table td.c-cert, .records-table td.c-start, .records-table td.c-insurer, .records-table td.c-cover, .records-table td.c-period { display: flex !important; } }

/* ---------- Sign-in pages (IMOTH Record Portal) ---------- */
.auth-body { background: var(--surface); }
.auth { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-side { position: relative; overflow: hidden; padding: 56px; display: flex; flex-direction: column;
  background: radial-gradient(120% 90% at 0% 0%, #133a7c 0%, var(--navy) 55%, #081f45 100%); color: #cfdaf0; }
.auth-side::after { display: none; }
.auth-shape { position: absolute; border-radius: 50%; pointer-events: none; }
.auth-shape-1 { width: 620px; height: 620px; right: -260px; bottom: -240px; border: 90px solid rgba(255,255,255,.045); }
.auth-shape-2 { width: 380px; height: 380px; right: -60px; bottom: -120px; background: radial-gradient(circle, rgba(59,108,240,.35), rgba(59,108,240,0) 70%); }
.auth-shape-3 { width: 520px; height: 520px; left: -300px; top: -280px; border: 1px solid rgba(255,255,255,.08); box-shadow: 0 0 0 60px rgba(255,255,255,.02); }
.auth-side-inner { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; }
.auth-brand { display: flex; align-items: center; gap: 14px; }
.auth-brand img { width: 52px; height: 52px; }
.auth-brand-name { color: #fff; font-weight: 800; letter-spacing: .14em; font-size: 20px; line-height: 1.1; }
.auth-brand-sub { font-size: 13px; color: #9fb3d6; margin-top: 2px; }
.auth-hero { margin-top: auto; }
.auth-hero h2 { color: #fff; font-size: 44px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin: 0 0 12px; max-width: none; }
.auth-hero p { font-size: 17px; color: #b8c7e6; margin: 0; letter-spacing: .01em; }
.auth-features { list-style: none; padding: 0; margin: 40px 0 auto; display: flex; flex-wrap: wrap; gap: 12px; }
.auth-features li { display: inline-flex; align-items: center; gap: 10px; padding: 9px 14px 9px 9px; border-radius: 99px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); color: #e6edfa; font-size: 13.5px; font-weight: 600; }
.auth-feature-icon { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: rgba(143,176,255,.18); color: #b9ccff; }

.auth-main { background: var(--surface); padding: 48px 32px; }
.auth-box { max-width: 400px; }
.auth-title { font-size: 30px; font-weight: 700; letter-spacing: -.02em; margin: 0 0 6px; }
.auth-lead { color: var(--muted); font-size: 15.5px; margin: 0 0 32px; }
.auth-form .field { margin-bottom: 18px; }
.auth-form label { font-size: 13px; }
.auth-link { font-weight: 600; }
.input-icon { position: relative; }
.input-icon > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.input-icon input { height: 50px; padding-left: 42px; border-radius: 12px; font-size: 15px; background: #fbfcfe;
  box-shadow: 0 1px 2px rgba(15,27,45,.04); transition: border-color .15s, box-shadow .15s, background .15s; }
.input-icon input:focus { background: #fff; box-shadow: 0 0 0 4px rgba(31,79,209,.12); }
.input-icon input:focus ~ .icon, .input-icon:focus-within > .icon { color: var(--blue); }
.input-icon.pw-wrap input { padding-right: 48px; }
.pw-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border: 0; border-radius: 10px;
  background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.pw-eye:hover { background: var(--bg); color: var(--text); }
.pw-eye .pw-eye-hide, .pw-eye[aria-pressed="true"] .pw-eye-show { display: none; }
.pw-eye[aria-pressed="true"] .pw-eye-hide { display: inline-flex; }
.pw-eye .pw-eye-show { display: inline-flex; }
.btn-auth { height: 52px; margin-top: 10px; border-radius: 12px; font-size: 15.5px; gap: 9px;
  box-shadow: 0 8px 20px rgba(31,79,209,.25); }
.btn-auth:hover { box-shadow: 0 10px 24px rgba(31,79,209,.32); }
.secure-note { margin-top: 36px; font-size: 12.5px; }
.auth-mobile-sub { font-size: 12.5px; color: var(--muted); }
.auth-mobile-brand .auth-brand-name { color: var(--navy); font-size: 17px; }
@media (max-width: 960px) {
  .auth-main { padding: 32px 20px; align-items: flex-start; }
  .auth-title { font-size: 26px; }
  .auth-lead { margin-bottom: 24px; }
}

/* ---------- Sign-in pages: official Imoth brand (red #E30613, cobalt #083BBF) ---------- */
.brand-imoth {
  --imoth-red: #E30613; --imoth-red-600: #C20510; --imoth-red-50: #FDECEC;
  --imoth-blue: #083BBF; --imoth-ink: #1A1A1A; --imoth-grey: #6B6F76; --imoth-line: #E3E5E9; --imoth-warm: #FBF8F5;
  color: var(--imoth-ink);
}
.brand-imoth .auth { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.brand-imoth .auth-side { background: var(--imoth-warm); color: var(--imoth-ink); padding: 56px 64px; position: relative; overflow: hidden; }
.brand-imoth .auth-side::after { display: none; }
.brand-imoth .auth-side-inner { position: relative; z-index: 1; display: flex; flex-direction: column; height: 100%; }
.brand-imoth .auth-logo { width: 250px; max-width: 100%; height: auto; }
.brand-imoth .auth-hero { margin: auto 0; }
.brand-imoth .auth-hero h2 { color: var(--imoth-ink); font-size: 52px; font-weight: 800; letter-spacing: -.03em; line-height: 1.05; margin: 0 0 28px; }
.auth-benefits { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.auth-benefits li { display: flex; align-items: center; gap: 14px; font-size: 17px; font-weight: 600; color: #2B2E33; }
.auth-benefits .icon { width: 38px; height: 38px; padding: 9px; border: 1.5px solid var(--imoth-red); border-radius: 50%; color: var(--imoth-red); background: #fff; }
/* Decorative curves in opposite corners */
.auth-curve { position: absolute; border-radius: 50%; pointer-events: none; }
.auth-curve-red { width: 440px; height: 440px; top: -250px; right: -200px; border: 34px solid var(--imoth-red); opacity: .10; }
.auth-curve-red::after { content: ""; position: absolute; inset: 40px; border-radius: 50%; border: 2px solid var(--imoth-red); opacity: .6; }
.auth-curve-blue { width: 520px; height: 520px; bottom: -320px; left: -240px; border: 40px solid var(--imoth-blue); opacity: .08; }
.auth-curve-blue::after { content: ""; position: absolute; inset: 56px; border-radius: 50%; border: 2px solid var(--imoth-blue); opacity: .7; }

.brand-imoth .auth-main { background: #fff; }
.brand-imoth .auth-title { color: var(--imoth-ink); font-size: 32px; font-weight: 800; letter-spacing: -.02em; }
.brand-imoth .auth-lead { color: var(--imoth-grey); }
.brand-imoth label { color: #2B2E33; }
.brand-imoth a, .brand-imoth .auth-link { color: var(--imoth-red); font-weight: 600; }
.brand-imoth a:hover { color: var(--imoth-red-600); }
.brand-imoth .input-icon input, .brand-imoth input[type=email], .brand-imoth input[type=password], .brand-imoth input[type=text] {
  border-color: var(--imoth-line); background: #fff; border-radius: 12px; }
.brand-imoth .input-icon input:focus, .brand-imoth input:focus { border-color: var(--imoth-blue); box-shadow: 0 0 0 4px rgba(8, 59, 191, .12); }
.brand-imoth .input-icon:focus-within > .icon { color: var(--imoth-blue); }
.brand-imoth .pw-eye:hover { background: #F4F5F7; }
.brand-imoth .btn-primary, .brand-imoth .btn-auth { background: var(--imoth-red); border-color: var(--imoth-red); color: #fff; box-shadow: 0 8px 20px rgba(227, 6, 19, .22); }
.brand-imoth .btn-primary:hover, .brand-imoth .btn-auth:hover { background: var(--imoth-red-600); border-color: var(--imoth-red-600); box-shadow: 0 10px 24px rgba(227, 6, 19, .28); }
.brand-imoth .btn-primary:focus-visible { outline: 3px solid rgba(8, 59, 191, .35); }
.brand-imoth .btn-ghost { color: var(--imoth-grey); }
.brand-imoth .secure-note { color: #8A8F98; }
.brand-imoth .alert-info { background: #F1F4FD; border-color: #D5DEF7; color: #0A2F8F; }
.brand-imoth .auth-mobile-brand { display: none; }
@media (max-width: 960px) {
  .brand-imoth .auth-mobile-brand { display: block; margin-bottom: 28px; }
  .brand-imoth .auth-logo-sm { width: 190px; height: auto; }
}
@media (max-width: 960px) {
  .brand-imoth .auth { grid-template-columns: minmax(0, 1fr); }
  .brand-imoth .auth-side { display: none; }
}
/* Records search: visible Search button inside the field; results refresh as you type. */
.tb-search input { padding-right: 88px; }
.tb-search-btn { position: absolute; right: 5px; top: 50%; transform: translateY(-50%); height: calc(100% - 10px); padding: 0 14px;
  border: 0; border-radius: 7px; background: var(--blue); color: #fff; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.tb-search-btn:hover { filter: brightness(1.08); }
.tb-search-btn:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.records-toolbar[aria-busy="true"] ~ #records-results { opacity: .55; transition: opacity .15s; }
.badge-cancelled { background: #f1f3f7; color: #5b6576; text-decoration: line-through; text-decoration-color: rgba(91,101,118,.45); }

/* Full-width KYC workspace and accessible file drop targets. */
.kyc-section { margin-top: 20px; }
.kyc-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
.kyc-slot { min-width: 0; padding: 20px; border: 1px solid var(--border); border-radius: 12px; }
.kyc-slot a, .kyc-selection { overflow-wrap: anywhere; }
.kyc-slot .row-between { gap: 10px; flex-wrap: wrap; }
.kyc-phone { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.kyc-phone input { max-width: 300px; }
.kyc-phone label, .kyc-phone .btn { margin: 0; }
.kyc-dropzone { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 160px; padding: 22px 14px; border: 2px dashed #b8c8e6; border-radius: 10px; background: #f7f9fe; text-align: center; cursor: pointer; }
.kyc-dropzone input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.kyc-dropzone:hover, .kyc-dropzone:focus-within, .kyc-dropzone.is-dragging { background: #edf3ff; border-color: #2355db; outline: 2px solid #2355db; outline-offset: 2px; }
.kyc-dropzone span { font-size: 13px; color: #526581; }
.kyc-selection { margin: 12px 0 0; }
@media (max-width: 1250px) { .kyc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .kyc-grid { grid-template-columns: minmax(0, 1fr); } .kyc-phone { align-items: stretch; flex-direction: column; } .kyc-phone input { max-width: none; } }

/* Keep the requested renewal details readable at every desktop width. */
@media (min-width: 721px) {
  .renewals-table { min-width: 1580px; }
  .renewals-table .c-client { width: 200px; }
  .renewals-table .c-agent { width: 220px; }
  .renewals-table .c-cert, .renewals-table .c-start, .renewals-table .c-period, .renewals-table .c-cover, .renewals-table .c-insurer { display: table-cell; }
}
.renewals-table td.c-agent { white-space: normal; overflow-wrap: anywhere; }

/* =====================================================================================
   Imoth "warm" theme — modern but human. Brand colours from the logo:
   cobalt #083BBF and red #E30613, on warm paper neutrals instead of cold blue-greys.
   ===================================================================================== */
:root {
  --imoth-cobalt: #083BBF;
  --imoth-red: #E30613;
  --navy: #0a2f8f;
  --navy-2: #083BBF;
  --blue: #083BBF;
  --blue-600: #062f99;
  --blue-50: #eef2fc;
  --bg: #f7f5f1;
  --surface: #ffffff;
  --border: #ebe7e0;
  --border-strong: #ddd7cd;
  --text: #1f1d1a;
  --muted: #6d675e;
  --faint: #a19a8f;
  --green: #17794a; --green-bg: #e9f6ef;
  --red: #c3121c; --red-bg: #fdeced;
  --amber: #9a5a00; --amber-bg: #fff3dc;
  --teal: #0f6f73; --teal-bg: #e4f4f3;
  --grey-bg: #f1eee9;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(60, 45, 20, .04), 0 2px 8px rgba(60, 45, 20, .04);
  --shadow-lg: 0 16px 40px rgba(40, 30, 10, .14);
  --font: "Segoe UI Variable Text", "Segoe UI", "Inter", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", "Inter", system-ui, -apple-system, Roboto, sans-serif;
}
body { background: var(--bg); color: var(--text); font-size: 14.5px; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 650; }
h2 { font-size: 16.5px; font-weight: 650; }
::selection { background: rgba(8, 59, 191, .16); }

/* ---- Sidebar: light and calm, the logo does the talking ---- */
.sidebar { background: #fffdfa; color: var(--text); border-right: 1px solid var(--border); }
.brand { color: var(--text); border-bottom: 0; padding: 22px 20px 14px; gap: 12px; }
.brand:hover { text-decoration: none; }
.brand img { width: 40px; height: 40px; }
.brand-name { font-family: var(--font-display); color: var(--imoth-red); font-weight: 800; font-size: 25px; letter-spacing: -.03em; line-height: 1; text-transform: none; }
.brand-sub { color: #3a3631; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; margin-top: 3px; }
.nav { padding: 8px 12px; }
.nav-label { color: var(--faint); font-weight: 600; letter-spacing: .08em; padding: 16px 12px 6px; }
.nav a { color: #4a453e; padding: 10px 12px; border-radius: 12px; font-weight: 550; position: relative; }
.nav a .icon { color: #8a8378; }
.nav a:hover { background: #f3efe8; color: var(--text); }
.nav a:hover .icon { color: var(--text); }
.nav a.active { background: var(--blue-50); color: var(--imoth-cobalt); font-weight: 650; }
.nav a.active .icon { color: var(--imoth-cobalt); }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--imoth-red); }
.nav .count { background: var(--imoth-red); color: #fff; }
.sidebar-foot { color: var(--muted); border-top: 1px solid var(--border); padding: 14px 18px; }
.sidebar-foot-text { display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; margin-bottom: 10px; }
.sidebar-foot-text .icon { color: var(--green); margin-top: 1px; }
.collapse-btn { border-color: var(--border); color: var(--muted); background: transparent; border-radius: 10px; }
.collapse-btn:hover { background: #f3efe8; color: var(--text); }
@media (min-width: 961px) {
  body.sidebar-collapsed .nav-label { background: var(--border); }
  body.sidebar-collapsed .nav a.active::before { left: -10px; }
}

/* ---- Top bar ---- */
.topbar { background: rgba(247, 245, 241, .86); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; height: 64px; }
.icon-btn { border-radius: 12px; }
.icon-btn:hover { background: #efebe4; }
.user-menu summary { border-radius: 14px; padding: 4px 10px 4px 4px; }
.user-menu summary:hover { background: #efebe4; }
.avatar { background: linear-gradient(135deg, #e8eefc, #fbe9ea); color: var(--imoth-cobalt); font-weight: 700; }
.menu-pop { border-radius: 14px; padding: 6px; }
.menu-pop a, .menu-pop button { border-radius: 10px; }
.menu-pop a:hover, .menu-pop button:hover { background: #f5f2ec; }
.content { padding: 28px 32px 48px; }

/* ---- Cards, buttons, inputs ---- */
.card { border-radius: var(--radius); border-color: var(--border); box-shadow: var(--shadow); }
.card-head { border-bottom-color: var(--border); }
.card-foot { background: #fbfaf7; }
.btn { border-radius: 12px; height: 40px; padding: 0 16px; border-color: var(--border-strong); font-weight: 600; }
.btn:hover { background: #f5f2ec; }
.btn-sm { height: 34px; padding: 0 12px; border-radius: 10px; }
.btn-primary { background: var(--imoth-cobalt); border-color: var(--imoth-cobalt); box-shadow: 0 1px 2px rgba(8, 59, 191, .25); }
.btn-primary:hover { background: var(--blue-600); }
.btn-soft { background: var(--blue-50); border-color: transparent; color: var(--imoth-cobalt); }
.btn-soft:hover { background: #e2e9fb; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=date], input[type=number], input[type=tel], select, textarea { border-radius: 12px; height: 40px; border-color: var(--border-strong); }
textarea { height: auto; }
input:focus, select:focus, textarea:focus { border-color: var(--imoth-cobalt); box-shadow: 0 0 0 4px rgba(8, 59, 191, .12); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible, summary:focus-visible { outline-color: rgba(8, 59, 191, .35); }
label, .label { color: #3f3a33; }

/* ---- Tables & badges ---- */
.table th { background: transparent; color: var(--faint); font-size: 11px; letter-spacing: .06em; border-bottom-color: var(--border); }
.table td { border-bottom-color: #f1ede6; }
.table tbody tr:hover { background: #fbf9f5; }
.badge { padding: 3px 10px; font-weight: 600; }
.pill { border-radius: 99px; padding: 2px 10px; }
.ref-link { color: var(--imoth-cobalt); font-weight: 650; font-size: 12.5px; }
.alert { border-radius: 14px; padding: 12px 16px; }
.empty .icon { color: #c9c2b6; }
.modal { border-radius: 20px; }

/* ---- Dashboard: greeting ---- */
.hello { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 24px; }
.hello-date { margin: 0 0 4px; color: var(--muted); font-size: 13.5px; font-weight: 500; }
.hello h1 { font-size: 30px; font-weight: 650; letter-spacing: -.02em; }
.hello-summary { margin: 8px 0 0; font-size: 15.5px; color: #4a453e; max-width: 62ch; line-height: 1.55; }
.hello-summary strong { color: var(--text); }
.hello-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sync-chip { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 16px; border-radius: 99px; font-size: 13.5px; font-weight: 600; background: var(--surface); border: 1px solid var(--border); color: var(--text); }
.sync-chip:hover { text-decoration: none; border-color: var(--border-strong); }
.sync-sub { color: var(--muted); font-weight: 500; }
.sync-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--faint); flex: none; }
.sync-ok .sync-dot { background: #22a164; box-shadow: 0 0 0 4px rgba(34, 161, 100, .16); animation: sync-breathe 2.4s ease-in-out infinite; }
.sync-warn .sync-dot { background: #e09100; box-shadow: 0 0 0 4px rgba(224, 145, 0, .18); }
.sync-off .sync-dot { background: var(--imoth-red); box-shadow: 0 0 0 4px rgba(227, 6, 19, .14); }
@keyframes sync-breathe { 50% { box-shadow: 0 0 0 7px rgba(34, 161, 100, .06); } }

/* ---- Dashboard: Today card ---- */
.today-card { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 0; margin-bottom: 28px; overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #fffdf9 100%); }
.today-main { padding: 24px 26px; }
.today-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.today-head h2 { font-size: 18px; }
.today-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.today-stat { display: flex; flex-direction: column; padding: 16px 18px; border-radius: 14px; background: #f8f6f2; color: inherit; transition: background .15s, transform .15s; }
.today-stat:hover { text-decoration: none; background: #f1eee8; transform: translateY(-1px); }
.today-stat:first-child { background: var(--blue-50); }
.today-stat:first-child:hover { background: #e3eafb; }
.ts-label { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 600; color: #4a453e; }
.today-stat:first-child .ts-label { color: var(--imoth-cobalt); }
.ts-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.ts-green .ts-dot { background: #22a164; }
.ts-red .ts-dot { background: var(--imoth-red); }
.ts-value { font-family: var(--font-display); font-size: 40px; font-weight: 700; line-height: 1.05; margin-top: 8px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.today-stat:first-child .ts-value { color: var(--imoth-cobalt); }
.ts-note { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.today-week { padding: 24px 26px; border-left: 1px solid var(--border); display: flex; flex-direction: column; }
.today-week-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.today-week-head strong { color: var(--text); }
.today-week .week-chart { height: 180px; gap: 8px; flex: 1; }
.today-week .wc-track { background: #f3f0ea; border-radius: 10px; max-width: 38px; }
.today-week .wc-bar { background: #b9c9f0; border-radius: 10px; }
.today-week .wc-col.is-today .wc-bar { background: var(--imoth-cobalt); }
.today-week .wc-col.is-today .wc-day { color: var(--imoth-cobalt); }
.today-week .wc-val { font-size: 12px; color: var(--muted); }
.today-week .wc-col.is-today .wc-val { color: var(--text); }
.today-week .wc-day { color: var(--muted); font-weight: 600; }

/* ---- Dashboard: at a glance ---- */
.section-title { font-size: 15px; color: #4a453e; margin: 0 0 12px 2px; }
.tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; margin-bottom: 28px; }
.tile { display: flex; flex-direction: column; padding: 16px 18px; color: inherit; transition: box-shadow .15s, transform .15s, border-color .15s; }
.tile:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 10px 24px rgba(60, 45, 20, .08); border-color: var(--border-strong); }
.tile-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: #4a453e; }
.tile-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex: none; }
.tile-blue .tile-dot { background: var(--imoth-cobalt); }
.tile-green .tile-dot { background: #22a164; }
.tile-red .tile-dot { background: var(--imoth-red); }
.tile-teal .tile-dot { background: #1a9a9f; }
.tile-amber .tile-dot { background: #e09100; }
.tile-value { font-family: var(--font-display); font-size: 28px; font-weight: 700; margin-top: 10px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.tile-note { font-size: 12px; color: var(--muted); margin-top: 4px; }
.kpi-value.bumped, .ts-value.bumped, .tile-value.bumped { animation: bump .6s ease; }
@keyframes bump { 30% { color: var(--imoth-red); transform: scale(1.04); } }

/* ---- Dashboard: latest entries + side column ---- */
.dash-columns { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.dash-side { display: grid; gap: 20px; }
.people-table td { padding: 12px 16px; }
.people-table th { padding: 10px 16px; }
.people-table td:first-child, .people-table th:first-child { padding-left: 22px; }
.person { display: flex; align-items: center; gap: 12px; color: inherit; min-width: 0; }
.person:hover { text-decoration: none; }
.person:hover .person-name { color: var(--imoth-cobalt); }
.person-avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; color: var(--imoth-cobalt); background: linear-gradient(135deg, #e6edfc, #f7e8ea); }
.avatar-amber { color: #8a5200; background: linear-gradient(135deg, #fff1d6, #fde6e2); }
.person-text { display: flex; flex-direction: column; min-width: 0; }
.person-name { font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.person-sub { font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.people-table tr.row-new td { background: #fff8e8; }
.attention-list { list-style: none; margin: 0; padding: 6px 10px 10px; }
.attention-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 12px; }
.attention-list li:hover { background: #fbf9f5; }
.caught-up { display: flex; align-items: center; gap: 14px; padding: 22px 24px 26px; }
.caught-up p { margin: 0; line-height: 1.45; }
.caught-up-icon { width: 44px; height: 44px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--green-bg); color: var(--green); flex: none; }
.quick-card { padding: 18px 12px 12px; }
.quick-title { font-size: 15px; margin: 0 10px 8px; }
.quick-links { display: grid; }
.quick-links a { display: flex; align-items: center; gap: 12px; padding: 10px 10px; border-radius: 12px; color: #3f3a33; font-weight: 550; }
.quick-links a .icon { color: var(--imoth-cobalt); }
.quick-links a:hover { background: #f5f2ec; text-decoration: none; color: var(--text); }

@media (max-width: 1320px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .today-card { grid-template-columns: minmax(0, 1fr); }
  .today-week { border-left: 0; border-top: 1px solid var(--border); }
  .dash-columns { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .content { padding: 18px 16px 40px; }
  .hello h1 { font-size: 24px; }
  .hello-summary { font-size: 14.5px; }
  .today-main, .today-week { padding: 18px; }
  .today-stats { grid-template-columns: minmax(0, 1fr); }
  .today-stat { flex-direction: row; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
  .ts-value { font-size: 30px; margin: 0 0 0 auto; order: 2; }
  .ts-note { width: 100%; order: 3; margin: 0; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 14px; }
  .tile-value { font-size: 24px; }
  .people-table td:first-child { padding-left: 0; }
  .person-name, .person-sub { max-width: 220px; }
}
@media (prefers-reduced-motion: reduce) { .sync-ok .sync-dot { animation: none; } .tile, .today-stat { transition: none; } }
.hello-app { color: var(--imoth-cobalt); font-weight: 650; }
.tiles.tiles-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.today-main { display: flex; flex-direction: column; }
.today-hero { display: flex; flex-direction: column; padding: 20px 22px; border-radius: 14px; background: var(--blue-50); color: inherit; transition: background .15s; }
.today-hero:hover { text-decoration: none; background: #e3eafb; }
.today-hero .ts-label { color: var(--imoth-cobalt); font-size: 13.5px; }
.today-hero .ts-value { color: var(--imoth-cobalt); font-size: 52px; }
.today-latest { margin: 14px 2px 0; font-size: 13.5px; color: var(--muted); }
.today-latest a { color: var(--text); }
@media (max-width: 1100px) { .tiles.tiles-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 720px) {
  .tiles.tiles-4 { gap: 10px; }
  .today-hero .ts-value { font-size: 40px; margin: 6px 0 0; }
}

/* ---- Sign up ---- */
.brand-imoth input[type=tel] { border-color: var(--imoth-line); background: #fff; border-radius: 12px; }
.brand-imoth .auth-main { overflow-y: auto; }
.auth-switch { margin: 22px 0 0; text-align: center; color: var(--imoth-grey, var(--muted)); font-size: 14px; }
.optional { font-weight: 500; color: #8A8F98; font-size: 12px; margin-left: 4px; }
.auth-form .check { margin: 6px 0 4px; font-size: 13px; color: #3f3a33; }
.auth-form .check input { accent-color: var(--imoth-red); }
.auth-done { text-align: left; margin-bottom: 18px; }
.auth-done-icon { width: 52px; height: 52px; border-radius: 16px; display: inline-flex; align-items: center; justify-content: center;
  background: #F1F4FD; color: var(--imoth-cobalt); margin-bottom: 16px; }
.auth-done-icon.tone-green { background: var(--green-bg); color: var(--green); }
.auth-done-icon .icon { width: 24px; height: 24px; }
.signup-steps { list-style: none; margin: 0 0 18px; padding: 16px 18px; border: 1px solid var(--border); border-radius: 14px; display: grid; gap: 10px; background: #fcfbf8; }
.signup-steps li { display: flex; align-items: center; gap: 12px; color: #8A8F98; font-weight: 550; font-size: 14px; }
.signup-steps span { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; border: 2px solid #ddd7cd; color: #8A8F98; background: #fff; flex: none; }
.signup-steps .is-done { color: var(--text); }
.signup-steps .is-done span { background: var(--green); border-color: var(--green); color: #fff; }
.signup-steps .is-current { color: var(--text); }
.signup-steps .is-current span { border-color: var(--imoth-cobalt); color: var(--imoth-cobalt); }

/* ---- Sign-up requests (User Management) ---- */
.count-pill { display: inline-flex; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px; align-items: center; justify-content: center;
  background: var(--imoth-red); color: #fff; font-size: 12px; font-weight: 700; vertical-align: 2px; margin-left: 6px; }
.request-list { list-style: none; margin: 0; padding: 6px 12px 12px; }
.request { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 12px; border-radius: 12px; flex-wrap: wrap; }
.request:hover { background: #fbf9f5; }
.request .person-name, .request .person-sub { max-width: 420px; }
.request-actions { display: flex; align-items: flex-start; gap: 8px; }
.decline-pop { position: relative; }
.decline-pop > summary { list-style: none; }
.decline-pop > summary::-webkit-details-marker { display: none; }
.decline-form { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; width: 300px; padding: 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg); display: grid; gap: 8px; }
.decline-form label { margin: 0; }
@media (max-width: 720px) {
  .request-actions { width: 100%; }
  .decline-form { right: auto; left: 0; width: min(300px, calc(100vw - 64px)); }
}
