:root {
  --ink: #172033;
  --muted: #6b778c;
  --line: #dde6f0;
  --surface: #ffffff;
  --surface-soft: #f8fbfd;
  --page: #edf3f8;
  --primary: #0f8b8d;
  --primary-dark: #0a5361;
  --accent: #d08b28;
  --danger: #b84a44;
  --nav: #10283f;
  --nav-2: #163a59;
  --shadow: 0 14px 34px rgba(23, 32, 51, 0.09);
}

/* Production visual polish: restrained practice-management shell */
:root {
  --ink: #102033;
  --muted: #64748b;
  --line: #dbe4ee;
  --surface: #ffffff;
  --surface-soft: #f7fafc;
  --page: #eef3f7;
  --primary: #087f8c;
  --primary-dark: #075766;
  --accent: #c8872d;
  --danger: #b42318;
  --nav: #0b2538;
  --nav-2: #0f344c;
  --shadow: 0 12px 28px rgba(15, 35, 52, 0.08);
}

body {
  background: linear-gradient(180deg, #f7fafc 0%, #edf3f7 100%);
  color: var(--ink);
}

.app-shell {
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  gap: 18px;
  padding: 18px 16px;
  background: linear-gradient(180deg, #092235 0%, #103a55 100%);
  box-shadow: 12px 0 30px rgba(15, 35, 52, 0.08);
}

.sidebar-brand {
  min-height: 70px;
  padding: 4px 6px 18px;
}

.brand-mark {
  border-radius: 8px;
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.14);
}

.brand-logo,
.nav-icon,
.panel-icon,
.summary-icon,
.focus-icon,
.settings-icon {
  border-radius: 8px;
}

.nav-section {
  gap: 3px;
}

.nav-section-title,
.nav-section-toggle {
  margin-top: 10px;
  color: rgba(232, 241, 247, 0.6);
  letter-spacing: 0;
}

.side-nav a {
  min-height: 38px;
  padding: 9px 10px;
  border-radius: 8px;
  color: rgba(236, 245, 250, 0.86);
  font-size: 13px;
  font-weight: 750;
}

.side-nav a:hover {
  background: rgba(255, 255, 255, 0.09);
}

.side-nav a.active {
  background: #eef8f9;
  color: var(--primary-dark);
  box-shadow: none;
}

.side-nav a.active .nav-icon {
  background: var(--primary);
  color: #fff;
}

.side-nav a:hover .nav-icon {
  background: rgba(255, 255, 255, 0.2);
}

.nav-icon {
  width: 26px;
  height: 26px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 9px;
}

.nav-submenu {
  margin-left: 36px;
  border-left-color: rgba(255, 255, 255, 0.12);
}

.nav-submenu a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.sidebar-footer {
  padding: 13px 10px 0;
}

.utilitybar {
  min-height: 62px;
  padding: 12px 30px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #d8e3ee;
  box-shadow: 0 8px 24px rgba(15, 35, 52, 0.04);
}

.workspace .page {
  padding: 28px 30px 38px;
}

.page-heading {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom-color: #d7e2ec;
}

.page-heading h1 {
  font-size: 30px;
  letter-spacing: 0;
}

.eyebrow,
.client-register-stats span,
.metric span,
th {
  letter-spacing: 0;
}

.panel,
.table-wrap,
.filter-panel,
.client-register-stats article,
.metric,
.summary-card,
.focus-card,
.settings-card,
.mini-panel,
.list-card,
.profile-info-card,
.profile-notes-card {
  border: 1px solid #d9e4ee;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(15, 35, 52, 0.06);
}

.panel.flat,
.table-wrap.flat,
.tab-panel .table-wrap.flat {
  box-shadow: none;
}

.portal-hero,
.client-hero,
.dashboard-command-calm {
  border-radius: 8px;
  border-color: #cfe0e7;
  background:
    linear-gradient(135deg, rgba(8, 127, 140, 0.1), rgba(255, 255, 255, 0.94) 48%, rgba(200, 135, 45, 0.1)),
    #fff;
  box-shadow: 0 12px 28px rgba(15, 35, 52, 0.07);
}

.button {
  border-radius: 7px;
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 10px 18px rgba(8, 127, 140, 0.18);
}

.button:hover {
  background: var(--primary-dark);
}

.button.secondary {
  border-color: #c5e6ea;
  background: #eef8f9;
  color: var(--primary-dark);
}

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

input,
textarea,
select {
  border-radius: 7px;
  border-color: #ccdae6;
  background: #fff;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(8, 127, 140, 0.12);
}

table {
  border-radius: 8px;
}

th {
  background: #f3f7fa;
  color: #516175;
  font-size: 11px;
}

td {
  border-bottom-color: #e4ebf2;
}

tbody tr:hover {
  background: #f8fbfd;
}

.pill,
.status-pill {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.tabs.modern-tabs,
.modern-tabs {
  border-radius: 8px;
  background: #fff;
  border: 1px solid #d9e4ee;
  box-shadow: 0 8px 18px rgba(15, 35, 52, 0.04);
}

.tabs.modern-tabs a,
.modern-tabs a {
  border-radius: 6px;
}

.tabs.modern-tabs a.active,
.modern-tabs a.active {
  background: #e9f7f8;
  color: var(--primary-dark);
}

.login-card {
  border-radius: 10px;
  box-shadow: 0 24px 50px rgba(15, 35, 52, 0.12);
}

.login-card .button.full,
.portal-notification-bar {
  border-radius: 8px;
}

@media (max-width: 780px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .workspace .page {
    padding: 20px 16px 28px;
  }

  .utilitybar {
    padding: 12px 16px;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(15, 139, 141, 0.1), transparent 34rem),
    linear-gradient(180deg, #f6f9fc, var(--page));
  color: var(--ink);
  font-size: 14px;
}

a {
  color: var(--primary-dark);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 20px;
  background: linear-gradient(180deg, var(--nav), var(--nav-2));
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  color: #e8f1f7;
  overflow-y: auto;
}

.workspace {
  min-width: 0;
}

.utilitybar {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.portal-notification-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 16px 28px 0;
  padding: 13px 16px;
  border: 1px solid #bfe6ea;
  border-radius: 12px;
  background: linear-gradient(135deg, #eefafa, #fff8ec);
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.06);
}

.portal-notification-bar div {
  display: grid;
  gap: 3px;
}

.portal-notification-bar strong {
  color: var(--primary-dark);
}

.portal-notification-bar span {
  color: var(--muted);
  font-size: 13px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-weight: 700;
}

.brand-mark.large {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  font-size: 18px;
}

.brand-logo {
  width: 48px;
  height: 48px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: #ffffff;
  overflow: hidden;
}

.brand-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.brand small {
  display: block;
  color: rgba(232, 241, 247, 0.72);
  font-size: 12px;
  margin-top: 2px;
}

.sidebar-brand {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.side-nav {
  display: grid;
  gap: 16px;
}

.nav-section {
  display: grid;
  gap: 4px;
}

.nav-section-title {
  display: block;
  margin: 4px 0 6px;
  color: rgba(232, 241, 247, 0.58);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-section-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 4px 0 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(232, 241, 247, 0.72);
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
}

.nav-section-toggle:hover {
  color: #fff;
}

.nav-section-toggle span:last-child {
  width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  font-size: 13px;
}

.nav-section.is-collapsed .nav-submenu {
  display: none;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #dce8f1;
  font-weight: 700;
}

.nav-badge {
  margin-left: auto;
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.portal-notification-link.has-unread {
  background: rgba(208, 139, 40, 0.18);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.portal-notification-link.has-unread .nav-icon {
  background: linear-gradient(135deg, var(--accent), var(--primary));
}

.notification-count {
  min-width: 26px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: #d08b28;
  box-shadow: 0 8px 18px rgba(208, 139, 40, 0.28);
}

.portal-nav-line-icon {
  position: relative;
  width: 22px;
  height: 22px;
  display: inline-block;
  flex: 0 0 22px;
  color: rgba(232, 246, 246, 0.9);
}

.portal-nav-line-icon::before,
.portal-nav-line-icon::after {
  content: "";
  position: absolute;
  display: block;
  box-sizing: border-box;
}

.portal-nav-line-icon.icon-client-files::before {
  left: 3px;
  top: 5px;
  width: 16px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.portal-nav-line-icon.icon-client-files::after {
  left: 5px;
  top: 3px;
  width: 8px;
  height: 4px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
}

.portal-nav-line-icon.icon-updates::before {
  left: 5px;
  top: 4px;
  width: 12px;
  height: 13px;
  border: 2px solid currentColor;
  border-radius: 9px 9px 5px 5px;
}

.portal-nav-line-icon.icon-updates::after {
  left: 8px;
  top: 17px;
  width: 6px;
  height: 3px;
  border-radius: 0 0 999px 999px;
  background: currentColor;
}

.side-nav a.active .portal-nav-line-icon,
.side-nav a:hover .portal-nav-line-icon,
.portal-notification-link.has-unread .portal-nav-line-icon {
  color: #ffffff;
}

.portal-nav-icon,
.portal-panel-icon,
.portal-client-type-icon {
  position: relative;
  overflow: hidden;
  color: transparent;
}

.portal-nav-icon::before,
.portal-nav-icon::after,
.portal-panel-icon::before,
.portal-panel-icon::after,
.portal-client-type-icon::before,
.portal-client-type-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.portal-nav-icon.icon-folder {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.portal-nav-icon.icon-folder::before {
  left: 7px;
  top: 8px;
  width: 11px;
  height: 5px;
  border-radius: 3px 3px 0 0;
  background: rgba(255, 255, 255, 0.88);
}

.portal-nav-icon.icon-folder::after {
  left: 6px;
  right: 6px;
  top: 12px;
  height: 10px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.92);
}

.side-nav a.active .portal-nav-icon.icon-folder,
.side-nav a:hover .portal-nav-icon.icon-folder {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
}

.side-nav a.active .portal-nav-icon.icon-folder::before,
.side-nav a.active .portal-nav-icon.icon-folder::after,
.side-nav a:hover .portal-nav-icon.icon-folder::before,
.side-nav a:hover .portal-nav-icon.icon-folder::after {
  background: #ffffff;
}

.portal-panel-icon.icon-folder {
  background: linear-gradient(135deg, #e9fbf6, #fdf7e8);
  border: 1px solid rgba(8, 127, 140, 0.24);
}

.portal-panel-icon.icon-folder::before {
  left: 7px;
  top: 8px;
  width: 11px;
  height: 5px;
  border-radius: 3px 3px 0 0;
  background: #0b7285;
}

.portal-panel-icon.icon-folder::after {
  left: 6px;
  right: 6px;
  top: 12px;
  height: 10px;
  border-radius: 3px;
  background: #0f8b8d;
  box-shadow: inset 0 -2px 0 rgba(255, 255, 255, 0.25);
}

.portal-nav-icon.icon-bell {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.portal-nav-icon.icon-bell::before {
  left: 9px;
  top: 7px;
  width: 10px;
  height: 12px;
  border-radius: 8px 8px 4px 4px;
  background: rgba(255, 255, 255, 0.92);
}

.portal-nav-icon.icon-bell::after {
  left: 8px;
  top: 18px;
  width: 12px;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 4px 4px 0 -2px rgba(255, 255, 255, 0.92);
}

.side-nav a.active .portal-nav-icon.icon-bell,
.side-nav a:hover .portal-nav-icon.icon-bell,
.portal-notification-link.has-unread .portal-nav-icon.icon-bell {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
}

.portal-notification-link.has-unread .portal-nav-icon.icon-bell::before,
.portal-notification-link.has-unread .portal-nav-icon.icon-bell::after {
  background: #ffffff;
}

.portal-client-type-icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 12px;
  background: #edf7f8;
  border: 1px solid rgba(8, 127, 140, 0.16);
  box-shadow: inset 0 -10px 18px rgba(8, 127, 140, 0.05);
}

.portal-client-type-icon.type-deceased_estate {
  background: linear-gradient(135deg, #eef9fa, #f7fbfc);
}

.portal-client-type-icon.type-deceased_estate::before {
  left: 12px;
  top: 8px;
  width: 16px;
  height: 22px;
  border-radius: 3px;
  background: #0b7285;
}

.portal-client-type-icon.type-deceased_estate::after {
  left: 16px;
  top: 14px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 5px 0 #ffffff, 0 10px 0 #ffffff;
}

.portal-client-type-icon.type-company {
  background: linear-gradient(135deg, #eef6ff, #f8fbff);
}

.portal-client-type-icon.type-company::before {
  left: 10px;
  top: 10px;
  width: 20px;
  height: 22px;
  border-radius: 4px;
  background: #2563eb;
}

.portal-client-type-icon.type-company::after {
  left: 14px;
  top: 15px;
  width: 3px;
  height: 3px;
  border-radius: 1px;
  background: #ffffff;
  box-shadow: 6px 0 0 #ffffff, 12px 0 0 #ffffff, 0 7px 0 #ffffff, 6px 7px 0 #ffffff, 12px 7px 0 #ffffff;
}

.portal-client-type-icon.type-trust {
  background: linear-gradient(135deg, #f3f1ff, #fffaf2);
}

.portal-client-type-icon.type-trust::before {
  left: 10px;
  top: 20px;
  width: 22px;
  height: 10px;
  border-radius: 3px;
  background: #6d4cc2;
}

.portal-client-type-icon.type-trust::after {
  left: 13px;
  top: 10px;
  width: 16px;
  height: 16px;
  transform: rotate(45deg);
  border-radius: 3px;
  background: #d08b28;
}

.portal-client-type-icon.type-individual,
.portal-client-type-icon.type-curator_bonis {
  background: linear-gradient(135deg, #edfdf6, #f8fbfd);
}

.portal-client-type-icon.type-individual::before,
.portal-client-type-icon.type-curator_bonis::before {
  left: 15px;
  top: 9px;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: #0f8b8d;
}

.portal-client-type-icon.type-individual::after,
.portal-client-type-icon.type-curator_bonis::after {
  left: 10px;
  top: 23px;
  width: 22px;
  height: 10px;
  border-radius: 10px 10px 4px 4px;
  background: #0b7285;
}

.portal-client-type-icon.type-curator_bonis::after {
  background: #d08b28;
}

.nav-submenu {
  display: grid;
  gap: 2px;
  margin: 2px 0 6px 42px;
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.nav-submenu a {
  min-height: 30px;
  padding: 7px 10px;
  color: rgba(220, 232, 241, 0.78);
  font-size: 13px;
  font-weight: 700;
}

.nav-submenu a.active {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.side-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  text-decoration: none;
}

.side-nav a.active {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.side-nav a.active .nav-icon,
.side-nav a:hover .nav-icon {
  background: linear-gradient(135deg, var(--primary), var(--accent));
}

.nav-icon {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.nav-icon {
  position: relative;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0;
}

.nav-icon::before,
.nav-icon::after {
  content: "";
  position: absolute;
  display: block;
  box-sizing: border-box;
}

.side-nav a.active .nav-icon,
.side-nav a:hover .nav-icon {
  color: #ffffff;
}

.icon-dashboard::before {
  left: 7px;
  top: 7px;
  width: 6px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 2px;
  box-shadow: 8px 0 0 -2px currentColor, 0 8px 0 -2px currentColor, 8px 8px 0 -2px currentColor;
}

.icon-work::before,
.icon-review::before {
  left: 7px;
  top: 8px;
  width: 14px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.icon-work::after {
  left: 10px;
  top: 6px;
  width: 8px;
  height: 5px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
}

.icon-review::after {
  left: 11px;
  top: 11px;
  width: 7px;
  height: 4px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.icon-reminders::before,
.icon-notifications::before {
  left: 8px;
  top: 6px;
  width: 12px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 9px 9px 5px 5px;
}

.icon-reminders::after {
  left: 12px;
  top: 3px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: -5px 18px 0 -1px currentColor, 5px 18px 0 -1px currentColor;
}

.icon-notifications::after {
  left: 9px;
  top: 20px;
  width: 10px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
}

.icon-clients::before {
  left: 6px;
  top: 8px;
  width: 16px;
  height: 12px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.icon-clients::after {
  left: 8px;
  top: 6px;
  width: 8px;
  height: 4px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 3px 3px 0 0;
}

.icon-onboarding::before {
  left: 8px;
  top: 6px;
  width: 12px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.icon-onboarding::after {
  left: 11px;
  top: 11px;
  width: 7px;
  height: 4px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
}

.icon-tasks::before {
  left: 8px;
  top: 7px;
  width: 13px;
  height: 15px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.icon-tasks::after {
  left: 11px;
  top: 11px;
  width: 8px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.icon-compliance::before {
  left: 7px;
  top: 7px;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.icon-compliance::after {
  left: 13px;
  top: 10px;
  width: 2px;
  height: 7px;
  background: currentColor;
  transform-origin: bottom center;
  transform: rotate(35deg);
}

.icon-documents::before {
  left: 8px;
  top: 6px;
  width: 12px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 2px;
}

.icon-documents::after {
  left: 15px;
  top: 6px;
  width: 5px;
  height: 5px;
  border-left: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
}

.icon-reports::before {
  left: 7px;
  bottom: 7px;
  width: 3px;
  height: 7px;
  background: currentColor;
  box-shadow: 6px -4px 0 currentColor, 12px -8px 0 currentColor;
  border-radius: 2px 2px 0 0;
}

.icon-reports::after {
  left: 6px;
  top: 20px;
  width: 16px;
  height: 2px;
  background: currentColor;
}

.icon-search::before {
  left: 7px;
  top: 7px;
  width: 11px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.icon-search::after {
  left: 17px;
  top: 17px;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: left center;
}

.icon-audit::before {
  left: 8px;
  top: 6px;
  width: 12px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 3px;
}

.icon-audit::after {
  left: 11px;
  top: 11px;
  width: 7px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.icon-settings::before {
  left: 7px;
  top: 7px;
  width: 14px;
  height: 14px;
  border: 3px dotted currentColor;
  border-radius: 999px;
}

.icon-settings::after {
  left: 11px;
  top: 11px;
  width: 6px;
  height: 6px;
  border: 2px solid currentColor;
  border-radius: 999px;
}

.sidebar-footer {
  display: grid;
  gap: 4px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.account-link {
  display: grid;
  gap: 4px;
  color: #fff;
  text-decoration: none;
}

.account-link small {
  color: rgba(220, 232, 241, 0.74);
}

.account-link:hover {
  color: #fff;
  text-decoration: underline;
}

.sidebar-footer span {
  font-weight: 700;
}

.sidebar-footer small,
.portal-title {
  color: rgba(232, 241, 247, 0.72);
}

.sidebar-version {
  display: block;
  margin-top: 4px;
  color: rgba(232, 241, 247, 0.52);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.portal-hero {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border: 1px solid rgba(15, 139, 141, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(15, 139, 141, 0.13), rgba(255, 255, 255, 0.86), rgba(208, 139, 40, 0.1)),
    #fff;
  box-shadow: var(--shadow);
}

.portal-brand-panel {
  display: flex;
  align-items: center;
  gap: 12px;
}

.portal-brand-panel img {
  max-width: 130px;
  max-height: 66px;
  object-fit: contain;
}

.portal-client-hero {
  background:
    linear-gradient(135deg, rgba(15, 139, 141, 0.14), rgba(16, 40, 63, 0.06)),
    #fff;
}

.global-search {
  width: min(560px, 100%);
}

.global-search input {
  min-height: 40px;
  border-radius: 999px;
  padding-left: 16px;
  background: #f8fbfd;
}

.nav,
.actions,
.form-actions,
.section-heading,
.row-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.actions form,
.form-actions form,
.row-actions form,
.onboarding-item-actions form,
.mini-list form {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.actions .button,
.form-actions .button,
.row-actions .button,
.onboarding-item-actions .button,
.mini-list .button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.nav a,
.link-button {
  color: var(--ink);
  font: inherit;
  background: none;
  border: 0;
  cursor: pointer;
  padding: 8px 0;
}

.page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 52px;
}

.workspace .page {
  width: min(1320px, calc(100% - 48px));
}

.workspace .page:has(.client-register-shell) {
  width: min(1560px, calc(100% - 48px));
}

.workspace .page:has(.dashboard-command-simple) {
  width: min(1680px, calc(100% - 28px));
}

.auth-page {
  min-height: 100vh;
  width: 100%;
  max-width: none;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 0;
  background:
    radial-gradient(circle at 18% 18%, rgba(15, 139, 141, 0.42), transparent 30%),
    radial-gradient(circle at 84% 12%, rgba(208, 139, 40, 0.28), transparent 28%),
    linear-gradient(135deg, #0b2f45 0%, #0f3b52 44%, #f3f7fa 44%, #eef5f7 100%);
}

.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(221, 230, 240, 0.8);
}

.page-heading h1 {
  letter-spacing: 0;
}

.client-hero {
  align-items: flex-start;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(18, 110, 130, 0.12), rgba(138, 90, 30, 0.08)),
    var(--surface);
  box-shadow: var(--shadow);
}

.cockpit-hero {
  overflow: hidden;
  position: relative;
  padding: 26px;
  border: 1px solid rgba(15, 139, 141, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(15, 83, 97, 0.95), rgba(16, 40, 63, 0.96)),
    var(--nav);
  color: #fff;
  box-shadow: 0 18px 40px rgba(16, 40, 63, 0.18);
}

.cockpit-hero .eyebrow,
.cockpit-hero .muted {
  color: rgba(255, 255, 255, 0.72);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.today-chip {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  font-weight: 800;
}

.client-title-block {
  display: flex;
  align-items: center;
  gap: 16px;
}

.client-avatar {
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary-dark);
  color: #fff;
  font-size: 19px;
  font-weight: 800;
}

.client-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

h1,
h2 {
  margin: 0;
  line-height: 1.15;
}

h1 {
  font-size: 31px;
}

h2 {
  font-size: 18px;
  margin-bottom: 16px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.muted {
  color: var(--muted);
}

.panel,
.login-card,
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.panel {
  padding: 24px;
  margin-bottom: 20px;
}

.narrow {
  max-width: 620px;
}

.login-shell {
  position: relative;
  min-height: 100vh;
  width: min(1120px, 100%);
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 32px;
}

.login-shell::before {
  content: "";
  position: absolute;
  inset: 32px auto 32px 32px;
  width: min(42%, 430px);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(9, 43, 64, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.09);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(500px, 100%);
  padding: 42px;
  border-radius: 22px;
  text-align: center;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 255, 255, 0.88)),
    var(--surface);
  border: 1px solid rgba(15, 139, 141, 0.18);
  box-shadow: 0 28px 70px rgba(16, 40, 63, 0.16);
  backdrop-filter: blur(14px);
}

.login-brand {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 22px;
}

.login-brand img {
  max-width: 240px;
  max-height: 125px;
  object-fit: contain;
}

.login-mark {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  font-size: 30px;
  box-shadow: 0 16px 34px rgba(15, 139, 141, 0.26);
}

.login-card .eyebrow {
  display: block;
  margin-bottom: 8px;
  text-align: center;
  color: var(--primary-dark);
}

.login-card h1 {
  margin: 0 0 10px;
  font-size: 34px;
  letter-spacing: 0;
}

.login-card > .muted {
  max-width: 380px;
  margin: 0 auto 24px;
  line-height: 1.55;
}

.login-card .stack {
  text-align: left;
}

.login-card input {
  min-height: 46px;
  border-radius: 12px;
  background: #fbfdff;
}

.login-card .button.full {
  min-height: 48px;
  margin-top: 4px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 16px 28px rgba(15, 139, 141, 0.22);
}

.login-security-note {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.login-legal-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
}

.login-legal-note a {
  color: var(--primary-dark);
  font-weight: 800;
}

.login-version {
  margin: 8px 0 0;
  color: #8da0b3;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.login-copyright {
  margin: 10px 0 0;
  color: #7b8795;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.legal-page {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 18px 0;
}

.legal-card {
  display: block;
  padding: 24px 28px;
}

.legal-card .eyebrow {
  margin: 0 0 4px;
}

.legal-card h1 {
  margin: 0 0 6px;
  font-size: 1.8rem;
  line-height: 1.15;
}

.legal-card h2 {
  margin: 16px 0 6px;
  color: var(--primary-dark);
  font-size: 0.95rem;
  line-height: 1.25;
}

.legal-card p {
  margin: 0 0 8px;
  color: #44566c;
  line-height: 1.48;
  font-size: 0.92rem;
}

.legal-card .muted {
  margin-bottom: 14px;
  line-height: 1.45;
}

.legal-card ul {
  margin: 4px 0 10px 18px;
  padding: 0;
}

.legal-card li {
  margin: 0 0 5px;
  color: #44566c;
  font-size: 0.92rem;
  line-height: 1.45;
}

.legal-card .login-copyright {
  margin: 18px 0 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: left;
}

.legal-card > .button {
  margin-top: 2px;
}

.legal-review-note {
  padding: 12px 14px;
  border: 1px solid rgba(208, 139, 40, 0.24);
  border-radius: 8px;
  background: #fffaf2;
}

.portal-notes-grid td:first-child,
.portal-notes-grid td:last-child {
  width: 150px;
  white-space: nowrap;
}

.portal-notes-grid td strong {
  display: block;
  color: var(--ink);
  margin-bottom: 3px;
}

.portal-mobile-table td::before {
  display: none;
}

.stack {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px 11px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  outline: 0;
  border-color: rgba(15, 139, 141, 0.75);
  box-shadow: 0 0 0 3px rgba(15, 139, 141, 0.12);
}

textarea {
  min-height: 86px;
  resize: vertical;
}

.password-field {
  display: flex;
  gap: 8px;
}

.password-field input {
  min-width: 0;
  flex: 1;
}

.password-field .button {
  min-height: 38px;
  padding-inline: 12px;
  white-space: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(15, 83, 97, 0.15);
}

.button:hover {
  text-decoration: none;
  background: var(--primary-dark);
}

.button.secondary {
  color: var(--primary-dark);
  background: #e8f6f6;
  box-shadow: none;
}

.button.danger {
  background: var(--danger);
  border-color: var(--danger);
  box-shadow: none;
}

.button.full {
  width: 100%;
}

.alert {
  border: 1px solid #d88f82;
  background: #fff2ef;
  color: #7b261d;
  border-radius: 6px;
  padding: 12px 14px;
  margin: 16px 0;
}

.alert.success {
  border-color: #9bd8b6;
  background: #effaf3;
  color: #166534;
}

.metric-grid,
.placeholder-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0 0 20px;
  border-bottom: 1px solid var(--line);
}

.tabs a {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
}

.tabs a:hover {
  text-decoration: none;
  background: #eef7f8;
}

.modern-tabs {
  position: sticky;
  top: 65px;
  z-index: 8;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(31, 41, 51, 0.06);
}

.modern-tabs a {
  border: 0;
  border-radius: 6px;
  background: transparent;
}

.modern-tabs a.active {
  background: var(--primary);
  color: #fff;
}

.client-action-bar {
  position: sticky;
  top: 128px;
  z-index: 7;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: -8px 0 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.07);
  backdrop-filter: blur(10px);
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.client-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.portal-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 90px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(31, 41, 51, 0.06);
}

.summary-card small {
  display: block;
  color: var(--muted);
  font-weight: 700;
}

.summary-card strong {
  display: block;
  margin-top: 5px;
  font-size: 24px;
}

.summary-icon {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
}

.onboarding-progress-card {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.07);
}

.onboarding-progress-card.is-overdue {
  border-left-color: var(--danger);
}

.onboarding-progress-card.is-complete {
  border-left-color: #2f855a;
}

.onboarding-progress-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.onboarding-progress-main h2 {
  margin-bottom: 4px;
}

.onboarding-progress-main p {
  margin: 0;
}

.progress-meter {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #e8edf3;
}

.progress-meter span {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.onboarding-progress-card.is-overdue .progress-meter span {
  background: linear-gradient(90deg, var(--danger), var(--accent));
}

.onboarding-progress-card.is-complete .progress-meter span {
  background: linear-gradient(90deg, #2f855a, var(--primary));
}

.onboarding-progress-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.readiness-card,
.missing-info-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
  margin-bottom: 20px;
  border: 1px solid #f6c36d;
  border-left: 5px solid var(--accent);
  border-radius: 12px;
  background: #fffaf2;
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.06);
}

.readiness-card.is-ready,
.missing-info-panel.is-complete {
  border-color: #a7f3d0;
  border-left-color: #0f8b8d;
  background: #f0fdfa;
}

.readiness-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: center;
}

.missing-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.missing-chip-list span {
  padding: 7px 10px;
  border: 1px solid #f6c36d;
  border-radius: 999px;
  background: #ffffff;
  color: #92400e;
  font-size: 12px;
  font-weight: 800;
}

.onboarding-status-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.onboarding-status-strip article {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfd;
}

.onboarding-status-strip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.onboarding-status-strip strong {
  display: block;
  margin-top: 5px;
  font-size: 23px;
}

.onboarding-status-strip .attention {
  border-color: rgba(208, 139, 40, 0.32);
  background: #fffaf2;
}

.onboarding-status-strip .danger-stat {
  border-color: rgba(184, 74, 68, 0.28);
  background: #fff7f6;
}

.onboarding-board {
  display: grid;
  gap: 12px;
}

.onboarding-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.04);
}

.onboarding-group-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #f8fbfd, #fff);
}

.onboarding-group-heading h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.onboarding-group-heading span {
  color: var(--muted);
  font-weight: 800;
}

.onboarding-items {
  display: grid;
}

.onboarding-item {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.onboarding-item:last-child {
  border-bottom: 0;
}

.onboarding-item.is-overdue {
  background: #fff7f6;
}

.onboarding-item.is-complete {
  background: #f7fdf9;
}

.checkmark {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 999px;
  color: #166534;
  font-weight: 900;
}

.onboarding-item.is-complete .checkmark {
  border-color: #86d59a;
  background: #dcfce7;
}

.onboarding-item.is-overdue .checkmark {
  border-color: rgba(184, 74, 68, 0.35);
}

.onboarding-item-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 6px;
}

.onboarding-item-title h4 {
  margin: 0;
  font-size: 15px;
}

.onboarding-item-body p {
  margin: 0 0 8px;
}

.onboarding-item-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.onboarding-item-actions .mini-form {
  flex: 1 1 420px;
}

.onboarding-item-actions > form:not(.mini-form) {
  margin-left: auto;
}

.template-item {
  align-items: start;
}

.template-item .checkmark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #e8f6f6;
  color: var(--primary-dark);
  font-size: 12px;
}

.template-item-form {
  display: grid;
  gap: 12px;
  width: 100%;
}

.template-item-danger {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.template-item-danger form {
  margin: 0;
}

.tone-blue .summary-icon { background: #126e82; }
.tone-red .summary-icon { background: #a33b32; }
.tone-gold .summary-icon { background: #b7791f; }
.tone-purple .summary-icon { background: #6b46c1; }
.tone-green .summary-icon { background: #2f855a; }
.tone-slate .summary-icon { background: #475569; }

.status-pill {
  background: #dff4ee;
  color: #166343;
  font-weight: 700;
}

.risk-low {
  background: #e1f5ea;
  color: #166343;
  font-weight: 700;
}

.risk-medium {
  background: #fff0d8;
  color: #7a4a0b;
  font-weight: 700;
}

.risk-high {
  background: #fff2ef;
  color: #7b261d;
  font-weight: 700;
}

.modern-callout {
  border-left-color: #b7791f;
  background: #fffaf2;
}

.metric {
  background: linear-gradient(180deg, #fff, #fbfdff);
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 10px;
  padding: 18px;
  box-shadow: 0 8px 22px rgba(23, 32, 51, 0.06);
}

.metric.accent {
  border-left-color: var(--accent);
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.mini-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: linear-gradient(180deg, #fbfdff, #ffffff);
}

.mini-panel h3 {
  margin: 0 0 14px;
  font-size: 15px;
}

.record-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

.record-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.record-list span {
  color: var(--muted);
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin-bottom: 0;
}

.callout {
  border-left: 5px solid var(--accent);
}

.cards-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.list-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.04);
}

.tab-panel .list-card {
  border-left: 4px solid rgba(15, 139, 141, 0.35);
}

.tab-panel .list-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tab-panel .list-card h3::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--primary);
}

.list-card.important {
  border-left: 5px solid var(--accent);
  background: #fffaf2;
}

.tab-panel .list-card.important h3::before {
  background: var(--danger);
}

.list-card h3,
.inline-create h3 {
  margin: 0 0 8px;
  font-size: 16px;
}

.list-card p {
  margin: 0 0 8px;
}

.row-actions {
  justify-content: flex-end;
  align-items: flex-start;
}

.mini-list {
  display: grid;
  gap: 10px;
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

.mini-list li,
.mini-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mini-list li {
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.mini-list form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-list input[type="file"] {
  max-width: 260px;
}

.mini-form input {
  width: auto;
}

.mini-form input,
.mini-form select {
  min-width: 150px;
  flex: 1 1 150px;
}

.mini-form .check {
  flex: 0 0 auto;
}

.tab-panel .mini-form {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbfd;
  max-width: 100%;
}

.pill.warning {
  background: #fff0d8;
  color: #7a4a0b;
  font-weight: 700;
}

.overdue-row {
  background: #fff2ef;
}

.inline-create {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.action-drawer {
  margin: 14px 0 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.04);
}

.action-drawer summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 12px 16px;
  color: var(--primary-dark);
  font-weight: 900;
  list-style: none;
}

.action-drawer summary::-webkit-details-marker {
  display: none;
}

.action-drawer summary::before {
  content: "+";
  width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  margin-right: 10px;
  border-radius: 8px;
  background: #e8f6f6;
  color: var(--primary-dark);
  font-weight: 900;
}

.action-drawer[open] summary {
  border-bottom: 1px solid var(--line);
}

.action-drawer[open] summary::before {
  content: "-";
}

.action-drawer .inline-create {
  margin: 0;
  border: 0;
  border-radius: 0 0 10px 10px;
  box-shadow: none;
}

.inline-create h3,
.inline-create .wide,
.inline-create .form-actions {
  grid-column: 1 / -1;
}

.compact-create {
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 240px) auto;
  align-items: end;
}

.compact-create h3 {
  margin-bottom: -4px;
}

.compact-create .form-actions {
  grid-column: auto;
  border-top: 0;
  padding-top: 0;
}

.muted-panel {
  box-shadow: none;
  background: #fbfcfd;
}

.filter-bar {
  display: grid;
  grid-template-columns: 1fr 180px 180px auto;
  gap: 12px;
  margin-bottom: 16px;
}

.filter-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 20px rgba(23, 32, 51, 0.05);
}

.filter-bar.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.client-register-shell {
  display: grid;
  gap: 16px;
}

.client-register-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.client-register-stats article {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff, #f7fbfd);
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.05);
}

.client-register-stats article.attention {
  border-color: #f6c36d;
  background: #fffaf2;
}

.client-register-stats span,
.client-register-stats strong {
  display: block;
}

.client-register-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.client-register-stats strong {
  margin-top: 6px;
  font-size: 26px;
}

.clients-filter-bar {
  display: grid;
  grid-template-columns: minmax(320px, 1.4fr) minmax(180px, 240px) minmax(180px, 240px) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 0;
}

.clients-filter-bar label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.clients-filter-bar input,
.clients-filter-bar select {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-transform: none;
}

.clients-table-wrap {
  border-radius: 14px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 42px rgba(23, 32, 51, 0.08);
}

.clients-table {
  min-width: 1180px;
}

.clients-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 14px 16px;
  background: #f4f8fb;
  color: #415466;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.clients-table td {
  padding: 15px 16px;
  vertical-align: middle;
}

.clients-table tbody tr:hover {
  background: #f8fbfd;
}

.client-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
}

.client-cell small,
.table-subtext span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.client-type-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef7f8;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.table-subtext strong {
  font-size: 13px;
}

.follow-up-cell {
  color: var(--primary-dark);
  font-weight: 800;
}

.nav-search input {
  min-height: 34px;
  max-width: 180px;
  padding: 7px 9px;
}

.quick-actions {
  margin: -8px 0 20px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.dashboard-heading .muted {
  margin: 8px 0 0;
}

.cockpit-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric.compact {
  padding: 16px;
}

.metric.compact strong {
  font-size: 28px;
}

.priority-strip .metric {
  border-left: 0;
  position: relative;
  overflow: hidden;
}

.priority-strip .metric::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: var(--primary);
}

.priority-strip .tone-red::before { background: #b84a44; }
.priority-strip .tone-green::before { background: #2f855a; }
.priority-strip .tone-purple::before { background: #6b46c1; }
.priority-strip .tone-gold::before { background: #d08b28; }

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 700;
}

.overview-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.overview-strip article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.05);
}

.overview-strip span {
  color: var(--muted);
  font-weight: 800;
}

.overview-strip strong {
  font-size: 24px;
}

.overview-strip .danger-stat {
  border-color: rgba(184, 74, 68, 0.24);
  background: #fff7f6;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.9fr);
  gap: 20px;
  align-items: start;
}

.portal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.85fr);
  gap: 20px;
  align-items: start;
}

.portal-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.65fr);
  gap: 20px;
  align-items: start;
}

.portal-home-primary,
.portal-home-summary {
  min-height: 260px;
}

.portal-home-summary {
  display: grid;
  align-content: start;
  gap: 16px;
}

.portal-action-count {
  display: block;
  color: var(--primary-dark);
  font-size: 52px;
  line-height: 1;
}

.portal-entity-list.relaxed {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.portal-request-card {
  display: grid;
  gap: 9px;
  padding: 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.05);
}

.portal-request-card:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.portal-request-card strong {
  font-size: 16px;
}

.portal-request-card small {
  color: var(--muted);
}

.portal-entity-list {
  display: grid;
  gap: 12px;
}

.portal-entity-list a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfd;
  color: var(--ink);
}

.portal-entity-list a:hover {
  text-decoration: none;
  background: #eef7f8;
}

.portal-entity-list small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.portal-clients-grid table {
  min-width: 920px;
}

.portal-access-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.portal-request-progress {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.portal-request-progress span,
.portal-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.portal-request-progress span {
  background: #f2f7fa;
  color: #415466;
}

.portal-request-items {
  gap: 10px;
}

.portal-request-item {
  align-items: flex-start;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: 10px;
  background: #fff;
}

.portal-item-action {
  display: grid;
  justify-items: end;
  gap: 8px;
  min-width: 210px;
}

.portal-item-action form {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.portal-status.status-needed,
.portal-request-item.status-needed {
  border-left-color: #f59e0b;
}

.portal-status.status-needed {
  background: #fff7ed;
  color: #9a3412;
}

.portal-status.status-action,
.portal-request-item.status-action {
  border-left-color: #dc2626;
}

.portal-status.status-action {
  background: #fee2e2;
  color: #991b1b;
}

.portal-status.status-review,
.portal-request-item.status-review {
  border-left-color: #2563eb;
}

.portal-status.status-review {
  background: #dbeafe;
  color: #1e40af;
}

.portal-status.status-accepted,
.portal-request-item.status-accepted {
  border-left-color: #16a34a;
}

.portal-status.status-accepted {
  background: #dcfce7;
  color: #166534;
}

.portal-status.status-muted,
.portal-request-item.status-muted {
  border-left-color: #94a3b8;
}

.portal-status.status-muted {
  background: #f1f5f9;
  color: #475569;
}

.table-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.client-avatar.small {
  width: 42px;
  height: 42px;
  font-size: 14px;
}

.empty-state {
  display: grid;
  gap: 6px;
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #f8fbfd;
  color: var(--muted);
}

.empty-state strong {
  color: var(--ink);
}

.dashboard-layout .panel h2,
.settings-card strong,
.table-wrap strong {
  letter-spacing: 0;
}

.queue-stack {
  display: grid;
  gap: 20px;
}

.queue-stack .panel {
  margin-bottom: 0;
}

.lane-panel {
  border-top: 4px solid rgba(15, 139, 141, 0.65);
}

.panel-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  margin-right: 8px;
  border-radius: 8px;
  background: #e8f6f6;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
  vertical-align: middle;
}

.profile-card .details {
  padding-top: 4px;
}

.profile-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.profile-info-card,
.profile-notes-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.04);
}

.profile-info-card {
  border-top: 4px solid rgba(15, 139, 141, 0.55);
}

.profile-info-card h3,
.profile-notes-card h3 {
  display: flex;
  align-items: center;
  margin: 0 0 14px;
  font-size: 16px;
}

.profile-info-card .details {
  grid-template-columns: 170px 1fr;
}

.estate-template-panel {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, #f4fbfb 0%, #ffffff 72%);
}

.estate-template-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.estate-template-card {
  display: grid;
  gap: 9px;
  min-height: 138px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 10px 24px rgba(28, 45, 58, 0.06);
}

.estate-template-card:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.estate-template-card strong {
  font-size: 15px;
}

.estate-template-card small {
  color: var(--muted);
  line-height: 1.45;
}

.highlight-card {
  border-top-color: var(--accent);
  background: #fffaf2;
}

.profile-notes-card {
  margin-top: 18px;
  background: #f8fbfd;
}

.profile-notes-card p {
  margin: 0 0 10px;
  line-height: 1.5;
}

.profile-notes-card p:last-child {
  margin-bottom: 0;
}

.dec-workflow-card {
  border-left: 5px solid var(--accent);
}

.dec-workflow-card h3 {
  margin: 0;
}

.dec-workflow-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dec-workflow-actions .mini-form {
  align-items: end;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.dec-workflow-actions textarea {
  min-height: 58px;
}

.estate-dec-workflow {
  grid-template-columns: 1fr;
}

.estate-dec-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.estate-dec-card h4 {
  margin: 0 0 4px;
}

.estate-dec-card .button {
  align-self: end;
}

.estate-dec-card-close {
  border-color: rgba(184, 74, 68, 0.22);
  background: #fffafa;
}

.estate-overview-priority {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  grid-column: 1 / -1;
}

.estate-key-details {
  grid-template-columns: minmax(140px, 0.5fr) minmax(0, 1fr);
}

.estate-notes-grid .table-note {
  max-width: 620px;
}

.estate-requests-grid table {
  min-width: 980px;
}

.estate-tasks-grid table {
  min-width: 1040px;
}

.estate-requests-grid td:nth-child(5) {
  max-width: 360px;
  color: var(--muted);
  line-height: 1.45;
}

.table-details summary {
  cursor: pointer;
  color: var(--primary-strong);
  font-weight: 800;
}

.table-details .mini-list {
  margin-top: 10px;
  min-width: 420px;
}

.table-details .mini-list li {
  align-items: center;
  gap: 10px;
}

.danger-text {
  color: var(--danger);
  font-weight: 800;
}

.portal-general-request-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px dashed rgba(8, 127, 140, 0.28);
  border-radius: 10px;
  background: #f7fcfd;
}

.important-row {
  background: #fffaf2;
}

.portal-access-grid {
  display: grid;
  gap: 12px;
}

.portal-access-card {
  display: grid;
  grid-template-columns: minmax(240px, 0.6fr) minmax(0, 1fr);
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.portal-access-card h3 {
  margin: 0 0 4px;
}

.portal-access-actions,
.portal-access-form {
  display: grid;
  gap: 10px;
}

.portal-permission-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.profile-subsections {
  display: grid;
  gap: 20px;
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.queue-list li {
  align-items: flex-start;
}

.queue-list li > div {
  display: grid;
  gap: 4px;
}

.queue-list strong {
  white-space: nowrap;
  font-size: 13px;
}

.review-hero {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.review-hero article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff, #f8fbfd);
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.05);
}

.review-hero span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.review-hero strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.queue-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.queue-grid .panel {
  margin-bottom: 0;
}

.wide-panel {
  grid-column: 1 / -1;
}

.notification-list li.unread {
  border-left: 4px solid var(--accent);
  padding-left: 10px;
  background: #fffaf2;
}

.notification-list small {
  color: var(--muted);
}

.portal-notifications-layout {
  max-width: 980px;
}

.portal-notifications-panel {
  padding: 24px;
}

.portal-notifications-panel .notification-list {
  gap: 0;
}

.portal-notifications-panel .notification-list li {
  align-items: flex-start;
  padding: 18px 0;
}

.portal-notifications-panel .notification-list li:first-child {
  padding-top: 6px;
}

.portal-notifications-panel .notification-list li:last-child {
  border-bottom: 0;
  padding-bottom: 4px;
}

.notification-content {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.notification-message {
  display: block;
  max-width: 720px;
  color: #405570;
  line-height: 1.45;
}

.portal-notifications-panel .button,
.portal-notifications-panel .pill {
  margin-top: 2px;
}

.readiness-list li {
  align-items: flex-start;
}

.checklist-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.checklist-grid span {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfd;
  font-weight: 800;
}

.overdue-item {
  border-left: 4px solid var(--danger);
  padding-left: 10px;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.snapshot-grid span {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--muted);
  font-size: 13px;
}

.snapshot-grid strong {
  color: var(--ink);
  font-size: 22px;
}

.activity-list small {
  color: var(--muted);
}

.modern-notes-table table {
  table-layout: fixed;
}

.modern-notes-table th,
.modern-notes-table td {
  vertical-align: top;
}

.modern-notes-table th:nth-child(1),
.modern-notes-table td:nth-child(1) {
  width: 90px;
}

.modern-notes-table th:nth-child(3),
.modern-notes-table td:nth-child(3) {
  width: 110px;
}

.modern-notes-table th:nth-child(4),
.modern-notes-table td:nth-child(4) {
  width: 95px;
}

.modern-notes-table th:nth-child(5),
.modern-notes-table td:nth-child(5) {
  width: 110px;
}

.modern-notes-table th:nth-child(6),
.modern-notes-table td:nth-child(6) {
  width: 132px;
}

.modern-notes-table th:nth-child(7),
.modern-notes-table td:nth-child(7) {
  width: 168px;
}

.modern-notes-table .row-actions {
  flex-wrap: nowrap;
  gap: 8px;
}

.modern-notes-table .date-cell,
.modern-notes-table .mono-cell {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.note-main-cell strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  line-height: 1.25;
}

.note-main-cell .table-note {
  display: -webkit-box;
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.soft-tag,
.visibility-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: #eef7f7;
  color: #075766;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.visibility-chip.internal {
  background: #eef2f6;
  color: #516176;
}

.visibility-chip.visible {
  background: #e7f8ef;
  color: #08723f;
}

.note-calendar-panel {
  margin-top: 18px;
}

.note-calendar-panel .section-heading {
  gap: 14px;
}

.calendar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.calendar-actions .button {
  min-height: 34px;
  padding: 8px 12px;
}

.calendar-actions .button.is-active {
  border-color: rgba(8, 127, 140, 0.34);
  background: #e5f7f8;
  color: var(--primary-dark);
}

.note-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.note-calendar-day {
  min-height: 280px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbfc 100%);
  overflow: hidden;
}

.note-calendar-day.has-items {
  border-color: rgba(7, 137, 145, 0.28);
  box-shadow: inset 0 3px 0 rgba(7, 137, 145, 0.28);
}

.note-calendar-day header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.note-calendar-day header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.note-calendar-day header strong {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 10px;
  background: #e7f6f7;
  color: #075766;
}

.note-calendar-day p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.note-calendar-count {
  display: inline-flex;
  margin: -2px 0 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef7f7;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 800;
}

.note-calendar-detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  width: 100%;
  margin: 0 0 8px;
  border: 1px solid rgba(8, 127, 140, 0.22);
  border-radius: 8px;
  background: #effafa;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 850;
}

.note-calendar-detail-link:hover {
  text-decoration: none;
  background: #e2f5f6;
}

.note-calendar-day ul {
  display: grid;
  gap: 6px;
  max-height: 180px;
  margin: 0;
  padding: 0;
  overflow-y: auto;
  list-style: none;
  scrollbar-width: thin;
}

.note-calendar-day li {
  padding: 7px;
  border: 1px solid #d7e7ec;
  border-radius: 9px;
  background: #ffffff;
}

.note-calendar-day li a {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.note-calendar-day li span,
.note-calendar-day small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.follow-up-detail {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.follow-up-detail-table {
  margin: 0;
  box-shadow: none;
}

.follow-up-detail-table td:nth-child(3) {
  max-width: 620px;
}

.dashboard-layout-simple {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.55fr);
}

.dashboard-command-simple {
  grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 1020px) {
  .note-calendar-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-layout-simple {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .note-calendar-grid {
    grid-template-columns: 1fr;
  }

  .modern-notes-table table {
    table-layout: auto;
  }
}

.dashboard-command {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr);
  gap: 18px;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid rgba(15, 139, 141, 0.18);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(15, 83, 97, 0.98), rgba(16, 40, 63, 0.96));
  color: #fff;
  box-shadow: 0 18px 40px rgba(16, 40, 63, 0.18);
}

.dashboard-command-calm {
  grid-template-columns: minmax(0, 1fr) 380px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(246, 251, 252, 0.95)),
    #fff;
  color: var(--ink);
  box-shadow: 0 14px 34px rgba(23, 32, 51, 0.08);
}

.dashboard-command-calm .muted {
  color: var(--muted);
}

.dashboard-command-calm .eyebrow {
  color: var(--primary-dark);
}

.dashboard-command-calm .dashboard-actions .button.secondary {
  border-color: var(--line);
  background: #f8fbfd;
  color: var(--primary-dark);
}

.dashboard-command-calm .dashboard-actions .button.secondary .action-icon {
  background: #e8f6f6;
  color: var(--primary-dark);
}

.dashboard-command-calm .dashboard-command-side {
  border-color: var(--line);
  background: #f8fbfd;
}

.dashboard-command-calm .command-total {
  background: #fff;
  border: 1px solid var(--line);
}

.dashboard-command-calm .command-total span,
.dashboard-command-calm .active-client-breakdown span {
  color: var(--muted);
}

.dashboard-command-calm .active-client-breakdown a {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.dashboard-command-calm .active-client-breakdown a:hover {
  border-color: rgba(15, 139, 141, 0.28);
  background: #f4fbfb;
}

.dashboard-command h1 {
  margin-bottom: 6px;
}

.dashboard-command .muted,
.dashboard-command .eyebrow {
  color: rgba(255, 255, 255, 0.74);
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.dashboard-actions .button {
  gap: 8px;
  background: #fff;
  color: var(--primary-dark);
}

.dashboard-actions .button.secondary {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.action-icon,
.focus-icon {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: rgba(15, 139, 141, 0.12);
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
}

.dashboard-actions .button.secondary .action-icon {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.dashboard-command-side {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.command-total {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
}

.command-total span,
.active-client-breakdown span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.command-total strong {
  font-size: 34px;
}

.active-client-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.active-client-breakdown a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.active-client-breakdown a:hover {
  background: rgba(255, 255, 255, 0.16);
  text-decoration: none;
}

.active-client-breakdown strong {
  font-size: 20px;
}

.focus-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.focus-strip-calm {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.focus-strip-calm .focus-card {
  min-height: 92px;
  border-radius: 10px;
}

.focus-card {
  display: flex;
  gap: 12px;
  min-height: 104px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.05);
}

.focus-card small,
.focus-card em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.focus-card small {
  text-transform: uppercase;
  font-size: 11px;
}

.focus-card strong {
  display: block;
  margin: 5px 0;
  font-size: 29px;
  line-height: 1;
}

.focus-card.tone-red .focus-icon { background: #fff0ee; color: #9f342f; }
.focus-card.tone-green .focus-icon { background: #edf8f1; color: #2f855a; }
.focus-card.tone-purple .focus-icon { background: #f1edff; color: #5a3cb3; }
.focus-card.tone-gold .focus-icon { background: #fff6e7; color: #9a6417; }
.focus-card.tone-teal .focus-icon { background: #e9f8f8; color: var(--primary-dark); }

.active-client-types {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) repeat(5, minmax(130px, 1fr));
  gap: 12px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid rgba(15, 139, 141, 0.16);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15, 139, 141, 0.08), rgba(208, 139, 40, 0.08)), #fff;
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.05);
}

.active-client-types h2 {
  margin: 4px 0 0;
  font-size: 20px;
}

.active-client-types a {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(15, 139, 141, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.82);
}

.active-client-types a:hover {
  text-decoration: none;
  border-color: rgba(15, 139, 141, 0.28);
  box-shadow: 0 8px 18px rgba(15, 83, 97, 0.08);
}

.active-client-types span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.active-client-types strong {
  color: var(--ink);
  font-size: 28px;
}

.file-health-panel {
  margin: 18px 0;
  padding: 18px;
  border: 1px solid rgba(15, 139, 141, 0.18);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(15, 139, 141, 0.08), rgba(255, 255, 255, 0.92)), #fff;
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.05);
}

.file-health-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.file-health-heading h2 {
  margin: 3px 0 0;
}

.file-health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.file-health-grid a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.86);
}

.file-health-grid a:hover {
  text-decoration: none;
  border-color: rgba(15, 139, 141, 0.28);
}

.file-health-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.smart-checklist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.smart-checklist-grid span {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.smart-checklist-grid .is-ok {
  border-color: #bde8ce;
  background: #f4fcf7;
}

.smart-checklist-grid .needs-action {
  border-color: #f6c36d;
  background: #fffaf2;
}

.smart-checklist-grid em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.timeline-list li {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.timeline-list p {
  margin: 4px 0;
}

.timeline-list small {
  color: var(--muted);
}

.timeline-icon {
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: #e8f6f6;
  color: var(--primary-dark);
  font-size: 11px;
  font-weight: 900;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 10px;
}

.table-wrap.flat {
  box-shadow: none;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.table-wrap .row-actions {
  justify-content: flex-start;
  gap: 8px;
  min-width: max-content;
}

.table-wrap .button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 13px;
}

.tab-panel .table-wrap.flat {
  margin-top: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

th,
td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: #52647a;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #f8fbfd;
}

tbody tr:hover {
  background: #f8fbfd;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  background: #e8edf3;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.status-active,
.status-completed,
.status-accepted,
.status-client-visible,
.status-low,
.status-risk-low {
  background: #dcfce7;
  color: #166534;
}

.status-open,
.status-in-progress,
.status-awaiting-review,
.status-outstanding,
.status-partially-received,
.status-medium,
.status-risk-medium,
.status-priority-high {
  background: #fef3c7;
  color: #92400e;
}

.status-overdue,
.status-rejected,
.status-urgent,
.status-priority-urgent,
.status-high,
.status-risk-high {
  background: #fee2e2;
  color: #991b1b;
}

.status-internal,
.status-internal-only,
.status-not-required,
.status-not-applicable,
.status-archived,
.status-cancelled,
.status-inactive {
  background: #e2e8f0;
  color: #334155;
}

.status-waiting-for-client,
.status-waiting-for-sars,
.status-waiting-for-cipc,
.status-waiting-for-master,
.status-needs-clarification {
  background: #e0f2fe;
  color: #075985;
}

.record-title {
  font-weight: 800;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.settings-card {
  display: grid;
  gap: 10px;
  min-height: 170px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--ink);
}

.settings-card:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.settings-card strong {
  font-size: 18px;
}

.settings-card small {
  color: var(--muted);
  line-height: 1.45;
}

.settings-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.brand-preview-panel {
  display: grid;
  gap: 18px;
}

.brand-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(135deg, #f4fbfb, #ffffff);
}

.brand-preview img {
  max-width: 150px;
  max-height: 78px;
  object-fit: contain;
}

.brand-preview strong,
.brand-preview small {
  display: block;
}

.brand-preview small {
  margin-top: 4px;
  color: var(--muted);
}

.practice-settings-form {
  align-items: start;
}

.practice-settings-layout {
  grid-template-columns: minmax(320px, 380px) minmax(0, 1fr);
}

.practice-settings-layout .brand-preview-panel {
  overflow: hidden;
}

.practice-settings-layout .brand-preview {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  justify-items: center;
  text-align: center;
}

.practice-settings-layout .brand-preview img {
  width: auto;
  max-width: 220px;
  max-height: 92px;
}

.practice-settings-layout .details {
  grid-template-columns: minmax(112px, 0.38fr) minmax(0, 1fr);
  gap: 0;
}

.practice-settings-layout .details dd {
  overflow-wrap: anywhere;
}

.practice-settings-layout .details dt,
.practice-settings-layout .details dd {
  align-items: start;
  min-width: 0;
  line-height: 1.35;
}

.practice-settings-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.practice-settings-form .form-section {
  padding: 18px;
  border-radius: 14px;
}

.practice-settings-form .form-actions {
  position: sticky;
  bottom: 0;
  margin: 0 -22px -22px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
}

.role-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
}

.role-meta span {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  background: #e8f6f6;
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 800;
}

.permission-workbench {
  display: grid;
  gap: 18px;
}

.permission-toolbar {
  position: sticky;
  top: 76px;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.08);
  backdrop-filter: blur(10px);
}

.permission-toolbar div {
  display: grid;
  gap: 4px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.permission-module {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.05);
  overflow: hidden;
}

.permission-module-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  background: #f8fbfd;
  border-bottom: 1px solid var(--line);
}

.permission-module-heading span {
  color: var(--muted);
  font-weight: 800;
}

.permission-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.permission-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  font-size: 12px;
}

.permission-check input {
  width: auto;
}

.permission-check:has(input:checked) {
  border-color: rgba(15, 139, 141, 0.35);
  background: #e8f6f6;
  color: var(--primary-dark);
}

.details {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 10px 18px;
  margin: 0;
}

.details.columns {
  grid-template-columns: 220px 1fr 220px 1fr;
}

dt {
  color: var(--muted);
  font-weight: 700;
}

dd {
  margin: 0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid h2,
.form-grid .wide,
.profile-section,
.form-actions {
  grid-column: 1 / -1;
}

.profile-section {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.profile-section h2 {
  grid-column: 1 / -1;
}

.onboarding-form {
  gap: 18px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(15, 139, 141, 0.05), rgba(208, 139, 40, 0.04)),
    #ffffff;
}

.client-form-progress {
  position: sticky;
  top: 76px;
  z-index: 7;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 24px rgba(23, 32, 51, 0.06);
  backdrop-filter: blur(10px);
}

.client-form-progress a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 800;
}

.client-form-progress a.active {
  background: #e8f6f6;
  color: var(--primary-dark);
}

.required-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.client-form.was-submitted input:required:invalid,
.client-form.was-submitted select:required:invalid,
.client-form.was-submitted textarea:required:invalid {
  border-color: var(--danger);
  background: #fff7f6;
}

.client-form.was-submitted input:required:invalid + .field-hint {
  color: var(--danger);
}

.sticky-form-actions {
  position: sticky;
  bottom: 0;
  z-index: 7;
  margin: 8px -24px -24px;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  box-shadow: 0 -10px 24px rgba(23, 32, 51, 0.08);
}

.form-section {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbfd;
}

.compact-fields {
  margin-top: 14px;
}

.client-type-panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--primary);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(23, 32, 51, 0.05);
}

.uppercase-panel input:not([type="date"]):not([type="number"]):not([type="checkbox"]):not([type="radio"]),
.uppercase-panel textarea {
  text-transform: uppercase;
}

.type-panel-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.type-panel-heading h2 {
  margin-bottom: 0;
}

.spouse-details {
  padding: 16px;
  border: 1px solid rgba(208, 139, 40, 0.28);
  border-radius: 10px;
  background: #fffaf2;
}

.form-subsection {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbfd, #ffffff);
}

.form-subsection h2 {
  margin-bottom: 0;
}

.profile-section[hidden] {
  display: none;
}

.repeatable-section {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfd;
}

.repeatable-list {
  display: grid;
  gap: 14px;
}

.repeatable-item {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(23, 32, 51, 0.04);
}

.repeatable-item .wide {
  grid-column: 1 / -1;
}

.remove-repeatable {
  align-self: end;
}

.year-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbfd;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check input {
  width: auto;
}

.form-actions {
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

@media (max-width: 1020px) {
  .cockpit-grid,
  .dashboard-command,
  .dashboard-layout,
  .portal-home-grid,
  .portal-layout,
  .queue-grid,
  .settings-layout,
  .estate-template-grid,
  .portal-card-grid,
  .portal-entity-list.relaxed,
  .readiness-head,
  .dec-workflow-actions,
  .list-card {
    grid-template-columns: 1fr;
  }

  .focus-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .review-hero {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .practice-settings-form .form-actions {
    position: static;
    margin: 0;
    padding: 0;
    border-top: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .focus-strip-calm {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .active-client-types {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .active-client-types > div {
    grid-column: 1 / -1;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .onboarding-item-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .onboarding-item-actions .mini-form,
  .onboarding-item-actions > form:not(.mini-form) {
    width: 100%;
    margin-left: 0;
  }
}

@media (max-width: 780px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 14px 16px;
  }

  .side-nav {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }

  .sidebar-footer {
    display: none;
  }

  .utilitybar,
  .page-heading,
  .client-title-block,
  .record-list li {
    align-items: flex-start;
    flex-direction: column;
  }

  .utilitybar {
    position: static;
    padding: 12px 16px;
  }

  .workspace .page {
    width: min(100% - 24px, 1180px);
  }

  .metric-grid,
  .focus-strip,
  .review-hero,
  .checklist-grid,
  .active-client-breakdown,
  .active-client-types,
  .report-grid,
  .client-summary-grid,
  .onboarding-status-strip,
  .profile-overview-grid,
  .settings-grid,
  .overview-strip,
  .permission-grid,
  .placeholder-grid,
  .split,
  .filter-bar,
  .filter-bar.compact,
  .clients-filter-bar,
  .client-register-stats,
  .form-grid,
  .profile-section,
  .repeatable-item,
  .year-grid,
  .inline-create,
  .list-card,
  .details,
  .details.columns {
    grid-template-columns: 1fr;
  }

  .nav {
    width: 100%;
  }

  .modern-tabs {
    position: static;
  }

  .client-avatar {
    width: 50px;
    height: 50px;
  }

  .permission-toolbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .actions,
  .form-actions,
  .section-heading {
    align-items: stretch;
  }

  .actions .button,
  .actions form,
  .form-actions .button,
  .form-actions form,
  .section-heading .button {
    width: 100%;
  }

  .permission-actions {
    grid-template-columns: 1fr;
  }
}

/* High-traffic screen polish */
.dashboard-command-calm {
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.7fr);
  min-height: 0;
  padding: 26px;
  border: 1px solid rgba(8, 127, 140, 0.14);
  background:
    linear-gradient(135deg, rgba(8, 127, 140, 0.1), rgba(255, 255, 255, 0) 42%),
    #ffffff;
  color: var(--ink);
  box-shadow: 0 16px 38px rgba(18, 38, 63, 0.08);
}

.dashboard-command-calm h1 {
  color: var(--ink);
}

.dashboard-command-calm .muted {
  color: var(--muted);
}

.dashboard-command-calm .dashboard-actions {
  gap: 10px;
  margin-top: 18px;
}

.dashboard-command-calm .dashboard-command-side {
  padding: 16px;
  border: 1px solid rgba(8, 127, 140, 0.14);
  background: linear-gradient(180deg, #f7fbfc, #ffffff);
}

.dashboard-command-calm .command-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 14px 16px;
  border: 1px solid rgba(8, 127, 140, 0.14);
  border-radius: 8px;
  background: #ffffff;
}

.dashboard-command-calm .active-client-breakdown {
  gap: 8px;
}

.dashboard-command-calm .active-client-breakdown a {
  border: 1px solid rgba(8, 127, 140, 0.12);
  background: #ffffff;
  color: var(--ink);
}

.dashboard-command-calm .active-client-breakdown span,
.dashboard-command-calm .command-total span {
  color: var(--muted);
}

.dashboard-command-calm .active-client-breakdown strong,
.dashboard-command-calm .command-total strong {
  color: var(--ink);
}

.focus-strip-calm {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.focus-strip-calm .focus-card {
  min-height: 98px;
  padding: 16px;
  border: 1px solid rgba(18, 38, 63, 0.08);
  border-left: 4px solid rgba(8, 127, 140, 0.32);
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(18, 38, 63, 0.06);
}

.focus-strip-calm .focus-card strong {
  font-size: 1.75rem;
}

.dashboard-layout {
  grid-template-columns: minmax(0, 1.32fr) minmax(320px, 0.68fr);
  gap: 18px;
  align-items: start;
}

.queue-stack {
  gap: 16px;
}

.lane-panel {
  overflow: hidden;
  border-radius: 10px;
}

.lane-panel .section-heading {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.queue-list {
  gap: 8px;
}

.queue-list li {
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(18, 38, 63, 0.07);
  border-radius: 8px;
  background: #fbfdff;
}

.queue-list li + li {
  border-top: 1px solid rgba(18, 38, 63, 0.07);
}

.snapshot-grid {
  gap: 10px;
}

.snapshot-grid span {
  border-radius: 8px;
  background: #f7fbfc;
}

.clients-heading {
  align-items: center;
  margin-bottom: 18px;
}

.client-register-shell {
  gap: 14px;
}

.client-register-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.client-register-stats article {
  min-height: 78px;
  padding: 16px 18px;
  border-radius: 10px;
  background: #ffffff;
}

.active-client-types {
  grid-template-columns: minmax(240px, 0.9fr) repeat(5, minmax(130px, 1fr));
  align-items: stretch;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(8, 127, 140, 0.14);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(8, 127, 140, 0.08), rgba(208, 139, 40, 0.08)),
    #ffffff;
  box-shadow: 0 12px 30px rgba(18, 38, 63, 0.06);
}

.active-client-types > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.active-client-types a {
  min-height: 80px;
  padding: 14px;
  border: 1px solid rgba(18, 38, 63, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 18px rgba(18, 38, 63, 0.04);
}

.active-client-types a:hover {
  transform: translateY(-1px);
  border-color: rgba(8, 127, 140, 0.35);
}

.clients-filter-bar {
  align-items: end;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, 240px) minmax(190px, 240px) auto;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  background: #ffffff;
}

.clients-filter-bar .button {
  min-height: 40px;
}

.clients-table-wrap {
  overflow: hidden;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 14px 32px rgba(18, 38, 63, 0.06);
}

.clients-table th {
  background: #f4f8fb;
}

.clients-table th,
.clients-table td {
  padding: 13px 16px;
}

.client-hero {
  align-items: center;
  padding: 22px;
  border: 1px solid rgba(8, 127, 140, 0.13);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(8, 127, 140, 0.08), rgba(208, 139, 40, 0.06)),
    #ffffff;
  box-shadow: 0 14px 34px rgba(18, 38, 63, 0.07);
}

.client-title-block {
  gap: 14px;
}

.client-hero .actions {
  flex-wrap: wrap;
}

.modern-tabs {
  top: 58px;
  z-index: 8;
  gap: 4px;
  padding: 7px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(18, 38, 63, 0.05);
}

.modern-tabs a {
  min-height: 38px;
  padding: 10px 13px;
  border-radius: 7px;
}

.client-action-bar {
  position: sticky;
  top: 112px;
  z-index: 7;
  gap: 8px;
  margin: 12px 0 18px;
  padding: 10px;
  border: 1px solid rgba(8, 127, 140, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 26px rgba(18, 38, 63, 0.06);
}

.client-action-bar .button {
  min-height: 36px;
  padding: 9px 12px;
}

.client-summary-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.summary-card {
  min-height: 84px;
  padding: 14px;
  border-radius: 10px;
  background: #ffffff;
}

.file-health-panel,
.readiness-card,
.onboarding-progress-card {
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(18, 38, 63, 0.06);
}

.file-health-grid,
.smart-checklist-grid {
  gap: 10px;
}

.file-health-grid a,
.smart-checklist-grid span {
  border-radius: 8px;
  background: #f8fbfd;
}

.client-form-progress {
  position: sticky;
  top: 58px;
  z-index: 9;
  gap: 8px;
  margin-bottom: 14px;
  padding: 8px;
  border: 1px solid rgba(8, 127, 140, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 22px rgba(18, 38, 63, 0.05);
}

.client-form-progress a {
  min-height: 34px;
  border-radius: 7px;
}

.client-form {
  gap: 18px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.form-card,
.client-type-panel {
  padding: 20px;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(18, 38, 63, 0.06);
}

.client-type-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 4px solid var(--primary);
}

.client-type-panel > h2 {
  grid-column: 1 / -1;
  margin: 4px 0 0;
  padding-top: 8px;
  color: var(--primary-strong);
}

.client-type-panel .wide,
.client-type-panel .form-subsection,
.client-type-panel .repeatable-section,
.client-type-panel .spouse-details,
.client-type-panel .section-heading {
  grid-column: 1 / -1;
}

.type-panel-heading {
  padding: 14px;
  border: 1px solid rgba(8, 127, 140, 0.1);
  border-radius: 10px;
  background: #f7fbfc;
}

.form-subsection,
.repeatable-section,
.spouse-details {
  border-radius: 10px;
}

.repeatable-item {
  border-radius: 10px;
}

.form-actions {
  position: sticky;
  bottom: 0;
  z-index: 10;
  margin-top: 4px;
  padding: 14px 0 0;
  background: linear-gradient(180deg, rgba(245, 248, 251, 0), var(--bg) 34%);
}

.portal-hero,
.portal-client-hero {
  border-color: rgba(8, 127, 140, 0.16);
  background:
    linear-gradient(135deg, rgba(8, 127, 140, 0.1), rgba(208, 139, 40, 0.06)),
    #ffffff;
}

.portal-home-grid {
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.62fr);
  gap: 18px;
}

.portal-home-primary,
.portal-home-summary {
  border-radius: 12px;
}

.portal-entity-list.relaxed {
  gap: 10px;
}

.portal-entity-list.relaxed a {
  padding: 14px;
  border-radius: 10px;
  background: #f8fbfd;
}

.portal-home-summary {
  display: flex;
  min-height: 260px;
  flex-direction: column;
  justify-content: center;
}

.portal-action-count {
  margin: 10px 0;
}

.portal-client-search {
  grid-template-columns: minmax(260px, 1fr) auto auto;
  margin-bottom: 16px;
}

.portal-clients-grid {
  border-radius: 10px;
}

.portal-clients-grid table {
  min-width: 880px;
}

.portal-tabs {
  margin-bottom: 14px;
}

.portal-request-item {
  border-radius: 10px;
}

.portal-item-action form {
  align-items: center;
}

.account-layout,
.portal-client-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.portal-detail-card {
  min-height: 0;
}

.portal-follow-up-card {
  grid-column: 1 / -1;
}

.portal-follow-up-card .portal-overview-followups {
  margin-top: 12px;
}

.portal-overview-followups table {
  table-layout: fixed;
}

.portal-overview-followups th:first-child,
.portal-overview-followups td:first-child {
  width: 130px;
}

.portal-overview-followups th:last-child,
.portal-overview-followups td:last-child {
  width: 150px;
}

.portal-detail-card h2 {
  margin-bottom: 14px;
}

.portal-detail-card .details {
  row-gap: 10px;
}

.portal-detail-card .details.columns {
  grid-template-columns: minmax(120px, 0.52fr) minmax(0, 1fr);
}

.portal-detail-card dt,
.portal-detail-card dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.portal-detail-card dd {
  color: var(--ink);
}

.portal-request-list {
  gap: 14px;
}

.portal-request-card-clean {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 12px;
}

.portal-request-card-clean > div {
  min-width: 0;
}

.portal-request-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.portal-request-head h3 {
  margin-bottom: 5px;
}

.portal-request-head p {
  margin: 0;
  color: var(--muted);
}

.portal-request-head small {
  display: block;
  margin-top: 8px;
  color: var(--primary-strong);
  font-weight: 800;
}

.portal-due-note {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid rgba(208, 139, 40, 0.22);
  border-radius: 8px;
  background: #fffaf2;
  color: #6a4a12;
}

.portal-request-items-clean {
  gap: 10px;
}

.portal-request-items-clean .portal-request-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, auto);
  align-items: center;
  padding: 14px;
  background: #fff;
}

.portal-request-items-clean input[type="file"] {
  max-width: 260px;
}

@media (max-width: 1180px) {
  .dashboard-command-calm,
  .dashboard-layout,
  .portal-home-grid {
    grid-template-columns: 1fr;
  }

  .account-layout,
  .portal-client-overview {
    grid-template-columns: 1fr;
  }

  .active-client-types {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .active-client-types > div {
    grid-column: 1 / -1;
  }
}

@media (max-width: 920px) {
  .focus-strip-calm,
  .client-register-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clients-filter-bar,
  .portal-client-search {
    grid-template-columns: 1fr;
  }

  .client-action-bar,
  .client-form-progress,
  .modern-tabs {
    position: static;
  }

  .client-type-panel {
    grid-template-columns: 1fr;
  }

  .portal-request-head,
  .portal-request-items-clean .portal-request-item {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .portal-detail-card .details.columns {
    grid-template-columns: 1fr;
    gap: 4px 0;
  }

  .portal-detail-card dd {
    margin-bottom: 8px;
  }

  .portal-item-action,
  .portal-item-action form {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .login-shell::before,
  .login-shell::after {
    display: none;
  }

  .login-shell {
    padding: 18px;
  }

  .login-card {
    padding: 28px 20px;
  }

  .portal-hero,
  .portal-client-hero {
    align-items: stretch;
  }

  .portal-hero .button,
  .portal-client-hero .button {
    width: 100%;
  }

  .portal-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 8px;
  }

  .portal-tabs a {
    justify-content: center;
    min-height: 42px;
    text-align: center;
  }

  .portal-mobile-table,
  .portal-mobile-table thead,
  .portal-mobile-table tbody,
  .portal-mobile-table tr,
  .portal-mobile-table th,
  .portal-mobile-table td {
    display: block;
  }

  .portal-mobile-table {
    min-width: 0 !important;
  }

  .portal-mobile-table thead {
    display: none;
  }

  .portal-mobile-table tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  .portal-mobile-table tr:last-child {
    border-bottom: 0;
  }

  .portal-mobile-table td {
    display: grid;
    grid-template-columns: minmax(96px, 0.42fr) minmax(0, 1fr);
    gap: 10px;
    padding: 7px 12px;
    border-bottom: 0;
    text-align: left;
    white-space: normal;
  }

  .portal-mobile-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
  }

  .portal-mobile-table td.empty {
    display: block;
    padding: 18px 12px;
    text-align: center;
  }

  .portal-mobile-table td.empty::before {
    display: none;
  }

  .portal-mobile-table .button,
  .portal-item-action .button,
  .portal-item-action input[type="file"] {
    width: 100%;
  }

  .portal-notifications-panel {
    padding: 18px;
  }

  .portal-notifications-panel .notification-list li {
    display: grid;
    gap: 12px;
  }

  .portal-notifications-panel .button,
  .portal-notifications-panel .pill {
    justify-self: start;
  }

  .portal-request-card-clean {
    padding: 14px;
  }

  .portal-request-progress {
    grid-template-columns: 1fr;
  }

  .portal-request-items-clean .portal-request-item {
    padding: 12px;
  }

  .portal-general-request-upload {
    grid-template-columns: 1fr;
  }

  .portal-item-action form {
    display: grid;
    gap: 8px;
  }

  .legal-page {
    padding: 12px 0;
  }

  .legal-card {
    padding: 20px 18px;
  }

  .legal-card h1 {
    font-size: 1.45rem;
  }

  .dashboard-command-calm,
  .client-hero,
  .form-card,
  .client-type-panel {
    padding: 16px;
  }

  .focus-strip-calm,
  .client-register-stats,
  .active-client-types {
    grid-template-columns: 1fr;
  }

  .client-action-bar .button,
  .dashboard-command-calm .dashboard-actions .button {
    width: 100%;
  }
}

/* Client file control-centre polish */
.client-hero {
  min-height: 112px;
  padding: 18px 22px;
}

.client-hero .client-avatar {
  width: 58px;
  height: 58px;
  border-radius: 8px;
  font-size: 1.25rem;
}

.client-hero h1 {
  margin: 3px 0 6px;
  font-size: clamp(1.55rem, 2vw, 2rem);
  line-height: 1.1;
}

.client-badges {
  gap: 7px;
}

.client-hero .actions .button {
  min-height: 40px;
  padding: 10px 14px;
}

.modern-tabs {
  margin-top: 12px;
  margin-bottom: 10px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.modern-tabs a {
  white-space: nowrap;
}

.client-action-bar {
  top: 106px;
  margin: 8px 0 18px;
  padding: 8px 10px;
}

.client-action-bar .button {
  min-height: 34px;
  padding: 8px 11px;
  border-color: rgba(8, 127, 140, 0.18);
  background: #effbfc;
  color: var(--primary-strong);
}

.client-overview-workbench.active {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(330px, 0.7fr);
  gap: 18px;
  align-items: start;
}

.overview-main-column,
.overview-side-column {
  display: grid;
  gap: 14px;
}

.client-overview-workbench > .modern-callout,
.client-overview-workbench > .split {
  grid-column: 1 / -1;
}

.priority-health-panel {
  border-color: rgba(8, 127, 140, 0.22);
  background:
    linear-gradient(135deg, rgba(8, 127, 140, 0.08), rgba(255, 255, 255, 0) 46%),
    #ffffff;
}

.file-health-panel {
  padding: 18px;
}

.file-health-heading {
  align-items: center;
  margin-bottom: 14px;
}

.file-health-heading h2 {
  margin: 2px 0 0;
  font-size: 1.12rem;
}

.file-health-grid {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.file-health-grid a {
  min-height: 56px;
  padding: 12px;
  border-color: rgba(18, 38, 63, 0.08);
}

.file-health-grid span {
  line-height: 1.15;
}

.smart-checklist-grid {
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
}

.smart-checklist-grid span {
  min-height: 78px;
  padding: 12px;
}

.smart-checklist-grid strong {
  line-height: 1.15;
}

.compact-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 0;
}

.compact-summary-grid .summary-card {
  min-height: 68px;
  gap: 10px;
  padding: 11px;
  box-shadow: 0 8px 18px rgba(18, 38, 63, 0.05);
}

.compact-summary-grid .summary-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  font-size: 0.78rem;
}

.compact-summary-grid .summary-card small {
  display: -webkit-box;
  min-height: 1.2em;
  overflow: hidden;
  color: #45617a;
  font-size: 0.72rem;
  line-height: 1.05;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.compact-summary-grid .summary-card strong {
  margin-top: 3px;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1;
}

.compact-summary-grid .summary-card .date-value {
  white-space: nowrap;
  font-size: 0.95rem;
  letter-spacing: 0;
}

.overview-side-column .onboarding-progress-card,
.overview-side-column .readiness-card {
  padding: 16px;
}

.overview-side-column .onboarding-progress-main {
  gap: 10px;
}

.overview-side-column .onboarding-progress-card h2,
.overview-side-column .readiness-card h2 {
  font-size: 1.15rem;
}

.overview-side-column .readiness-head {
  grid-template-columns: auto 1fr;
  gap: 10px;
}

.overview-side-column .readiness-head > a {
  grid-column: 1 / -1;
  justify-self: start;
}

@media (max-width: 1180px) {
  .client-overview-workbench.active {
    grid-template-columns: 1fr;
  }

  .estate-overview-priority,
  .portal-access-card {
    grid-template-columns: 1fr;
  }

  .compact-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .compact-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .client-hero {
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .estate-dec-card {
    grid-template-columns: 1fr;
  }

  .compact-summary-grid,
  .file-health-grid,
  .smart-checklist-grid {
    grid-template-columns: 1fr;
  }
}
