:root {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --surface-2: #f0f1f3;
  --border: #e2e4e8;
  --text: #14151a;
  --text-muted: #5c6070;
  --brand-black: #000000;
  --brand-orange: #FF5F00;
  --brand-orange-soft: #fff1e8;
  --green: #1a7f4e;
  --green-soft: #e6f6ee;
  --red: #b42318;
  --red-soft: #fdecea;
  --amber: #b4690e;
  --amber-soft: #fff1dc;
  --blue: #2b6cb0;
  --blue-soft: #e8f1fb;
  --gray-soft: #eef0f3;
  --shadow: 0 1px 2px rgba(20,21,26,0.06), 0 1px 8px rgba(20,21,26,0.04);
  --radius: 10px;
  --logo: url("logo-black.png");
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0c0f;
    --surface: #16171c;
    --surface-2: #1d1f26;
    --border: #2a2c34;
    --text: #eceef2;
    --text-muted: #9a9db0;
    --brand-orange-soft: #2a1a10;
    --green: #4ade91;
    --green-soft: #10281c;
    --red: #ff8a80;
    --red-soft: #2c1614;
    --amber: #ffb020;
    --amber-soft: #2b2008;
    --blue: #7db8f0;
    --blue-soft: #16283a;
    --gray-soft: #23252c;
    --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 1px 8px rgba(0,0,0,0.3);
    --logo: url("logo-white.png");
  }
}
:root[data-theme="dark"] {
  --bg: #0b0c0f;
  --surface: #16171c;
  --surface-2: #1d1f26;
  --border: #2a2c34;
  --text: #eceef2;
  --text-muted: #9a9db0;
  --brand-orange-soft: #2a1a10;
  --green: #4ade91;
  --green-soft: #10281c;
  --red: #ff8a80;
  --red-soft: #2c1614;
  --amber: #ffb020;
  --amber-soft: #2b2008;
  --blue: #7db8f0;
  --blue-soft: #16283a;
  --gray-soft: #23252c;
  --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 1px 8px rgba(0,0,0,0.3);
  --logo: url("logo-white.png");
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}
a { color: var(--brand-orange); }
[hidden] { display: none !important; }

/* ---- Top bar: light, sticky, frosted. Brand + client switcher on the
   left, main nav in the middle, account menu on the right. ---- */
header.topbar {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1600px; margin: 0 auto; padding: 0 20px; height: 60px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px;
}
.topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-right { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }

.brand { display: flex; align-items: center; gap: 10px; }
button.brand-home {
  background: none; border: none; padding: 0; margin: 0; cursor: pointer;
  color: inherit; font: inherit; text-align: left;
}
/* Pragmatic Solutions icon: black on light, white on dark (--logo). */
.brand .mark {
  width: 34px; height: 30px; background: var(--logo) center / contain no-repeat; flex-shrink: 0;
}
header.topbar .brand .mark { width: 26px; height: 23px; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; color: var(--text); }
.brand h1 { font-size: 17px; margin: 0; font-weight: 600; letter-spacing: 0.2px; }
.brand .sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.topbar-divider { width: 1px; height: 22px; background: var(--border); flex-shrink: 0; }

/* Client switcher */
.client-switch {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0; max-width: 280px;
  padding: 5px 10px 5px 6px; border: 1px solid transparent; border-radius: 999px;
  background: transparent; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.client-switch:hover, .client-switch[aria-expanded="true"] { background: var(--surface-2); border-color: var(--border); }
.client-switch:disabled { cursor: default; background: transparent; border-color: transparent; }
.client-switch:disabled .chev { display: none; }
.client-switch-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-switch-logo .client-logo { width: 24px; height: 24px; border-radius: 6px; font-size: 10px; }
.chev {
  width: 7px; height: 7px; flex-shrink: 0; margin: -3px 2px 0 2px;
  border-right: 1.5px solid var(--text-muted); border-bottom: 1.5px solid var(--text-muted); transform: rotate(45deg);
}

/* Main nav */
.topnav { display: flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 999px; border: 1px solid var(--border); }
.topnav-link {
  border: none; background: transparent; cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--text-muted); padding: 5px 16px; border-radius: 999px; transition: background 0.15s, color 0.15s;
}
.topnav-link:hover { color: var(--text); }
.topnav-link.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(20,21,26,0.08), 0 0 0 1px var(--border); }

/* Account */
.avatar-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 3px;
  border: 1px solid transparent; border-radius: 999px; background: transparent; cursor: pointer;
}
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { background: var(--surface-2); border-color: var(--border); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--brand-orange); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: 0.02em;
}

/* Dropdown menus */
.menu-wrap { position: relative; min-width: 0; }
.menu {
  position: absolute; top: calc(100% + 8px); left: 0; min-width: 240px; max-height: 60vh; overflow-y: auto; z-index: 40;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 6px;
  box-shadow: 0 10px 30px rgba(20,21,26,0.12), 0 2px 6px rgba(20,21,26,0.06);
}
.menu-right { left: auto; right: 0; }
.menu-header { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu-email { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-chip {
  display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11px; font-weight: 600;
  text-transform: capitalize; background: var(--brand-orange-soft); color: var(--brand-orange);
}
.menu-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: none; border-radius: 8px;
  background: transparent; cursor: pointer; font-size: 13px; color: var(--text); text-align: left;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--surface-2); outline: none; }
.menu-item .client-logo { width: 26px; height: 26px; border-radius: 6px; font-size: 10px; }
.menu-item .menu-item-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-item.current { font-weight: 600; }
.menu-item.current::after {
  content: ""; width: 5px; height: 9px; margin-right: 4px; flex-shrink: 0;
  border-right: 2px solid var(--brand-orange); border-bottom: 2px solid var(--brand-orange); transform: rotate(45deg);
}

.icon-btn { font-size: 17px; padding: 6px 10px; line-height: 1; }

button, select, input[type="text"], input[type="email"], textarea {
  font: inherit;
  color: var(--text);
}
.btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.btn:hover { border-color: var(--brand-orange); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary { background: var(--brand-orange); border-color: var(--brand-orange); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { background: transparent; border-color: #3a3c46; color: #fff; }
.btn.ghost:hover { border-color: var(--brand-orange); }
.login-card .btn.ghost { color: var(--text); border-color: var(--border); }
.login-card .btn.ghost:hover { border-color: var(--brand-orange); color: var(--brand-orange); }
.btn.danger { color: var(--red); border-color: var(--red-soft); }
.btn.danger:hover { border-color: var(--red); }

main { padding: 18px 20px 60px; max-width: 1600px; margin: 0 auto; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow);
  font: inherit; color: inherit; text-align: left; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.stat-card:hover { border-color: color-mix(in srgb, var(--brand-orange) 45%, var(--border)); transform: translateY(-1px); }
.stat-card:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 2px; }
.stat-card.active { border-color: var(--brand-orange); box-shadow: 0 0 0 1px var(--brand-orange), var(--shadow); }
.stat-card .num { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat-card .label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.stat-card.accent-green .num { color: var(--green); }
.stat-card.accent-red .num { color: var(--red); }
.stat-card.accent-orange .num { color: var(--brand-orange); }

.toolbar {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 12px; display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center;
}
.toolbar input[type="text"] {
  flex: 1 1 220px; min-width: 160px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
}
.toolbar select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.toolbar .spacer { flex: 1 1 auto; }
.toolbar .count { font-size: 12px; color: var(--text-muted); white-space: nowrap; }

.colmenu-wrap { position: relative; }
.colmenu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
  padding: 10px; z-index: 20; max-height: 320px; overflow-y: auto; min-width: 220px;
}
.colmenu.open { display: block; }
.colmenu label { display: flex; align-items: center; gap: 8px; padding: 4px 2px; font-size: 13px; cursor: pointer; }

.table-wrap {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: auto; max-height: 68vh;
}
table { border-collapse: collapse; width: 100%; table-layout: fixed; }
thead th {
  position: sticky; top: 0; z-index: 2; background: var(--surface-2); text-align: left; padding: 10px 12px;
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.03em; color: var(--text-muted);
  border-bottom: 1px solid var(--border); cursor: pointer; white-space: nowrap; user-select: none;
}
thead th:hover { color: var(--text); }
thead th .arrow { font-size: 10px; margin-left: 4px; opacity: 0.6; }
tbody td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; overflow-wrap: anywhere; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.editable-row { cursor: pointer; }
td.wrap-cell { white-space: pre-wrap; word-break: break-word; }
td.nowrap-cell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.gray { background: var(--gray-soft); color: var(--text-muted); }
.pill.orange { background: var(--brand-orange-soft); color: var(--brand-orange); }

.comment-cell { white-space: normal; }
.comment-text { display: block; white-space: pre-wrap; word-break: break-word; }
.comment-text.truncated {
  max-height: 3.2em; overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 60%, transparent 100%);
}
.expand-link { font-size: 11px; color: var(--brand-orange); cursor: pointer; margin-top: 2px; display: inline-block; }

.empty-state { padding: 40px 20px; text-align: center; color: var(--text-muted); }

footer {
  max-width: 1600px; margin: 14px auto 0; padding: 0 20px 20px; font-size: 12px; color: var(--text-muted);
  text-align: center;
}

/* ---- Integrations ---- */
.page-head { margin: 4px 0 14px; }
.page-head h2 { margin: 0 0 4px; font-size: 20px; letter-spacing: -0.01em; }
.page-head p { margin: 0; color: var(--text-muted); font-size: 13px; }
.int-panel { display: flex; flex-direction: column; gap: 14px; }
.int-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.int-section-head { margin-bottom: 12px; }
.int-section-head h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.int-section-head p { margin: 3px 0 0; color: var(--text-muted); font-size: 12px; }
.int-count { font-size: 11px; font-weight: 700; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 7px; }
.int-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.int-card {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; row-gap: 10px;
  padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2);
}
.int-card.is-active { background: var(--surface); border-color: color-mix(in srgb, var(--green) 35%, var(--border)); }
.int-card .int-avatar { width: 38px; height: 38px; font-size: 13px; grid-row: 1; }
.int-card-body { min-width: 0; }
.int-card-name { font-weight: 600; font-size: 13px; }
.int-card-desc { color: var(--text-muted); font-size: 12px; line-height: 1.45; margin-top: 2px; }
.int-card-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.red-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.red-add input { flex: 1 1 220px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.red-term { font-weight: 600; }
.red-muted { color: var(--text-muted); font-size: 13px; }
.red-auto { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--border); }
.red-auto h3 { margin: 0 0 4px; font-size: 13px; }
.red-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.int-tag { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.int-tag.tag-low { background: var(--green-soft); color: var(--green); }
.int-tag.tag-med { background: var(--amber-soft); color: var(--amber); }
.int-tag.tag-info { background: var(--blue-soft); color: var(--blue); }
.int-empty-line { padding: 18px; text-align: center; color: var(--text-muted); font-size: 13px; border: 1px dashed var(--border); border-radius: var(--radius); }
.btn.small { padding: 4px 10px; font-size: 12px; }
.link-btn.subtle { color: var(--text-muted); font-size: 12px; }
.link-btn.subtle:hover { color: var(--brand-orange); }
.int-add { margin-top: 12px; }
.int-add-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.int-add-form input { flex: 1 1 200px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.int-add-form .form-msg { flex-basis: 100%; }
.int-request-form { display: flex; flex-direction: column; gap: 8px; }
.int-request-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.int-request-form input, .int-request-form textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font: inherit; resize: vertical;
}
.int-request-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.int-request-foot .form-msg { flex: 1; margin: 0; text-align: left; }
.int-requests { margin-top: 14px; border-top: 1px solid var(--border); }
.int-request { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.int-request:last-child { border-bottom: none; }
.int-request-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.int-request-link { font-size: 12px; word-break: break-all; }
.int-request-meta { font-size: 11px; color: var(--text-muted); }
@media (max-width: 640px) { .int-request-row { grid-template-columns: 1fr; } }

/* ---- Overview: coming soon ---- */
.coming-soon {
  max-width: 560px; margin: 48px auto; padding: 40px 32px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.coming-soon::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 160px; pointer-events: none;
  background: radial-gradient(60% 100% at 50% 0%, var(--brand-orange-soft), transparent 70%);
}
.coming-soon > * { position: relative; }
.coming-soon-art { margin: 0 auto 18px; width: 220px; }
.coming-soon-art svg { display: block; width: 100%; height: auto; }
.cs-card { fill: var(--surface); stroke: var(--border); stroke-width: 1.5; }
.cs-line { fill: var(--text); opacity: 0.18; }
.cs-line.faint { opacity: 0.1; }
.cs-bar { fill: var(--text); opacity: 0.12; }
.cs-bar.accent { fill: var(--brand-orange); opacity: 1; }
.cs-ring { fill: none; stroke: var(--gray-soft); stroke-width: 6; }
.cs-ring-fill { fill: none; stroke: var(--brand-orange); stroke-width: 6; stroke-linecap: round; }
.cs-trend { fill: none; stroke: var(--brand-orange); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.cs-dot { fill: var(--brand-orange); }
.cs-bubble { fill: var(--surface-2); stroke: var(--border); stroke-width: 1.5; stroke-linejoin: round; }
.cs-bubble.accent { fill: var(--brand-orange); stroke: var(--brand-orange); }
.cs-line.on-accent { fill: #fff; opacity: 0.9; }
.cs-line.on-accent.faint { opacity: 0.6; }
.coming-soon-badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.06em; text-transform: uppercase; background: var(--brand-orange-soft); color: var(--brand-orange);
}
.coming-soon h2 { margin: 12px 0 8px; font-size: 22px; letter-spacing: -0.01em; }
.coming-soon p { margin: 0 auto 18px; max-width: 420px; color: var(--text-muted); font-size: 14px; line-height: 1.55; }
.coming-soon-list { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.coming-soon-list li {
  padding: 5px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--border);
}
@media (max-width: 640px) { .coming-soon { margin: 20px auto; padding: 28px 18px; } }

/* ---- Login screen ---- */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px 24px;
}
.login-card .brand { flex-direction: column; justify-content: center; text-align: center; gap: 10px; margin-bottom: 18px; }
.login-card .brand .mark { width: 46px; height: 41px; }
.login-card .brand h1 { color: var(--text); font-size: 18px; }
.login-card .brand .sub { color: var(--text-muted); }
.login-card.picker-card { max-width: 560px; }
/* Fixed-width cards, wrapped and centred, so a short list doesn't leave empty columns on the right. */
.client-pick-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-bottom: 18px; }
.client-pick-grid .client-pick { flex: 0 0 150px; }
.client-pick {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 20px 12px 16px; min-height: 130px; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; font: inherit; color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.client-pick:hover, .client-pick:focus-visible { border-color: var(--brand-orange); box-shadow: var(--shadow); transform: translateY(-1px); outline: none; }
.client-pick .client-logo { width: 56px; height: 56px; }
.client-pick-name { font-weight: 600; font-size: 14px; text-align: center; }
.client-pick-hint { font-size: 11px; color: var(--text-muted); }
.client-pick.last { border-color: var(--brand-orange); }
.picker-footer {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap;
  padding-top: 12px; border-top: 1px solid var(--border); font-size: 11px; color: var(--text-muted);
}
.picker-user { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.picker-user #clientPickUser { color: var(--text); }
.picker-actions { display: flex; gap: 4px; }
.login-card .picker-actions .btn { padding: 3px 8px; font-size: 11px; font-weight: 500; border-color: transparent; color: var(--text-muted); background: transparent; }
.login-card .picker-actions .btn:hover { color: var(--brand-orange); border-color: transparent; }
.login-card p.desc { color: var(--text-muted); font-size: 13px; margin: 0 0 16px; text-align: center; }
.login-card input[type="email"], .login-card input[type="password"] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); margin-bottom: 10px;
}
.login-card .btn.primary { width: 100%; justify-content: center; padding: 10px 12px; }
.form-msg { font-size: 13px; margin-top: 12px; text-align: center; }
.form-msg.error { color: var(--red); }
.form-msg.success { color: var(--green); }
.link-btn {
  background: none; border: none; padding: 0; margin: 0; cursor: pointer; font: inherit;
  color: var(--brand-orange); text-decoration: underline;
}
.auth-switch { font-size: 13px; color: var(--text-muted); text-align: center; margin: 14px 0 0; }
#pendingScreen .desc { margin-bottom: 20px; }
#pendingScreen .btn { width: 100%; justify-content: center; }

/* ---- Modal (add/edit row) ---- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(10,10,12,0.5); display: flex; align-items: flex-start;
  justify-content: center; padding: 40px 16px; overflow-y: auto; z-index: 100;
}
.modal {
  position: relative; width: 100%; max-width: 640px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px;
}
.modal h2 { margin: 0 0 14px; font-size: 16px; }
.modal-close-icon {
  position: absolute; top: 12px; right: 12px; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: 8px;
  color: var(--text-muted); font-size: 22px; line-height: 1; cursor: pointer; padding: 0;
}
.modal-close-icon:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }

/* Add/edit row: header, scrolling sectioned body, pinned footer. */
#rowModalOverlay { align-items: center; backdrop-filter: blur(2px); }
.row-modal { max-width: 920px; padding: 0; border-radius: 14px; overflow: hidden; box-shadow: 0 24px 60px rgba(10,10,12,0.25); }
.row-modal form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); }
.row-modal-head { position: relative; display: flex; align-items: center; gap: 10px; padding: 12px 52px 12px 18px; border-bottom: 1px solid var(--border); }
.row-modal-icon { width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-orange-soft); }
.row-modal-icon svg { width: 18px; height: 18px; fill: none; stroke: var(--brand-orange); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.row-modal-titles { min-width: 0; }
.row-modal-titles h2 { margin: 0; font-size: 15px; letter-spacing: -0.01em; }
.row-modal-titles p { margin: 1px 0 0; font-size: 12px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-modal-titles p:empty { display: none; }
.row-modal-head .modal-close-icon { top: 50%; transform: translateY(-50%); right: 12px; }
.row-modal-body { overflow-y: auto; padding: 4px 18px; }
.row-form-section { padding: 10px 0 12px; border-bottom: 1px solid var(--border); }
.row-form-section:last-child { border-bottom: none; }
.row-form-section-head { margin: 0 0 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.row-form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 12px; }
.row-field { min-width: 0; }
.row-field.span-2 { grid-column: span 2; }
.row-field.span-4 { grid-column: 1 / -1; }
.row-field-label { display: block; font-size: 12px; font-weight: 600; color: var(--text); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-field-label .req { color: var(--brand-orange); }
.row-field input[type="text"], .row-field textarea {
  width: 100%; padding: 6px 9px; border: 1px solid var(--border); border-radius: 7px; background: var(--surface); font: inherit; font-size: 13px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.row-field textarea { resize: vertical; min-height: 52px; line-height: 1.4; }
.row-field input[readonly] { background: var(--surface-2); color: var(--text-muted); cursor: not-allowed; }
.row-field input.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.row-field input::placeholder, .row-field textarea::placeholder { color: color-mix(in srgb, var(--text-muted) 70%, transparent); }
.row-field input[type="text"]:focus, .row-field textarea:focus {
  outline: none; border-color: var(--brand-orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-orange) 18%, transparent);
}
.seg { display: flex; padding: 2px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; }
.seg-btn { flex: 1; border: none; background: transparent; padding: 4px 6px; border-radius: 5px; font-size: 12.5px; font-weight: 600; color: var(--text-muted); cursor: pointer; white-space: nowrap; }
.seg-btn:hover { color: var(--text); }
.seg-btn.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(20,21,26,0.1), 0 0 0 1px var(--border); }
.seg-btn.seg-muted.on { color: var(--text-muted); }
.seg-btn:focus-visible { outline: 2px solid var(--brand-orange); outline-offset: 1px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; padding-top: 5px; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch-track { position: relative; width: 38px; height: 22px; border-radius: 999px; background: var(--border); transition: background 0.15s; flex-shrink: 0; }
.switch-track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.25); transition: transform 0.15s; }
.switch input:checked + .switch-track { background: var(--red); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--brand-orange); outline-offset: 2px; }
.row-modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 10px 18px; border-top: 1px solid var(--border); background: var(--surface-2); }
.row-modal-foot .form-msg { flex: 1; margin: 0; text-align: left; }
@media (max-width: 760px) {
  .row-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row-field.span-2, .row-field.span-4 { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  #rowModalOverlay { padding: 0; align-items: stretch; }
  .row-modal { border-radius: 0; max-width: none; }
  .row-modal form { max-height: 100vh; }
}

/* ---- Epic/issue detail modal (Jira) ----
   Styled to match the "jira-epic-export-pdf" skill's branded PDF export
   (kicker / title+tick / reference / status chip / Description label /
   navy-headed tables). Follows the app's own light/dark theme (via the same
   --text/--surface/etc. variables everything else uses) rather than forcing
   a fixed light look — only the table header bar stays a constant dark navy
   in both themes (like the top navbar elsewhere in the app), since that's a
   brand accent, not body content. Montserrat is loaded in index.html for
   this modal only. */
.epic-link {
  color: var(--brand-orange); text-decoration: underline; cursor: pointer; background: none; border: none;
  padding: 0; font: inherit;
}
.epic-link:hover { filter: brightness(1.1); }
.jira-loading { color: var(--text-muted); font-size: 13px; }

.jira-modal {
  --jira-orange: var(--brand-orange);
  --jira-navy: var(--text);
  --jira-slate: var(--text-muted);
  --jira-surface: var(--surface-2);
  --jira-hairline: var(--border);
  --jira-header-navy: #0D131D;
  --jira-green: var(--green);
  --jira-green-soft: var(--green-soft);
  --jira-amber-ink: var(--amber);
  --jira-amber-soft: var(--amber-soft);
  --jira-blue: var(--blue);
  --jira-blue-soft: var(--blue-soft);
  max-width: 760px;
  background: var(--surface);
  color: var(--jira-navy);
  border: 1px solid var(--jira-hairline);
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, sans-serif;
}
.jira-modal .modal-close-icon { color: var(--jira-slate); }
.jira-status-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.jira-freshness { font-size: 12px; color: var(--jira-slate); display: inline-flex; gap: 8px; align-items: center; }
.jira-freshness .link-btn { font-size: 12px; }
.jira-export-btn { position: absolute; top: 14px; right: 56px; padding: 5px 12px; font-size: 12px; font-weight: 600; }
.jira-export-btn:not(:disabled):hover { border-color: var(--brand-orange); color: var(--brand-orange); }
.jira-modal .modal-close-icon:hover { background: var(--jira-surface); color: var(--jira-navy); border-color: var(--jira-hairline); }
.jira-modal .jira-loading { color: var(--jira-slate); }
.jira-modal .epic-link { color: var(--jira-orange); }

.jira-breadcrumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; font-size: 12px;
}
.jira-breadcrumb-link {
  background: none; border: none; padding: 0; cursor: pointer; color: var(--jira-orange); font: inherit; font-weight: 600;
}
.jira-breadcrumb-link:hover { text-decoration: underline; }
.jira-breadcrumb-current { color: var(--jira-slate); font-weight: 700; }
.jira-breadcrumb-sep { color: var(--jira-hairline); }

.jira-kicker {
  color: var(--jira-orange); font-weight: 800; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.06em; margin-bottom: 8px;
}
.jira-title-row { display: flex; align-items: flex-start; gap: 10px; padding-right: 130px; }
.jira-title-tick { width: 4px; flex-shrink: 0; margin-top: 4px; align-self: stretch; background: var(--jira-orange); border-radius: 2px; }
.jira-modal h2 { margin: 0; font-size: 20px; font-weight: 800; color: var(--jira-navy); line-height: 1.3; }
.jira-reference { color: var(--jira-slate); font-size: 13px; margin: 4px 0 12px 14px; }
#jiraModalStatus { margin: 0 0 18px 14px; }

.jira-status-chip {
  display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.jira-status-chip.status-delivered { background: var(--jira-green-soft); color: var(--jira-green); }
.jira-status-chip.status-progress { background: var(--jira-amber-soft); color: var(--jira-amber-ink); }
.jira-status-chip.status-testing { background: var(--jira-blue-soft); color: var(--jira-blue); }

.jira-scroll {
  max-height: 60vh; overflow-y: auto; overflow-x: hidden;
  padding-right: 12px; margin-right: -12px; scrollbar-gutter: stable;
}

.jira-section-label {
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--jira-navy); margin: 4px 0 12px; padding-bottom: 8px; border-bottom: 2px solid var(--jira-navy);
}

.jira-body { font-size: 14px; line-height: 1.65; color: var(--jira-navy); }
.jira-body p { margin: 0 0 12px; }
.jira-body ul, .jira-body ol { margin: 0 0 12px; padding-left: 22px; }
.jira-body li { margin-bottom: 4px; }
.jira-body blockquote {
  margin: 0 0 12px; padding: 10px 14px; border-left: 3px solid var(--jira-orange);
  background: var(--jira-surface); color: var(--jira-slate); border-radius: 0 6px 6px 0;
}
.jira-body h1, .jira-body h2, .jira-body h3, .jira-body h4 { margin: 18px 0 8px; color: var(--jira-navy); font-weight: 700; }
.jira-body h1:first-child, .jira-body h2:first-child, .jira-body h3:first-child { margin-top: 0; }
.jira-body code { background: var(--jira-surface); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.jira-body pre { background: var(--jira-surface); padding: 10px; border-radius: 8px; overflow-x: auto; }
.jira-body a { color: var(--jira-orange); word-break: break-word; }
.jira-body hr { border: none; border-top: 1px solid var(--jira-hairline); margin: 14px 0; }
.jira-body table { border-collapse: collapse; width: 100%; margin: 0 0 14px; font-size: 13px; }
.jira-body th, .jira-body td { border: 1px solid var(--jira-hairline); padding: 6px 10px; text-align: left; vertical-align: top; }
.jira-body th { background: var(--jira-header-navy); color: #FFFFFF; font-weight: 700; }

.jira-tabs { display: flex; gap: 20px; margin: 4px 0 12px; border-bottom: 2px solid var(--jira-hairline); }
.jira-tab {
  background: none; border: none; cursor: pointer; font: inherit;
  font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--jira-slate); padding: 0 0 8px; margin-bottom: -2px; border-bottom: 2px solid transparent;
}
.jira-tab:hover { color: var(--jira-navy); }
.jira-tab.active { color: var(--jira-navy); border-bottom-color: var(--jira-orange); }
.jira-tab-count { color: var(--jira-slate); font-weight: 700; }
.jira-tab-count:empty { display: none; }
.jira-child-row {
  display: grid; grid-template-columns: 90px 1fr auto auto; gap: 10px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--jira-hairline); font-size: 13px;
}
.jira-child-row:last-child { border-bottom: none; }
.jira-child-row .epic-link { text-align: left; }
.jira-child-summary { color: var(--jira-navy); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jira-child-type { color: var(--jira-slate); font-size: 11px; text-transform: uppercase; white-space: nowrap; }

.jira-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.jira-tag.tag-low { background: var(--jira-green-soft); color: var(--jira-green); }
.jira-tag.tag-med { background: var(--jira-amber-soft); color: var(--jira-amber-ink); }
.jira-tag.tag-info { background: var(--jira-blue-soft); color: var(--jira-blue); }

@media (max-width: 640px) {
  .jira-child-row { grid-template-columns: 70px 1fr; grid-template-rows: auto auto; }
  .jira-child-type { grid-column: 2; }
}

/* ---- Admin panel ---- */
.admin-panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.admin-panel + .admin-panel { margin-top: 16px; }
.admin-tabs { display: flex; gap: 20px; margin: 0 0 16px; border-bottom: 2px solid var(--border); }
.admin-tab {
  background: none; border: none; border-bottom: 2px solid transparent; margin-bottom: -2px;
  padding: 8px 2px; font: inherit; font-size: 14px; font-weight: 600; color: var(--text-muted); cursor: pointer;
}
.admin-tab:hover { color: var(--text); }
.admin-tab.active { color: var(--text); border-bottom-color: var(--brand-orange); }
.admin-tabs ~ .admin-panel { margin-top: 0; }
.admin-panel h2 { margin: 0 0 12px; font-size: 15px; }
.settings-desc { font-size: 13px; color: var(--text-muted); margin: 0 0 14px; line-height: 1.5; }
.add-user-form { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.add-user-form input[type="email"], .add-user-form input[type="password"], .add-user-form input[type="text"] {
  flex: 1 1 200px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2);
}
.add-user-form select { padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
table.users-table { width: 100%; border-collapse: collapse; }
table.users-table th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--text-muted); padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.users-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.users-table td.actions-cell { white-space: nowrap; text-align: right; }
table.users-table td.actions-cell .btn + .btn { margin-left: 6px; }
.domain-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.domain-row:last-child { border-bottom: none; }
.domain-row .domain-meta { color: var(--text-muted); font-size: 12px; }
/* Pill-shaped dropdown (Users table roles). Tinted by data-role. */
.pill-select {
  appearance: none; -webkit-appearance: none; font: inherit; font-size: 12px; font-weight: 600;
  padding: 5px 28px 5px 12px; border-radius: 999px; border: 1px solid var(--border); cursor: pointer;
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237a7f8e' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-position: right 11px center; background-size: 10px 6px; background-repeat: no-repeat;
  color: var(--text); transition: border-color 0.15s, box-shadow 0.15s;
}
.pill-select:hover:not(:disabled) { border-color: color-mix(in srgb, var(--brand-orange) 50%, var(--border)); }
.pill-select:focus-visible { outline: none; border-color: var(--brand-orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-orange) 18%, transparent); }
.pill-select:disabled { opacity: 0.6; cursor: not-allowed; }
.pill-select.small { font-size: 11.5px; padding: 3px 24px 3px 10px; background-position: right 9px center; }
.pill-select[data-role="pending"] { color: var(--text-muted); background-color: var(--surface-2); }
.pill-select[data-role="viewer"] { color: var(--blue); background-color: var(--blue-soft); border-color: transparent; }
.pill-select[data-role="contributor"] { color: var(--green); background-color: var(--green-soft); border-color: transparent; }
.pill-select[data-role="editor"] { color: var(--amber); background-color: var(--amber-soft); border-color: transparent; }
.pill-select.add { color: var(--text-muted); border-style: dashed; width: 100%; }
.pill-select option { color: var(--text); background: var(--surface); }

/* Client access: summary button + panel. */
.access-wrap { position: relative; }
.access-summary {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 10px 4px 5px;
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: 12.5px; color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.access-summary:hover, .access-summary[aria-expanded="true"] { border-color: color-mix(in srgb, var(--brand-orange) 50%, var(--border)); background: var(--surface-2); }
.access-summary.empty { padding-left: 12px; color: var(--text-muted); border-style: dashed; }
.access-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.access-role { color: var(--text-muted); font-weight: 500; }
.logo-stack { display: inline-flex; }
.logo-stack .client-logo { width: 22px; height: 22px; border-radius: 6px; font-size: 9px; border: 2px solid var(--surface); box-sizing: content-box; background-color: var(--surface); }
.logo-stack .client-logo + .client-logo { margin-left: -8px; }
.access-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 25; width: 320px; padding: 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(20,21,26,0.12), 0 2px 6px rgba(20,21,26,0.06);
}
.access-panel-head { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); padding: 4px 6px 8px; }
.access-empty { font-size: 12.5px; color: var(--text-muted); padding: 4px 6px 8px; }
.access-row { display: flex; align-items: center; gap: 8px; padding: 6px; border-radius: 8px; }
.access-row:hover { background: var(--surface-2); }
.access-row .client-logo { width: 24px; height: 24px; border-radius: 6px; font-size: 9px; flex-shrink: 0; }
.access-row-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icon-remove { border: none; background: transparent; color: var(--text-muted); font-size: 16px; line-height: 1; width: 24px; height: 24px; border-radius: 6px; cursor: pointer; }
.icon-remove:hover { color: var(--red); background: var(--red-soft); }
.access-add { padding: 6px 6px 2px; border-top: 1px solid var(--border); margin-top: 4px; }
.domain-add { display: flex; gap: 6px; }
.domain-add input { flex: 1; min-width: 0; padding: 5px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 12.5px; }
.domain-add input:focus { outline: none; border-color: var(--brand-orange); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-orange) 18%, transparent); }
.domain-icon { width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; background: var(--brand-orange-soft); }
.domain-icon svg { width: 14px; height: 14px; fill: none; stroke: var(--brand-orange); stroke-width: 1.7; }
.access-summary .domain-icon { margin-left: 1px; }
.fixed-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: var(--gray-soft); color: var(--text); border: 1px solid var(--border); cursor: default; user-select: none;
}
.fixed-badge.muted { color: var(--text-muted); }
.domain-row .domain-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.domain-row select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); font-size: 12px; }
.invite-box { margin: 0 0 16px; padding: 12px; border: 1px solid var(--brand-orange); border-radius: 8px; background: var(--brand-orange-soft); }
.invite-label { font-size: 13px; margin-bottom: 8px; }
.invite-row { display: flex; gap: 8px; }
.invite-row input { flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
/* Clients tab: the clients table on the left, "New client" beside it. */
.clients-layout:not([hidden]) { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.clients-layout > .admin-panel + .admin-panel { margin-top: 0; }
.clients-layout > .admin-panel:last-child { position: sticky; top: 16px; }
.add-client-form { display: flex; flex-direction: column; gap: 10px; }
.add-client-form input[type="text"] { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); }
.add-client-form .btn { justify-content: center; text-align: center; }
.dropzone {
  display: flex; align-items: center; gap: 12px; padding: 14px; min-height: 84px; cursor: pointer;
  border: 2px dashed var(--border); border-radius: var(--radius); background: var(--surface-2);
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone:focus-visible, .dropzone.dragging { border-color: var(--brand-orange); background: var(--brand-orange-soft); outline: none; }
.dropzone.has-file { border-style: solid; }
.dropzone-preview { width: 52px; height: 52px; object-fit: contain; flex-shrink: 0; }
.dropzone-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: 13px; }
.dropzone-text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone-text span { color: var(--text-muted); font-size: 12px; }
.dropzone:not(.has-file) .dropzone-text { width: 100%; align-items: center; text-align: center; }
@media (max-width: 900px) {
  .clients-layout:not([hidden]) { grid-template-columns: 1fr; }
  .clients-layout > .admin-panel:last-child { position: static; }
}
.clients-table td { vertical-align: middle; }
.clients-table .logo-col { width: 72px; }
.clients-table .client-name { font-weight: 600; }
.clients-table .domain-meta, .client-domains .domain-meta { color: var(--text-muted); font-size: 12px; }
.logo-cell { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.logo-btn { background: none; border: none; padding: 0; cursor: pointer; border-radius: 8px; }
.logo-btn:hover .client-logo { outline: 2px solid var(--brand-orange); outline-offset: 2px; }
.client-logo { display: block; width: 44px; height: 44px; object-fit: contain; border-radius: 8px; }
.client-logo.placeholder {
  display: flex; align-items: center; justify-content: center; background: var(--gray-soft);
  color: var(--text-muted); font-weight: 700; font-size: 14px; border: 1px dashed var(--border);
}
.client-block { padding: 4px 0 10px; border-bottom: 1px solid var(--border); }
.client-block:last-child { border-bottom: none; }
.client-block .domain-row { border-bottom: none; padding-bottom: 4px; }

@media (max-width: 760px) {
  .topbar-inner { grid-template-columns: 1fr auto; padding: 0 12px; }
  .topnav { display: none; }
  .brand-name, .topbar-divider { display: none; }
}
@media (max-width: 640px) {
  main { padding: 14px 12px 40px; }
  .brand h1 { font-size: 15px; }
  .table-wrap { max-height: 60vh; }
}
