/* Chasetaxllc Admin — dashboard UI. Independent from the public site's stylesheet. */
:root {
  --navy: #081936;   /* Chasetaxllc navy */
  --navy-700: #0d2550;
  --green: #0a5e9f;   /* accent: Chasetaxllc brand blue */
  --green-050: #e8f2fa;
  --sage: #FFB547;
  --ink: #101E3A;
  --muted: #55617A;
  --muted-2: #8590A6;
  --border: #E3E8F3;
  --border-2: #EEF2F9;
  --bg: #F6F9FE;
  --white: #fff;
  --red: #c0392b;
  --red-050: #fdecea;
  --blue: #3771E6;
  --blue-050: #EBF1FC;
  --amber: #B86E00;
  --amber-050: #FFF6E6;
  --violet: #537AC9;
  --violet-050: #EEF3FD;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(11, 17, 29,0.05);
  --shadow: 0 1px 3px rgba(11, 17, 29,0.06), 0 6px 16px rgba(11, 17, 29,0.05);
  --shadow-lg: 0 12px 34px rgba(11, 17, 29,0.12);
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 15px; line-height: 1.55; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.ic { width: 18px; height: 18px; flex: none; }

/* ---- shell ---- */
.ad-shell { display: flex; min-height: 100vh; }
.ad-side {
  width: 248px; flex: none; color: #D8DEEA;
  background: linear-gradient(185deg, #111B2F 0%, var(--navy) 55%, #0C1E41 100%);
  display: flex; flex-direction: column; padding: 18px 14px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
/* Sidebar brand: logo image only — the wordmark text is hidden. */
.ad-brand { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 10px 8px 18px; margin-bottom: 8px; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.08); }
/* white tile: the logo's dark lettering would vanish on the black sidebar */
.ad-brand img { height: 92px; width: auto; max-width: 100%; object-fit: contain; padding: 8px; background: #fff; border-radius: 14px; }
.ad-side .ad-brand__wm { display: none; }
/* Wordmark matching the public site header: serif Chasetaxllc + letterspaced line. */
.ad-brand__wm { display: block; padding-left: 12px; border-left: 1px solid rgba(255,255,255,0.22); min-width: 0; }
.ad-brand__wm strong { display: block; font-family: var(--display); font-weight: 800; font-size: 1.18rem; letter-spacing: 0.01em; line-height: 1; color: #fff; }
.ad-brand__wm em { display: block; font-style: normal; font-size: 0.5rem; font-weight: 500; letter-spacing: 0.32em; text-transform: uppercase; color: #FFB948; margin-top: 5px; }
.ad-brand__wm small { display: block; font-size: 0.48rem; letter-spacing: 0.14em; text-transform: uppercase; color: #7081A3; margin-top: 4px; }
/* On white auth cards the wordmark flips to navy. */
.ad-auth__logo .ad-brand__wm strong { color: var(--navy); }
.ad-auth__logo .ad-brand__wm em { color: var(--green); }
.ad-auth__logo .ad-brand__wm { border-left-color: var(--border); }
.ad-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.ad-nav__label { font-size: 0.66rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: #7081A3; padding: 16px 12px 6px; }
.ad-nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: var(--radius-sm); font-weight: 500; font-size: 0.92rem; color: #B8C0D1; transition: background .15s, color .15s; }
.ad-nav a .ic { width: 18px; height: 18px; opacity: 0.85; }
.ad-nav a:hover { background: rgba(255,255,255,0.07); color: #fff; }
.ad-nav a.is-active { background: rgba(255,185,72,0.16); color: #fff; font-weight: 600; }
.ad-nav a.is-active::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sage); }
.ad-nav a.is-active .ic { opacity: 1; color: var(--sage); }
.ad-logout { display: flex; align-items: center; gap: 11px; padding: 10px 12px; margin-top: 6px; border-radius: var(--radius-sm); color: #B8C0D1; font-size: 0.92rem; border-top: 1px solid rgba(255,255,255,0.08); border-radius: 0; padding-top: 14px; }
.ad-logout:hover { color: #fff; }

.ad-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ad-topbar {
  display: flex; align-items: center; gap: 14px; padding: 15px 32px;
  background: rgba(255,255,255,0.85); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 5;
}
.ad-topbar h1 { font-family: var(--display); font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; flex: 1; }
.ad-topbar__user { display: flex; align-items: center; gap: 9px; color: var(--ink); font-size: 0.9rem; font-weight: 600; }
.ad-topbar__user .ic { width: 34px; height: 34px; padding: 8px; border-radius: 50%; background: var(--green-050); color: var(--green); }
.ad-burger { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; width: 38px; height: 38px; align-items: center; justify-content: center; }
.ad-content { padding: 30px 32px 70px; max-width: 1240px; width: 100%; margin-inline: auto; }

/* ---- flash ---- */
.ad-flash { padding: 13px 16px; border-radius: 10px; margin-bottom: 20px; font-weight: 500; font-size: 0.92rem; }
.ad-flash--ok { background: #eafaf0; color: #0a7a3e; border: 1px solid #bfe8cf; }
.ad-flash--err { background: var(--red-050); color: var(--red); border: 1px solid #f3c9c4; }

/* ---- cards / stats ---- */
.ad-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px,1fr)); gap: 16px; margin-bottom: 26px; }
.ad-card {
  display: flex; align-items: center; gap: 15px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); transition: transform .15s, box-shadow .15s;
}
.ad-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.ad-card__ic { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--green-050); color: var(--green); }
.ad-card__ic .ic { width: 22px; height: 22px; }
.ad-card__ic--blue { background: var(--blue-050); color: var(--blue); }
.ad-card__ic--amber { background: var(--amber-050); color: var(--amber); }
.ad-card__ic--violet { background: var(--violet-050); color: var(--violet); }
.ad-card__ic--red { background: var(--red-050); color: var(--red); }
.ad-card__ic--navy { background: #FFEFD5; color: var(--navy); }
.ad-card__num { font-size: 1.75rem; font-weight: 700; color: var(--ink); line-height: 1; letter-spacing: -0.02em; }
.ad-card__label { color: var(--muted); font-size: 0.82rem; margin-top: 6px; font-weight: 500; }

.ad-panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px 26px; margin-bottom: 22px; }
.ad-panel h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 16px; letter-spacing: -0.01em; }

/* ---- table ---- */
.ad-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--white); box-shadow: var(--shadow); }
table.ad-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.ad-table th { text-align: left; font-size: 0.7rem; letter-spacing: 0.07em; text-transform: uppercase; color: var(--muted-2); font-weight: 700; padding: 13px 18px; background: var(--border-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.ad-table td { padding: 14px 18px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ad-table tr:last-child td { border-bottom: none; }
.ad-table tbody tr { transition: background .12s; }
.ad-table tbody tr:hover td { background: var(--green-050); }
.ad-table tr.is-unread td { font-weight: 600; }
.ad-empty { padding: 48px 20px; text-align: center; color: var(--muted-2); }
/* A panel wrapping a table shouldn't double-pad. */
.ad-panel > .ad-table-wrap { box-shadow: none; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 11px; border-radius: 999px; font-size: 0.73rem; font-weight: 600; letter-spacing: 0.01em; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }
.badge--contact { background: #EBF1FC; color: #3771E6; }
.badge--estimate { background: var(--green-050); color: var(--green); }
.badge--newsletter { background: #FFF3E0; color: #2350A9; }
.badge--pub { background: #eafaf0; color: #0a7a3e; }
.badge--unpub { background: #EBEEF4; color: #6A7C9F; }
.badge--submitted { background: #EBF1FC; color: #3771E6; }
.badge--review { background: #FFF3E0; color: #2350A9; }
.badge--progress { background: #EEF3FD; color: #537AC9; }
.badge--done { background: #eafaf0; color: #0a7a3e; }
.badge--cancel { background: var(--red-050); color: var(--red); }

/* ---- forms / buttons ---- */
.ad-field { margin-bottom: 16px; }
.ad-field label { display: block; font-weight: 600; font-size: 0.86rem; margin-bottom: 6px; }
.ad-field input, .ad-field select, .ad-field textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 9px;
  font-family: inherit; font-size: 0.95rem; background: var(--white); color: var(--ink);
}
.ad-field input:focus, .ad-field select:focus, .ad-field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-050); }
.ad-field textarea { min-height: 110px; resize: vertical; }
.ad-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ad-hint { font-size: 0.8rem; color: var(--muted-2); margin-top: 5px; }
.ad-error { font-size: 0.8rem; color: var(--red); margin-top: 5px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: var(--radius-sm); font-weight: 600; font-size: 0.9rem; border: 1px solid transparent; cursor: pointer; font-family: inherit; transition: background .15s, border-color .15s, transform .1s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--navy); color: #fff; box-shadow: 0 2px 8px rgba(11, 17, 29,0.22); }
.btn--primary:hover { background: var(--navy-700); box-shadow: 0 4px 14px rgba(11, 17, 29,0.28); }
.btn--ghost { background: var(--white); color: var(--ink); border-color: var(--border); box-shadow: var(--shadow-sm); }
.btn--ghost:hover { border-color: var(--green); color: var(--green); }
.btn--danger { background: var(--red-050); color: var(--red); }
.btn--danger:hover { background: #f9dbd7; }
.btn--sm { padding: 7px 13px; font-size: 0.82rem; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--border); background: var(--white); }
.icon-btn:hover { border-color: var(--green); color: var(--green); }

/* ---- filter bar ---- */
.ad-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; align-items: center; }
.ad-filters select, .ad-filters input[type=search] { padding: 9px 12px; border: 1px solid var(--border); border-radius: 9px; font-family: inherit; font-size: 0.9rem; }
.ad-filters input[type=search] { min-width: 220px; }
.ad-pagination { display: flex; gap: 8px; margin-top: 18px; justify-content: center; }
.ad-pagination a, .ad-pagination span { padding: 7px 13px; border-radius: 8px; border: 1px solid var(--border); font-size: 0.86rem; }
.ad-pagination a:hover { border-color: var(--green); }
.ad-pagination .is-current { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---- settings: panel header + upload ---- */
.ad-panel__head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.ad-panel__head .ic { width: 20px; height: 20px; color: var(--green); }
.ad-panel__head h2 { margin: 0; }
.ad-panel__sub { color: var(--muted); font-size: 0.86rem; margin: 4px 0 20px; }
.ad-panel + .ad-panel { margin-top: 22px; }

.ad-field label .ic { width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; color: var(--muted-2); }

.ad-upload-row { display: flex; gap: 20px; flex-wrap: wrap; }
.ad-upload { flex: 1; min-width: 220px; }
.ad-upload__swatch {
  display: flex; align-items: center; justify-content: center; height: 84px; padding: 10px;
  border: 1px dashed var(--border); border-radius: 9px; background:
    linear-gradient(45deg, #FFF3DF 25%, transparent 25%), linear-gradient(-45deg, #FFF3DF 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #FFF3DF 75%), linear-gradient(-45deg, transparent 75%, #FFF3DF 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-color: var(--white);
  margin-bottom: 10px;
}
.ad-upload__swatch img { max-height: 100%; max-width: 100%; object-fit: contain; }
.ad-upload input[type=file] {
  width: 100%; font-size: 0.85rem; padding: 9px 10px; border: 1px solid var(--border); border-radius: 9px;
  background: var(--white); font-family: inherit; color: var(--muted);
}
.ad-upload input[type=file]::file-selector-button {
  margin-right: 10px; padding: 6px 12px; border: none; border-radius: 7px; background: var(--green-050);
  color: var(--green); font-weight: 600; font-size: 0.82rem; font-family: inherit; cursor: pointer;
}
.ad-upload input[type=file]::file-selector-button:hover { background: var(--sage); }

.ad-form-footer { display: flex; align-items: center; gap: 14px; margin-top: 22px; }
.ad-form-footer .ad-hint { margin: 0; }

/* ---- visitors (live tracking) ---- */
.vz-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; background: var(--muted-2); flex: none; }
.vz-dot--live { background: #0a7a3e; box-shadow: 0 0 0 3px #eafaf0; }
.vz-row { cursor: pointer; }
.vz-row.is-open td { background: var(--green-050); }
.vz-detail td { padding: 0; }
.vz-detail__inner { padding: 16px 20px; background: #fbfcf9; }
.vz-timeline { display: flex; flex-direction: column; gap: 9px; max-height: 280px; overflow-y: auto; }
.vz-evt { display: flex; gap: 10px; align-items: baseline; font-size: 0.86rem; }
.vz-evt time { color: var(--muted-2); font-size: 0.78rem; white-space: nowrap; flex: none; width: 68px; }
.vz-evt .badge { flex: none; }
.vz-url { color: var(--muted); font-size: 0.82rem; }

/* ---- application ticket thread ---- */
/* Chat window: tinted backdrop makes both bubble colours pop. */
.tk-thread {
  display: flex; flex-direction: column; gap: 12px; padding: 20px;
  background: #FFEFD4; border: 1px solid var(--border); border-radius: 16px;
  max-height: 560px; overflow-y: auto;
  background-image: radial-gradient(rgba(11, 17, 29,0.05) 1px, transparent 1px);
  background-size: 22px 22px;
}
.tk-thread--empty { background-image: none; }
.tk-empty { margin: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--muted-2); padding: 30px; text-align: center; }
.tk-empty .ic { width: 30px; height: 30px; opacity: 0.5; }

/* day separator */
.tk-daysep { text-align: center; margin: 4px 0; }
.tk-daysep span { display: inline-block; padding: 3px 12px; background: rgba(255,255,255,0.7); border: 1px solid var(--border); border-radius: 999px; font-size: 0.72rem; font-weight: 600; color: var(--muted); }

/* a message row = avatar + bubble; mine flips to the right */
.tk-row { display: flex; align-items: flex-end; gap: 9px; max-width: 84%; }
.tk-row--them { align-self: flex-start; }
.tk-row--mine { align-self: flex-end; flex-direction: row-reverse; }
.tk-avatar { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 0.82rem; box-shadow: var(--shadow-sm); }
.tk-avatar--team { background: var(--navy); color: #fff; }
.tk-avatar--client { background: var(--sage); color: var(--navy); }
.tk-avatar .ic { width: 18px; height: 18px; }

.tk-bubble { padding: 10px 14px; border-radius: 16px; box-shadow: var(--shadow-sm); font-size: 0.9rem; min-width: 0; }
.tk-row--them .tk-bubble { background: #fff; border: 1px solid var(--border); color: var(--ink); border-bottom-left-radius: 5px; }
.tk-row--mine .tk-bubble { background: linear-gradient(180deg, #214A9D, var(--green)); color: #fff; border-bottom-right-radius: 5px; }
.tk-msg__meta { font-size: 0.7rem; margin-bottom: 4px; font-weight: 600; letter-spacing: 0.02em; }
.tk-row--them .tk-msg__meta { color: var(--muted-2); }
.tk-row--mine .tk-msg__meta { color: rgba(255,255,255,0.85); }
.tk-msg__body { line-height: 1.5; word-break: break-word; }
.tk-file {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 9px; padding: 8px 11px;
  background: var(--white); border: 1px solid var(--border); border-radius: 9px; font-size: 0.84rem; font-weight: 500; color: var(--ink);
}
.tk-file:hover { border-color: var(--green); color: var(--green); }
.tk-file .ic { width: 16px; height: 16px; flex: none; }
.tk-file span { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-file em { font-style: normal; color: var(--muted-2); font-size: 0.78rem; }
.tk-row--mine .tk-file { border-color: transparent; }

.tk-reply { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 18px; }
.tk-reply__file { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 14px; }
.tk-reply__file input[type=file] { font-size: 0.85rem; }
.tk-reply__file input[type=file]::file-selector-button {
  margin-right: 10px; padding: 7px 13px; border: none; border-radius: 7px; background: var(--green-050);
  color: var(--green); font-weight: 600; font-size: 0.82rem; font-family: inherit; cursor: pointer;
}

/* ---- site editor: split view with live preview ---- */
.pg-editor { display: grid; grid-template-columns: minmax(360px, 34%) 1fr; gap: 18px; align-items: start; }
.pg-formcol { min-width: 0; }
.pg-preview {
  position: sticky; top: 78px; height: calc(100vh - 105px);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
  background: var(--white); box-shadow: var(--shadow); display: flex; flex-direction: column;
}
.pg-preview__bar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px;
  font-size: 0.82rem; font-weight: 600; color: var(--muted);
  background: var(--border-2); border-bottom: 1px solid var(--border); flex: none;
}
.pg-preview__bar .ic { width: 15px; height: 15px; color: var(--green); }
.pg-preview iframe { width: 100%; height: 100%; border: 0; flex: 1; }
@media (max-width: 1100px) {
  .pg-editor { grid-template-columns: 1fr; }
  .pg-preview { display: none; }
}

/* ---- site editor (Pages) ---- */
.pg-group { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; overflow: hidden; }
.pg-group summary {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 15px 20px; cursor: pointer; font-weight: 600; font-size: 0.95rem; list-style: none;
}
.pg-group summary::-webkit-details-marker { display: none; }
.pg-group summary::after { content: "▾"; color: var(--muted-2); transition: transform .15s; }
.pg-group[open] summary::after { transform: rotate(180deg); }
.pg-group summary:hover { background: var(--green-050); }
.pg-group summary em { font-style: normal; font-weight: 500; font-size: 0.78rem; color: var(--muted-2); margin-left: auto; padding-right: 8px; }
.pg-fields { padding: 6px 20px 18px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 14px; }
.pg-field { padding-top: 12px; }
.pg-field label { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 0.82rem; margin-bottom: 6px; color: var(--muted); }
.pg-field label .ic { width: 14px; height: 14px; color: var(--muted-2); }
.pg-field input[type=text], .pg-field textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 0.9rem; background: var(--white); color: var(--ink);
}
.pg-field input[type=text]:focus, .pg-field textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-050); }
.pg-field textarea { resize: vertical; }
.pg-field.is-edited input[type=text], .pg-field.is-edited textarea { border-color: var(--green); background: #FFFCF7; }
.pg-flag { background: var(--green-050); color: var(--green); font-size: 0.68rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: 0.04em; text-transform: uppercase; }
.pg-img { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.pg-img img { width: 130px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); background: var(--border-2); flex: none; }
.pg-img input[type=file] { font-size: 0.82rem; }

/* ---- login / install ---- */
/* ---- Admin login ---- */
.ad-auth {
  position: relative; min-height: 100vh;
  display: grid; place-items: center;
  background: var(--navy); padding: 24px; overflow: hidden;
}
/* soft glow + dotted texture so the dark field isn't a flat slab */
.ad-auth::before {
  content: ""; position: absolute; top: -20%; left: 50%; transform: translateX(-50%);
  width: 900px; height: 900px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,185,72,0.16) 0%, transparent 62%);
  pointer-events: none;
}
.ad-auth::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,0.07) 1.4px, transparent 1.4px);
  background-size: 22px 22px;
  mask-image: linear-gradient(160deg, #000 0%, transparent 55%);
  -webkit-mask-image: linear-gradient(160deg, #000 0%, transparent 55%);
  pointer-events: none;
}
.ad-auth__card {
  position: relative; z-index: 1;
  width: 100%; max-width: 430px;
  background: var(--white); border-radius: 20px;
  padding: 36px 36px 30px;
  box-shadow: 0 26px 60px rgba(0,0,0,0.32);
}
/* Logo keeps its own proportions — a fixed width+height squashed it flat.
   The current logo is dark artwork on a transparent ground, so it sits on a
   light panel (a dark one would swallow its lettering). */
.ad-auth__logo {
  display: flex; justify-content: center; align-items: center;
  background: linear-gradient(160deg, #FFFFFF 0%, var(--green-050) 100%);
  border: 1px solid rgba(255,158,2,0.35);
  border-radius: 14px;
  padding: 18px 24px;
  margin-bottom: 26px;
}
.ad-auth__logo img { height: 62px; width: auto; max-width: 88%; display: block; }
.ad-auth__eyebrow {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 13px; border-radius: 999px;
  background: var(--green-050); color: var(--green);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.11em; text-transform: uppercase;
}
.ad-auth__eyebrow .ic { width: 13px; height: 13px; }
.ad-auth h1 { font-size: 1.5rem; margin: 14px 0 6px; letter-spacing: -0.02em; }
.ad-auth p.sub { color: var(--muted); font-size: 0.92rem; margin: 0 0 24px; line-height: 1.5; }
/* icon tucked inside each field */
.ad-auth .ad-field { position: relative; }
.ad-auth .ad-field > .ic {
  position: absolute; left: 14px; bottom: 14px;
  width: 17px; height: 17px; color: var(--muted-2); pointer-events: none;
}
.ad-auth .ad-field input { padding-left: 40px; height: 46px; }
.ad-auth .btn { width: 100%; justify-content: center; height: 48px; font-size: 0.96rem; }
.ad-auth__foot {
  margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-size: 0.82rem; color: var(--muted-2);
}
.ad-auth__foot a { color: var(--green); font-weight: 600; }
.ad-auth__foot a:hover { text-decoration: underline; }
.ad-auth__foot span { display: inline-flex; align-items: center; gap: 6px; }
.ad-auth__foot .ic { width: 14px; height: 14px; color: var(--green); flex: none; }
@media (max-width: 460px) {
  .ad-auth__card { padding: 28px 22px 24px; border-radius: 16px; }
  .ad-auth__logo img { height: 52px; }
  .ad-auth__foot { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* ---- testimonial preview card ---- */
.tst-preview { display: flex; gap: 12px; align-items: flex-start; }
.tst-preview img { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; background: var(--border); }
.tst-preview .q { font-size: 0.86rem; color: var(--muted); max-width: 420px; }
.tst-preview strong { display: block; font-size: 0.9rem; }
.tst-preview small { color: var(--muted-2); }

@media (max-width: 900px) {
  .ad-side { position: fixed; left: -270px; z-index: 60; transition: left .2s; box-shadow: 8px 0 30px rgba(0,0,0,.25); }
  .ad-side.is-open { left: 0; }
  .ad-burger { display: flex; }
  .ad-topbar { padding: 14px 16px; }
  .ad-topbar h1 { font-size: 1.1rem; }
  .ad-content { padding: 22px 16px 60px; }
  .ad-field-row { grid-template-columns: 1fr; }
  /* Dim + block the page behind the open drawer; tap it to close. */
  .ad-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(11, 17, 29,.45); opacity: 0; visibility: hidden; transition: opacity .2s; }
  .ad-side.is-open ~ .ad-main .ad-backdrop,
  body.ad-drawer-open .ad-backdrop { opacity: 1; visibility: visible; }
}
@media (max-width: 560px) {
  /* Keep the avatar, drop the long email/username text so the bar never overflows. */
  .ad-topbar__user { font-size: 0; gap: 0; }
  .ad-form-footer { flex-direction: column; align-items: flex-start; gap: 10px; }
  .ad-panel { padding: 18px 16px; }
}

/* ---------- Live chat page ---------- */
.lc { display: grid; grid-template-columns: 300px 1fr; gap: 16px; height: calc(100vh - 150px); min-height: 420px; }
.lc__list { background: #fff; border: 1px solid var(--border); border-radius: 8px; overflow-y: auto; }
.lc__item { display: block; position: relative; padding: 12px 14px; border-bottom: 1px solid var(--border); color: var(--ink); }
.lc__item:hover { background: #F5F7FA; }
.lc__item.is-active { background: #FFF5E4; box-shadow: inset 3px 0 0 var(--green); }
.lc__item-top { display: flex; align-items: center; gap: 8px; }
.lc__item-top strong { font-size: 0.9rem; }
.lc__item-last { color: var(--muted-2); font-size: 0.8rem; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lc__wait { background: #F89900; color: #fff; font-size: 0.65rem; font-weight: 700; padding: 1px 7px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.04em; }
.lc__unread { position: absolute; top: 12px; right: 12px; background: #c0392b; color: #fff; min-width: 18px; height: 18px; border-radius: 9px; font-size: 0.7rem; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }

.lc__thread { background: #fff; border: 1px solid var(--border); border-radius: 8px; display: flex; flex-direction: column; overflow: hidden; }
.lc__empty { margin: auto; text-align: center; color: var(--muted-2); padding: 30px; }
.lc__empty .ic { width: 40px; height: 40px; color: var(--border); }
.lc__empty p { margin: 10px 0 4px; font-weight: 600; color: var(--muted); }
.lc__empty span { font-size: 0.85rem; }
.lc__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.lc__head strong { display: block; }
.lc__head small { color: var(--muted-2); font-size: 0.78rem; }
.lc__head-actions { display: flex; align-items: center; gap: 10px; }
.lc__msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; background: #F3F5F8; }
.lc__msg { max-width: 74%; padding: 9px 13px; border-radius: 12px; font-size: 0.9rem; line-height: 1.5; position: relative; }
.lc__msg span { display: block; }
.lc__msg time { display: block; font-size: 0.68rem; opacity: 0.65; margin-top: 3px; }
.lc__msg--visitor { background: #fff; border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 3px; }
.lc__msg--agent { background: var(--green); color: #fff; align-self: flex-end; border-bottom-right-radius: 3px; }
.lc__msg--system { align-self: center; background: transparent; color: var(--muted-2); font-size: 0.78rem; max-width: 100%; }
.lc__form { display: flex; gap: 10px; padding: 12px; border-top: 1px solid var(--border); }
.lc__form input { flex: 1; border: 1px solid var(--border); border-radius: 22px; padding: 10px 16px; font: inherit; outline: none; }
.lc__form input:focus { border-color: var(--green); }
.lc__closed { padding: 16px; text-align: center; color: var(--muted-2); border-top: 1px solid var(--border); }
@media (max-width: 780px) {
  .lc { grid-template-columns: 1fr; height: auto; }
  .lc__list { max-height: 200px; }
  .lc__thread { min-height: 420px; }
}

/* Sidebar unread/new counters */
.ad-nav__badge {
  margin-left: auto;
  background: #c0392b; color: #fff;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 10px;
  font-size: 0.72rem; font-weight: 700; line-height: 20px;
  text-align: center; flex: none;
}
.ad-nav a.is-active .ad-nav__badge { background: #fff; color: #1F4798; }

/* ---------- Mail template previews ---------- */
.mt-item {
  display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  padding: 18px; margin-bottom: 14px; align-items: start;
}
.mt-item__meta { display: flex; flex-direction: column; gap: 10px; }
.mt-item__trigger { font-size: 0.92rem; font-weight: 600; color: var(--ink); }
.mt-item__subject { font-size: 0.84rem; color: var(--muted); word-break: break-word; }
.mt-item__meta small {
  display: block; text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.66rem; color: var(--muted-2); font-weight: 600; margin-bottom: 2px;
}
.mt-item__preview { background: #F3F5F8; border-radius: 6px; padding: 18px; overflow-x: auto; }
@media (max-width: 820px) {
  .mt-item { grid-template-columns: 1fr; gap: 14px; }
  .mt-item__preview { padding: 10px; }
}

/* Rows that open a detail view */
.ad-table tr.is-clickable { cursor: pointer; }
.ad-table tr.is-clickable:hover { background: #F5F7FA; }

/* ---------- Tax Organizer: form cards ---------- */
.org-heading {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.09em;
  color: var(--muted-2); font-weight: 600; margin: 4px 0 12px;
}
.org-card {
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 16px 18px; margin-bottom: 14px;
  box-shadow: 0 1px 2px rgba(11, 17, 29,0.05);
}
.org-card.is-hidden { background: #F9FAFC; opacity: 0.85; }

.org-card__top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.org-card__ext {
  flex: none; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 8px;
  background: #FFF5E4; color: var(--green);
  font-size: 0.66rem; font-weight: 700; letter-spacing: 0.04em;
}
.org-card__ext[data-ext="PDF"] { background: #fdeceb; color: #c0392b; }
.org-card__ext[data-ext="ZIP"] { background: #FFF3E1; color: #214CA2; }
.org-card__file { flex: 1 1 240px; min-width: 0; }
.org-card__file strong {
  display: block; font-size: 0.92rem; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.org-card__file small { display: block; color: var(--muted-2); font-size: 0.78rem; margin-top: 2px; }
.org-card__actions { flex: none; }

.org-edit {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(200px, 1.7fr) 80px minmax(180px, 0.9fr) auto;
  gap: 12px; align-items: end;
  margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border);
}
.org-edit__field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.org-edit__field > span {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--muted-2); font-weight: 600;
}
.org-edit__field input { width: 100%; }
.org-edit__save { white-space: nowrap; }

@media (max-width: 820px) {
  .org-edit { grid-template-columns: 1fr 80px; }
  .org-edit__field--desc { grid-column: 1 / -1; }
  .org-edit__field--file { grid-column: 1 / -1; }
  .org-edit__save { grid-column: 1 / -1; justify-content: center; }
  .org-card__actions { width: 100%; }
}

/* ---- Live alert toasts (notify.php poll) ---- */
.ad-toasts {
  position: fixed; right: 18px; bottom: 18px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
  width: min(360px, calc(100vw - 36px));
  pointer-events: none;                 /* only the cards themselves take clicks */
}
.ad-toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 14px 14px 15px;
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(11, 17, 29,0.22);
  opacity: 0; transform: translateX(28px);
  transition: opacity .26s ease, transform .26s cubic-bezier(0.16,0.84,0.3,1);
}
.ad-toast.is-in  { opacity: 1; transform: none; }
.ad-toast.is-out { opacity: 0; transform: translateX(28px); }
.ad-toast__ic {
  flex: none; display: grid; place-items: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--green-050); color: var(--green);
}
.ad-toast__ic svg { width: 18px; height: 18px; }
.ad-toast__txt { flex: 1; min-width: 0; }
.ad-toast__txt strong { display: block; font-size: 0.9rem; color: var(--ink); }
.ad-toast__txt > span {
  display: block; margin-top: 2px;
  font-size: 0.83rem; color: var(--muted); line-height: 1.45;
  overflow-wrap: anywhere;
}
.ad-toast__cta {
  display: inline-block; margin-top: 8px;
  font-size: 0.8rem; font-weight: 700; color: var(--green);
}
.ad-toast__cta:hover { text-decoration: underline; }
.ad-toast__x {
  flex: none; display: grid; place-items: center;
  width: 26px; height: 26px; padding: 0; margin: -2px -2px 0 0;
  border: 0; border-radius: 7px; background: none;
  color: var(--muted-2); cursor: pointer;
}
.ad-toast__x:hover { background: var(--bg); color: var(--ink); }
.ad-toast__x svg { width: 14px; height: 14px; }
/* per-type accent, so the kind of alert reads at a glance */
.ad-toast--chat { border-left-color: #284887; }
.ad-toast--chat .ad-toast__ic { background: rgba(40, 72, 135,0.10); color: #284887; }
.ad-toast--lead { border-left-color: #2452AE; }
.ad-toast--lead .ad-toast__ic { background: rgba(255,159,5,0.14); color: #2452AE; }
.ad-toast--message { border-left-color: #627499; }
.ad-toast--message .ad-toast__ic { background: rgba(98, 116, 153,0.10); color: #627499; }
@media (max-width: 560px) {
  .ad-toasts { right: 10px; left: 10px; bottom: 10px; width: auto; }
}

/* ---- Topbar alerts toggle (sound + desktop notifications) ---- */
.ad-alerts {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  height: 36px; padding: 0 13px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--white); color: var(--muted);
  font: inherit; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.ad-alerts:hover { border-color: var(--green); color: var(--green); }
.ad-alerts .ic { width: 17px; height: 17px; }
.ad-alerts__on { display: none; }
.ad-alerts__off { display: inline-flex; }
.ad-alerts.is-on { background: var(--green-050); border-color: #FFE3B6; color: var(--green); }
.ad-alerts.is-on .ad-alerts__on { display: inline-flex; }
.ad-alerts.is-on .ad-alerts__off { display: none; }
/* gentle nudge while alerts are off, so it doesn't go unnoticed */
.ad-alerts:not(.is-on) .ad-alerts__off { animation: adBellHint 4s ease-in-out 2s 3; }
@keyframes adBellHint {
  0%, 88%, 100% { transform: none; }
  92% { transform: rotate(-12deg); }
  96% { transform: rotate(10deg); }
}
@media (prefers-reduced-motion: reduce) {
  .ad-alerts:not(.is-on) .ad-alerts__off { animation: none; }
}
@media (max-width: 720px) {
  .ad-alerts { padding: 0; width: 36px; justify-content: center; border-radius: 10px; }
  .ad-alerts__lbl { display: none; }
}

/* Client's note attached to an uploaded document */
.ad-doc-note {
  margin-top: 7px; padding: 7px 10px;
  background: var(--bg); border-left: 3px solid var(--border);
  border-radius: 0 7px 7px 0;
  font-size: 0.82rem; color: var(--muted); line-height: 1.5;
  max-width: 420px;
}

/* "Replace file" on an organizer row — optional, so it reads quieter than the
   text fields next to it. */
.org-edit__field--file > span em { font-style: normal; font-weight: 400; color: var(--muted-2); text-transform: none; letter-spacing: 0; }
.org-edit__field--file input[type="file"] {
  font-size: 0.8rem; padding: 6px 8px;
  border: 1px dashed var(--border); border-radius: 8px; background: var(--bg);
}

/* Financial-year filter (admin list pages) */
/* Section heading with an action on the right (e.g. Download all). */
.ad-sec-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 0 0 10px; }
.ad-sec-head h3 { margin: 0; font-size: 0.95rem; }

/* One-time reset link handed to the admin to pass on by hand. */
.ad-resetlink { margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: #FFF7EA; border: 1px solid #FFE6BD; font-size: 0.85rem; color: var(--muted); }
.ad-resetlink strong { color: var(--ink); }
.ad-resetlink input { width: 100%; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 7px; font: inherit; font-size: 0.8rem; background: var(--white); color: var(--ink); }

/* Irreversible actions, visually separated from everything else. */
.ad-danger { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: flex-end; padding: 16px 18px; border: 1px solid #f0cfcf; border-left: 4px solid #c0392b; border-radius: 10px; background: #fdf5f4; }
.ad-danger > div { max-width: 460px; }
.ad-danger strong { color: #8d2a1e; }
.ad-danger p { margin: 5px 0 0; font-size: 0.85rem; color: var(--muted); }
.ad-danger form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.ad-danger label { display: block; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.ad-danger code { font-size: 0.78rem; background: #fff; padding: 1px 5px; border-radius: 4px; border: 1px solid #f0cfcf; }
.ad-danger input { display: block; margin-top: 5px; padding: 8px 10px; border: 1px solid #e3b9b3; border-radius: 7px; font: inherit; font-size: 0.85rem; min-width: 240px; background: var(--white); }

/* Financial-year picker in the sidebar — same control the client portal has. */
.ad-side__fy { padding: 4px 16px 14px; }
.ad-side__fy label {
  display: block; text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.66rem; color: #7081A3; font-weight: 600; margin-bottom: 5px;
}
.ad-side__fy select {
  width: 100%; padding: 7px 10px; border-radius: 5px; cursor: pointer;
  background: rgba(255,255,255,0.06); color: #fff;
  border: 1px solid rgba(255,255,255,0.14); font: inherit; font-size: 0.85rem;
}
.ad-side__fy select option { color: #101828; }

/* Year the document is filed under, editable from the list. */
.ad-fy-cell select {
  padding: 5px 8px; border: 1px solid var(--border); border-radius: 7px;
  font: inherit; font-size: 0.85rem; background: var(--white); cursor: pointer;
}
.ad-fy-cell__hint { color: var(--muted-2); font-size: 0.72rem; margin-top: 3px; }

.ad-fy-note {
  margin: 0 0 18px; padding: 10px 14px; border-radius: 9px;
  background: #FFF3E1; border: 1px solid #FFE2B3; color: #1F4798; font-size: 0.88rem;
}
.ad-fy-note a { color: #1F4798; font-weight: 700; }

/* Services: inline edit row tucked under each service */
.svc-edit-row > td { background: var(--bg); padding: 14px 18px; border-bottom: 2px solid var(--border); }
.ad-table tbody tr.svc-edit-row:hover > td { background: var(--bg); }

/* ---------- Blog (list + editor) ---------- */
.blog-row { display: flex; align-items: center; gap: 14px; }
.blog-row img, .blog-row__ph { width: 72px; height: 48px; flex: none; border-radius: 8px; object-fit: cover; background: var(--green-050); display: grid; place-items: center; color: var(--green); }
.blog-row strong { display: block; color: var(--ink); }
.blog-row small { display: block; color: var(--muted-2); font-size: 0.8rem; }

.blog-form { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.blog-form > .ad-flash { grid-column: 1 / -1; margin: 0; }
.blog-form__side .ad-panel { margin-bottom: 20px; }
@media (max-width: 1100px) { .blog-form { grid-template-columns: 1fr; } }

.blog-editor { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--white); }
.blog-editor:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-050); }
.blog-editor__bar { position: sticky; top: 0; z-index: 2; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; border-bottom: 1px solid var(--border); background: #F8F9FB; border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
.blog-editor__bar button { font: 600 0.82rem var(--font); color: var(--ink); background: var(--white); border: 1px solid var(--border); border-radius: 7px; padding: 6px 10px; cursor: pointer; }
.blog-editor__bar button:hover { border-color: var(--green); color: var(--green); }
.blog-editor__sep { width: 1px; margin: 2px 4px; background: var(--border); }
.blog-editor__area { min-height: 380px; max-height: 70vh; overflow-y: auto; padding: 18px 20px; font-size: 0.98rem; line-height: 1.7; color: var(--ink); outline: none; }
.blog-editor__area h2 { font-size: 1.45rem; margin: 1.2em 0 0.4em; }
.blog-editor__area h3 { font-size: 1.15rem; margin: 1.1em 0 0.4em; }
.blog-editor__area p { margin: 0 0 0.9em; }
.blog-editor__area blockquote { margin: 1em 0; padding: 8px 16px; border-left: 4px solid var(--sage); background: #F8F9FB; }
.blog-editor__area img { max-width: 100%; height: auto; border-radius: 8px; }
.blog-editor__area a { color: var(--blue); }

.blog-cover-prev { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); }
.blog-slug { display: flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.blog-slug span { padding: 0 2px 0 12px; color: var(--muted-2); font-size: 0.9rem; }
.ad-field .blog-slug input { border: 0; box-shadow: none; padding-left: 2px; }
.blog-count { float: right; font-weight: 500; font-size: 0.78rem; color: var(--muted-2); }
.blog-count.is-over { color: var(--red); }
.seo-preview { padding: 14px 16px; border: 1px dashed var(--border); border-radius: var(--radius-sm); background: #F8F9FB; font-family: Arial, sans-serif; }
.seo-preview small { display: block; color: #2D4576; font-size: 0.78rem; }
.seo-preview strong { display: block; margin: 4px 0; color: #1B469D; font-size: 1.05rem; font-weight: 400; line-height: 1.3; }
.seo-preview p { margin: 0; color: #2D4576; font-size: 0.84rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* ---------- Tax Returns pipeline ---------- */
.rt { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; }
.rt-nav { background: #fff; border: 1px solid var(--border); border-radius: 14px; padding: 10px; position: sticky; top: 14px; max-height: calc(100vh - 28px); overflow: auto; }
.rt-nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; font-size: 0.84rem; color: var(--ink, #0F1E3A); text-decoration: none; }
.rt-nav a:hover { background: var(--bg); }
.rt-nav a.is-active { background: var(--green); color: #fff; }
.rt-nav a.is-active b { background: rgba(255,255,255,.22); color: #fff; }
.rt-nav a.is-zero { color: var(--muted-2); }
.rt-nav b { min-width: 24px; padding: 1px 7px; border-radius: 999px; background: var(--bg); font-size: 0.74rem; text-align: center; color: var(--muted); }
.rt-nav__all { font-weight: 700; margin-bottom: 4px; }
.rt-nav__group { display: flex; justify-content: space-between; align-items: center; margin: 12px 10px 4px; font-size: 0.72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted-2); }
.rt-nav__group b { background: none; }
.rt-main { min-width: 0; }
.rt-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rt-status select { min-width: 210px; max-width: 100%; }
.rt-notify { display: inline-flex; align-items: center; gap: 5px; font-size: 0.8rem; color: var(--muted); white-space: nowrap; }
.rt-pd td:first-child { width: 190px; color: var(--muted); }
.rt-pd__sub { background: var(--bg); text-align: left; font-size: 0.8rem; text-transform: uppercase; letter-spacing: .04em; }
.rt-ssn { font-family: ui-monospace, Consolas, monospace; letter-spacing: .04em; }
@media (max-width: 1000px) { .rt { grid-template-columns: 1fr; } .rt-nav { position: static; max-height: none; } }
.rt-status select, .rt-search input[type=search] { padding: 8px 11px; border: 1px solid var(--border); border-radius: 9px; background: #fff; font-family: inherit; font-size: 0.86rem; color: inherit; }
.rt-search input[type=search] { min-width: 240px; }
.rt-status select:focus, .rt-search input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-050); }
.rt-main .ad-table td:first-child { min-width: 220px; }

/* ---------- Settings → Features: compact, collapsible ---------- */
.ft-grp { border: 1px solid var(--border); border-radius: 10px; margin-top: 8px; }
.ft-grp summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; font-weight: 700; font-size: 0.88rem; }
.ft-grp summary::-webkit-details-marker { display: none; }
.ft-grp summary span { flex: 1; }
.ft-grp summary em { font-style: normal; font-weight: 600; font-size: 0.76rem; color: var(--muted-2); }
.ft-grp summary .ic { width: 15px; height: 15px; color: var(--muted-2); transition: transform .2s ease; }
.ft-grp[open] summary .ic { transform: rotate(180deg); }
.ft-grp[open] summary { border-bottom: 1px solid var(--border); }
.ft-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px; padding: 10px; }
.ft { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; font-size: 0.83rem; font-weight: 600; transition: border-color .15s, background .15s; }
.ft:hover { border-color: var(--green); }
.ft:has(input:checked) { background: var(--green-050); border-color: var(--green); }
.ft input { width: 15px; height: 15px; margin: 0; accent-color: var(--green); flex: none; }
.ad-nav a.ad-nav__sub { padding-left: 14px; padding-right: 10px; font-size: 0.8rem; gap: 8px; }
.rt-hist { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; margin: -4px 0 16px; font-size: 0.8rem; color: var(--muted); }
.rt-hist span + span::before { content: "←"; margin-right: 14px; color: var(--muted-2); }
.rt-hist em { font-style: normal; color: var(--muted-2); }

/* ---------- sidebar: pipeline stages as collapsible tabs ---------- */
.ad-navtab { margin: 4px 0; border-radius: 10px; }
.ad-navtab summary { list-style: none; display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 10px; cursor: pointer;
  font-size: 0.74rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: rgba(255,255,255,.62); user-select: none; transition: background .15s, color .15s; }
.ad-navtab summary::-webkit-details-marker { display: none; }
.ad-navtab summary:hover { background: rgba(255,255,255,.06); color: #fff; }
.ad-navtab summary:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.ad-navtab summary .ic { width: 14px; height: 14px; flex: none; transition: transform .2s ease; }
.ad-navtab[open] summary { color: #fff; background: rgba(255,255,255,.05); }
.ad-navtab[open] summary .ic { transform: rotate(180deg); }
.ad-navtab[open] { background: rgba(255,255,255,.025); padding-bottom: 4px; }
.ad-navtab a.ad-nav__sub { margin-left: 6px; }
.ad-navtab summary > span:first-child { flex: 1; }
.ad-navtab summary .ad-nav__count { margin-left: 0; }

/* ---------- Settings → Features: PIN lock ---------- */
.ft-lock { display: flex; align-items: center; gap: 10px; padding: 12px 16px; flex-wrap: wrap; }
.ft-lock .ic { width: 16px; height: 16px; color: var(--muted-2); }
.ft-lock strong { font-size: 0.9rem; }
.ft-lock span { font-size: 0.76rem; color: var(--muted-2); margin-right: auto; }
.ft-lock input { width: 110px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; font: inherit; font-size: 0.85rem; letter-spacing: .2em; }
.ft-lock input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-050); }
.ft-open__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ft-open__head .ic { width: 16px; height: 16px; }
.ft-open__head strong { font-size: 0.9rem; }
.ft-open__head span { font-size: 0.76rem; color: #0a7a3e; margin-right: auto; }

/* ---------- pipeline client page: documents + internal comments ---------- */
.rt-sub { margin: 18px 0 10px; font-size: 0.9rem; }
.rt-send { margin-top: 18px; border: 1px dashed var(--border); border-radius: 12px; padding: 12px 14px; }
.rt-send summary { cursor: pointer; font-weight: 700; font-size: 0.88rem; display: flex; align-items: center; gap: 8px; list-style: none; }
.rt-send summary::-webkit-details-marker { display: none; }
.rt-send summary .ic { width: 16px; height: 16px; color: var(--green); }
.rt-send[open] summary { margin-bottom: 8px; }
.rt-notes { border-left: 4px solid #F59E0B; }
.rt-notes .ad-panel__head .ic { color: #B45309; }
.rt-notes__form { display: grid; gap: 8px; margin-bottom: 16px; }
.rt-notes__form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 0.9rem; resize: vertical; background: #FFFBEB; }
.rt-notes__form textarea:focus { outline: none; border-color: #F59E0B; box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.rt-notes__form button { justify-self: start; }
.rt-notes__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rt-notes__list li { padding: 12px 14px; border-radius: 10px; background: #FFFBEB; border: 1px solid #FDE68A; }
.rt-notes__meta { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--muted); }
.rt-notes__meta form { margin-left: auto; }
.rt-notes__body { margin-top: 6px; font-size: 0.9rem; color: var(--ink, #0F1E3A); overflow-wrap: anywhere; }
.rt-notecount { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px; padding: 1px 7px; border-radius: 999px; background: #FEF3C7; color: #92400E; font-size: 0.72rem; font-weight: 700; text-decoration: none; vertical-align: 1px; }
.rt-notecount .ic { width: 12px; height: 12px; }

/* ---------- pipeline list: Comments column ---------- */
.rt-th-note { font-weight: 600; text-transform: none; letter-spacing: 0; color: #B45309; font-size: 0.7rem; margin-left: 4px; }
.rt-notecell { min-width: 170px; max-width: 260px; }
.rt-notelast { display: flex; align-items: flex-start; gap: 6px; margin-bottom: 6px; padding: 6px 9px; border-radius: 8px; background: #FFFBEB; border: 1px solid #FDE68A; color: #78350F; font-size: 0.78rem; line-height: 1.35; text-decoration: none; }
.rt-notelast .ic { width: 13px; height: 13px; flex: none; margin-top: 2px; color: #B45309; }
.rt-notelast span { flex: 1; overflow-wrap: anywhere; }
.rt-notelast b { flex: none; font-size: 0.7rem; color: #B45309; }
.rt-noteadd { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; border: 1px dashed #F59E0B; color: #B45309; font-size: 0.76rem; font-weight: 700; text-decoration: none; }
.rt-noteadd:hover { background: #FFFBEB; }
.rt-noteadd .ic { width: 12px; height: 12px; }
.rt-notecell { min-width: 210px; }

/* ---------- pipeline list: inline comment box (right of Status) ---------- */
.rt-notecell { min-width: 230px; }
.rt-noteform { display: grid; gap: 6px; }
.rt-noteform textarea { width: 100%; min-height: 54px; padding: 7px 9px; border: 1px solid #FDE68A; border-radius: 8px; background: #FFFBEB; font: inherit; font-size: 0.8rem; resize: vertical; }
.rt-noteform textarea:focus { outline: none; border-color: #F59E0B; box-shadow: 0 0 0 3px rgba(245,158,11,.18); }
.rt-noteform__btn { justify-self: start; display: inline-flex; align-items: center; gap: 4px; background: #F59E0B; color: #fff; border: 0; }
.rt-noteform__btn:hover { background: #D97706; }
.rt-noteform__btn .ic { width: 12px; height: 12px; }

/* ---------- single editable comment ---------- */
.rt-notes__bar, .rt-noteform__bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rt-noteform__bar span { font-size: 0.72rem; color: var(--muted-2); }

/* ---------- client ↔ team messages (portal + admin) ---------- */
.msg-thread { list-style: none; margin: 4px 0 0; padding: 4px 2px; display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; }
.msg-day { align-self: center; font-size: 0.72rem; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: .05em; margin: 6px 0 0; }
.msg { max-width: min(78%, 620px); padding: 10px 14px; border-radius: 14px; font-size: 0.9rem; line-height: 1.5; }
.msg--them { align-self: flex-start; background: var(--bg, #F4F7FC); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.msg--me { align-self: flex-end; background: var(--green-050, #EEF3FD); border: 1px solid #C9D8F7; border-bottom-right-radius: 4px; }
.msg__meta { font-size: 0.72rem; color: var(--muted-2); margin-bottom: 3px; }
.msg__meta strong { color: var(--ink, #0F1E3A); }
.msg__body { overflow-wrap: anywhere; }
.msg-compose { display: grid; gap: 8px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.msg-compose label { font-weight: 700; font-size: 0.86rem; }
.msg-compose textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 0.92rem; resize: vertical; }
.msg-compose textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-050); }
.msg-compose__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.msg-new { display: inline-flex; align-items: center; gap: 4px; margin: 3px 0 2px; padding: 1px 8px; border-radius: 999px; background: #E0EAFF; color: #1D4ED8; font-size: 0.72rem; font-weight: 700; text-decoration: none; }
.msg-new .ic { width: 12px; height: 12px; }
@media (max-width: 600px) { .msg { max-width: 92%; } }

/* ---------- admin login: code step ---------- */
.ad-otp-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.ad-linkbtn { background: none; border: 0; padding: 0; color: var(--green); font: inherit; font-size: 0.84rem; font-weight: 600; cursor: pointer; }
.ad-linkbtn:hover { text-decoration: underline; }

/* ---------- comment history in the pipeline list ---------- */
.rt-notehist { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; max-height: 190px; overflow-y: auto; }
.rt-notehist li { padding: 6px 9px; border-radius: 8px; background: #FFFBEB; border: 1px solid #FDE68A; font-size: 0.78rem; line-height: 1.4; color: #78350F; }
.rt-notehist span { display: block; overflow-wrap: anywhere; }
.rt-notehist em { display: block; margin-top: 2px; font-style: normal; font-size: 0.68rem; color: #B45309; }

/* ---------- edit / delete on each internal comment ---------- */
.rt-notehist .note-item { padding: 6px 9px; border-radius: 8px; background: #FFFBEB; border: 1px solid #FDE68A; font-size: 0.78rem; line-height: 1.4; color: #78350F; }
.note-item__body { display: block; overflow-wrap: anywhere; }
.rt-notehist .note-item em { display: block; margin-top: 2px; font-style: normal; font-size: 0.68rem; color: #B45309; }
.note-item__acts { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-top: 4px; }
.note-edit summary, .note-del { display: inline-flex; align-items: center; gap: 3px; list-style: none; cursor: pointer; background: none; border: 0; padding: 0; font: inherit; font-size: 0.72rem; font-weight: 700; color: #B45309; }
.note-del { color: #B42318; }
.note-edit summary::-webkit-details-marker { display: none; }
.note-edit summary .ic, .note-del .ic { width: 12px; height: 12px; }
.note-edit[open] { flex-basis: 100%; }
.note-edit form { display: grid; gap: 6px; margin-top: 6px; }
.note-edit textarea { width: 100%; padding: 6px 8px; border: 1px solid #F59E0B; border-radius: 8px; background: #fff; font: inherit; font-size: 0.8rem; resize: vertical; }
.note-edit .rt-noteform__btn { justify-self: start; }
.rt-notes__list .note-item { padding: 12px 14px; border-radius: 10px; background: #FFFBEB; border: 1px solid #FDE68A; }
.rt-notehist:has(.note-edit[open]) { max-height: none; }

/* ---------- pipeline: clients not opened yet ---------- */
.ad-nav__new { min-width: 20px; padding: 0 6px; border-radius: 999px; background: #EF4444; color: #fff; font-size: 0.68rem; font-weight: 800; text-align: center; line-height: 18px; box-shadow: 0 0 0 2px rgba(239,68,68,.25); }
.ad-nav a .ad-nav__new { margin-left: auto; }
.ad-nav a .ad-nav__new + .ad-nav__count { margin-left: 6px; }
.ad-navtab summary .ad-nav__new { margin-left: 0; }
.ad-navtab.has-new > summary { color: #FCA5A5; background: rgba(239,68,68,.12); }
.ad-navtab.has-new > summary:hover { color: #fff; }
.ad-nav a.ad-nav__sub.has-new:not(.is-active) { color: #FECACA; }
.rt-new { display: inline-block; padding: 1px 7px; border-radius: 999px; background: #FEE2E2; color: #B91C1C; font-size: 0.68rem; font-weight: 800; vertical-align: 1px; }
.ad-navtab summary > span:first-child { white-space: nowrap; }
.ad-navtab.has-new > summary { letter-spacing: .02em; gap: 6px; }
