:root {
  color-scheme: light;
  --ink: #0f172a;
  --muted: #475569;
  --subtle: #64748b;
  --line: #e2e8f0;
  --line-strong: #cbd5e1;
  --canvas: #f8fafc;
  --panel: #ffffff;
  --panel-soft: #f1f5f9;
  --accent: #0d655c;
  --accent-dark: #084b45;
  --accent-hover: #0a564e;
  --accent-glow: rgba(13, 101, 92, 0.22);
  --accent-soft: #e6f4f2;
  --teal-light: #149a88;
  --cyan-accent: #06b6d4;
  --blue: #0284c7;
  --blue-soft: #f0f9ff;
  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --success: #16a34a;
  --success-soft: #f0fdf4;
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 4px 0 rgba(15, 23, 42, 0.05), 0 1px 2px -1px rgba(15, 23, 42, 0.03);
  --shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 35px -10px rgba(15, 23, 42, 0.12), 0 10px 15px -5px rgba(15, 23, 42, 0.08);
  --shadow-glow: 0 0 20px rgba(13, 101, 92, 0.15);
  --sidebar: 280px;
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --glass-bg: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(226, 232, 240, 0.85);
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }

img {
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

html { min-width: 320px; background: var(--canvas); }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(rgba(19, 104, 94, 0.025) 1px, transparent 1px) 0 0 / 100% 48px,
    var(--canvas);
  font-size: 15px;
  line-height: 1.5;
}

/* The startup screen locks only the main application while it is loading.
   Public confirmation pages do not use that loader and must always scroll. */
body:not(.startup-ready):not(.public-page) { overflow: hidden; }

.startup-loader {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 34px;
  padding: 32px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 42%, #0a3d40 0%, #051a1f 62%, #030f13 100%);
  color: #fff;
  opacity: 1;
  transition: opacity .5s cubic-bezier(0.4, 0, 0.2, 1), visibility .5s ease;
}
.startup-loader.is-complete { visibility: hidden; opacity: 0; pointer-events: none; }

.startup-loader-aurora {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  filter: blur(60px);
}
.startup-loader-aurora i {
  position: absolute;
  border-radius: 50%;
  opacity: 0.5;
  animation: startup-aurora-drift 16s ease-in-out infinite;
}
.startup-loader-aurora i:nth-child(1) { top: -18%; left: -8%; width: 46vw; height: 46vw; background: radial-gradient(circle, rgba(20, 154, 136, 0.55), transparent 70%); animation-duration: 17s; }
.startup-loader-aurora i:nth-child(2) { right: -12%; bottom: -16%; width: 50vw; height: 50vw; background: radial-gradient(circle, rgba(6, 182, 212, 0.4), transparent 70%); animation-duration: 21s; animation-delay: -6s; }
.startup-loader-aurora i:nth-child(3) { top: 32%; left: 38%; width: 34vw; height: 34vw; background: radial-gradient(circle, rgba(94, 234, 212, 0.32), transparent 72%); animation-duration: 13s; animation-delay: -3s; }

.startup-loader-grid {
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    linear-gradient(rgba(148, 233, 219, 0.05) 1px, transparent 1px) 0 0 / 100% 46px,
    linear-gradient(90deg, rgba(148, 233, 219, 0.04) 1px, transparent 1px) 0 0 / 46px 100%;
  mask-image: radial-gradient(circle at center, #000 16%, transparent 68%);
}

.startup-loader-frame { position: absolute; z-index: 1; inset: 22px; pointer-events: none; }
.startup-loader-frame i { position: absolute; width: 26px; height: 26px; border: 1px solid rgba(148, 233, 219, 0.28); opacity: 0; animation: startup-frame-in 1s ease-out .5s forwards; }
.startup-loader-frame i:nth-child(1) { top: 0; left: 0; border-width: 1px 0 0 1px; border-radius: 6px 0 0 0; }
.startup-loader-frame i:nth-child(2) { top: 0; right: 0; border-width: 1px 1px 0 0; border-radius: 0 6px 0 0; }
.startup-loader-frame i:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 1px 1px; border-radius: 0 0 0 6px; }
.startup-loader-frame i:nth-child(4) { bottom: 0; right: 0; border-width: 0 1px 1px 0; border-radius: 0 0 6px 0; }

.startup-loader-mark {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  animation: startup-mark-float 4.4s ease-in-out infinite;
}
.startup-loader-halo {
  position: absolute;
  z-index: 1;
  inset: -46px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(94, 234, 212, 0.55), rgba(56, 189, 248, 0.12) 35%, transparent 55%, rgba(94, 234, 212, 0.4) 90%, rgba(94, 234, 212, 0.55));
  filter: blur(18px);
  opacity: 0.75;
  animation: startup-halo-spin 6s linear infinite;
}

.startup-loader-core {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 116px;
  height: 116px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  background: #ffffff;
  box-shadow:
    0 0 0 7px rgba(94, 234, 212, 0.14),
    0 22px 46px rgba(1, 12, 14, 0.5);
}
.startup-loader-core::after {
  position: absolute;
  z-index: 1;
  content: "";
  inset: 2px 3px auto;
  height: 42%;
  border-radius: 11px 11px 50% 50%;
  background: linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,0));
  pointer-events: none;
}
.startup-loader-core img {
  position: relative;
  z-index: 2;
  width: 98px;
  height: 98px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.15));
}

.startup-loader-copy {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  width: min(420px, 86vw);
  text-align: center;
}
.startup-loader-eyebrow {
  margin: 0 0 10px;
  color: #5eead4;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0;
  animation: startup-copy-in .7s ease-out .15s forwards;
}
.startup-loader-copy h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  text-shadow: 0 4px 16px rgba(0,0,0,0.3);
  opacity: 0;
  animation: startup-copy-in .7s ease-out .32s forwards;
}

.startup-loader-progress {
  position: relative;
  width: 100%;
  height: 4px;
  margin: 28px 0 16px;
  overflow: hidden;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  opacity: 0;
  animation: startup-copy-in .7s ease-out .5s forwards;
}
.startup-loader-progress span {
  position: relative;
  display: block;
  width: 0;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
  background: linear-gradient(90deg, #149a88 0%, #38bdf8 55%, #99f6e4 100%);
  box-shadow: 0 0 14px rgba(94, 234, 212, 0.7);
  animation: startup-progress 3s cubic-bezier(0.2, 0.72, 0.2, 1) forwards;
}
.startup-loader-progress span::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.85), transparent);
  transform: translateX(-100%);
  animation: startup-progress-shimmer 1.3s ease-in-out infinite;
}

.startup-loader-status {
  color: #8fb3ae;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0;
  animation: startup-copy-in .7s ease-out .64s forwards, startup-status-pulse 2s ease-in-out 1.4s infinite;
}

@keyframes startup-progress { 0% { width: 0; } 28% { width: 42%; } 68% { width: 82%; } 100% { width: 100%; } }
@keyframes startup-progress-shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes startup-copy-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes startup-frame-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes startup-halo-spin { to { transform: rotate(360deg); } }
@keyframes startup-mark-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes startup-aurora-drift { 0%, 100% { transform: translate(0, 0) scale(1); } 50% { transform: translate(4%, -5%) scale(1.12); } }
@keyframes startup-status-pulse { 0%, 100% { opacity: 0.75; } 50% { opacity: 1; color: #c8e6e0; } }

@media (prefers-reduced-motion: reduce) {
  .startup-loader-aurora i,
  .startup-loader-halo,
  .startup-loader-mark,
  .startup-loader-status { animation: none; }
  .startup-loader-eyebrow,
  .startup-loader-copy h1,
  .startup-loader-progress { opacity: 1; animation: none; }
  .startup-loader-progress span { animation-timing-function: linear; }
  .startup-loader-progress span::after { display: none; }
}

/* Custom scrollbar styling */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.04); border-radius: 999px; }
::-webkit-scrollbar-thumb { background: rgba(13, 101, 92, 0.25); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

button, input, select, textarea { font: inherit; letter-spacing: 0; }

button {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  background: linear-gradient(145deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  box-shadow: var(--shadow-xs);
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

button:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  box-shadow: 0 6px 16px var(--accent-glow);
  transform: translateY(-1px);
}
button:active { transform: translateY(0); scale: 0.98; }
button:disabled { cursor: not-allowed; opacity: 0.58; box-shadow: none; transform: none; }

#loginSubmitBtn.is-loading,
#logoutBtn.is-loading { position: relative; cursor: progress; }
#loginSubmitBtn.is-loading span { opacity: .78; }
#loginSubmitBtn.is-loading::after,
#logoutBtn.is-loading::after { display: inline-block; width: 14px; height: 14px; margin-left: 9px; content: ""; border: 2px solid rgba(255,255,255,.42); border-top-color: #fff; border-radius: 50%; vertical-align: -2px; animation: auth-spinner .72s linear infinite; }
#logoutBtn.is-loading::after { border-color: rgba(13,101,92,.2); border-top-color: var(--accent); }
@keyframes auth-spinner { to { transform: rotate(360deg); } }

button.secondary,
button.ghost,
.button.secondary {
  border-color: var(--line-strong);
  background: #fff;
  color: #334258;
}

button.secondary:hover,
button.ghost:hover,
.button.secondary:hover { border-color: #9aabba; background: #f7f9fb; color: var(--ink); box-shadow: var(--shadow-sm); }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 15px; border: 1px solid var(--accent); border-radius: 7px; background: var(--accent); color: #fff; text-decoration: none; cursor: pointer; font-weight: 750; }

button.danger-button {
  border-color: #e4b7b2;
  background: #fff;
  color: var(--danger);
}

button.danger-button:hover {
  border-color: var(--danger);
  background: var(--danger-soft);
  color: #922b23;
  box-shadow: none;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(20, 106, 146, 0.16);
  outline-offset: 1px;
  border-color: var(--blue);
}

input, select, textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.4;
  box-shadow: inset 0 1px 1px rgba(20, 35, 55, 0.025);
}

input::placeholder, textarea::placeholder { color: #a1aaba; }
input[readonly] { border-color: #c5dcd8; background: #f2f8f7; color: #245a55; cursor: default; }
textarea { min-height: 100px; resize: vertical; }

label {
  display: grid;
  gap: 7px;
  color: #3d4a60;
  font-size: 13px;
  font-weight: 750;
}

h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); letter-spacing: 0; }
h1 { margin-bottom: 0; font-size: 24px; line-height: 1.15; }
h2 { margin-bottom: 0; font-size: 28px; line-height: 1.2; }
h3 { margin-bottom: 3px; font-size: 17px; }

.app-layout { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  width: var(--sidebar);
  min-height: 100vh;
  padding: 20px 16px 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.09);
  background: #102f34;
  color: #fff;
  box-shadow: 8px 0 28px rgba(18, 38, 45, 0.08);
}

.brand { display: flex; align-items: center; gap: 13px; color: #fff; text-decoration: none; }
.brand-mark { display: grid; flex: 0 0 auto; place-items: center; width: 64px; height: 58px; border: 1px solid rgba(255,255,255,.18); border-radius: 10px; background: #fff; overflow: hidden; box-shadow: 0 7px 18px rgba(4,25,29,.16); }
.brand-mark img { width: 58px; height: 51px; object-fit: contain; }
.brand-copy { display: grid; gap: 4px; min-width: 0; }
.brand-copy strong { color: #fff; font-size: 18px; font-weight: 800; line-height: 1.08; letter-spacing: -.01em; }
.brand-copy small { color: #b4ccce; font-size: 9px; font-weight: 800; line-height: 1.25; letter-spacing: .045em; text-transform: uppercase; }

.workspace-label { display: grid; gap: 4px; margin: 30px 7px 12px; padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.workspace-label span { color: #82a5a9; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.workspace-label strong { font-size: 12px; font-weight: 700; }

.side-nav { display: grid; gap: 5px; }
.nav-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid transparent;
  background: transparent;
  color: #a8b9bd;
  text-align: left;
  opacity: 0.76;
}
.nav-item:hover { border-color: rgba(255,255,255,.07); background: rgba(255,255,255,.055); color: #fff; box-shadow: none; opacity: 1; }
.nav-item.active { border-color: rgba(112, 217, 199, 0.19); background: #1b4b4d; color: #fff; box-shadow: inset 3px 0 #51c1b1; opacity: 1; }
.nav-item > span:last-child { display: grid; gap: 2px; min-width: 0; }
.nav-item strong { font-size: 13px; }
.nav-item small { color: #8ea9ac; font-size: 10px; font-weight: 600; }
.nav-item.active small { color: #b8d3d3; }
.nav-icon { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid rgba(255,255,255,.1); border-radius: 6px; color: #8fb6b7; font-size: 11px; font-weight: 900; }
.nav-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-item:first-child .nav-icon svg { fill: currentColor; stroke: none; }
.nav-item.active .nav-icon { border-color: rgba(114,219,201,.32); background: rgba(114,219,201,.1); color: #8be0d1; }
.nav-item.management-only .nav-icon { border-color: rgba(159, 134, 255, .28); background: rgba(159, 134, 255, .09); color: #c6b8ff; }

.sidebar-spacer { flex: 1; min-height: 24px; }
.system-card { padding: 13px; border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius); background: rgba(3, 22, 25, 0.24); }
.system-card-head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; color: #b4c8ca; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.live-label { padding: 3px 6px; border-radius: 4px; background: rgba(60, 204, 140, .12); color: #71d4a8; font-size: 9px; }
.db-status { display: flex; align-items: center; gap: 8px; min-height: 35px; margin-bottom: 7px; border-bottom: 1px solid rgba(255,255,255,.08); color: #c8d6d7; font-size: 11px; font-weight: 750; }
.db-status i { width: 6px; height: 6px; border-radius: 50%; background: #e2aa45; box-shadow: 0 0 0 3px rgba(226,170,69,.12); animation: status-pulse 1.8s ease-in-out infinite; }
.db-status.connected i { background: #35c77e; box-shadow: 0 0 0 3px rgba(53,199,126,.12); }
.db-status.disconnected i { background: #e45f55; box-shadow: 0 0 0 3px rgba(228,95,85,.12); animation: none; }
.system-detail { display: flex; justify-content: space-between; gap: 8px; padding-top: 8px; color: #7f9ca0; font-size: 10px; }
.system-detail strong { color: #c4d5d7; font-weight: 700; }
#sessionCountdown { font-variant-numeric: tabular-nums; }
.sidebar-version { margin: 12px 7px 0; color: #698a8e; font-size: 9px; text-transform: uppercase; }

@keyframes status-pulse { 50% { opacity: .45; transform: scale(.78); } }

.sidebar-scrim { display: none; }
.main-area { grid-column: 2; display: flex; flex-direction: column; min-width: 0; min-height: 100vh; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 11px clamp(20px, 3vw, 42px);
  border-bottom: 1px solid rgba(205, 216, 226, .85);
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(15px);
}
.page-context { min-width: 0; }
.page-context p { margin-bottom: 4px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.topbar-actions { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.user-chip { display: flex; align-items: center; gap: 11px; min-width: 190px; padding: 5px 14px 5px 5px; border-right: 1px solid var(--line); }
.user-chip > span:last-child { display: grid; justify-items: start; gap: 3px; min-width: 0; }
.user-chip strong, .user-chip small { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip strong { color: var(--ink); font-size: 12px; line-height: 1.2; }
.user-chip small { color: var(--muted); font-size: 10px; }
.user-avatar { position: relative; isolation: isolate; display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border: 1px solid rgba(255,255,255,.72); border-radius: 14px; background: linear-gradient(145deg, #159b8d 0%, #0d6f65 48%, #074b45 100%); box-shadow: inset 2px 2px 3px rgba(255,255,255,.45), inset -3px -4px 7px rgba(0,34,31,.3), 0 7px 15px rgba(7,75,69,.22); color: #fff; font-size: 17px; font-weight: 950; line-height: 1; text-shadow: 0 1px 0 rgba(0,0,0,.32); transform: perspective(90px) rotateX(3deg) rotateY(-5deg); }
.user-avatar::after { content: ""; position: absolute; z-index: -1; inset: 3px 4px auto; height: 38%; border-radius: 10px 10px 50% 50%; background: linear-gradient(180deg, rgba(255,255,255,.42), rgba(255,255,255,0)); pointer-events: none; }
.user-avatar.developer { background: linear-gradient(145deg, #8975dd 0%, #6550b8 52%, #40307f 100%); box-shadow: inset 2px 2px 3px rgba(255,255,255,.42), inset -3px -4px 7px rgba(42,25,96,.34), 0 7px 16px rgba(101,80,184,.23); }
.user-avatar.admin { background: linear-gradient(145deg, #2994c3 0%, #176f99 52%, #0c4a6c 100%); box-shadow: inset 2px 2px 3px rgba(255,255,255,.42), inset -3px -4px 7px rgba(7,45,66,.34), 0 7px 16px rgba(23,111,153,.23); }
.user-avatar.manager { background: linear-gradient(145deg, #20a796 0%, #0d756a 52%, #075047 100%); }
.user-avatar.uploader { background: linear-gradient(145deg, #32a66a 0%, #187c4b 52%, #0a5430 100%); }
.identity-role { display: inline-flex; align-items: center; gap: 5px; min-height: 20px; padding: 0 7px; border: 1px solid #cce5d6; border-radius: 999px; background: var(--success-soft); color: var(--success); font-size: 8px; font-weight: 900; letter-spacing: .035em; line-height: 1; text-transform: uppercase; white-space: nowrap; }
.identity-role::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(24,124,75,.08); }
.identity-role.manager { border-color: #b9dcd5; background: var(--accent-soft); color: var(--accent); }
.identity-role.admin { border-color: #bed9e7; background: var(--blue-soft); color: var(--blue); }
.identity-role.developer { border-color: #d8cffc; background: #f4f1ff; color: #6550b8; }
.icon-btn { display: grid; place-items: center; width: 40px; padding: 0; border-color: var(--line); background: #fff; color: var(--ink); }
.menu-btn { display: none; }
.install-app-button { min-height: 36px; padding: 0 12px; border-color: #a9d5ce !important; background: var(--accent-soft) !important; color: var(--accent) !important; font-size: 10px; }
.install-app-button::before { content: "\2193"; margin-right: 6px; font-size: 13px; }

.content { flex: 1; width: 100%; max-width: 1540px; margin: 0 auto; padding: 30px clamp(20px, 3vw, 42px) 112px; }
.view { animation: view-enter 180ms ease-out; }
@keyframes view-enter { from { opacity: 0; transform: translateY(3px); } }

.view-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.view-description { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.audit-view-head { align-items: center; }
.audit-date-filter { display: flex; align-items: end; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.9); box-shadow: var(--shadow-sm); }
.audit-filter-field { gap: 4px; min-width: 142px; }
.audit-filter-field span { color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .03em; text-transform: uppercase; }
.audit-filter-field input { min-height: 38px; padding: 7px 9px; background: #fff; color: var(--ink); font-size: 10px; cursor: pointer; }
.audit-date-separator { align-self: center; margin-top: 14px; color: var(--subtle); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.audit-filter-actions { display: flex; gap: 6px; }
.audit-filter-actions button { min-height: 38px; padding: 0 10px; font-size: 9px; white-space: nowrap; }
.audit-clear-button { border-color: transparent; background: transparent; color: var(--muted); }
.audit-clear-button:hover { border-color: var(--line); background: var(--panel-soft); color: var(--ink); }
.audit-panel-badges { display: flex; align-items: center; gap: 7px; }
.read-only-badge { border-color: #c8deda; background: var(--accent-soft); color: var(--accent); }
.eyebrow { margin-bottom: 5px; color: var(--accent); font-size: 10px; font-weight: 850; text-transform: uppercase; }
.actions, .form-actions, .row-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.compact-control { display: flex; align-items: center; gap: 8px; }
.compact-control span { color: var(--muted); }
.compact-control select { width: 150px; min-height: 40px; }
.bulk-workflow-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.bulk-action-group { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; padding: 6px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.84); box-shadow: var(--shadow-sm); }
.bulk-review-group { border-color: #c7e3dd; background: #f4fbf9; }
.bulk-send-group { border-color: #c8d8e6; background: #f6f9fc; }
.bulk-delete-group { border-color: #efc8c2; background: #fff7f5; }
.bulk-delete-group .bulk-step-label { color: var(--danger); }
.bulk-step-label { padding-inline: 5px; color: var(--accent); font-size: 8px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.bulk-capacity-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 0 9px; border: 1px solid #b9d7e5; border-radius: 999px; background: #eaf5fa; color: #125f84; font-size: 10px; font-weight: 850; white-space: nowrap; }
.bulk-select-control, .recipient-checkbox, .review-checkbox, .delete-checkbox { display: inline-flex; grid-template-columns: none; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 750; white-space: nowrap; }
.bulk-select-control { min-height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; }
.recipient-checkbox, .review-checkbox, .delete-checkbox { min-height: 32px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel-soft); }
.review-checkbox { border-color: #c7e3dd; background: #f2faf8; color: var(--accent-dark); }
.delete-checkbox { border-color: #efc8c2; background: #fff7f5; color: var(--danger); }
.bulk-select-control input, .recipient-checkbox input, .review-checkbox input, .delete-checkbox input { width: 15px; min-height: 15px; margin: 0; padding: 0; accent-color: var(--accent); }
.delete-checkbox input, .bulk-delete-group input { accent-color: var(--danger); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(130px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { position: relative; min-height: 106px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-sm); overflow: hidden; }
.stat::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--stat-color, var(--accent)); }
.stat span { display: block; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; }
.stat strong { display: block; margin-top: 10px; font-size: 30px; line-height: 1; }
.stat small { display: block; margin-top: 8px; color: var(--subtle); font-size: 10px; }
.stat-filter { width: 100%; min-height: 106px; color: var(--ink); text-align: left; font: inherit; appearance: none; cursor: pointer; transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease, background 160ms ease; }
.stat-filter:hover { border-color: color-mix(in srgb, var(--stat-color, var(--accent)) 48%, var(--line)); background: #fff; color: var(--ink); box-shadow: 0 11px 25px rgba(15,38,53,.11); transform: translateY(-2px); }
.stat-filter:focus-visible { outline: 3px solid color-mix(in srgb, var(--stat-color, var(--accent)) 24%, transparent); outline-offset: 2px; }
.stat-filter.is-active { border-color: var(--stat-color, var(--accent)); background: #fff; color: var(--ink); box-shadow: 0 0 0 3px color-mix(in srgb, var(--stat-color, var(--accent)) 10%, transparent), var(--shadow-sm); }
.stat-filter em { display: inline-flex; align-items: center; gap: 5px; margin-top: 11px; color: var(--stat-color, var(--accent)); font-size: 9px; font-style: normal; font-weight: 850; letter-spacing: .02em; text-transform: uppercase; }
.stat-filter em::after { content: "\2192"; font-size: 13px; transition: transform 160ms ease; }
.stat-filter:hover em::after { transform: translateX(3px); }
.stat:nth-child(2) { --stat-color: #3278a8; }
.stat:nth-child(3) { --stat-color: #c28a2e; }
.stat:nth-child(4) { --stat-color: #22a06b; }
.stat.service-stat strong { font-size: 27px; letter-spacing: -.025em; }
.mail-service { --stat-color: #111827; }
.database-service { --stat-color: #3ecf8e; }

.dashboard-health-toolbar { display: flex; align-items: stretch; flex-wrap: wrap; gap: 14px; margin: 14px 0 20px; }
.dashboard-service-bar { display: flex; flex-wrap: wrap; flex: 1 1 480px; gap: 10px; }
.service-health-card { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 3px 14px; flex: 1 1 250px; min-width: 230px; padding: 11px 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-sm); }
.service-health-card.compact { flex-basis: 200px; padding: 9px 12px; }
.service-health-main { grid-column: 1; grid-row: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.service-health-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.service-health-name span { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.service-health-name strong { font-size: 13px; color: var(--ink); }
.service-health-name small { color: var(--subtle); font-size: 9px; }
.service-health-status { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; align-items: flex-end; gap: 1px; text-align: right; }
.service-health-status b { font-size: 11px; font-weight: 800; color: var(--ink); }
.service-health-status span { color: var(--subtle); font-size: 9px; }
.service-health-card p { grid-column: 1 / -1; grid-row: 2; margin: 2px 0 0; color: var(--subtle); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.service-health-dot { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 50%; background: #e2aa45; box-shadow: 0 0 0 4px rgba(226,170,69,.15); animation: status-pulse 1.8s ease-in-out infinite; }
.service-health-card[data-service-state="connected"] .service-health-dot { background: #22a06b; box-shadow: 0 0 0 4px rgba(34,160,107,.15); animation: status-pulse 2.6s ease-in-out infinite; }
.service-health-card[data-service-state="connected"] .service-health-status b { color: #1f8a5c; }
.service-health-card[data-service-state="error"] .service-health-dot { background: #d3453b; box-shadow: 0 0 0 4px rgba(211,69,59,.18); animation: status-blink 0.9s steps(1,end) infinite; }
.service-health-card[data-service-state="error"] .service-health-status b { color: #c23a31; }
.service-health-card[data-service-state="disconnected"] .service-health-dot { background: #9aa7ae; box-shadow: 0 0 0 4px rgba(154,167,174,.15); animation: none; }
.service-health-card[data-service-state="disconnected"] .service-health-status b { color: #7d8b92; }
.dashboard-refresh-control { display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 0 0 auto; gap: 8px; padding: 11px 15px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-sm); }
.refresh-live { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.refresh-health-dot { width: 6px; height: 6px; border-radius: 50%; background: #22a06b; box-shadow: 0 0 0 3px rgba(34,160,107,.15); animation: status-pulse 2.6s ease-in-out infinite; }

@keyframes status-blink { 50% { opacity: .2; } }

.panel, .data-panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow-sm); }
.data-panel { overflow: hidden; }
.data-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 67px; padding: 14px 17px; border-bottom: 1px solid var(--line); }
.data-panel-head h3 { margin: 0; }
.data-panel-head p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.record-count { flex: 0 0 auto; padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel-soft); color: var(--muted); font-size: 10px; font-weight: 750; }

.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; }
th, td { padding: 13px 16px; border-bottom: 1px solid #e6ebf1; text-align: left; vertical-align: middle; }
th { background: #f8fafb; color: #68758a; font-size: 10px; font-weight: 850; text-transform: uppercase; white-space: nowrap; }
td { color: #344258; font-size: 12px; }
tbody tr { transition: background 120ms ease; }
tbody tr:hover { background: #fbfcfd; }
tbody tr:last-child td { border-bottom: 0; }
.party-primary { display: grid; gap: 5px; min-width: 210px; }
.party-primary > strong { color: var(--ink); font-size: 13px; line-height: 1.25; }
.party-primary small { color: var(--muted); font-size: 10px; }
.party-primary .firm-name-line { width: fit-content; color: #5a4a86; font-size: 10px; font-weight: 800; letter-spacing: .035em; text-transform: uppercase; }
.party-primary .client-name-line { display: inline-flex; align-items: baseline; gap: 5px; width: fit-content; max-width: 100%; padding: 5px 9px; border: 1px solid rgba(13,101,92,.13); border-radius: 7px; background: rgba(13,101,92,.09); color: var(--accent-dark); font-size: 10.5px; font-weight: 750; line-height: 1.35; overflow-wrap: anywhere; }
.party-primary .client-name-line strong { flex: 0 0 auto; color: inherit; font-size: 9px; font-weight: 850; letter-spacing: .025em; text-transform: uppercase; }
.optional-label { color: var(--muted); font-size: 10px; font-weight: 600; text-transform: none; }
.numeric { color: var(--ink); font-variant-numeric: tabular-nums; font-weight: 750; white-space: nowrap; }
.entity-code { color: var(--muted); font-family: Consolas, monospace; font-size: 10px; }

.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 25px; padding: 0 8px; border: 1px solid #d8e0e8; border-radius: 5px; background: #f3f6f8; color: #5c6879; font-size: 9px; font-weight: 850; text-transform: uppercase; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .75; }
.badge.responded { border-color: #bfe5cf; background: var(--success-soft); color: var(--success); }
.badge.opened, .badge.sent, .badge.delivered { border-color: #c6dfec; background: var(--blue-soft); color: var(--blue); }
.badge.bounced { border-color: #f0c7c3; background: var(--danger-soft); color: var(--danger); }
.delivery-summary { display: grid; justify-items: start; gap: 7px; min-width: 155px; }
.response-status { display: grid; justify-items: start; gap: 6px; }
.response-attribution { display: grid; gap: 2px; margin-top: 2px; padding-left: 9px; border-left: 2px solid var(--line); overflow-wrap: anywhere; }
.response-attribution strong { color: var(--ink); font-size: 10px; font-weight: 750; line-height: 1.4; }
.response-attribution-time { color: var(--subtle); font-size: 9px; line-height: 1.4; }
.response-attribution-msme { color: var(--muted); font-size: 9px; font-weight: 650; line-height: 1.4; }
.variance-detail { display: grid; justify-items: end; gap: 2px; }
.variance-detail span { color: var(--muted); font-size: 9px; font-weight: 650; }
.variance-detail strong { color: var(--ink); font-size: 12.5px; font-weight: 800; }
.delivery-activity { display: block; width: 100%; color: var(--muted); font-size: 9px; font-weight: 550; line-height: 1.55; white-space: normal; overflow-wrap: anywhere; }
.delivery-summary-link { width: 100%; min-height: 0; padding: 8px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: inherit; text-align: left; font: inherit; cursor: pointer; transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease; }
.delivery-summary-link:hover { border-color: #b9d8e6; background: #f1f8fb; color: inherit; box-shadow: 0 5px 14px rgba(35,110,148,.1); transform: none; }
.delivery-summary-link:focus-visible { outline: 3px solid rgba(35,128,174,.18); outline-offset: 2px; }
.delivery-view-hint { display: inline-flex; align-items: center; gap: 4px; color: var(--blue); font-size: 8px; font-weight: 850; letter-spacing: .02em; text-transform: uppercase; }
.delivery-view-hint::after { content: "\2192"; font-size: 12px; transition: transform 150ms ease; }
.delivery-summary-link:hover .delivery-view-hint::after { transform: translateX(3px); }
.workflow-table { min-width: 1080px; table-layout: fixed; }
.workflow-table th:nth-child(1) { width: 21%; }
.workflow-table th:nth-child(2) { width: 10%; }
.workflow-table th:nth-child(3) { width: 11%; }
.workflow-table th:nth-child(4) { width: 12%; }
.workflow-table th:nth-child(5) { width: 13%; }
.workflow-table th:nth-child(6) { width: 33%; }
.workflow-table th,
.workflow-table td { padding-inline: 12px; }
.workflow-table td { min-width: 0; vertical-align: top; }
.workflow-table .party-primary,
.workflow-table .delivery-summary,
.workflow-table .review-summary { min-width: 0; }
.review-summary { display: grid; justify-items: start; gap: 5px; min-width: 0; }
.review-summary small { color: var(--muted); font-size: 9px; overflow-wrap: anywhere; }
.review-badge { --review-color: var(--warning); display: inline-flex; align-items: center; gap: 6px; min-height: 25px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; color: var(--review-color); font-size: 9px; font-weight: 850; text-transform: uppercase; white-space: nowrap; }
.review-badge-icon { display: grid; place-items: center; width: 15px; height: 15px; border-radius: 50%; background: var(--review-color); color: #fff; font-size: 9px; line-height: 1; }
.review-badge-icon > span { color: #fff; }
.review-badge.pending { --review-color: var(--warning); border-color: #ecd29e; background: var(--warning-soft); }
.review-badge.verified { --review-color: var(--success); border-color: #bfe5cf; background: var(--success-soft); }
.review-badge.rejected { --review-color: var(--danger); border-color: #f0c7c3; background: var(--danger-soft); }
.review-controls { display: grid; grid-template-columns: minmax(150px, 1.15fr) minmax(135px, .85fr); align-items: end; gap: 7px; min-width: 0; margin-bottom: 8px; }
.review-controls label { gap: 4px; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.review-controls input { width: 100%; min-width: 0; min-height: 34px; padding: 7px 9px; font-size: 10px; text-transform: none; }
.review-controls > .row-actions { grid-column: 1 / -1; gap: 6px; }
.workflow-table td:last-child > .row-actions { gap: 6px; }
.workflow-table td:last-child button,
.workflow-table td:last-child .recipient-checkbox,
.workflow-table td:last-child .review-checkbox { min-height: 34px; }
.read-only-note { display: inline-flex; max-width: 220px; margin-bottom: 7px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.verify-button { border-color: #b9dcd5; color: var(--accent); }

.party-layout { display: grid; gap: 18px; }
.party-register { overflow: visible; }
.party-shortlist { position: relative; z-index: 6; display: grid; grid-template-columns: minmax(220px, 1.3fr) repeat(4, minmax(155px, .82fr)) auto; align-items: end; gap: 10px; padding: 13px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fbfdfd, #f7fafb); }
.party-shortlist-search, .party-filter-field { display: grid; gap: 5px; min-width: 0; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.party-shortlist-search input { min-height: 38px; padding: 8px 10px; border-color: #cfdae2; background: #fff; color: var(--ink); font-size: 11px; font-weight: 650; text-transform: none; }
.party-shortlist-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(13,101,92,.11); }
.party-shortlist > #clearPartyFilters { min-height: 38px; white-space: nowrap; }
.party-multi-filter { position: relative; min-width: 0; text-transform: none; }
.party-multi-filter > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 38px; padding: 8px 11px; border: 1px solid #cfdae2; border-radius: 6px; background: #fff; color: var(--ink); cursor: pointer; font-size: 11px; font-weight: 750; list-style: none; transition: border-color .16s ease, box-shadow .16s ease, background .16s ease; }
.party-multi-filter > summary::-webkit-details-marker { display: none; }
.party-multi-filter > summary::after { content: ""; width: 7px; height: 7px; margin-left: auto; border-right: 2px solid #52657b; border-bottom: 2px solid #52657b; transform: rotate(45deg) translateY(-2px); transition: transform .16s ease; }
.party-multi-filter > summary small { padding: 3px 6px; border-radius: 999px; background: #eef5f5; color: var(--accent); font-size: 7px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.party-multi-filter[open] > summary { border-color: var(--accent); background: #fbfefd; box-shadow: 0 0 0 3px rgba(13,101,92,.11); }
.party-multi-filter[open] > summary::after { transform: rotate(225deg) translate(-1px, -1px); }
.party-filter-menu { position: absolute; z-index: 30; top: calc(100% + 7px); left: 0; display: grid; gap: 4px; width: max(100%, 250px); max-width: calc(100vw - 24px); max-height: 360px; padding: 10px; overflow-y: auto; overflow-x: hidden; box-sizing: border-box; border: 1px solid #cbd9df; border-radius: 10px; background: #fff; box-shadow: 0 16px 38px rgba(21,45,61,.18); }
.party-date-filter-menu { left: auto; right: 0; }
.workflow-filter-menu { right: 0; left: auto; width: max(100%, 300px); }
.party-filter-menu-head { display: grid; gap: 2px; padding: 2px 4px 8px; border-bottom: 1px solid #e5ecef; }
.party-filter-menu-head strong { color: var(--ink); font-size: 11px; }
.party-filter-menu-head span { color: var(--muted); font-size: 8px; font-weight: 550; }
.party-filter-menu > p { margin: 7px 5px 2px; color: #60768a; font-size: 8px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase; }
.party-filter-menu label { display: flex; align-items: center; gap: 9px; min-height: 34px; padding: 6px 8px; border: 1px solid transparent; border-radius: 7px; color: #263a50; cursor: pointer; font-size: 10px; font-weight: 700; text-transform: none; transition: background .14s ease, border-color .14s ease; }
.party-filter-menu label:hover, .party-filter-menu label:has(input:focus-visible) { border-color: #c5ddd9; background: #f0f8f7; }
.party-filter-menu input[type="checkbox"] { flex: 0 0 auto; width: 17px; height: 17px; min-height: 0; margin: 0; accent-color: var(--accent); }
.party-filter-menu-clear { min-height: 32px; margin-top: 5px; border: 0; background: #f2f6f7; color: var(--accent); font-size: 9px; }
.party-date-quick-actions { display: flex; flex-wrap: wrap; gap: 6px; padding: 2px 4px 8px; }
.party-date-quick-actions button { flex: 1 1 90px; min-width: 0; min-height: 32px; padding: 0 8px; font-size: 10px; white-space: nowrap; }
.party-date-range-inputs { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 4px 8px; }
.party-date-range-inputs label { display: grid; gap: 3px; flex: 1 1 110px; min-width: 0; color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.party-date-range-inputs input { box-sizing: border-box; width: 100%; min-width: 0; min-height: 34px; padding: 6px 8px; border: 1px solid #cfdae2; border-radius: 6px; background: #fff; color: var(--ink); font-size: 10.5px; cursor: pointer; }
.party-filter-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.party-filter-chips:empty { display: none; }
.party-filter-chip { display: inline-flex; align-items: center; gap: 7px; width: auto; min-height: 29px; padding: 5px 9px; border: 1px solid #a8d8d1; border-radius: 999px; background: #eaf7f5; color: #0b685e; font-size: 9px; font-weight: 750; box-shadow: none; }
.party-filter-chip:hover { border-color: var(--accent); background: #def2ef; transform: none; box-shadow: none; }
.party-filter-chip b { font-size: 14px; line-height: 1; }
.party-filter-summary { grid-column: 1 / -1; margin: -1px 0 0; color: var(--muted); font-size: 9px; line-height: 1.45; }
.entry-color-legend { display: flex; flex-wrap: wrap; gap: 7px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: #fbfcfd; }
.entry-color-legend:empty { display: none; }
.entry-legend-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 27px; padding: 0 9px; border: 1px solid var(--entry-accent); border-radius: 999px; background: var(--entry-tint); color: #33445a; font-size: 9px; font-weight: 750; }
.entry-legend-chip::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--entry-accent); }
.entry-user-group > td { background: var(--entry-tint); }
.entry-user-group > td:first-child { box-shadow: inset 4px 0 0 var(--entry-accent); }
.entry-user-group:hover > td { outline: 1px solid var(--entry-accent); outline-offset: -1px; }
.entry-color-0 { --entry-tint: #edf8f6; --entry-accent: #138477; }
.entry-color-1 { --entry-tint: #eef5fb; --entry-accent: #397fb3; }
.entry-color-2 { --entry-tint: #fff7e8; --entry-accent: #b67817; }
.entry-color-3 { --entry-tint: #f4f0fb; --entry-accent: #7957ad; }
.entry-color-4 { --entry-tint: #fff0f3; --entry-accent: #b94e6a; }
.entry-color-5 { --entry-tint: #eef8ee; --entry-accent: #4a8b4f; }
.entry-color-6 { --entry-tint: #fff2e9; --entry-accent: #b9622a; }
.entry-color-7 { --entry-tint: #eef2f8; --entry-accent: #536f9e; }
.firm-context-control select { min-width: 170px; border-color: #9bcac4; background: linear-gradient(180deg, #ffffff, #f1f9f7); color: var(--accent-dark); font-weight: 800; box-shadow: 0 4px 12px rgba(13,101,92,.06); }
.firm-context-control span::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: #22b8a6; box-shadow: 0 0 0 4px rgba(34,184,166,.12); }
.import-panel { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 18px; padding: 20px; overflow: hidden; }
.import-intro { display: flex; align-items: center; gap: 13px; min-width: 0; }
.import-intro .eyebrow { margin-bottom: 3px; }
.import-intro h3 { margin-bottom: 4px; font-size: 16px; }
.import-intro p:last-child { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.import-icon { display: grid; place-items: center; gap: 2px; flex: 0 0 58px; min-height: 52px; padding: 7px; border: 1px solid #cde6e1; border-radius: 9px; background: linear-gradient(145deg, #edf9f6, #e2f3ef); color: var(--accent); font-size: 9px; font-weight: 900; }
.import-icon svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.import-icon strong { font-size: 9px; letter-spacing: .01em; }
.import-role-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.import-role-badges span { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border: 1px solid #c9dedc; border-radius: 999px; background: #f3f9f8; color: #31615d; font-size: 8px; font-weight: 850; letter-spacing: .025em; text-transform: uppercase; }
.import-role-badges span::before { content: ""; width: 5px; height: 5px; margin-right: 6px; border-radius: 50%; background: #1ba391; }
.import-review-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.import-actions { display: grid; grid-template-columns: minmax(230px, .9fr) minmax(290px, 1.15fr) minmax(250px, 1fr); gap: 12px; align-items: stretch; }
.import-action-card { position: relative; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-content: start; gap: 8px 11px; min-width: 0; padding: 15px; border: 1px solid #d5e2e6; border-radius: 13px; background: linear-gradient(150deg, #ffffff, #f7fafb); box-shadow: 0 8px 24px rgba(21,45,61,.055); }
.import-action-card::after { content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(120deg, rgba(34,184,166,.05), transparent 45%); }
.import-action-card > * { position: relative; z-index: 1; }
.import-firm-step { border-color: #a9d6d0; background: linear-gradient(145deg, #f0faf8, #ffffff); }
.import-step-number { grid-row: 1 / span 3; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: linear-gradient(145deg, #117a6e, #07554f); color: #fff; font-size: 13px; font-weight: 900; box-shadow: 0 7px 15px rgba(13,101,92,.22); }
.import-action-card > div > strong { display: block; margin-bottom: 4px; color: var(--ink); font-size: 12px; }
.import-action-card > div > small { display: block; color: var(--muted); font-size: 9.5px; line-height: 1.45; }
.import-action-buttons { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
.import-action-buttons .button { flex: 1 1 120px; min-height: 37px; padding-inline: 10px; }
.import-upload-step .file-button { align-self: end; justify-content: center; width: 100%; min-height: 40px; margin-top: 4px; }
.import-firm-control { display: grid; min-width: 0; max-width: none; gap: 5px; color: var(--accent-dark); font-size: 10px; font-weight: 850; }
.import-firm-control select { min-height: 40px; border-color: #9fcfc7; background: #f5fbfa; color: var(--ink); font-size: 12px; }
.import-firm-control small { color: var(--muted); font-size: 9px; font-weight: 600; line-height: 1.35; }
.import-firm-control select:disabled { background: #edf3f3; color: #526a69; opacity: 1; }
.sample-download-button { border-color: #9fd2ca; background: #f1faf8; color: var(--accent-dark); }
.sample-download-button:hover { border-color: #65b5aa; background: #e5f5f1; color: var(--accent-dark); }
.file-button { display: inline-flex; margin: 0; color: #fff; }
.file-button:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.import-review { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 20px; padding: 14px; border: 1px solid #b9dcd5; border-radius: 7px; background: #f2faf8; }
.import-review > div:first-child { display: grid; gap: 4px; }
.import-review strong { overflow-wrap: anywhere; font-size: 12px; }
.import-review span { color: var(--muted); font-size: 11px; }
.import-review span.error { color: var(--danger); }
.import-errors { grid-column: 1 / -1; display: grid; gap: 5px; margin: 0; padding: 11px 11px 0 28px; border-top: 1px solid #cce7e1; color: var(--danger); font-size: 10px; line-height: 1.45; }
.import-errors:empty { display: none; }
.import-next-file { grid-column: 1 / -1; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px; border: 1px solid #b9dfca; border-radius: 9px; background: linear-gradient(135deg, #effaf4, #fbfffd); }
.import-next-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--success); color: #fff; font-size: 18px; font-weight: 900; }
.import-next-file strong { display: block; color: var(--success); font-size: 13px; }
.import-next-file p { margin: 3px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.import-next-file .file-button { white-space: nowrap; }
.import-field-guide { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.import-field-guide > div { display: grid; gap: 3px; padding: 10px 11px; border: 1px solid #d8e5e6; border-radius: 7px; background: #fbfdfd; }
.import-field-guide strong { color: var(--ink); font-size: 10px; }
.import-field-guide span { color: var(--muted); font-size: 9px; line-height: 1.45; }
.import-help { grid-column: 1 / -1; padding: 11px 13px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-soft); }
.import-help summary { color: var(--accent); font-size: 10px; font-weight: 800; cursor: pointer; }
.import-help ol { display: grid; gap: 6px; margin: 11px 0 0; padding-left: 18px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.import-note { grid-column: 1 / -1; margin: -3px 0 0; color: var(--subtle); font-size: 9px; }
.party-form { padding: 18px; }
.user-management-layout { display: grid; gap: 18px; }
.notification-management-layout { display: grid; gap: 18px; margin-top: 18px; }
.notification-recipient-panel { padding: 18px; }
.notification-recipient-grid { grid-template-columns: 1fr 1.4fr .65fr; }
.client-shortlist-grid { grid-template-columns: 1fr 1.6fr; }
.notification-active-toggle { align-self: end; display: flex; flex-direction: row; align-items: center; gap: 8px; min-height: 43px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel-soft); }
.notification-active-toggle input { width: 17px; height: 17px; }
.notification-event-options { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 16px 0 0; padding: 13px 14px; border: 1px solid var(--line); border-radius: 7px; }
.notification-event-options legend { padding: 0 6px; color: var(--ink); font-size: 10px; font-weight: 800; }
.notification-event-options label { display: flex; flex-direction: row; align-items: center; gap: 7px; font-size: 10px; }
.notification-event-options input { width: 16px; height: 16px; }
.notification-guidance { margin: 10px 0 0; color: var(--muted); font-size: 9px; line-height: 1.5; }
.notification-table { min-width: 820px; }
.notification-event-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.notification-event-tags span { padding: 4px 6px; border: 1px solid #cbe0df; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-size: 8px; font-weight: 800; text-transform: uppercase; }
.notification-row-actions { flex-wrap: wrap; }
.create-user-panel { padding: 18px; overflow: hidden; }
.user-form-grid { grid-template-columns: 1fr 1.3fr 1fr; }
.role-explainer { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; margin-top: 16px; }
.role-explainer span { display: grid; gap: 4px; min-height: 72px; padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--panel-soft); color: var(--muted); font-size: 10px; line-height: 1.45; }
.role-explainer strong { color: var(--ink); font-size: 11px; }
.users-table { min-width: 1020px; }
.audit-table { min-width: 1040px; }
.audit-table th:first-child, .audit-table td:first-child { width: 190px; }
.audit-table th:nth-child(2), .audit-table td:nth-child(2) { width: 250px; }
.audit-table tbody tr:nth-child(even) { background: #fbfcfd; }
.audit-actor { gap: 4px; }
.audit-actor .audit-actor-role { color: var(--accent-dark); font-weight: 750; }
.audit-time { display: block; color: #2f4057; font-size: 11px; font-variant-numeric: tabular-nums; line-height: 1.5; }
.audit-action { display: inline-flex; align-items: center; gap: 6px; min-height: 27px; padding: 0 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel-soft); color: var(--ink); font-size: 9px; font-weight: 850; text-transform: capitalize; white-space: nowrap; }
.audit-action::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.audit-action.tone-success { border-color: #bfe5cf; background: var(--success-soft); color: var(--success); }
.audit-action.tone-danger { border-color: #f0c7c3; background: var(--danger-soft); color: var(--danger); }
.audit-action.tone-login { border-color: #c6dfec; background: var(--blue-soft); color: var(--blue); }
.audit-action.tone-neutral { color: #6b7280; }
.audit-action.tone-info { border-color: #d4dceb; background: #f5f7fb; color: #536f9e; }
.audit-details { display: block; min-width: 260px; max-width: 520px; color: #536176; font-size: 10px; line-height: 1.5; overflow-wrap: anywhere; }
.audit-detail-grid { display: grid; grid-template-columns: repeat(2, minmax(130px, 1fr)); gap: 7px; min-width: 330px; max-width: 620px; margin: 0; }
.audit-detail-grid > div { min-width: 0; padding: 7px 8px; border: 1px solid #dce6eb; border-radius: 6px; background: #f8fbfc; }
.audit-detail-grid dt { margin: 0 0 2px; color: var(--muted); font-size: 8px; font-weight: 850; letter-spacing: .025em; text-transform: uppercase; }
.audit-detail-grid dd { margin: 0; color: #31445b; font-size: 10px; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.audit-empty-state { display: grid; place-items: center; gap: 5px; min-height: 130px; color: var(--muted); text-align: center; }
.audit-empty-state strong { color: var(--ink); font-size: 13px; }
.audit-empty-state small { font-size: 10px; }
.user-row-actions { flex-wrap: wrap; min-width: 280px; }
.role-badge, .account-status { display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--panel-soft); color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; white-space: nowrap; }
.role-badge::before, .account-status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.role-badge.developer { border-color: #d8cffc; background: #f4f1ff; color: #6550b8; }
.role-badge.admin { border-color: #bed9e7; background: var(--blue-soft); color: var(--blue); }
.role-badge.manager { border-color: #b9dcd5; background: var(--accent-soft); color: var(--accent); }
.role-badge.uploader { border-color: #cce5d6; background: var(--success-soft); color: var(--success); }
.row-role-select { width: auto; min-width: 130px; min-height: 32px; padding: 4px 25px 4px 8px; font-size: 10px; }
.account-status.active { border-color: #cce5d6; background: var(--success-soft); color: var(--success); }
.account-status.pending { border-color: #ecd29e; background: var(--warning-soft); color: var(--warning); }
.protected-account { display: inline-flex; align-items: center; min-height: 30px; padding: 0 9px; border: 1px solid #d8cffc; border-radius: 5px; background: #f4f1ff; color: #6550b8; font-size: 9px; font-weight: 800; text-transform: uppercase; }
.form-section-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding-bottom: 15px; border-bottom: 1px solid var(--line); }
.form-section-head h3 { font-size: 16px; }
.form-section-head p { margin: 0; color: var(--muted); font-size: 11px; }
.form-section-head > span { color: var(--subtle); font-size: 9px; }
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(160px, 1fr)); gap: 15px; padding-top: 17px; }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 58px; margin-top: 17px; padding-top: 14px; border-top: 1px solid var(--line); }
.form-message { min-height: 18px; margin: 0; color: var(--success); font-size: 11px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-line; }
.form-message.error, .error { color: var(--danger); }
.form-message.warning { color: var(--warning); }
.row-actions { flex-wrap: wrap; }
.row-actions button { min-height: 32px; padding: 0 9px; border-radius: 5px; font-size: 10px; }
.row-feedback { max-width: 380px; margin-top: 7px; padding: 7px 8px; border-radius: 5px; font-size: 10px; line-height: 1.4; }
.row-feedback.info { background: var(--blue-soft); color: var(--blue); }
.row-feedback.success { background: var(--success-soft); color: var(--success); }
.row-feedback.error { background: var(--danger-soft); color: var(--danger); }

.notice { margin-bottom: 16px; padding: 12px 14px; border: 1px solid #ecd29e; border-radius: var(--radius); background: var(--warning-soft); color: #785019; font-size: 12px; font-weight: 700; }
.operator-gate { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px; background: rgba(10, 31, 38, .72); backdrop-filter: blur(5px); }
.operator-card { display: grid; width: min(100%, 440px); padding: 30px; box-shadow: 0 24px 80px rgba(5, 25, 32, .28); }
.operator-card .eyebrow { margin: 14px 0 5px; }
.operator-card h2 { margin: 0 0 10px; font-size: 25px; }
.operator-card > p:not(.eyebrow, .form-message) { margin: 0 0 20px; color: var(--muted); font-size: 12px; line-height: 1.6; }
.operator-card label + label { margin-top: 12px; }
.operator-card button { margin-top: 5px; }
.operator-card > small { margin-top: 13px; color: var(--subtle); font-size: 9px; line-height: 1.5; text-align: center; }
.operator-actions { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 9px; margin-top: 5px; }
.operator-actions button { margin-top: 0; }
.operator-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 900; }
.error-notice { border-color: #efc6c1; background: var(--danger-soft); color: var(--danger); }
.app-toast { --toast-color: #256f96; position: fixed; z-index: 120; top: 96px; right: 22px; display: grid; grid-template-columns: 34px minmax(0, 1fr) 28px; align-items: start; gap: 11px; width: min(440px, calc(100vw - 28px)); margin: 0; padding: 14px; border: 1px solid #bdd8e8; border-radius: 11px; background: #f5fbff; color: var(--toast-color); box-shadow: 0 18px 55px rgba(18,35,63,.2); animation: toast-in 180ms ease-out; }
.app-toast.error { --toast-color: var(--danger); border-color: #efc6c1; background: #fff6f4; }
.app-toast.success { --toast-color: var(--success); border-color: #bfe5cf; background: #f2fbf6; }
.app-toast.warning { --toast-color: #785019; border-color: #ecd29e; background: #fffaf0; }
.app-toast-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--toast-color); color: #fff; font-size: 16px; font-weight: 900; line-height: 1; }
.app-toast-copy { display: grid; gap: 3px; min-width: 0; }
.app-toast-copy strong { color: currentColor; font-size: 11px; }
.app-toast-copy > span { color: inherit; font-size: 10px; font-weight: 650; line-height: 1.5; overflow-wrap: anywhere; white-space: pre-line; }
.app-toast-close { display: grid; place-items: center; width: 28px; min-height: 28px; padding: 0; border: 0; background: transparent; color: currentColor; font-size: 20px; box-shadow: none; opacity: .7; }
.app-toast-close:hover { border: 0; background: rgba(18,35,63,.06); color: currentColor; box-shadow: none; opacity: 1; }
.table-error { display: block; padding: 12px; border: 1px solid #efc6c1; border-radius: 7px; background: var(--danger-soft); color: var(--danger); font-size: 10px; font-weight: 700; line-height: 1.55; text-align: left; white-space: pre-line; }

.dialog-open { overflow: hidden; }
.action-dialog { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 18px; }
.action-dialog-backdrop { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; border-radius: 0; background: rgba(8, 25, 34, .62); box-shadow: none; backdrop-filter: blur(5px); cursor: default; }
.action-dialog-backdrop:hover { border: 0; background: rgba(8, 25, 34, .66); box-shadow: none; }
.action-dialog-card { position: relative; display: grid; width: min(500px, 100%); padding: 25px; border: 1px solid rgba(255,255,255,.8); border-radius: 15px; background: #fff; box-shadow: 0 28px 90px rgba(3, 21, 28, .32); animation: dialog-in 170ms ease-out; }
.action-dialog-head { display: flex; align-items: center; gap: 13px; }
.action-dialog-icon { display: grid; place-items: center; flex: 0 0 43px; width: 43px; height: 43px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); font-size: 18px; font-weight: 900; }
.action-dialog-head p { margin: 0 0 3px; color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.action-dialog-head h2 { color: var(--ink); font-size: 21px; line-height: 1.2; }
.action-dialog-message { margin: 18px 0 12px; color: #3d4b60; font-size: 12px; line-height: 1.6; }
.action-dialog-details { padding: 12px 13px; border: 1px solid var(--line); border-radius: 8px; background: #f7f9fa; color: var(--muted); font-size: 10px; line-height: 1.55; overflow-wrap: anywhere; white-space: pre-line; }
.action-dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 21px; }
.action-dialog-actions button { min-width: 118px; }
.action-dialog.tone-security .action-dialog-icon { background: var(--success-soft); color: var(--success); }
.action-dialog.tone-danger .action-dialog-icon { background: var(--danger-soft); color: var(--danger); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.login-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr); align-items: stretch; min-height: calc(100vh - 174px); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.login-intro { position: relative; display: flex; flex-direction: column; justify-content: center; padding: clamp(34px, 6vw, 82px); background: #123e43; color: #fff; overflow: hidden; }
.login-intro::before { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px) 0 0 / 86px 100%, linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 100% 72px; mask-image: linear-gradient(90deg, #000, transparent); }
.login-intro > * { position: relative; z-index: 1; }
.product-kicker { color: #8fddd1; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.login-intro h2 { max-width: 710px; margin: 15px 0; color: #fff; font-size: clamp(32px, 4vw, 54px); line-height: 1.05; }
.login-intro > p { max-width: 620px; margin-bottom: 28px; color: #bed0d2; font-size: 15px; line-height: 1.65; }
.login-capabilities { display: flex; flex-wrap: wrap; gap: 8px; }
.login-capabilities span { display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 10px; border: 1px solid rgba(255,255,255,.13); border-radius: 5px; background: rgba(255,255,255,.055); color: #d5e1e2; font-size: 10px; font-weight: 700; }
.login-capabilities i { width: 5px; height: 5px; border-radius: 50%; background: #55cdb8; box-shadow: 0 0 0 3px rgba(85,205,184,.11); }
.login-panel { display: flex; flex-direction: column; justify-content: center; padding: clamp(28px, 5vw, 62px); border: 0; border-radius: 0; box-shadow: none; }
.panel-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.panel-heading p { margin: 0 0 3px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.panel-heading h2 { font-size: 24px; }
.panel-icon { display: grid; place-items: center; width: 54px; height: 48px; border: 1px solid var(--line); border-radius: 7px; background: #fff; overflow: hidden; }
.panel-icon img { display: block; width: 42px; height: 42px; object-fit: contain; }
.form-stack { display: grid; gap: 16px; }
.form-stack button { margin-top: 3px; }
.auth-request-state { display: grid; gap: 16px; }
.form-stack .auth-link { justify-self: start; min-height: auto; margin: -7px 0 0; padding: 0; border: 0; background: transparent; color: var(--accent); font-size: 10px; font-weight: 800; box-shadow: none; }
.form-stack .auth-link:hover { border: 0; background: transparent; color: var(--accent-dark); box-shadow: none; text-decoration: underline; }
.auth-help { margin: -6px 0 2px; color: var(--muted); font-size: 11px; line-height: 1.55; }
.auth-success { display: grid; grid-template-columns: 42px 1fr; gap: 12px; align-items: center; padding: 16px; border: 1px solid #bfe5cf; border-radius: 8px; background: var(--success-soft); }
.auth-success-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--success); color: #fff; font-size: 20px; font-weight: 900; }
.auth-success > div > p { margin: 0 0 2px; color: var(--success); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.auth-success h3 { font-size: 18px; }
.auth-success > p, .auth-next-steps, .auth-success > button { grid-column: 1 / -1; }
.auth-success > p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.auth-success > p strong { color: var(--ink); overflow-wrap: anywhere; }
.auth-next-steps { display: grid; gap: 7px; padding-top: 10px; border-top: 1px solid #cce8d7; }
.auth-next-steps span { color: var(--muted); font-size: 10px; }
.auth-next-steps span::before { content: "\2713"; margin-right: 7px; color: var(--success); font-weight: 900; }
.recovery-step { display: grid; gap: 16px; }
.recovery-code-input { letter-spacing: .28em; font-size: 18px; font-weight: 800; text-align: center; }
.password-rules { display: flex; flex-wrap: wrap; gap: 8px; margin-top: -5px; }
.password-rules span { display: inline-flex; align-items: center; gap: 6px; color: var(--subtle); font-size: 9px; font-weight: 700; }
.password-rules i { width: 7px; height: 7px; border: 1px solid #aeb9c4; border-radius: 50%; }
.password-rules span.valid { color: var(--success); }
.password-rules span.valid i { border-color: var(--success); background: var(--success); box-shadow: inset 0 0 0 2px #fff; }
.show-password-control { display: inline-flex; flex-direction: row; align-items: center; justify-self: start; gap: 8px; color: var(--muted); font-size: 10px; cursor: pointer; }
.show-password-control input { width: 15px; min-height: 15px; margin: 0; }
.login-note { display: flex; align-items: center; gap: 7px; margin: 22px 0 0; color: var(--subtle); font-size: 9px; }
.login-note span { color: var(--success); font-size: 8px; }

.reset-destination-card { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 16px; padding: 13px 15px; border: 1px solid #badbd5; border-radius: 9px; background: linear-gradient(135deg, #f2faf8, #fff); color: #163e3b; }
.reset-destination-card.local { border-color: #e7d49c; background: #fffaf0; color: #664c00; }
.reset-destination-card.error { border-color: #efc6c1; background: var(--danger-soft); color: var(--danger); }
.reset-destination-icon { display: grid; place-items: center; flex: 0 0 34px; width: 34px; height: 34px; border-radius: 8px; background: rgba(16,118,107,.1); font-size: 17px; }
.reset-destination-card strong { display: block; margin-bottom: 3px; font-size: 11px; }
.reset-destination-card p { margin: 0; overflow-wrap: anywhere; color: inherit; font-size: 10px; line-height: 1.5; }
.help-bot-button { position: fixed; z-index: 35; right: 20px; bottom: 18px; display: grid; place-items: center; width: 50px; height: 50px; min-height: 50px; padding: 3px; overflow: visible; border: 2px solid rgba(159,245,232,.88); border-radius: 50%; background: linear-gradient(145deg, #0b5961, #062f3b); box-shadow: 0 0 0 5px rgba(24,183,164,.1), 0 0 18px rgba(54,232,206,.36), 0 10px 22px rgba(4,47,45,.28); transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease; animation: bot-glow 2.8s ease-in-out infinite; }
.help-bot-button::before { position: absolute; z-index: 2; inset: 4px; content: ""; border-radius: inherit; background: linear-gradient(145deg, rgba(255,255,255,.25), transparent 34%, transparent 72%, rgba(5,40,47,.18)); pointer-events: none; }
.help-bot-button::after { position: absolute; inset: -6px; content: ""; border: 1px solid rgba(96,225,207,.3); border-radius: inherit; pointer-events: none; animation: bot-ring 2.8s ease-out infinite; }
.help-bot-button:hover { transform: translateY(-4px) scale(1.045); box-shadow: 0 0 0 9px rgba(24,183,164,.14), 0 0 42px rgba(54,232,206,.58), 0 21px 44px rgba(4,47,45,.38); }
.help-guide-open { overflow: hidden; }
.help-guide-open .help-bot-button { opacity: 0; pointer-events: none; transform: translateY(8px) scale(.92); }
.help-bot-backdrop { position: fixed; z-index: 38; inset: 0; background: rgba(7, 25, 32, .28); backdrop-filter: blur(3px); animation: help-fade-in .16s ease-out; }
.help-bot-button > .bot-logo-small { width: 40px; height: 40px; flex-basis: 40px; border: 0; box-shadow: none; }
.bot-logo { position: relative; z-index: 1; display: grid; place-items: center; flex: 0 0 54px; width: 54px; height: 54px; overflow: visible; border: 2px solid rgba(166,244,233,.7); border-radius: 50%; background: #073f4a; box-shadow: 0 0 22px rgba(87,228,209,.35), inset 0 1px 0 rgba(255,255,255,.18); }
.bot-logo::after { position: absolute; right: -1px; bottom: 1px; width: 10px; height: 10px; content: ""; border: 2px solid #0b5258; border-radius: 50%; background: #61e5c8; box-shadow: 0 0 9px rgba(97,229,200,.92); }
.bot-logo img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; object-position: center 38%; filter: saturate(.98) contrast(1.04); }
.bot-logo svg { display: block; width: 100%; height: 100%; border-radius: inherit; }
.bot-logo-small { flex-basis: 60px; }
.bot-logo-small::after { right: 1px; bottom: 3px; border-color: #063c47; }
.help-bot-panel { position: fixed; z-index: 40; right: 24px; bottom: 84px; display: grid; grid-template-rows: auto minmax(0, 1fr); width: min(500px, calc(100vw - 32px)); height: min(730px, calc(100dvh - 100px)); contain: layout paint; border: 1px solid rgba(117,169,175,.56); border-radius: 22px; background: #fff; box-shadow: 0 30px 90px rgba(7,26,38,.34), 0 0 0 1px rgba(255,255,255,.76) inset; overflow: hidden; animation: help-panel-in .22s cubic-bezier(.2,.8,.2,1); }
.help-bot-head { position: relative; display: grid; grid-template-columns: 42px minmax(0, 1fr) 36px; align-items: center; gap: 12px; min-height: 66px; padding: 12px 14px; overflow: hidden; border-bottom: 1px solid rgba(255,255,255,.12); background: radial-gradient(circle at 12% 15%, rgba(61,216,198,.2), transparent 25%), linear-gradient(135deg, #082f38 0%, #0a5758 62%, #0b746a 100%); }
.help-bot-head::after { position: absolute; top: -34px; right: 60px; width: 96px; height: 96px; content: ""; border: 1px solid rgba(128,241,225,.14); border-radius: 50%; box-shadow: 0 0 0 14px rgba(128,241,225,.025), 0 0 0 28px rgba(128,241,225,.018); pointer-events: none; }
.help-bot-head .bot-logo { flex: 0 0 42px; width: 42px; height: 42px; border-width: 1.5px; }
.help-bot-head .bot-logo::after { width: 8px; height: 8px; }
.help-bot-title { flex: 1; min-width: 0; }
.help-bot-title-row { display: flex; align-items: center; gap: 9px; min-width: 0; }
.help-bot-head p { margin: 0 0 3px; color: #aee8df; font-size: 10px; font-weight: 850; letter-spacing: .07em; text-transform: uppercase; }
.help-bot-head h2 { min-width: 0; margin: 0; overflow: hidden; color: #fff; font-size: 21px; line-height: 1.15; letter-spacing: -.015em; text-overflow: ellipsis; white-space: nowrap; }
.help-bot-head .icon-btn { position: relative; z-index: 3; display: grid !important; flex: 0 0 36px; width: 36px; min-height: 36px; height: 36px; margin: 0; padding: 0; border-color: rgba(255,255,255,.26); background: rgba(255,255,255,.1); color: #fff; font-size: 20px; }
.help-bot-head .icon-btn:hover { border-color: rgba(255,255,255,.42); background: rgba(255,255,255,.14); }
.help-offline-badge { position: relative; z-index: 2; display: inline-flex; flex: 0 0 auto; align-items: center; gap: 6px; padding: 4px 7px; border: 1px solid rgba(143,221,209,.38); border-radius: 999px; background: rgba(143,221,209,.13); color: #d2f7f1; font-size: 8px; font-weight: 800; text-transform: uppercase; white-space: nowrap; }
.help-offline-badge > span { width: 6px; height: 6px; border-radius: 50%; background: #65e2cf; box-shadow: 0 0 0 3px rgba(101,226,207,.12); }
.help-bot-workspace { display: grid; grid-template-rows: auto minmax(0, 1fr); min-width: 0; min-height: 0; overflow: hidden; background: #fff; }
.help-guide-nav { position: relative; z-index: 1; min-height: 0; padding: 12px 14px 18px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fcfefe, #f2f7f7); box-shadow: 0 4px 8px -6px rgba(15, 35, 45, .18); }
.help-guide-intro { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 10px; padding: 0 2px 8px; }
.help-guide-intro .eyebrow { margin: 0; color: var(--accent); font-size: 9px; }
.help-guide-intro strong { color: var(--ink); font-size: 13px; line-height: 1.25; }
.help-guide-intro p:last-child { display: none; }
.help-template-actions { display: flex; gap: 6px; padding-bottom: 9px; }
.help-template-link { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 0 11px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.help-template-link:hover { background: var(--accent-dark); }
.help-sample-link { border: 1px solid #afd8d2; background: #edf8f6; color: var(--accent-dark); }
.help-sample-link:hover { border-color: #75bdb2; background: #dff2ee; color: var(--accent-dark); }
.help-topic-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; padding: 0 2px; color: #536276; font-size: 9px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.help-topic-heading small { color: var(--subtle); font-size: 9px; letter-spacing: 0; text-transform: none; }
.help-topic-grid { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 12px) / 3); gap: 6px; width: 100%; min-width: 0; padding: 1px 1px 6px; overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x proximity; scrollbar-width: thin; }
.help-topic-grid button { display: grid; grid-template-columns: 33px minmax(0, 1fr); align-items: center; gap: 8px; min-width: 0; min-height: 58px; padding: 8px 19px 8px 8px; overflow: hidden; border: 1px solid #d7e1e6; border-radius: 13px; background: rgba(255,255,255,.96); color: var(--ink); text-align: left; scroll-snap-align: start; box-shadow: 0 3px 9px rgba(18,35,63,.05); transition: border-color .16s ease, background .16s ease, transform .16s ease, box-shadow .16s ease; }
.help-topic-grid button::after { position: absolute; right: 8px; content: '\203A'; color: #87a09d; font-size: 15px; }
.help-topic-grid button { position: relative; }
.help-topic-grid button:hover, .help-topic-grid button:focus-visible, .help-topic-grid button[aria-pressed="true"] { border-color: #78bdb3; background: #edf8f6; color: var(--accent-dark); box-shadow: 0 5px 14px rgba(13,101,92,.09); transform: translateY(-1px); }
.help-topic-grid button[aria-pressed="true"] { box-shadow: inset 3px 0 0 var(--accent), 0 5px 14px rgba(13,101,92,.08); }
.help-topic-grid button > span:not(.help-topic-icon) { display: grid; gap: 2px; min-width: 0; }
.help-topic-grid strong { display: block; overflow: hidden; font-size: 12px; line-height: 1.2; text-overflow: ellipsis; }
.help-topic-grid small { display: block; overflow: hidden; color: var(--muted); font-size: 9px; font-weight: 500; line-height: 1.3; text-overflow: ellipsis; }
.help-topic-icon { display: grid; place-items: center; width: 33px; height: 33px; border: 1px solid #d3ebe7; border-radius: 10px; background: linear-gradient(145deg, #edf9f7, #dff2ee); color: var(--accent); font-size: 14px; font-weight: 900; }
.help-conversation { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto; min-width: 0; min-height: 0; overflow: hidden; background: #f5f8f9; }
.help-answer-label { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 11px 14px; border-bottom: 1px solid var(--line); background: #fff; }
.help-answer-label > div { display: grid; gap: 3px; }
.help-answer-label span { color: var(--muted); font-size: 9px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.help-answer-label strong { color: var(--ink); font-size: 14px; }
.help-clear-button { min-height: 33px; padding: 0 11px; border: 1px solid var(--line); background: #fff; color: var(--muted); font-size: 10px; }
.help-clear-button:hover { border-color: #98c9c2; background: var(--accent-soft); color: var(--accent-dark); }
.help-bot-messages { display: flex; flex-direction: column; gap: 16px; min-height: 0; padding: 16px 14px 22px; overflow-y: auto; overscroll-behavior: contain; background: radial-gradient(circle at 90% 0, rgba(174,224,217,.34), transparent 36%), linear-gradient(180deg, #f5f9fa, #eef4f5); }
.help-message { position: relative; align-self: flex-start; width: fit-content; min-width: 0; max-width: calc(100% - 12px); padding: 14px 16px 14px 46px; overflow-wrap: anywhere; word-break: normal; border: 1px solid var(--line); border-radius: 5px 16px 16px 16px; background: #fff; color: #344258; font-size: 12px; line-height: 1.68; white-space: pre-wrap; box-shadow: 0 5px 18px rgba(18,35,63,.07); }
.help-message-role { display: block; margin-bottom: 4px; color: #7f9599; font-size: 9px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.help-message-text { margin: 0; }
.help-message.assistant::before { position: absolute; top: 12px; left: 9px; width: 27px; height: 27px; content: ''; border: 1px solid #7bc9bf; border-radius: 50%; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%2314b8a6'/%3E%3Cstop offset='0.55' stop-color='%230d9488'/%3E%3Cstop offset='1' stop-color='%230f766e'/%3E%3C/linearGradient%3E%3C/defs%3E%3Ccircle cx='32' cy='32' r='32' fill='url(%23g)'/%3E%3Cpath d='M32 14 L36 28 L50 32 L36 36 L32 50 L28 36 L14 32 L28 28 Z' fill='%23fff'/%3E%3Ccircle cx='47' cy='17' r='4' fill='%23fff' opacity='.85'/%3E%3C/svg%3E") center / cover no-repeat; box-shadow: 0 0 0 3px #e8f6f4, 0 0 13px rgba(61,190,171,.3); }
.help-message.user { align-self: flex-end; padding: 14px 46px 14px 16px; border-color: #9bd0c8; border-radius: 15px 5px 15px 15px; background: linear-gradient(145deg, #e5f6f3, #d9efec); color: #174a46; }
.help-message.user .help-message-role { color: #4c8880; text-align: right; }
.help-message.user::before { position: absolute; top: 12px; right: 9px; left: auto; width: 24px; height: 24px; content: 'Y'; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #159b8d 0%, #0d6f65 48%, #074b45 100%); color: #fff; font-size: 10px; font-weight: 800; box-shadow: 0 0 0 3px #e8f6f4; }
.help-message.pending { color: var(--muted); font-style: italic; }
.help-message.error { border-color: #efc6c1; background: var(--danger-soft); color: var(--danger); }
.help-bot-form { display: grid; gap: 5px; min-width: 0; padding: 10px 12px 6px; border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -8px 24px rgba(18,35,63,.05); }
.help-bot-form > label { color: var(--ink); font-size: 10px; font-weight: 800; }
.help-bot-form > small { color: var(--subtle); font-size: 9px; }
.help-composer-row { display: grid; grid-template-columns: minmax(0, 1fr) 82px; gap: 8px; width: 100%; min-width: 0; }
.help-bot-form textarea { min-width: 0; max-width: 100%; min-height: 48px; max-height: 110px; padding: 12px 13px; resize: none; border-radius: 13px; font-size: 12px; line-height: 1.45; }
.help-bot-form textarea:focus { border-color: #74bdb3; box-shadow: 0 0 0 3px rgba(13,101,92,.1); }
.help-bot-form button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; align-self: stretch; width: 82px; min-width: 0; padding: 0 10px; border-radius: 13px; }
.help-bot-form button span:last-child { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.16); font-size: 12px; }
.help-bot-note { margin: 0; padding: 0 12px 10px; background: #fff; color: var(--subtle); font-size: 8.5px; line-height: 1.45; }

/* Smart App Guide: keep every control and answer inside the panel.
   The original horizontal topic rail made cards and long guidance look cut off. */
.help-bot-panel,
.help-bot-panel * { box-sizing: border-box; }
.help-guide-nav { overflow: hidden; }
.help-topic-grid {
  grid-auto-flow: row;
  grid-auto-columns: auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 100%;
  max-height: 68px;
  -webkit-mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 82%, transparent 100%);
  overflow-x: hidden;
  overflow-y: auto;
  padding-right: 4px;
  scroll-snap-type: none;
}
.help-topic-grid button {
  min-width: 0;
  min-height: 62px;
  padding-right: 24px;
}
.help-topic-grid strong,
.help-topic-grid small {
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
}
.help-conversation { grid-template-rows: auto minmax(60px, 1fr) auto auto; }
.help-bot-messages { min-width: 0; overflow-x: hidden; }
.help-message {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}
.help-message.user { width: fit-content; max-width: 92%; }
.help-bot-form { min-width: 0; }
.help-composer-row { display: flex; min-width: 0; max-width: 100%; }
.help-bot-form textarea { flex: 1 1 0; width: 0; min-width: 0; }
.help-bot-form button { flex: 0 0 88px; width: 88px; min-width: 88px; }

@media (max-width: 620px) {
  .help-topic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 152px;
  }
  .help-topic-grid button { min-height: 58px; }
  .help-conversation { grid-template-rows: auto minmax(50px, 1fr) auto auto; }
}

@media (max-width: 420px) {
  .help-bot-form button { flex-basis: 54px; width: 54px; min-width: 54px; }
}

@keyframes help-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes help-panel-in { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes bot-glow { 0%,100% { box-shadow: 0 0 0 7px rgba(24,183,164,.1), 0 0 28px rgba(54,232,206,.38), 0 18px 38px rgba(4,47,45,.32); } 50% { box-shadow: 0 0 0 9px rgba(24,183,164,.15), 0 0 46px rgba(54,232,206,.6), 0 21px 44px rgba(4,47,45,.38); } }
@keyframes bot-ring { 0% { opacity: .8; transform: scale(.92); } 75%,100% { opacity: 0; transform: scale(1.28); } }

.app-footer { display: flex; justify-content: space-between; gap: 16px; padding: 14px clamp(20px,3vw,42px); border-top: 1px solid var(--line); color: var(--subtle); font-size: 9px; text-transform: uppercase; }
.app-footer > span:last-child { display: inline-flex; align-items: center; gap: 7px; }
.footer-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); animation: status-pulse 1.4s ease-in-out infinite; }

.public-page {
  display: block;
  min-height: 100dvh;
  padding: clamp(24px, 5vw, 48px) 18px 90px;
  overflow-x: hidden;
  overflow-y: auto;
  background:
    radial-gradient(circle at 15% 15%, rgba(13, 101, 92, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(2, 132, 199, 0.06) 0%, transparent 40%),
    #edf3f5;
}
.public-page .public-card { margin: 0 auto; }
.public-card {
  position: relative;
  width: min(640px, 100%);
  padding: clamp(24px, 5vw, 40px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.public-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), var(--teal-light), var(--cyan-accent));
}
.public-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.public-brand img {
  width: 72px;
  height: 64px;
  padding: 4px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.public-brand > span { display: grid; gap: 4px; }
.public-brand strong { color: var(--ink); font-size: 20px; line-height: 1.15; font-weight: 800; letter-spacing: -0.01em; }
.public-brand small { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.public-card .eyebrow { color: var(--accent); font-weight: 800; }
.public-card h1 { margin-bottom: 18px; font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.public-card .form-grid { grid-template-columns: 1fr; }
.public-card label small { display: block; margin-top: 6px; color: var(--muted); font-weight: 500; line-height: 1.45; }
.summary {
  display: grid;
  gap: 10px;
  margin: 18px 0 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-soft);
  color: var(--ink);
  font-size: 13px;
  box-shadow: var(--shadow-xs);
}
.creditor-response-card {
  display: grid;
  gap: 14px;
  margin: 8px 0;
  padding: 18px;
  border: 1px solid #b9ddd7;
  border-radius: var(--radius);
  background: linear-gradient(145deg, #f0faf8, #ffffff);
  box-shadow: var(--shadow-xs);
}
.creditor-response-card legend { padding: 0 8px; color: var(--accent-dark); font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; }
.creditor-response-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.creditor-response-card label { display: grid; gap: 6px; }
.public-page .app-footer {
  position: fixed;
  inset: auto 0 0;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
}

/* Readable application typography
   Keep operational text legible across dashboards, tables, forms and system UI. */
.brand-copy small { font-size: 10.5px; }
.workspace-label span { font-size: 11px; }
.workspace-label strong { font-size: 13px; }
.nav-item strong { font-size: 14px; line-height: 1.25; }
.nav-item small { font-size: 11px; line-height: 1.35; }
.system-card-head { font-size: 11px; }
.live-label { font-size: 10px; }
.db-status { font-size: 12px; }
.system-detail { font-size: 11px; line-height: 1.4; }
.sidebar-version { font-size: 10px; }

.page-context p,
.eyebrow { font-size: 11px; line-height: 1.35; }
.user-chip strong { font-size: 12px; }
.user-chip small { font-size: 10.5px; line-height: 1.35; }
.install-app-button { font-size: 11px; }
.view-description { font-size: 12.5px; line-height: 1.5; }

.audit-filter-field span,
.bulk-step-label { font-size: 10px; }
.audit-filter-field input,
.audit-filter-actions button { font-size: 12px; }
.audit-date-separator { font-size: 10px; }
.bulk-select-control,
.recipient-checkbox,
.review-checkbox { font-size: 11.5px; }

.stat span { font-size: 12px; }
.stat small { font-size: 11.5px; line-height: 1.45; }
.data-panel-head h3 { font-size: 18px; }
.data-panel-head p { font-size: 12.5px; line-height: 1.45; }
.record-count { font-size: 11px; }

th { font-size: 11px; line-height: 1.4; }
td { font-size: 13px; line-height: 1.5; }
.party-primary > strong { font-size: 14px; }
.party-primary small { font-size: 11.5px; line-height: 1.45; }
.party-primary .firm-name-line { font-size: 11px; }
.party-primary .client-name-line { font-size: 12px; }
.party-primary .client-name-line strong { font-size: 10px; }
.optional-label,
.entity-code { font-size: 11px; }
.badge,
.review-badge,
.role-badge,
.account-status,
.protected-account { font-size: 10.5px; }
.response-attribution strong,
.response-attribution-time,
.response-attribution-msme,
.delivery-activity,
.review-summary small { font-size: 10.5px; }
.review-controls label { font-size: 10px; }
.review-controls input { font-size: 12px; }
.read-only-note { font-size: 11px; }

.party-shortlist-search,
.party-filter-field { font-size: 10.5px; }
.party-shortlist-search input,
.party-multi-filter > summary { font-size: 12.5px; }
.party-multi-filter > summary small { font-size: 9px; }
.party-filter-menu-head strong { font-size: 12.5px; }
.party-filter-menu-head span,
.party-filter-menu > p { font-size: 10px; }
.party-filter-menu label { font-size: 12px; }
.party-filter-menu-clear,
.party-filter-chip,
.party-filter-summary,
.entry-legend-chip { font-size: 10.5px; }

.import-intro h3,
.form-section-head h3 { font-size: 18px; }
.import-intro p:last-child,
.form-section-head p { font-size: 12.5px; }
.import-icon,
.import-icon strong { font-size: 10px; }
.import-review strong { font-size: 13px; }
.import-review span { font-size: 12px; }
.import-errors { font-size: 11.5px; }
.import-field-guide strong { font-size: 11.5px; }
.import-field-guide span { font-size: 10.5px; }
.import-help summary { font-size: 11.5px; }
.import-help ol { font-size: 11.5px; }
.import-note { font-size: 10.5px; }

.notification-event-options legend,
.notification-event-options label { font-size: 11.5px; }
.notification-guidance { font-size: 10.5px; }
.notification-event-tags span { font-size: 9.5px; }
.role-explainer span { font-size: 11.5px; }
.role-explainer strong { font-size: 12.5px; }
.audit-time { font-size: 12.5px; }
.audit-action { font-size: 10.5px; }
.audit-details { font-size: 11.5px; }
.audit-empty-state strong { font-size: 14px; }
.audit-empty-state small { font-size: 11.5px; }
.row-role-select { font-size: 12px; }
.form-section-head > span { font-size: 10.5px; }
.form-message { font-size: 12px; }
.row-actions button { font-size: 11.5px; }
.row-feedback,
.table-error { font-size: 11.5px; }
.notice { font-size: 13px; }

.operator-card > p:not(.eyebrow, .form-message) { font-size: 13px; }
.operator-card > small { font-size: 10.5px; }
.app-toast-copy strong { font-size: 13px; }
.app-toast-copy > span { font-size: 12px; }
.action-dialog-head p { font-size: 10.5px; }
.action-dialog-head h2 { font-size: 23px; }
.action-dialog-message { font-size: 13px; }
.action-dialog-details { font-size: 11.5px; }

.product-kicker,
.panel-heading p { font-size: 11px; }
.panel-heading h2 { font-size: 26px; }
.form-stack .auth-link { font-size: 11.5px; }
.auth-help,
.auth-success > p { font-size: 12.5px; }
.auth-success > div > p { font-size: 10.5px; }
.auth-next-steps span { font-size: 11.5px; }
.password-rules span { font-size: 10.5px; }
.show-password-control { font-size: 11.5px; }
.login-note { font-size: 10.5px; }
.reset-destination-card strong { font-size: 12px; }
.reset-destination-card p { font-size: 11.5px; }

.help-bot-head p { font-size: 10.5px; }
.help-bot-head h2 { font-size: 21px; }
.help-offline-badge { font-size: 9px; }
.help-guide-intro .eyebrow,
.help-topic-heading,
.help-topic-heading small,
.help-answer-label span { font-size: 10px; }
.help-guide-intro strong { font-size: 14px; }
.help-template-link { font-size: 11px; }
.help-topic-grid strong { font-size: 13px; }
.help-topic-grid small { font-size: 10.5px; }
.help-answer-label strong { font-size: 15px; }
.help-clear-button,
.help-bot-form > label { font-size: 11.5px; }
.help-message { font-size: 13px; }
.help-bot-form > small,
.help-bot-note { font-size: 10px; }
.help-bot-form textarea { font-size: 13px; }

.app-footer { font-size: 10.5px; }
.public-brand small { font-size: 11.5px; }
.public-card h1 { font-size: 30px; }
.summary,
.creditor-response-card legend { font-size: 13px; }
.creditor-response-card p,
.public-card label small { font-size: 11.5px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.hidden { display: none !important; }

@media (max-width: 1180px) {
  .form-grid { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .import-field-guide { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .audit-view-head { align-items: stretch; flex-direction: column; }
  .audit-date-filter { align-self: flex-start; flex-wrap: wrap; }
  .party-register .table-wrap { overflow: visible; }
  .parties-table { display: block; min-width: 0; padding: 12px; }
  .parties-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .parties-table tbody { display: grid; gap: 12px; }
  .parties-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-left: 4px solid var(--entry-accent, var(--accent)); border-radius: 10px; background: var(--entry-tint, #fff); box-shadow: var(--shadow-sm); overflow: hidden; }
  .parties-table .entry-user-group:hover > td { outline: 0; }
  .parties-table td { display: grid; grid-template-columns: minmax(110px, .45fr) minmax(0, 1fr); align-items: start; gap: 12px; min-width: 0; padding: 12px 14px; border-bottom: 1px solid rgba(205,216,226,.78); background: transparent !important; overflow-wrap: anywhere; }
  .parties-table td::before { content: attr(data-label); color: var(--muted); font-size: 10px; font-weight: 850; line-height: 1.4; text-transform: uppercase; }
  .parties-table td:nth-child(1),
  .parties-table td:nth-child(6),
  .parties-table td[colspan] { grid-column: 1 / -1; }
  .parties-table td:nth-child(6),
  .parties-table td[colspan] { display: block; }
  .parties-table td:nth-child(6)::before { display: block; margin-bottom: 10px; }
  .parties-table td[colspan]::before { content: none; }
  .parties-table .party-primary { min-width: 0; }
  .parties-table .review-summary,
  .parties-table .delivery-summary { min-width: 0; }
  .parties-table .review-controls { grid-template-columns: minmax(220px, 1fr) minmax(190px, .8fr); }
  .parties-table .review-controls > .row-actions { align-items: center; }
  .parties-table .row-feedback { max-width: none; }
}

@media (max-width: 900px) {
  :root { --sidebar: 248px; }
  .app-layout { grid-template-columns: 1fr; }
  .main-area { grid-column: 1; }
  .sidebar { transform: translateX(-105%); transition: transform 180ms ease; }
  body.sidebar-open .sidebar { transform: translateX(0); }
  .sidebar-scrim { position: fixed; inset: 0; z-index: 18; display: block; background: rgba(11,25,34,.44); opacity: 0; pointer-events: none; transition: opacity 180ms ease; }
  body.sidebar-open .sidebar-scrim { opacity: 1; pointer-events: auto; }
  .menu-btn { display: grid; }
  .login-layout { grid-template-columns: 1fr; }
  .login-intro { min-height: 330px; }
  .login-panel { min-height: 420px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: repeat(2, minmax(150px, 1fr)); }
  .role-explainer { grid-template-columns: 1fr; }
  .party-shortlist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .party-shortlist-search { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .topbar { min-height: 66px; padding: 9px 13px; }
  .page-context p { display: none; }
  .page-context h1 { font-size: 19px; }
  .user-chip { display: none !important; }
  .topbar-actions { gap: 6px; }
  .topbar-actions button { min-height: 38px; padding: 0 11px; font-size: 11.5px; }
  .install-app-button { width: 36px; padding: 0 !important; font-size: 0 !important; }
  .install-app-button::before { margin: 0; font-size: 16px; }
  .content { padding: 18px 12px 92px; }
  .view-head { align-items: stretch; flex-direction: column; }
  .audit-date-filter { display: grid; grid-template-columns: 1fr 18px 1fr; width: 100%; }
  .audit-filter-field { min-width: 0; }
  .audit-date-separator { text-align: center; }
  .audit-filter-actions { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr 1fr; }
  .audit-filter-actions button { width: 100%; }
  .audit-panel-badges { flex-wrap: wrap; justify-content: flex-end; }
  .actions { align-items: stretch; }
  .actions > *, .compact-control { flex: 1 1 100%; }
  .bulk-workflow-actions { display: grid; justify-content: stretch; }
  .bulk-action-group { display: grid; grid-template-columns: 1fr; align-items: stretch; }
  .bulk-step-label { padding: 2px 4px; }
  .bulk-capacity-badge { justify-content: center; width: 100%; }
  .bulk-select-control { justify-content: flex-start; width: 100%; }
  .bulk-action-group button { width: 100%; }
  .compact-control select { width: 100%; }
  .stats { gap: 8px; }
  .stat { min-height: 94px; padding: 14px; }
  .stat strong { font-size: 25px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-section-head, .form-footer { align-items: stretch; flex-direction: column; }
  .form-actions { justify-content: flex-end; }
  .login-intro { min-height: 300px; padding: 30px 24px; }
  .login-intro h2 { font-size: 33px; }
  .login-panel { min-height: 390px; padding: 30px 24px; }
  .data-panel-head { align-items: flex-start; }
  .party-shortlist { grid-template-columns: 1fr; padding: 13px 12px; }
  .party-shortlist-search { grid-column: auto; }
  .party-shortlist > #clearPartyFilters { width: 100%; }
  .party-filter-menu { position: static; width: 100%; max-height: 300px; margin-top: 6px; box-shadow: 0 8px 22px rgba(21,45,61,.13); }
  .party-filter-chip { width: auto; }
  .table-wrap:has(.mobile-card-table) { overflow: visible; }
  .mobile-card-table { display: block; min-width: 0; padding: 10px; }
  .mobile-card-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .mobile-card-table tbody { display: grid; gap: 10px; }
  .mobile-card-table tr { display: grid; padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow-sm); }
  .mobile-card-table td { display: grid; grid-template-columns: minmax(92px, .7fr) minmax(0, 1.3fr); align-items: start; gap: 10px; min-height: 38px; padding: 9px 0; border-bottom: 1px solid #edf1f5; text-align: right; overflow-wrap: anywhere; }
  .mobile-card-table td:last-child { border-bottom: 0; }
  .mobile-card-table td::before { content: attr(data-label); color: var(--muted); font-size: 10.5px; font-weight: 850; line-height: 1.4; text-align: left; text-transform: uppercase; }
  .mobile-card-table td[colspan] { display: block; min-height: 44px; text-align: left; }
  .mobile-card-table td[colspan]::before { content: none; }
  .mobile-card-table .party-primary { min-width: 0; text-align: right; }
  .mobile-card-table .row-actions { justify-content: flex-end; flex-wrap: wrap; min-width: 0; }
  .mobile-card-table .user-row-actions { min-width: 0; }
  .mobile-card-table .audit-details { min-width: 0; max-width: none; }
  .mobile-card-table .audit-detail-grid { grid-template-columns: 1fr; min-width: 0; max-width: none; text-align: left; }
  .mobile-card-table .row-feedback { grid-column: 1 / -1; max-width: none; text-align: left; }
  .mobile-card-table .review-summary { justify-items: end; margin-left: auto; }
  .mobile-card-table .delivery-summary { justify-items: end; margin-left: auto; }
  .mobile-card-table .delivery-summary-link { justify-items: end; max-width: 320px; text-align: right; }
  .mobile-card-table .delivery-activity { white-space: normal; text-align: right; }
  .mobile-card-table .review-controls { grid-column: 1 / -1; grid-template-columns: 1fr; min-width: 0; text-align: left; }
  .mobile-card-table .review-controls .row-actions { justify-content: stretch; }
  .mobile-card-table .review-controls button { flex: 1 1 auto; }
  .mobile-card-table .review-checkbox { flex: 1 1 100%; justify-content: center; }
  .parties-table tr { grid-template-columns: 1fr; padding: 0; }
  .parties-table td,
  .parties-table td:nth-child(1),
  .parties-table td:nth-child(6) { grid-column: 1; }
  .parties-table td:nth-child(6) { padding: 12px; }
  .parties-table .review-controls { grid-template-columns: 1fr; }
  .app-footer { flex-direction: column; align-items: center; text-align: center; }
  .public-card { padding: 25px 20px; }
  .import-panel, .import-review { grid-template-columns: 1fr; align-items: stretch; }
  .import-next-file { grid-template-columns: auto minmax(0, 1fr); }
  .import-next-file .file-button { grid-column: 1 / -1; width: 100%; }
  .import-field-guide { grid-template-columns: 1fr; }
  .import-actions > *, .import-review-actions > * { flex: 1 1 auto; }
  .import-firm-control { flex-basis: 100%; max-width: none; }
  .help-bot-button { right: 14px; bottom: 14px; width: 44px; height: 44px; min-height: 44px; }
  .help-bot-button > .bot-logo-small { width: 36px; height: 36px; flex-basis: 36px; }
  .help-bot-panel { right: 8px; bottom: 8px; width: calc(100vw - 16px); height: calc(100dvh - 16px); border-radius: 18px; animation: help-panel-mobile-in .2s ease-out; }
  .help-bot-workspace { grid-template-rows: auto minmax(0, 1fr); }
  .help-guide-nav { padding: 10px 11px; }
  .help-guide-intro { padding-bottom: 7px; }
  .help-template-actions { padding-bottom: 8px; }
  .help-topic-grid button { min-height: 44px; }
  .help-offline-badge { display: none; }
  .help-bot-messages { padding: 15px 14px 20px; }
  .help-bot-form { padding-inline: 12px; }
  .help-bot-form button { min-height: 42px; }
  .operator-card { padding: 24px 20px; }
  .app-toast { top: 88px; right: 10px; width: calc(100vw - 20px); }
  .action-dialog { align-items: end; padding: 10px; }
  .action-dialog-card { padding: 21px 18px; border-radius: 15px 15px 10px 10px; }
  .action-dialog-actions { flex-direction: column-reverse; }
  .action-dialog-actions button { width: 100%; }
}

@media (max-width: 420px) {
  .help-bot-head { padding: 13px 14px; }
  .help-bot-title h2 { font-size: 17px; }
  .help-offline-badge { display: none; }
  .help-topic-grid { grid-auto-columns: calc((100% - 6px) / 2); }
  .help-topic-grid button { min-height: 54px; }
  .help-answer-label, .help-bot-messages { padding-inline: 14px; }
  .help-bot-form { padding-inline: 12px; }
  .help-composer-row { grid-template-columns: minmax(0, 1fr) 54px; }
  .help-bot-form button { width: 54px; min-width: 0; min-height: 40px; }
  .help-bot-form button span:first-child { display: none; }
}

@keyframes help-panel-mobile-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* 2026 professional interface refinement
   Shared visual language for the workspace, authentication and public portal. */
:root {
  --ink: #13233a;
  --muted: #617087;
  --subtle: #8491a3;
  --line: #d8e1e9;
  --line-strong: #c5d1dc;
  --canvas: #f2f6f8;
  --panel-soft: #f7fafb;
  --accent: #087267;
  --accent-dark: #04554d;
  --accent-soft: #e8f6f3;
  --shadow-sm: 0 2px 8px rgba(18, 40, 58, .055);
  --shadow: 0 18px 46px rgba(18, 40, 58, .1);
  --radius: 12px;
  --sidebar: 288px;
}

body {
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 0%, rgba(42, 160, 145, .055), transparent 31rem),
    linear-gradient(rgba(16, 78, 72, .024) 1px, transparent 1px) 0 0 / 100% 56px,
    var(--canvas);
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1 { font-size: clamp(23px, 2vw, 29px); letter-spacing: -.025em; }
h2 { font-size: clamp(27px, 2.3vw, 34px); letter-spacing: -.03em; }
h3 { font-size: 18px; letter-spacing: -.015em; }

button,
.button {
  min-height: 44px;
  padding-inline: 17px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 780;
}

button:hover,
.button:hover { transform: translateY(-1px); }
button:active,
.button:active { transform: translateY(0); }

input,
select,
textarea {
  min-height: 46px;
  padding: 10px 13px;
  border-radius: 9px;
  background: #fff;
  font-size: 14px;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:hover,
select:hover,
textarea:hover { border-color: #aebdca; }
input::placeholder,
textarea::placeholder { color: #929eae; opacity: 1; }
label { gap: 8px; color: #344258; font-size: 13px; }

.sidebar {
  padding: 24px 18px 18px;
  background:
    radial-gradient(circle at 0 0, rgba(67, 197, 178, .11), transparent 24rem),
    linear-gradient(180deg, #0d3438 0%, #092c31 100%);
  box-shadow: 10px 0 36px rgba(10, 37, 44, .09);
}

.brand { gap: 14px; padding: 2px; }
.brand-mark { width: 66px; height: 62px; border-radius: 13px; }
.brand-mark img { width: 60px; height: 55px; }
.brand-copy { gap: 5px; }
.brand-copy strong { font-size: 19px; letter-spacing: -.025em; }
.brand-copy small { color: #b9d5d5; font-size: 10.5px; letter-spacing: .055em; }

.workspace-label { margin: 31px 8px 14px; padding-top: 21px; }
.side-nav { gap: 7px; }
.nav-item {
  grid-template-columns: 38px 1fr;
  min-height: 62px;
  padding: 9px 11px;
  border-radius: 11px;
}
.nav-item.active {
  border-color: rgba(118, 224, 207, .21);
  background: linear-gradient(135deg, rgba(49, 127, 125, .66), rgba(28, 88, 91, .82));
  box-shadow: inset 3px 0 #60d1c0, 0 8px 24px rgba(1, 25, 29, .14);
}
.nav-icon { width: 34px; height: 34px; border-radius: 9px; }
.nav-item strong { font-size: 14px; }
.nav-item small { font-size: 11px; }
.system-card { padding: 15px; border-radius: 12px; background: rgba(1, 22, 25, .3); }

.topbar {
  min-height: 82px;
  padding: 13px clamp(22px, 3vw, 46px);
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 4px 18px rgba(18, 40, 58, .035);
}
.page-context p { margin-bottom: 5px; color: #64758b; font-size: 10.5px; letter-spacing: .055em; }
.topbar .page-context h1 { font-size: 25px; }
.user-chip { min-width: 225px; padding-right: 17px; }
.user-chip strong { font-size: 13px; }
.user-chip small { font-size: 11px; }
.user-avatar { flex-basis: 44px; width: 44px; height: 44px; border-radius: 15px; }
.identity-role { min-height: 21px; font-size: 8.5px; }

.content { max-width: 1600px; padding: 34px clamp(22px, 3vw, 46px) 120px; }
.view-head { margin-bottom: 23px; }
.view-description { margin-top: 8px; font-size: 13px; }
.eyebrow { margin-bottom: 7px; letter-spacing: .055em; }

.panel,
.data-panel {
  border-color: #d5dfe7;
  border-radius: 14px;
  box-shadow: 0 5px 18px rgba(18, 40, 58, .055);
}
.data-panel-head { min-height: 74px; padding: 17px 20px; }
.data-panel-head h3 { font-size: 19px; }
.data-panel-head p { margin-top: 5px; font-size: 12.5px; }
.record-count { padding: 6px 10px; border-radius: 7px; font-size: 11px; }

.stats { gap: 15px; margin-bottom: 22px; }
.stat,
.stat-filter { min-height: 126px; }
.stat { padding: 21px; border-radius: 14px; box-shadow: 0 4px 16px rgba(18, 40, 58, .055); }
.stat::before { width: 4px; }
.stat span { font-size: 11.5px; letter-spacing: .025em; }
.stat strong { margin-top: 12px; font-size: 34px; letter-spacing: -.035em; }
.stat small { margin-top: 9px; font-size: 11.5px; }

.table-wrap { scrollbar-color: #b8c8d1 transparent; scrollbar-width: thin; }
table { font-variant-numeric: tabular-nums; }
th,
td { padding: 15px 17px; }
th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f5f8fa;
  color: #596a80;
  font-size: 10.5px;
  letter-spacing: .025em;
}
td { color: #314157; font-size: 13px; }
tbody tr:hover { background: #f9fbfc; }
.party-primary { gap: 6px; }
.party-primary > strong { font-size: 14.5px; }
.party-primary small { font-size: 11.5px; }
.party-primary .client-name-line {
  padding: 6px 10px;
  border-radius: 8px;
  background: #edf6f4;
  font-size: 11.5px;
}
.party-primary .firm-name-line { color: #65518d; font-size: 10.5px; }
.badge,
.review-badge,
.role-badge,
.account-status { min-height: 28px; padding-inline: 9px; border-radius: 7px; }

/* Entry ownership remains identifiable through a precise accent instead of large colour patches. */
.entry-user-group > td { background: #fff; }
.entry-user-group > td:first-child { box-shadow: inset 4px 0 0 var(--entry-accent); }
.entry-user-group:hover > td { background: color-mix(in srgb, var(--entry-accent) 3.5%, #fff); outline: 0; }
.entry-color-0,
.entry-color-1,
.entry-color-2,
.entry-color-3,
.entry-color-4,
.entry-color-5,
.entry-color-6,
.entry-color-7 { --entry-tint: #fff; }
.entry-color-0 { --entry-accent: #138477; }
.entry-color-1 { --entry-accent: #397fb3; }
.entry-color-2 { --entry-accent: #b67817; }
.entry-color-3 { --entry-accent: #7957ad; }
.entry-color-4 { --entry-accent: #b94e6a; }
.entry-color-5 { --entry-accent: #4a8b4f; }
.entry-color-6 { --entry-accent: #b9622a; }
.entry-color-7 { --entry-accent: #536f9e; }
.entry-legend-chip { background: #fff; box-shadow: var(--shadow-sm); }

.bulk-workflow-actions { gap: 10px; }
.bulk-action-group { gap: 8px; padding: 8px; border-radius: 11px; }
.bulk-select-control { min-height: 42px; border-radius: 8px; font-size: 11px; }
.bulk-capacity-badge { min-height: 30px; }
.row-actions { gap: 7px; }
.row-actions button { min-height: 36px; padding-inline: 11px; border-radius: 7px; font-size: 11px; }
.recipient-checkbox,
.review-checkbox,
.delete-checkbox { min-height: 36px; padding-inline: 10px; border-radius: 7px; font-size: 11px; }

.party-layout,
.user-management-layout { gap: 22px; }
.party-shortlist {
  gap: 12px;
  padding: 17px 20px;
  background: linear-gradient(180deg, #fbfdfd, #f6f9fa);
}
.party-shortlist-search,
.party-filter-field { gap: 7px; font-size: 10px; letter-spacing: .025em; }
.party-shortlist-search input,
.party-multi-filter > summary,
.party-shortlist > #clearPartyFilters { min-height: 44px; }
.party-multi-filter > summary { padding-inline: 13px; border-radius: 9px; font-size: 12px; }
.party-filter-menu { padding: 12px; border-radius: 12px; box-shadow: 0 20px 48px rgba(18, 40, 58, .17); }
.party-filter-menu label { min-height: 38px; font-size: 11.5px; }
.party-filter-chips { gap: 7px; }
.party-filter-chip { min-height: 31px; padding-inline: 10px; }
.entry-color-legend { padding: 12px 20px; }

.import-panel { gap: 18px 26px; padding: 21px; }
.import-intro { gap: 15px; }
.import-icon { flex-basis: 62px; min-height: 58px; border-radius: 12px; }
.import-intro h3 { font-size: 18px; }
.import-field-guide { gap: 10px; }
.import-field-guide > div { min-height: 70px; padding: 12px 13px; border-radius: 9px; }
.import-help { padding: 13px 15px; border-radius: 9px; }
.party-form,
.create-user-panel,
.notification-recipient-panel { padding: 22px; }
.form-section-head { padding-bottom: 18px; }
.form-grid { gap: 18px; padding-top: 20px; }
.form-footer { margin-top: 20px; padding-top: 17px; }

.audit-date-filter { padding: 12px; border-radius: 12px; }
.audit-filter-field input,
.audit-filter-actions button { min-height: 42px; }
.audit-table tbody tr:nth-child(even) { background: #f9fbfc; }
.audit-detail-grid > div { padding: 9px 10px; border-radius: 8px; }
.audit-action { min-height: 29px; padding-inline: 10px; }

.operator-gate { background: rgba(7, 28, 34, .74); backdrop-filter: blur(8px); }
.operator-card { width: min(100%, 500px); padding: 34px; border-radius: 18px; }
.operator-icon { width: 50px; height: 50px; border-radius: 13px; }
.operator-card h2 { font-size: 28px; }

.login-layout { min-height: calc(100vh - 196px); border-radius: 17px; }
.login-intro {
  background:
    radial-gradient(circle at 25% 20%, rgba(76, 212, 192, .14), transparent 25rem),
    linear-gradient(145deg, #0b3439, #104c4d);
}
.login-intro h2 { margin: 18px 0; font-size: clamp(38px, 4.4vw, 62px); letter-spacing: -.045em; }
.login-intro > p { font-size: 16px; }
.login-capabilities span { min-height: 34px; padding-inline: 12px; border-radius: 8px; font-size: 11px; }
.login-panel { padding: clamp(32px, 5vw, 68px); }
.panel-heading { margin-bottom: 29px; }
.panel-heading h2 { font-size: 29px; }
.panel-icon { width: 62px; height: 58px; border-radius: 11px; box-shadow: var(--shadow-sm); }
.panel-icon img { width: 52px; height: 50px; }
.form-stack { gap: 18px; }
.form-stack button:not(.auth-link) { min-height: 48px; }

.app-toast { top: 106px; right: 26px; padding: 16px; border-radius: 14px; box-shadow: 0 22px 58px rgba(18, 35, 63, .2); }
.action-dialog-card { width: min(540px, 100%); padding: 28px; border-radius: 18px; }
.action-dialog-icon { width: 47px; height: 47px; border-radius: 13px; }
.action-dialog-message { margin-top: 20px; font-size: 13.5px; }
.action-dialog-details { padding: 14px 15px; border-radius: 10px; font-size: 12px; }

.help-bot-button { right: 24px; bottom: 22px; width: 56px; height: 56px; min-height: 56px; }
.help-bot-button > .bot-logo-small { width: 46px; height: 46px; flex-basis: 46px; }
.help-bot-panel {
  right: 26px;
  bottom: 90px;
  width: min(560px, calc(100vw - 36px));
  height: min(760px, calc(100dvh - 108px));
  border-radius: 24px;
}
.help-bot-head { grid-template-columns: 46px minmax(0, 1fr) 38px; min-height: 72px; padding: 14px 17px; }
.help-bot-head .bot-logo { flex: 0 0 46px; width: 46px; height: 46px; }
.help-bot-head h2 { font-size: 22px; }
.help-guide-nav { padding: 14px 16px; }
.help-template-actions { gap: 8px; }
.help-template-link { min-height: 36px; padding-inline: 13px; }
.help-topic-grid { grid-auto-columns: 168px; gap: 8px; }
.help-topic-grid button { min-height: 64px; padding: 9px 20px 9px 9px; }
.help-topic-grid strong { font-size: 12.5px; white-space: normal; }
.help-topic-grid small { font-size: 10px; white-space: normal; }
.help-answer-label { min-height: 52px; padding-inline: 17px; }
.help-bot-messages { padding: 18px 17px 24px; }
.help-message { max-width: 94%; padding: 14px 16px 14px 47px; border-radius: 7px 17px 17px 17px; font-size: 13px; }
.help-message.user { padding: 14px 47px 14px 16px; border-radius: 17px 7px 17px 17px; }
.help-bot-form { padding: 12px 14px 7px; }
.help-composer-row { grid-template-columns: minmax(0, 1fr) 88px; }
.help-bot-form textarea { min-height: 54px; }
.help-bot-form button { width: 88px; }

.public-page {
  padding: 42px 18px 96px;
  background:
    radial-gradient(circle at 50% 0, rgba(16, 118, 107, .09), transparent 32rem),
    #edf3f5;
}
.public-card { width: min(700px, 100%); padding: 40px; border-top-width: 5px; border-radius: 18px; }
.public-brand { gap: 18px; margin-bottom: 31px; padding-bottom: 23px; }
.public-brand img { width: 82px; height: 73px; border-radius: 12px; }
.public-brand strong { font-size: 22px; }
.public-card h1 { margin-bottom: 21px; font-size: clamp(29px, 4vw, 37px); }
.summary { gap: 10px; margin: 18px 0 24px; padding: 18px; border-radius: 11px; font-size: 13.5px; }
.creditor-response-card { padding: 18px; border-radius: 12px; }
.public-card #submitResponseBtn { min-height: 50px; font-size: 14px; }

/* Public confirmation: the record selects the firm; the recipient does not. */
.public-brand { flex-direction: column; justify-content: center; text-align: center; }
.public-brand img { display: block; margin-inline: auto; }
.public-brand > span { justify-items: center; }
.public-brand strong { font-size: 23px; }
.public-brand small { font-size: 11px; }
.public-card[data-audit-firm="sprd_and_co"] { border-top-color: #496895; }
.public-card[data-audit-firm="sprd_and_co"] .public-brand small,
body[data-audit-firm="sprd_and_co"] .public-card .eyebrow { color: #496895; }
.public-card[data-audit-firm="bala_and_co"] { border-top-color: #0d655c; }

.app-footer { padding-block: 17px; font-size: 10.5px; }

/* Switch the operational register to clear cards as soon as its container becomes cramped. */
.party-register { container-type: inline-size; }
@container (max-width: 1260px) {
  .party-register .table-wrap { overflow: visible; }
  .parties-table { display: block; min-width: 0; padding: 14px; }
  .parties-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
  .parties-table tbody { display: grid; gap: 14px; }
  .parties-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-left: 4px solid var(--entry-accent, var(--accent)); border-radius: 13px; background: #fff; box-shadow: 0 4px 16px rgba(18,40,58,.055); overflow: hidden; }
  .parties-table td { display: grid; grid-template-columns: minmax(118px, .42fr) minmax(0, 1fr); align-items: start; gap: 14px; min-width: 0; padding: 14px 16px; border-bottom: 1px solid #e5ebf0; background: #fff !important; overflow-wrap: anywhere; }
  .parties-table td::before { content: attr(data-label); color: var(--muted); font-size: 10px; font-weight: 850; letter-spacing: .025em; line-height: 1.4; text-transform: uppercase; }
  .parties-table td:nth-child(1),
  .parties-table td:nth-child(6),
  .parties-table td[colspan] { grid-column: 1 / -1; }
  .parties-table td:nth-child(6),
  .parties-table td[colspan] { display: block; }
  .parties-table td:nth-child(6)::before { display: block; margin-bottom: 12px; }
  .parties-table td[colspan]::before { content: none; }
  .parties-table .party-primary,
  .parties-table .review-summary,
  .parties-table .delivery-summary { min-width: 0; }
  .parties-table .review-controls { grid-template-columns: minmax(220px, 1fr) minmax(190px, .8fr); }
  .parties-table .row-feedback { max-width: none; }
}

@media (max-width: 1180px) {
  :root { --sidebar: 264px; }
  .content { padding-inline: 24px; }
  .party-shortlist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .party-shortlist-search { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  :root { --sidebar: 272px; }
  .sidebar { padding: 21px 16px 16px; }
  .content { padding-inline: 18px; }
  .topbar { min-height: 76px; padding-inline: 18px; }
}

@media (max-width: 620px) {
  h2 { font-size: 27px; }
  .topbar { min-height: 68px; padding: 10px 12px; }
  .content { padding: 20px 11px 96px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat,
  .stat-filter { min-height: 112px; }
  .stat { padding: 16px; }
  .stat strong { font-size: 29px; }
  .data-panel-head { min-height: 68px; padding: 15px; }
  .party-shortlist { grid-template-columns: 1fr; padding: 15px; }
  .party-shortlist-search { grid-column: auto; }
  .parties-table { padding: 9px; }
  .parties-table tbody { gap: 11px; }
  .parties-table tr { grid-template-columns: 1fr; }
  .parties-table td,
  .parties-table td:nth-child(1),
  .parties-table td:nth-child(6) { grid-column: 1; }
  .parties-table td { grid-template-columns: minmax(100px, .44fr) minmax(0, 1fr); padding: 12px; }
  .parties-table td:nth-child(6) { padding: 13px; }
  .parties-table .review-controls { grid-template-columns: 1fr; }
  .import-panel,
  .party-form,
  .create-user-panel,
  .notification-recipient-panel { padding: 16px; }
  .operator-card { padding: 25px 20px; border-radius: 16px; }
  .operator-actions { grid-template-columns: 1fr; }
  .login-intro { min-height: 276px; }
  .login-panel { padding: 30px 22px; }
  .help-bot-panel { right: 7px; bottom: 7px; width: calc(100vw - 14px); height: calc(100dvh - 14px); border-radius: 19px; }
  .help-topic-grid { grid-auto-columns: 160px; }
  .help-message { max-width: 98%; }
  .public-page { padding: 18px 10px 82px; }
  .public-card { padding: 27px 19px; border-radius: 14px; }
  .public-brand img { width: 65px; height: 59px; }
  .public-brand strong { font-size: 19px; }
}

/* Shared Chartered Accountant firm workflow — consistent for every permitted role. */
.import-field-guide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.firm-context-control { min-width: 210px; }
.firm-context-control select { min-width: 168px; }
.import-upload-step .file-button { align-self: end; justify-self: stretch; width: 100%; }

@media (max-width: 1180px) {
  .import-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .import-upload-step { grid-column: 1 / -1; }
}

@media (max-width: 900px) {
  .import-actions { grid-template-columns: 1fr; }
  .import-upload-step { grid-column: auto; }
}

@media (max-width: 620px) {
  .firm-context-control,
  .firm-context-control select { width: 100%; min-width: 0; }
  .import-action-card { grid-template-columns: 30px minmax(0, 1fr); padding: 13px; }
  .import-role-badges { gap: 5px; }
  .import-role-badges span { min-height: 22px; font-size: 7.5px; }
}

/* Add party form: keep every first-row input on the same baseline.
   Helper text must never stretch a label and push neighbouring controls down. */
.party-form .form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
}
.party-form .form-grid > label {
  align-content: start;
  align-items: start;
  min-width: 0;
}
.party-form .form-grid > label > input,
.party-form .form-grid > label > select { width: 100%; }
.party-form .form-label-text {
  display: block;
  min-width: 0;
}
.party-form .form-label-text .optional-label { margin-left: 4px; }
.party-form .form-grid > label > small {
  min-height: 32px;
  margin: 0;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.38;
}

@media (max-width: 1180px) {
  .party-form .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .party-form .form-grid { grid-template-columns: 1fr; }
  .party-form .form-grid > label > small { min-height: 0; }
}
