/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:    #1a2744;
  --navy-lt: #243459;
  --navy-dk: #111b30;
  --accent:  #2a6bcc;
  --accent-lt: #3a82f0;
  --white:   #ffffff;
  --gray-50: #f8f9fa;
  --gray-100:#f0f2f5;
  --gray-200:#e2e6ea;
  --gray-400:#9aa3b0;
  --gray-600:#5a6472;
  --gray-800:#1e2430;
  --text:    #1e2430;
  --text-lt: #4a5568;

  --red:     #c0392b;
  --red-bg:  #fdf2f1;
  --red-bd:  #f5c6c3;
  --orange:  #d35400;
  --orange-bg:#fdf5ee;
  --orange-bd:#f5d0a9;
  --yellow:  #b7791f;
  --yellow-bg:#fefce8;
  --yellow-bd:#f9e4a8;
  --green:   #1a6e3c;
  --green-bg:#f0fdf4;
  --green-bd:#a7f3d0;

  --sidebar-width: 220px;
  --header-height: 56px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text);
  background: var(--gray-100);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background: var(--navy);
  color: var(--white);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-duck {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar-logo h1 {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: 0.3px;
  line-height: 1.3;
}
.sidebar-sub1 {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.5px;
  margin-top: 3px;
}
.sidebar-sub2 {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.3px;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: rgba(255,255,255,0.75);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: var(--white);
  text-decoration: none;
}
.nav-item.active {
  background: rgba(255,255,255,0.12);
  color: var(--white);
  border-left-color: var(--accent-lt);
}
.nav-item .icon { font-size: 16px; width: 20px; text-align: center; }

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}
.sidebar-footer .user-name {
  color: rgba(255,255,255,0.85);
  font-weight: 600;
  font-size: 13px;
}
.sidebar-footer a { color: rgba(255,255,255,0.5); font-size: 12px; }
.sidebar-footer a:hover { color: var(--white); }

.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.page-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 28px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.page-header h2 {
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-800);
  flex: 1;
}
.page-header .subtitle {
  font-size: 12px;
  color: var(--gray-400);
  font-family: var(--font-sans);
  font-weight: 400;
}

.page-body {
  padding: 24px 28px;
  flex: 1;
}

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}
.card-header {
  padding: 14px 20px 12px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-header h3 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--gray-800);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex: 1;
}
.card-body { padding: 16px 20px; }

/* ── Stats Grid ─────────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 16px 20px;
}
.stat-card .stat-label {
  font-size: 11px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}
.stat-card .stat-value {
  font-size: 32px;
  font-weight: 700;
  color: var(--navy);
  font-family: var(--font-serif);
  line-height: 1.1;
  margin-top: 4px;
}
.stat-card .stat-sub { font-size: 12px; color: var(--gray-400); margin-top: 2px; }

/* ── Dashboard Grid ─────────────────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
}

/* ── SOL Alerts ─────────────────────────────────────────────────── */
.sol-row {
  display: grid;
  grid-template-columns: 1fr 100px 110px 80px;
  gap: 10px;
  align-items: center;
  padding: 9px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
  transition: background 0.1s;
}
.sol-row:hover { background: var(--gray-50); }
.sol-row:last-child { border-bottom: none; }
.sol-row a { color: var(--text); font-weight: 600; }
.sol-row a:hover { color: var(--accent); text-decoration: none; }
.sol-row .days { font-weight: 700; font-size: 14px; text-align: right; }
.sol-row .meta { font-size: 12px; color: var(--gray-400); }

.badge-red    { background: var(--red-bg);    color: var(--red);    border: 1px solid var(--red-bd);    padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-orange { background: var(--orange-bg); color: var(--orange); border: 1px solid var(--orange-bd); padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); border: 1px solid var(--yellow-bd); padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-green  { background: var(--green-bg);  color: var(--green);  border: 1px solid var(--green-bd);  padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-gray   { background: var(--gray-100);  color: var(--gray-600); border: 1px solid var(--gray-200); padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-blue   { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-navy   { background: var(--navy); color: var(--white); padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-purple { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-teal   { background: #f0fdfa; color: #0f766e; border: 1px solid #99f6e4; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.badge-sky    { background: #f0f9ff; color: #0369a1; border: 1px solid #bae6fd; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 700; white-space: nowrap; }

/* ── Incident type badges ────────────────────────────────────────── */
/* Base shape shared by all incident badges */
[class^="badge-incident-"] {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
}
.badge-incident-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-incident-green  { background: #dcfce7; color: #166534; }
.badge-incident-orange { background: #ffedd5; color: #c2410c; }
.badge-incident-teal   { background: #ccfbf1; color: #0f766e; }
.badge-incident-purple { background: #f3e8ff; color: #7e22ce; }
.badge-incident-yellow { background: #fef9c3; color: #854d0e; }
.badge-incident-navy   { background: var(--navy); color: var(--white); }
.badge-incident-red    { background: #fee2e2; color: #b91c1c; }
.badge-incident-gray   { background: var(--gray-100); color: var(--gray-600); }

/* ── Activity Feed ──────────────────────────────────────────────── */
.activity-item {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 12.5px;
}
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-top: 5px; flex-shrink: 0; }
.activity-body { flex: 1; }
.activity-body strong { color: var(--text); }
.activity-time { font-size: 11px; color: var(--gray-400); }

/* ── Table ──────────────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  background: var(--white);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
thead th {
  background: var(--navy);
  color: rgba(255,255,255,0.85);
  padding: 10px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  position: sticky;
  top: 0;
}
thead th:hover { background: var(--navy-lt); color: var(--white); }
thead th .sort-icon { opacity: 0.4; font-size: 10px; }
thead th.sorted .sort-icon { opacity: 1; }

tbody tr {
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background 0.1s;
}
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #f0f4ff; }
tbody tr.row-closed { opacity: 0.55; }
tbody tr.row-settled { opacity: 0.65; }
tbody td {
  padding: 8px 12px;
  vertical-align: middle;
}
.td-name { font-weight: 600; color: var(--text); text-transform: uppercase; }
.td-name.confidence-high { font-weight: 800; }
.td-name.confidence-low { font-style: italic; font-weight: 400; color: var(--gray-600); }
.th-rownum, .td-rownum { width: 32px; min-width: 32px; text-align: right; color: var(--gray-400); font-size: 11px; padding-right: 8px !important; }
.td-date-added { white-space: nowrap; color: var(--gray-600); font-size: 12px; }

.td-location { min-width: 110px; }
.loc-city  { font-size: 12px; color: var(--text); }
.loc-desc  { font-size: 11px; color: var(--gray-400); line-height: 1.3; display: block; margin-top: 1px; }

/* ── Search Bar ─────────────────────────────────────────────────── */
.search-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.search-bar input, .search-bar select {
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 13.5px;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.search-bar input:focus, .search-bar select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42,107,204,0.12);
}
.search-bar input[type="text"] { width: 260px; }
#search-main { width: 300px; }

/* ── Filters Row ────────────────────────────────────────────────── */
.filters-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
  font-size: 12.5px;
}
.filter-label { color: var(--gray-600); font-weight: 600; }
.filter-chip {
  padding: 4px 10px;
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  cursor: pointer;
  color: var(--gray-800);
  font-size: 12px;
  font-weight: 500;
  transition: background 0.1s;
}
.filter-chip:hover, .filter-chip.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}
.result-count { margin-left: auto; color: var(--gray-400); font-size: 12px; }
.filter-divider { width: 1px; background: var(--gray-200); margin: 0 4px; align-self: stretch; }
.toggle-closed-btn {
  padding: 4px 12px;
  background: transparent;
  border: 1px dashed var(--gray-400);
  border-radius: 4px;
  color: var(--gray-600);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.1s;
  margin-left: 4px;
}
.toggle-closed-btn:hover { border-color: var(--gray-600); color: var(--gray-800); }
.toggle-closed-btn.active {
  background: var(--gray-200);
  border-color: var(--gray-400);
  border-style: solid;
  color: var(--gray-800);
}

/* ── Case Detail ────────────────────────────────────────────────── */
.case-header {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 20px;
}
.case-header .case-title {
  flex: 1;
}
.case-header h1 {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}
.case-header .meta-row {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--gray-600);
}
.case-header .meta-row .sep { color: var(--gray-200); }

.sol-countdown {
  text-align: center;
  padding: 12px 20px;
  border-radius: 8px;
  min-width: 130px;
  border: 2px solid;
}
.sol-countdown .days-num {
  font-size: 36px;
  font-weight: 800;
  font-family: var(--font-serif);
  line-height: 1;
}
.sol-countdown .days-label { font-size: 11px; font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase; margin-top: 2px; }
.sol-countdown .sol-date-val { font-size: 12px; margin-top: 6px; }
.sol-countdown.red    { background: var(--red-bg);    color: var(--red);    border-color: var(--red); }
.sol-countdown.orange { background: var(--orange-bg); color: var(--orange); border-color: var(--orange); }
.sol-countdown.yellow { background: var(--yellow-bg); color: var(--yellow); border-color: var(--yellow); }
.sol-countdown.green  { background: var(--green-bg);  color: var(--green);  border-color: var(--green); }
.sol-countdown.none   { background: var(--gray-100);  color: var(--gray-400); border-color: var(--gray-200); }

/* ── UM Warning Banner ──────────────────────────────────────────── */
.um-banner {
  background: var(--orange-bg);
  border: 2px solid var(--orange);
  border-radius: 8px;
  padding: 12px 18px;
  margin-bottom: 20px;
  font-weight: 700;
  color: var(--orange);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ── Detail Sections ────────────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
.detail-grid.full { grid-template-columns: 1fr; }
.detail-grid.thirds { grid-template-columns: 1fr 1fr 1fr; }

.field-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 0;
  border-bottom: 1px solid var(--gray-100);
}
.field-row:last-child { border-bottom: none; }
.field-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.field-value {
  font-size: 13.5px;
  color: var(--text);
  word-break: break-word;
  display: flex;
  align-items: center;
  gap: 6px;
}
.field-value.empty { color: var(--gray-400); font-style: italic; }
.field-edit-btn {
  visibility: hidden;
  font-size: 11px;
  color: var(--accent);
  cursor: pointer;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 1px 6px;
  background: none;
  font-family: var(--font-sans);
}
.field-row:hover .field-edit-btn { visibility: visible; }

/* ── Inline Edit ────────────────────────────────────────────────── */
.inline-edit-form {
  display: none;
  margin-top: 4px;
  gap: 6px;
  align-items: center;
}
.inline-edit-form.visible { display: flex; }
.inline-edit-form input,
.inline-edit-form select,
.inline-edit-form textarea {
  border: 1px solid var(--accent);
  border-radius: 5px;
  padding: 5px 9px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text);
  flex: 1;
  outline: none;
}
.inline-edit-form textarea { resize: vertical; min-height: 60px; }
.btn-save {
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 5px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-sans);
}
.btn-save:hover { background: var(--accent-lt); }
.btn-cancel {
  background: none;
  border: 1px solid var(--gray-200);
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 12px;
  color: var(--gray-600);
  font-family: var(--font-sans);
}
.btn-cancel:hover { background: var(--gray-100); }

/* ── Audit Log ──────────────────────────────────────────────────── */
.audit-item {
  padding: 7px 0;
  border-bottom: 1px solid var(--gray-100);
  font-size: 12.5px;
}
.audit-item:last-child { border-bottom: none; }
.audit-item .audit-meta { color: var(--gray-400); font-size: 11px; }
.audit-item .audit-action { font-weight: 700; color: var(--accent); }
.audit-item .audit-change { color: var(--gray-600); }
.audit-item del { color: var(--red); background: var(--red-bg); padding: 0 3px; border-radius: 2px; }
.audit-item ins { color: var(--green); background: var(--green-bg); padding: 0 3px; border-radius: 2px; text-decoration: none; }

/* ── SOL Page ───────────────────────────────────────────────────── */
.sol-section {
  margin-bottom: 28px;
}
.sol-section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 8px;
  margin-bottom: 2px;
}
.sol-section-header h3 {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
}
.sol-section-header.red h3    { color: var(--red); }
.sol-section-header.orange h3 { color: var(--orange); }
.sol-section-header.yellow h3 { color: var(--yellow); }

.sol-notes-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  white-space: nowrap;
  text-decoration: none;
}
.sol-notes-link:hover { text-decoration: underline; }

.sol-table-row {
  display: grid;
  grid-template-columns: 220px 100px 90px 1fr 70px;
  gap: 12px;
  padding: 9px 16px;
  border-bottom: 1px solid var(--gray-100);
  align-items: center;
  font-size: 13px;
  transition: background 0.1s;
}
.sol-table-row:hover { background: var(--gray-50); }
.sol-table-row.header {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-400);
  background: var(--gray-50);
  cursor: default;
}
.sol-days-big {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-serif);
}
.red .sol-days-big    { color: var(--red); }
.orange .sol-days-big { color: var(--orange); }
.yellow .sol-days-big { color: var(--yellow); }

/* ── Login ──────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
}
.login-box {
  background: var(--white);
  border-radius: 10px;
  padding: 40px 44px;
  width: 380px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo {
  display: block;
  margin: 0 auto 20px;
  height: 90px;
  width: auto;
}
.login-box h1 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--navy);
  margin-bottom: 4px;
}
.login-box .subtitle {
  color: var(--gray-500);
  font-size: 16px;
  margin-bottom: 4px;
}
.login-box .subtitle-firm {
  color: var(--gray-400);
  font-size: 14px;
  margin-bottom: 24px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.form-group input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42,107,204,0.15);
}
.btn-primary {
  width: 100%;
  padding: 11px;
  background: var(--navy);
  color: var(--white);
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-sans);
  margin-top: 6px;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--navy-lt); }
.alert-success {
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #166534;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}
.btn-secondary {
  padding: 10px 18px;
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  text-decoration: none;
  display: inline-block;
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--gray-100); }
.alert-error {
  background: var(--red-bg);
  border: 1px solid var(--red-bd);
  color: var(--red);
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  margin-bottom: 16px;
}

/* ── Utilities ──────────────────────────────────────────────────── */
.mb-4  { margin-bottom: 16px; }
.mb-6  { margin-bottom: 24px; }
.mt-4  { margin-top: 16px; }
.flex  { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.flex-1 { flex: 1; }
.text-sm { font-size: 12px; }
.text-gray { color: var(--gray-400); }
.font-bold { font-weight: 700; }
.loading { color: var(--gray-400); font-style: italic; padding: 20px; text-align: center; }
.empty-state { color: var(--gray-400); font-style: italic; padding: 30px; text-align: center; font-size: 14px; }
.section-divider { height: 1px; background: var(--gray-200); margin: 20px 0; }

/* ── Section / Field (Case Detail) ─────────────────────────────── */
.section {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  margin-bottom: 14px;
  /* overflow: hidden removed — it was clipping the provider autocomplete dropdown.
     Rounded corners are preserved by border-radius on .section-hdr instead. */
}

.section-hdr {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  background: var(--navy);
  cursor: pointer;
  user-select: none;
  border-radius: 7px 7px 0 0;
}
.section-hdr:hover { background: var(--navy-lt); }

.s-chevron {
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  transition: transform 0.2s;
  flex-shrink: 0;
  display: inline-block;
}
.section.collapsed .s-chevron { transform: rotate(-90deg); }

.s-title {
  flex: 1;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.9);
}

.s-actions { display: flex; gap: 6px; }
.btn-sedit {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 600;
  transition: background 0.15s;
}
.btn-sedit:hover { background: rgba(255,255,255,0.2); color: var(--white); }
.btn-ssave {
  font-size: 11px;
  background: #16a34a;
  color: var(--white);
  border: none;
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-weight: 700;
}
.btn-ssave:hover { background: #15803d; }
.btn-scancel {
  font-size: 11px;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
  font-family: var(--font-sans);
}
.btn-scancel:hover { background: rgba(255,255,255,0.18); }

.s-body {
  padding: 12px 16px;
  transition: background 0.3s;
}
.section.collapsed .s-body { display: none; }
.section.sec-editing .s-body { background: #fffcf0; border-radius: 0 0 7px 7px; }

/* ── Field blocks ─────────────────────────────────────────────── */
.f-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 24px;
}
.f-grid > * { min-width: 0; }
.f-grid.one-col { grid-template-columns: 1fr; }
.f-grid.three-col { grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr); }

.f {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid var(--gray-100);
  min-height: 34px;
}
.f:last-child { border-bottom: none; }
.f.empty { display: none; }
.section.sec-editing .f { display: flex !important; }

.fl {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  min-width: 130px;
  flex-shrink: 0;
  padding-top: 3px;
  line-height: 1.3;
}

.fv {
  font-size: 13.5px;
  color: var(--text);
  flex: 1;
  word-break: break-word;
  line-height: 1.45;
  white-space: normal;
}
.fv.phone { font-family: monospace; font-size: 13px; }

.fe { flex: 1; }
.fe input, .fe select, .fe textarea {
  width: 100%;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 5px 8px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--white);
  outline: none;
  box-shadow: 0 0 0 2px rgba(42,107,204,0.1);
}
.fe textarea { resize: vertical; min-height: 64px; }

/* Sub-group label within a section */
.sub-hdr {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
  padding: 10px 0 4px;
  margin-top: 4px;
  border-top: 1px solid var(--gray-200);
}
.sub-hdr:first-child { border-top: none; margin-top: 0; padding-top: 4px; }

/* Sections placed side by side */
.section-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.section-row .section { margin-bottom: 0; }
.section-row.three { grid-template-columns: 1fr 1fr 1fr; }

/* Doc badges */
.doc-badges { display: flex; gap: 12px; flex-wrap: wrap; padding: 4px 0; }
.doc-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
}
.doc-badge .doc-label { color: var(--gray-600); font-size: 12px; }

/* Expanded SOL countdown on detail page */
.sol-widget {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 22px;
  border-radius: 8px;
  border: 2px solid;
  min-width: 140px;
  text-align: center;
  flex-shrink: 0;
}
.sol-widget.red    { background: var(--red-bg);    color: var(--red);    border-color: var(--red);    }
.sol-widget.orange { background: var(--orange-bg); color: var(--orange); border-color: var(--orange); }
.sol-widget.yellow { background: var(--yellow-bg); color: var(--yellow); border-color: var(--yellow); }
.sol-widget.green  { background: var(--green-bg);  color: var(--green);  border-color: var(--green);  }
.sol-widget.expired { background: var(--red-bg);   color: var(--red);    border-color: var(--red);    }
.sol-widget.none   { background: var(--gray-100);  color: var(--gray-400); border-color: var(--gray-200); }
.sol-widget .sol-num { font-size: 38px; font-weight: 800; font-family: var(--font-serif); line-height: 1; }
.sol-widget .sol-lbl { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.6px; margin-top: 2px; }
.sol-widget .sol-dt  { font-size: 12px; margin-top: 6px; font-weight: 500; }

/* Case detail header */
.cd-header {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 18px 22px;
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
}
.cd-header-main { flex: 1; min-width: 0; }
.cd-name {
  font-family: var(--font-serif);
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  line-height: 1.2;
}
.cd-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--gray-600);
}
.cd-meta .sep { color: var(--gray-200); }

/* ── Adjuster Cards ─────────────────────────────────────────────── */
.adj-cards-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.adj-cards-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.adj-card {
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: var(--gray-50);
  overflow: visible;
}
.adj-card-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  border-radius: 5px 5px 0 0;
}
.adj-type-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gray-600);
}
.adj-btns { display: flex; gap: 6px; }
.btn-adj-change, .btn-adj-edit-contact, .btn-adj-hist {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--accent);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.1s;
}
.btn-adj-change:hover { background: var(--accent); color: var(--white); border-color: var(--accent); }
.btn-adj-edit-contact { color: var(--gray-700); }
.btn-adj-edit-contact:hover { background: var(--gray-100); }
.btn-adj-hist { color: var(--gray-600); }
.btn-adj-hist:hover { background: var(--gray-200); }
.btn-adj-remove {
  font-size: 13px;
  line-height: 1;
  padding: 1px 6px;
  border-radius: 3px;
  border: 1px solid #fca5a5;
  background: var(--white);
  color: #dc2626;
  cursor: pointer;
  font-weight: 700;
  transition: background 0.1s;
}
.btn-adj-remove:hover { background: #fee2e2; }

/* Adjuster name autocomplete */
.adj-name-ac-wrap { position: relative; }
.adj-ac-drop {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  z-index: 400;
  max-height: 200px;
  overflow-y: auto;
}
.adj-ac-item {
  padding: 6px 10px;
  font-size: 12.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
.adj-ac-item:hover, .adj-ac-item.ac-focused { background: #eff6ff; }
.adj-ac-name { font-weight: 600; color: var(--gray-800); }
.adj-ac-insurer { font-size: 11px; color: var(--gray-500); }

/* "Use existing contact info?" prompt */
.adj-profile-prompt {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
}
.adj-profile-prompt-text { color: #1e40af; flex: 1; min-width: 0; }
.btn-adj-use-profile, .btn-adj-skip-profile {
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-adj-use-profile {
  background: var(--accent);
  color: var(--white);
  border: none;
  font-weight: 600;
}
.btn-adj-use-profile:hover { background: var(--accent-lt); }
.btn-adj-skip-profile {
  background: transparent;
  border: 1px solid var(--gray-300);
  color: var(--gray-600);
}
.btn-adj-skip-profile:hover { background: var(--gray-100); }

.adj-current-info {
  padding: 8px 10px;
  font-size: 13px;
}
.adj-name { font-weight: 600; color: var(--gray-800); margin-bottom: 2px; }
.adj-name-link { color: inherit; text-decoration: none; border-bottom: 1px dotted var(--gray-400); }
.adj-name-link:hover { color: var(--accent); border-bottom-color: var(--accent); }
.adj-detail { color: var(--gray-600); font-size: 12px; margin-top: 2px; }
.adj-detail a { color: var(--accent); }
.adj-since { font-size: 11px; color: var(--gray-400); margin-top: 4px; }
.adj-none { padding: 8px 10px; font-size: 12px; color: var(--gray-400); font-style: italic; }
.add-adj-control { margin-top: 6px; }
.add-adj-control select { font-size: 12px; padding: 4px 8px; border: 1px dashed var(--gray-300); border-radius: 5px; color: var(--gray-500); background: transparent; cursor: pointer; }
.add-adj-control select:hover { border-color: var(--accent); color: var(--accent); }

/* Client insurance cards — blue accent */
.adj-card[data-adj-type^="CLIENT"] { border-color: #bfdbfe; }
.adj-card[data-adj-type^="CLIENT"] .adj-card-hdr { background: #eff6ff; border-bottom-color: #bfdbfe; }
.adj-card[data-adj-type^="CLIENT"] .adj-type-label { color: #1e40af; }

/* Defendant insurance cards — amber accent */
.adj-card[data-adj-type^="DEF"] { border-color: #fed7aa; }
.adj-card[data-adj-type^="DEF"] .adj-card-hdr { background: #fff7ed; border-bottom-color: #fed7aa; }
.adj-card[data-adj-type^="DEF"] .adj-type-label { color: #92400e; }

/* Change / edit-contact forms */
.adj-change-form, .adj-edit-contact-form {
  border-top: 1px dashed var(--gray-200);
  padding: 10px;
  background: #fafbff;
}
.adj-form-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.adj-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin-bottom: 8px;
}
.adj-form-grid label {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  font-weight: 600;
  color: var(--gray-600);
  gap: 2px;
}
.adj-form-grid input {
  font-size: 12.5px;
  padding: 4px 6px;
  border: 1px solid var(--gray-300);
  border-radius: 3px;
  background: var(--white);
}
.adj-form-grid input:focus { outline: none; border-color: var(--accent); }
.adj-fi-wide { grid-column: 1 / -1; }
.adj-form-btns { display: flex; gap: 8px; }
.btn-adj-save {
  padding: 4px 14px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 4px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}
.btn-adj-save:hover { background: var(--accent-lt); }
.btn-adj-save:disabled { opacity: 0.6; cursor: default; }
.btn-adj-cancel {
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-size: 12.5px;
  color: var(--gray-600);
  cursor: pointer;
}
.btn-adj-cancel:hover { background: var(--gray-100); }

/* History list */
.adj-former-card {
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: var(--gray-50);
  overflow: hidden;
}
.adj-former-hdr {
  padding: 5px 10px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}
.adj-former-hdr .adj-type-label {
  font-style: italic;
  color: var(--gray-500);
}
.adj-history-list {
  border-top: 1px solid var(--gray-200);
}
.adj-hist-row {
  border-bottom: 1px solid var(--gray-100);
  font-size: 11.5px;
  background: var(--gray-50);
}
.adj-hist-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  opacity: 0.8;
  user-select: none;
}
.adj-hist-summary:hover { opacity: 1; background: var(--gray-100); }
.adj-hist-name { font-weight: 500; color: var(--gray-800); text-decoration: none; }
.adj-hist-name:hover { text-decoration: none; }
.adj-hist-reason-wrap { display: flex; align-items: center; flex: 1; min-width: 0; }
.adj-hist-reason-edit { align-items: center; gap: 4px; flex: 1; min-width: 0; }
.adj-hist-snippet { color: var(--gray-500); font-style: italic; cursor: pointer; }
.adj-hist-no-reason { color: var(--gray-300); cursor: pointer; }
.adj-hist-dates { color: var(--gray-400); margin-left: auto; font-style: italic; }
.adj-hist-expanded {
  padding: 6px 10px 10px;
  border-top: 1px solid var(--gray-100);
}
.adj-hist-notes-ta {
  flex: 1;
  min-width: 0;
  height: 22px;
  font-size: 11.5px;
  padding: 2px 5px;
  border: 1px solid var(--gray-200);
  border-radius: 3px;
  box-sizing: border-box;
  font-family: inherit;
  color: var(--gray-700);
  line-height: 1.3;
}
.adj-hist-notes-ta:focus { outline: none; border-color: var(--accent); }
.adj-hist-exp-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.btn-adj-hist-save-notes {
  font-size: 11.5px; padding: 3px 10px; border-radius: 4px;
  background: var(--accent); color: #fff; border: none; cursor: pointer;
}
.btn-adj-hist-save-notes:hover { opacity: 0.85; }
.btn-adj-hist-cancel-notes {
  font-size: 11.5px; padding: 3px 8px; border-radius: 4px;
  background: none; color: var(--gray-500); border: 1px solid var(--gray-200); cursor: pointer;
}
.btn-adj-hist-cancel-notes:hover { background: var(--gray-100); }
.adj-hist-profile-link {
  font-size: 11px; color: var(--accent); text-decoration: none; margin-left: auto;
}
.adj-hist-profile-link:hover { text-decoration: underline; }

/* ── Closure workflow ───────────────────────────────────────────── */

/* Dashboard: rejection notification banners */
.closure-notification {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 12px;
  font-size: 14px;
  color: #664d03;
}
.notif-dismiss-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #664d03;
  font-size: 16px;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
  opacity: 0.7;
}
.notif-dismiss-btn:hover { opacity: 1; }

/* Dashboard: pending closure count banner */
.closure-banner {
  background: #fff8e1;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #78350f;
}

/* Dashboard: first-login prompt banner */
.first-login-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  background: #e8f4fd;
  border: 1px solid #3b82f6;
  border-radius: 6px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #1e3a5f;
}
.first-login-banner .notif-dismiss-btn {
  color: #1e3a5f;
}
.first-login-banner-body { flex: 1; }

/* Dashboard: flagged-for-review suggestion rows */
.suggestion-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
}
.suggestion-row:last-child { border-bottom: none; }
.suggestion-main { flex: 1; min-width: 0; }
.suggestion-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: flex-start; padding-top: 2px; }
.btn-small { padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 600; cursor: pointer; }
.btn-primary-sm { background: var(--accent); color: #fff; border: none; text-decoration: none; display: inline-block; }
.btn-primary-sm:hover { opacity: 0.9; }
.btn-ghost-sm { background: none; border: 1px solid var(--gray-200); color: var(--gray-600); }
.btn-ghost-sm:hover { background: var(--gray-50); }

/* Case detail: pending closure banner */
.pending-closure-banner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: #fff8e1;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #78350f;
}
.pcb-left { flex: 1; }
.pcb-actions { display: flex; gap: 8px; flex-shrink: 0; }
.btn-confirm-closure {
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-confirm-closure:hover:not(:disabled) { background: #15803d; }
.btn-confirm-closure:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-reject-closure {
  background: none;
  color: #dc2626;
  border: 1px solid #dc2626;
  border-radius: 5px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-reject-closure:hover { background: #fef2f2; }

/* Case detail: initiate / flag buttons in header */
.cd-header-actions { margin-top: 12px; display: flex; gap: 8px; }
.btn-initiate-closure {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-initiate-closure:hover { opacity: 0.9; }
.btn-flag-review {
  background: none;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 5px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-flag-review:hover { background: var(--gray-50); }
.btn-activate-case {
  background: #16a34a;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-activate-case:hover { background: #15803d; }

/* Modal overlay + dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-dialog {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  width: 480px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 12px;
  border-bottom: 1px solid var(--gray-100);
}
.modal-header h3 { margin: 0; font-size: 16px; color: var(--gray-800); }
.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--gray-400);
  padding: 0;
  line-height: 1;
}
.modal-close:hover { color: var(--gray-700); }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-field { display: flex; flex-direction: column; gap: 5px; }
.modal-field label { font-size: 13px; font-weight: 600; color: var(--gray-700); }
.modal-field input, .modal-field select, .modal-field textarea {
  border: 1px solid var(--gray-200);
  border-radius: 5px;
  padding: 7px 10px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
.modal-field textarea { resize: vertical; }
.modal-field input:focus, .modal-field select:focus, .modal-field textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 12px 20px 18px;
  border-top: 1px solid var(--gray-100);
}
.btn-modal-cancel {
  background: none;
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
  border-radius: 5px;
  padding: 7px 16px;
  font-size: 13px;
  cursor: pointer;
}
.btn-modal-cancel:hover { background: var(--gray-50); }
.btn-modal-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-modal-primary:hover { opacity: 0.9; }
.btn-modal-danger {
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-modal-danger:hover { background: #b91c1c; }
.modal-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
}
.req { color: #dc2626; }

/* ── Client communications panel ───────────────────────────────── */

.comm-notif-panel { margin-bottom: 20px; }
.comm-loading, .comm-empty {
  padding: 16px 20px;
  font-size: 13px;
  color: var(--gray-400);
}
.comm-group-hdr {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  padding: 6px 16px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gray-400);
}
.comm-notif-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.1s;
}
.comm-notif-row:last-child { border-bottom: none; }
.comm-notif-row:hover { background: var(--gray-50); }
.cnotif-main { flex: 1; min-width: 0; }
.cnotif-name { font-weight: 600; color: var(--text); font-size: 14px; }
.cnotif-name:hover { color: var(--accent); text-decoration: none; }
.cnotif-meta { display: block; font-size: 12px; color: var(--gray-400); margin-top: 2px; }
.cnotif-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.btn-cnotif-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.btn-cnotif-primary:hover { opacity: 0.9; }
.btn-cnotif-ghost {
  background: none;
  border: 1px solid var(--gray-200);
  color: var(--gray-600);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-cnotif-ghost:hover { background: var(--gray-50); }
.comm-templates-warn { background: #fffbeb; color: #92400e; font-size: 13px; display: flex; align-items: center; gap: 8px; }

.btn-holiday {
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}
.btn-holiday:hover { background: #b91c1c; }

/* Case detail: check-in button */
.btn-checkin {
  background: #0369a1;
  color: #fff;
  border: none;
  border-radius: 5px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.btn-checkin:hover { background: #0284c7; }
.btn-checkin:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── Intake Badge ───────────────────────────────────────────────── */
.badge-intake { background: var(--gray-100); color: var(--gray-500); border: 1px solid var(--gray-200); border-radius: 4px; padding: 2px 8px; font-size: 11px; font-weight: 600; letter-spacing: .4px; white-space: nowrap; text-transform: uppercase; }

/* ── New Intake Button (cases list header) ──────────────────────── */
.btn-new-intake {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 6px;
  padding: 7px 18px; font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  margin-left: auto;
}
.btn-new-intake:hover { background: #0369a1; color: #fff; }

/* ── Intake Page Layout ──────────────────────────────────────────── */
.intake-page { max-width: 1060px; }

/* ── Intake Cards ────────────────────────────────────────────────── */
.intake-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.intake-card-hdr {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  padding: 13px 28px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gray-500);
  letter-spacing: .8px;
  text-transform: uppercase;
}
.intake-body { padding: 28px; }

/* ── Sub-section labels inside insurance card ───────────────────── */
.intake-section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-600);
  letter-spacing: .3px;
  margin-bottom: 12px;
  margin-top: 4px;
}
.intake-divider {
  border: none;
  border-top: 1px solid var(--gray-100);
  margin: 22px 0;
}

/* ── Field rows ─────────────────────────────────────────────────── */
.intake-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}
.intake-row:last-child { margin-bottom: 0; }
.required-row .intake-label { font-weight: 700; }
.intake-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-500);
  letter-spacing: .2px;
}
.intake-label .req { color: #dc2626; margin-left: 1px; }
.intake-optional { font-weight: 400; color: var(--gray-400); font-size: 11px; margin-left: 4px; }
.intake-field-note { font-size: 11px; color: var(--gray-400); line-height: 1.4; margin-top: 2px; }
.intake-hint {
  font-size: 13px;
  color: var(--gray-400);
  margin: 0 0 16px;
}

/* ── Inputs ─────────────────────────────────────────────────────── */
.intake-input {
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  padding: 10px 13px;
  font-size: 14px;
  color: var(--gray-800);
  background: #fff;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  height: 42px;
  line-height: 1.4;
}
.intake-input::placeholder { color: var(--gray-400); }
.intake-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px #bae6fd66; }
textarea.intake-input { resize: vertical; height: auto; min-height: 80px; }
select.intake-input { cursor: pointer; }

/* ── Grid layouts ───────────────────────────────────────────────── */
.intake-col-span-2 { grid-column: span 2; }
.intake-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 28px;
}
.intake-grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0 28px;
}
.intake-grid-2 .intake-row,
.intake-grid-3 .intake-row { margin-bottom: 20px; }

/* ── Providers ──────────────────────────────────────────────────── */
.provider-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 10px;
}
.provider-row .provider-input { flex: 1; }
.btn-remove-provider {
  background: none; border: none; color: var(--gray-400);
  cursor: pointer; font-size: 16px; padding: 4px 8px; line-height: 1;
  flex-shrink: 0; border-radius: 4px;
}
.btn-remove-provider:hover { color: #dc2626; background: #fef2f2; }
.btn-add-provider {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1.5px dashed var(--gray-300); border-radius: 6px;
  color: var(--accent); font-size: 13px; font-weight: 600;
  padding: 8px 18px; cursor: pointer; margin-top: 4px;
  transition: border-color .15s, background .15s;
}
.btn-add-provider:hover { background: #f0f9ff; border-color: var(--accent); }

/* ── Submit row ─────────────────────────────────────────────────── */
.intake-submit-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 0 32px;
}
.btn-intake-submit {
  background: var(--accent); color: #fff;
  border: none; border-radius: 7px;
  padding: 11px 32px; font-size: 15px; font-weight: 600;
  cursor: pointer; letter-spacing: .2px;
}
.btn-intake-submit:hover { background: #0369a1; }
.btn-intake-submit:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-intake-cancel {
  color: var(--gray-400); font-size: 14px; text-decoration: none;
}
.btn-intake-cancel:hover { color: var(--gray-600); }
.intake-error-msg { color: #dc2626; font-size: 13px; font-weight: 500; }

/* ── E-bike warning banner ──────────────────────────────────────── */
.ebike-banner {
  background: #eff6ff; border: 1px solid #93c5fd;
  border-radius: 5px; padding: 8px 14px; margin-bottom: 10px;
  font-size: 13px; color: #1d4ed8;
}

/* ── Completeness column ────────────────────────────────────────── */
.th-issues { width: 44px; text-align: center; cursor: pointer; }
.td-issues { text-align: center; position: relative; }
.issues-badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: #fef3c7; color: #92400e; border: 1px solid #fcd34d;
  border-radius: 12px; min-width: 22px; height: 20px; padding: 0 6px;
  font-size: 11px; font-weight: 700; cursor: default; position: relative;
}
.issues-badge:hover .issues-tooltip { display: block; }
.issues-tooltip {
  display: none;
  position: absolute; z-index: 100; top: 26px; left: 50%; transform: translateX(-50%);
  background: #1e293b; color: #fff; border-radius: 5px;
  padding: 7px 10px; font-size: 12px; white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0,0,0,.25); pointer-events: none; text-align: left;
}
.issues-tooltip::before {
  content: ''; position: absolute; top: -5px; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-bottom-color: #1e293b; border-top: none;
}
.issues-ok { color: var(--gray-300); font-size: 13px; }

/* ── Needs Attention dashboard section ──────────────────────────── */
.attn-count-badge {
  display: inline-block; background: #fef3c7; color: #92400e;
  border-radius: 10px; padding: 1px 8px; font-size: 12px; font-weight: 600;
  margin-left: 6px; vertical-align: middle;
}
.btn-attn-dismiss {
  background: none; border: none; cursor: pointer; color: var(--gray-400);
  font-size: 16px; line-height: 1; padding: 4px 6px; border-radius: 4px;
  flex-shrink: 0; transition: color 0.15s, background 0.15s;
}
.btn-attn-dismiss:hover { color: var(--gray-700); background: var(--gray-100); }
.attention-list { padding: 0; }
.attention-row {
  display: flex; flex-direction: column; gap: 4px;
  padding: 10px 16px; border-bottom: 1px solid var(--gray-100);
}
.attention-row:last-child { border-bottom: none; }
.attention-main { display: flex; align-items: center; gap: 8px; }
.attention-name { font-weight: 600; color: var(--accent); text-decoration: none; font-size: 14px; }
.attention-name:hover { text-decoration: underline; }
.attention-issues { display: flex; flex-wrap: wrap; gap: 5px; }
.attention-chip {
  background: #fef3c7; color: #78350f; border: 1px solid #fde68a;
  border-radius: 10px; padding: 2px 8px; font-size: 11px; font-weight: 500;
}

/* ── Intake checkboxes ──────────────────────────────────────────── */
.intake-check-row {
  display: flex; gap: 24px; align-items: center;
  padding: 8px 0 12px;
}
.intake-check-label {
  display: flex; align-items: center; gap: 7px;
  font-size: 13.5px; color: var(--gray-600); cursor: pointer;
}
.intake-check-label input[type="checkbox"] {
  width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent);
}

/* ── Expense row inline editing ─────────────────────────────────── */
.exp-del-col { width: 28px; text-align: center; }
.exp-edit-col { width: 110px; white-space: nowrap; }
.btn-exp-rowedit, .btn-exp-rowsave, .btn-exp-rowcancel {
  font-size: 11px; padding: 2px 8px; border-radius: 4px;
  cursor: pointer; font-family: var(--font-sans);
}
.btn-exp-rowedit {
  background: var(--gray-100); color: var(--gray-600);
  border: 1px solid var(--gray-200);
}
.btn-exp-rowedit:hover { background: var(--gray-200); }
.btn-exp-rowsave {
  background: #16a34a; color: #fff; border: none; margin-right: 3px;
}
.btn-exp-rowsave:hover { background: #15803d; }
.btn-exp-rowcancel {
  background: none; color: var(--gray-400); border: 1px solid var(--gray-200);
}
.btn-exp-rowcancel:hover { color: var(--gray-600); background: var(--gray-100); }

/* ── No-attorney banner ─────────────────────────────────────────── */
.no-attorney-banner {
  display: flex; align-items: center; gap: 12px;
  background: #fff3cd; border: 1px solid #ffc107;
  border-radius: 5px; padding: 8px 14px; margin-bottom: 12px;
  font-size: 13px; color: #664d03;
}
.no-attorney-select {
  font-size: 13px; padding: 3px 8px; border-radius: 4px;
  border: 1px solid #d97706; background: #fff; color: #444;
  cursor: pointer;
}

/* ── Expenses section ───────────────────────────────────────────── */
.expenses-table {
  width: 100%; border-collapse: collapse; font-size: 13.5px;
  margin-bottom: 8px;
}
.expenses-table th {
  text-align: left; font-size: 11px; font-weight: 600;
  color: var(--gray-400); text-transform: uppercase; letter-spacing: .4px;
  padding: 0 8px 6px; border-bottom: 1px solid var(--gray-100);
}
.exp-th-amount, .expense-row .exp-amount { text-align: right; }
.exp-th-date { width: 110px; }
.exp-th-amount { width: 100px; }
.exp-th-actions { width: 36px; }
.expense-row td {
  padding: 6px 8px; border-bottom: 1px solid var(--gray-100);
  vertical-align: middle;
}
.expense-row:last-child td { border-bottom: none; }
.btn-exp-delete {
  background: none; border: none; cursor: pointer;
  color: var(--gray-400); font-size: 12px; padding: 2px 4px;
  border-radius: 3px; line-height: 1;
}
.btn-exp-delete:hover { color: #dc2626; background: #fee2e2; }
.expense-new-row {
  display: flex; gap: 8px; align-items: center;
  padding: 8px 0 4px; border-top: 1px solid var(--gray-100);
  margin-top: 4px;
}
.exp-input {
  height: 32px; padding: 0 8px; border: 1px solid var(--gray-200);
  border-radius: 5px; font-size: 13px; background: var(--gray-50);
}
.exp-input:focus { outline: none; border-color: var(--accent); background: #fff; }
.exp-input-desc { flex: 1; }
.exp-input-amount { width: 90px; text-align: right; }
.exp-input-date { width: 130px; }
.btn-exp-add {
  background: var(--accent); color: #fff; border: none;
  border-radius: 5px; padding: 0 14px; height: 32px;
  font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.btn-exp-add:hover { background: #0369a1; }
.expenses-total {
  text-align: right; font-size: 13px; font-weight: 600;
  color: var(--gray-600); padding: 6px 8px 2px;
}
.expense-row--unpaid td { background: #fffbeb; }
.expense-row--unpaid:last-child td { border-bottom: none; }
.badge-unpaid {
  display: inline-block; font-size: 9px; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase;
  background: #fef3c7; color: #92400e;
  border: 1px solid #fcd34d; border-radius: 3px;
  padding: 1px 4px; margin-left: 5px; vertical-align: middle;
}
.btn-exp-mark-paid {
  font-size: 11px; padding: 2px 7px; border-radius: 4px; cursor: pointer;
  font-family: var(--font-sans);
  background: #fef3c7; color: #92400e; border: 1px solid #fcd34d;
  margin-left: 4px;
}
.btn-exp-mark-paid:hover { background: #fde68a; }
.exp-mark-paid-prompt {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 4px;
}
.btn-exp-markpaid-confirm {
  font-size: 12px; padding: 2px 6px; border-radius: 4px; cursor: pointer;
  background: #16a34a; color: #fff; border: none;
}
.btn-exp-markpaid-confirm:hover { background: #15803d; }
.btn-exp-markpaid-cancel {
  font-size: 12px; padding: 2px 6px; border-radius: 4px; cursor: pointer;
  background: none; color: var(--gray-400); border: 1px solid var(--gray-200);
}
.btn-exp-markpaid-cancel:hover { color: var(--gray-600); background: var(--gray-100); }
.exp-paid-check-label {
  display: flex; align-items: center; gap: 4px;
  font-size: 13px; color: var(--gray-600); white-space: nowrap; cursor: pointer;
}
.exp-date-wrap {
  display: flex; align-items: center; gap: 4px;
}
.exp-date-label-text { font-size: 12px; color: var(--gray-500); white-space: nowrap; }

/* ── SOL Widget inline edit ─────────────────────────────────────────── */
.sol-widget .sol-type-lbl {
  font-size: 10px; color: inherit; opacity: 0.7;
  margin-top: 3px; letter-spacing: 0.3px;
}
.btn-sol-edit {
  margin-top: 7px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 4px;
  color: inherit;
  font-size: 10px; font-weight: 600;
  padding: 2px 9px;
  cursor: pointer;
  font-family: var(--font-sans);
}
.btn-sol-edit:hover { background: rgba(255,255,255,0.28); }
.sol-widget.sol-editing { min-width: 210px; }
.sol-edit-form {
  display: flex; flex-direction: column; gap: 7px;
  padding: 2px 0 0;
}
.sol-ef-row {
  display: flex; flex-direction: column; gap: 2px; text-align: left;
}
.sol-ef-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; opacity: 0.75;
}
.sol-ef-row input, .sol-ef-row select {
  width: 100%; padding: 4px 6px;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 4px;
  font-size: 12px; font-family: var(--font-sans);
  background: rgba(255,255,255,0.9); color: var(--text);
  outline: none;
}
.sol-ef-btns { display: flex; gap: 6px; margin-top: 2px; }
.btn-sol-save {
  flex: 1; background: rgba(255,255,255,0.9); color: var(--text);
  border: none; border-radius: 4px;
  font-size: 11px; font-weight: 700;
  padding: 4px 8px; cursor: pointer;
}
.btn-sol-save:hover { background: #fff; }
.btn-sol-save:disabled { opacity: 0.5; cursor: default; }
.btn-sol-cancel {
  flex: 1; background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: 4px; color: inherit;
  font-size: 11px; padding: 4px 8px; cursor: pointer;
  opacity: 0.8;
}
.btn-sol-cancel:hover { opacity: 1; background: rgba(255,255,255,0.1); }

/* ── Defendant section controls ─────────────────────────────────────── */
.btn-add-defendant {
  font-size: 11px; color: rgba(255,255,255,0.85);
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 4px; padding: 3px 10px;
  cursor: pointer; font-family: var(--font-sans); font-weight: 600;
  margin-right: 4px;
  transition: background 0.15s;
}
.btn-add-defendant:hover { background: rgba(255,255,255,0.28); color: #fff; }

.btn-def-delete {
  font-size: 11px; color: #fca5a5;
  background: rgba(220,38,38,0.2);
  border: 1px solid rgba(220,38,38,0.4);
  border-radius: 4px; padding: 3px 9px;
  cursor: pointer; font-family: var(--font-sans); font-weight: 600;
  transition: background 0.15s;
}
.btn-def-delete:hover { background: rgba(220,38,38,0.4); color: #fff; }

/* ── E-bike banner inline select ────────────────────────────────────── */
.ebike-quick-select {
  font-size: 12px; padding: 2px 6px;
  border-radius: 4px; border: 1px solid #93c5fd;
  background: #fff; color: #1d4ed8; cursor: pointer;
  margin-left: 4px;
}

/* ── Nominatim address dropdown ─────────────────────────────────────── */
.nom-dropdown {
  position: absolute; z-index: 200;
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,.12);
  max-height: 220px; overflow-y: auto;
  width: 100%; left: 0; top: calc(100% + 2px);
}
.nom-option {
  padding: 8px 12px; font-size: 13px; cursor: pointer;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text);
}
.nom-option:last-child { border-bottom: none; }
.nom-option:hover { background: var(--gray-50); }
.nom-option-active { background: var(--gray-100) !important; }

/* ── To-Do Widget ───────────────────────────────────────────────── */

/* Input area: two rows — text field full-width, controls below */
.todo-input-row {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-200);
}

.todo-text-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 14px;
  font-family: var(--font-sans);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.todo-text-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(42,107,204,0.08); }

/* Second row: swatches + date side by side */
.todo-input-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.todo-color-swatches {
  display: flex;
  gap: 7px;
  align-items: center;
}

.todo-swatch {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  flex-shrink: 0;
  transition: transform 0.1s, border-color 0.1s;
}
.todo-swatch:hover { transform: scale(1.25); }
.todo-swatch.selected { border-color: var(--gray-800); box-shadow: 0 0 0 1px var(--gray-800); }

.todo-date-input {
  padding: 6px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--gray-600);
}
.todo-date-input:focus { outline: none; border-color: var(--accent); }

/* To-do list rows */
.todo-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 20px;
  border-bottom: 1px solid var(--gray-100);
  transition: background 0.1s;
}
.todo-item:last-child { border-bottom: none; }
.todo-item:hover { background: var(--gray-50); }

.todo-check {
  flex-shrink: 0;
  margin-top: 1px;
  width: 17px;
  height: 17px;
  cursor: pointer;
  accent-color: var(--accent);
}

.todo-color-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}

.todo-body {
  flex: 1;
  min-width: 0;
}

.todo-text {
  font-size: 13.5px;
  color: var(--text);
  word-break: break-word;
  line-height: 1.45;
}

.todo-due {
  font-size: 11.5px;
  color: var(--gray-400);
  margin-top: 3px;
}
.todo-due.overdue { color: var(--red); font-weight: 600; }

.todo-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.15s;
  align-items: center;
}
.todo-item:hover .todo-actions { opacity: 1; }

.todo-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  color: var(--gray-400);
  font-size: 12px;
  line-height: 1;
  transition: background 0.1s, color 0.1s;
}
.todo-btn:hover { background: var(--gray-100); color: var(--gray-600); }
.todo-btn.delete:hover { color: var(--red); }

.todo-edit-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--accent);
  border-radius: 4px;
  font-size: 13.5px;
  font-family: var(--font-sans);
  color: var(--text);
  outline: none;
  box-shadow: 0 0 0 3px rgba(42,107,204,0.08);
}

.todo-empty {
  padding: 20px;
  color: var(--gray-400);
  font-size: 13px;
  text-align: center;
}

.todo-footer {
  padding: 10px 20px;
  border-top: 1px solid var(--gray-100);
}

.todo-completed-link {
  background: none;
  border: none;
  font-size: 12px;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
}
.todo-completed-link:hover { text-decoration: underline; }

.todo-item-completed { opacity: 0.75; }
.todo-item-completed:hover { opacity: 1; }

/* ── Conflict resolution UI ─────────────────────────────────────── */
.conflict-banner {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 8px;
  padding: 12px 18px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #92400e;
}

/* SOL warning banner (passed + imminent) */
.sol-warning-banner {
  border-radius: 6px;
  margin-bottom: 16px;
  overflow: hidden;
}
.sol-warning-section {
  padding: 12px 16px;
  font-size: 14px;
}
.sol-warning-overdue {
  background: #fef2f2;
  border: 1px solid #ef4444;
  color: #7f1d1d;
}
.sol-warning-imminent {
  background: #fff7ed;
  border: 1px solid #f97316;
  color: #7c2d12;
}
.sol-warning-has-sibling {
  border-top: none;
  border-radius: 0 0 6px 6px;
}
.sol-warning-overdue:only-child,
.sol-warning-overdue:not(.sol-warning-has-sibling) {
  border-radius: 6px;
}
.sol-warning-imminent:only-child {
  border-radius: 6px;
}
.sol-warning-overdue + .sol-warning-imminent {
  border-top: none;
}
.sol-warning-list {
  margin-top: 8px;
}
.sol-warning-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 3px 0;
  font-size: 13px;
}
.sol-warning-row a { color: inherit; font-weight: 600; text-decoration: underline; }
.sol-warning-row span { color: inherit; opacity: 0.8; white-space: nowrap; }

/* Status sync drift warning */
.status-sync-banner {
  background: #fef3c7;
  border: 1px solid #f59e0b;
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  color: #78350f;
}
.cr-loading { color: var(--gray-400); padding: 48px 0; text-align: center; font-size: 14px; }

.cr-empty-state {
  max-width: 480px;
  margin: 60px auto;
  text-align: center;
  padding: 48px 32px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
}
.cr-empty-icon { font-size: 40px; margin-bottom: 16px; }
.cr-empty-title { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.cr-empty-sub { font-size: 14px; color: var(--gray-400); margin-bottom: 12px; }

.cr-progress-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.cr-progress-label { font-size: 13px; color: var(--gray-400); white-space: nowrap; }
.cr-progress-track {
  flex: 1;
  min-width: 120px;
  height: 6px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
}
.cr-progress-fill { height: 100%; background: #16a34a; border-radius: 4px; transition: width .3s; }
.cr-case-link { font-size: 12px; color: var(--accent); text-decoration: none; white-space: nowrap; }
.cr-case-link:hover { text-decoration: underline; }

.cr-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
  max-width: 920px;
}

.cr-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  background: var(--gray-50);
  flex-wrap: wrap;
}
.cr-header-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cr-case-name { font-size: 16px; font-weight: 700; color: var(--gray-800); }
.cr-sol-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.cr-header-right { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cr-field-label { font-size: 12px; color: var(--gray-500); }
.cr-field-label code {
  background: var(--gray-100);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  font-family: monospace;
}
.cr-unmapped { color: #b45309; font-size: 11px; }
.cr-counter { font-size: 12px; color: var(--gray-400); white-space: nowrap; }

.cr-ab-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--gray-100);
}
.cr-option-wrap { padding: 20px; }
.cr-option-wrap + .cr-option-wrap { border-left: 1px solid var(--gray-100); }
.cr-option-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400);
  margin-bottom: 10px;
}
.cr-badge-a, .cr-badge-b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}
.cr-badge-a { background: #2563eb; }
.cr-badge-b { background: #7c3aed; }

.cr-option {
  width: 100%;
  min-height: 80px;
  text-align: left;
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  line-height: 1.5;
  word-break: break-word;
  transition: border-color .15s, background .15s;
}
.cr-option:hover { border-color: var(--gray-400); background: var(--gray-50); }
.cr-option--selected { border-color: #2563eb !important; background: #eff6ff !important; }
.cr-empty-val { color: var(--gray-300); font-style: italic; }

.cr-custom-row {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
}
.cr-custom-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-family: inherit;
}
.cr-custom-input:focus { outline: none; border-color: #2563eb; }

.cr-notes-row {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--gray-100);
  align-items: flex-start;
}
.cr-notes-input {
  flex: 1;
  padding: 8px 12px;
  font-size: 14px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-family: inherit;
  resize: vertical;
  min-height: 38px;
}
.cr-notes-input:focus { outline: none; border-color: #2563eb; }
.cr-ai-btn {
  white-space: nowrap;
  padding: 8px 14px;
  font-size: 13px;
  background: #f0f0ff;
  border: 1px solid #c7c7f0;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  color: #3730a3;
}
.cr-ai-btn:hover { background: #e0e0ff; }
.cr-ai-btn:disabled { opacity: .5; cursor: default; }

.cr-action-row {
  display: flex;
  gap: 10px;
  padding: 16px 20px 12px;
}
.cr-accept-btn { min-width: 140px; }
.cr-kbd-hint { font-size: 11px; opacity: .65; margin-left: 4px; }

.cr-msg { min-height: 18px; font-size: 12px; color: #dc2626; padding: 0 20px 14px; }

.cr-kbd-row {
  display: flex;
  gap: 20px;
  margin-top: 14px;
  font-size: 12px;
  color: var(--gray-400);
  flex-wrap: wrap;
}
.cr-kbd-row kbd {
  display: inline-block;
  padding: 1px 6px;
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  font-family: monospace;
  font-size: 11px;
  color: var(--gray-600);
  margin-right: 4px;
}

.cr-sugg-panel {
  max-width: 920px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  overflow: hidden;
}
.cr-sugg-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--gray-100); }
.cr-sugg-title { font-size: 15px; font-weight: 700; color: var(--gray-800); margin-bottom: 4px; }
.cr-sugg-title em { font-style: normal; color: var(--accent); }
.cr-sugg-sub { font-size: 13px; color: var(--gray-500); }
.cr-sugg-list { padding: 12px 24px; display: flex; flex-direction: column; gap: 8px; }
.cr-sugg-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  background: #fff;
  transition: background .1s;
}
.cr-sugg-row:hover { background: var(--gray-50); }
.cr-sugg-row input[type=checkbox] { flex-shrink: 0; width: 16px; height: 16px; cursor: pointer; }
.cr-sugg-label { font-weight: 600; color: var(--gray-700); min-width: 160px; }
.cr-sugg-arrow { color: var(--gray-300); }
.cr-sugg-value { color: var(--gray-800); font-family: monospace; font-size: 13px; }
.cr-sugg-select {
  font-size: 13px;
  font-family: inherit;
  padding: 4px 8px;
  border: 1px solid var(--gray-300);
  border-radius: 5px;
  background: #fff;
  color: var(--gray-700);
  cursor: pointer;
  min-width: 180px;
}
.cr-sugg-actions { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--gray-100); }

/* ── Insurers page ──────────────────────────────────────────────── */
.ins-action-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.ins-std-status {
  font-size: 13px;
  color: #16a34a;
  margin-left: 4px;
}
.ins-loading {
  padding: 32px 16px;
  color: var(--gray-400);
  font-size: 14px;
  text-align: center;
}
.ins-empty {
  padding: 24px 16px;
  color: var(--gray-400);
  font-size: 14px;
  text-align: center;
}
.ins-count-badge {
  display: inline-block;
  background: var(--gray-100);
  color: var(--gray-500);
  font-size: 12px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
}
.ins-search {
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  width: 200px;
  font-family: inherit;
}
.ins-search:focus { outline: none; border-color: var(--accent); }

.ins-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.ins-th {
  padding: 8px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-400);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.ins-table tbody tr:hover { background: var(--gray-50); }
.ins-table tbody tr + tr { border-top: 1px solid var(--gray-100); }
.ins-td-name { padding: 10px 16px; width: 220px; vertical-align: top; }
.ins-td-aliases { padding: 10px 16px; vertical-align: top; }
.ins-td-actions { padding: 10px 16px; white-space: nowrap; vertical-align: top; }

.ins-alias-chip {
  display: inline-block;
  background: var(--gray-100);
  color: var(--gray-600);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  margin: 2px 3px 2px 0;
}
.ins-no-aliases { color: var(--gray-300); font-size: 13px; }
.ins-del-btn { color: #dc2626 !important; }
.ins-del-btn:hover { background: #fee2e2 !important; }

.ins-log-toggle { font-size: 12px; }

/* standardization results */
.ins-std-results { margin-bottom: 20px; }
.ins-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.ins-results-table th {
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-400);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.ins-results-table td { padding: 7px 12px; border-bottom: 1px solid var(--gray-100); vertical-align: top; }
.ins-old-val { color: #b45309; text-decoration: line-through; font-size: 13px; }
.ins-new-val { color: #16a34a; font-weight: 600; font-size: 13px; }
.ins-method-badge {
  display: inline-block;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
  background: var(--gray-100);
  color: var(--gray-500);
  white-space: nowrap;
}
.ins-method-insurer_alias { background: #dbeafe; color: #1e40af; }
.ins-method-title_case    { background: #fef3c7; color: #92400e; }

/* modal hint text */
.modal-hint { font-size: 12px; color: var(--gray-400); margin-top: 4px; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { width: 56px; }
  .sidebar-logo h1, .sidebar-logo span, .nav-item span, .sidebar-footer .user-name { display: none; }
  .nav-item { padding: 12px; justify-content: center; }
  .main-content { margin-left: 56px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid.thirds { grid-template-columns: 1fr; }
  .sol-table-row { grid-template-columns: 1fr 80px 70px 60px; }
  .sol-table-row > *:nth-child(4) { display: none; }
}

@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-body { padding: 16px; }
  .case-header { flex-direction: column; }
}

/* ── Provider type badges ─────────────────────────────────────── */
[class^="badge-provider-"] {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
}
.badge-provider-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-provider-red    { background: #fee2e2; color: #b91c1c; }
.badge-provider-purple { background: #f3e8ff; color: #7e22ce; }
.badge-provider-green  { background: #dcfce7; color: #166534; }
.badge-provider-orange { background: #ffedd5; color: #c2410c; }
.badge-provider-teal   { background: #ccfbf1; color: #0f766e; }
.badge-provider-yellow { background: #fef9c3; color: #854d0e; }
.badge-provider-gray   { background: var(--gray-100); color: var(--gray-600); }
.badge-provider-indigo { background: #e0e7ff; color: #4338ca; }

/* ── Providers page layout ────────────────────────────────────── */
.prov-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 0;
  height: calc(100vh - var(--header-height, 56px) - 57px); /* below sticky page-header */
  overflow: hidden;
}
.prov-list-panel {
  border-right: 1px solid var(--gray-200);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--white);
}
.prov-filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--gray-200);
  background: var(--gray-50);
  flex-shrink: 0;
}
.prov-filter-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.prov-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
  box-sizing: border-box;
}
.prov-type-select {
  flex: 1;
  padding: 7px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: var(--white);
  box-sizing: border-box;
}
.prov-search-input:focus, .prov-type-select:focus { outline: none; border-color: var(--accent); }
.prov-active-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--gray-600);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.prov-list-body {
  flex: 1;
  overflow-y: auto;
}
.prov-list-loading {
  padding: 32px 20px;
  text-align: center;
  color: var(--gray-400);
  font-size: 14px;
}
.prov-list-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--gray-400);
  font-size: 14px;
}
.prov-row {
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
  cursor: pointer;
  transition: background 0.1s;
}
.prov-row:hover { background: var(--gray-50); }
.prov-row-selected { background: #eff6ff !important; border-left: 3px solid var(--accent); padding-left: 13px; }
.prov-row-main { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.prov-type-badge { font-size: 10px; padding: 1px 6px; }
.prov-row-name { font-size: 14px; font-weight: 600; color: var(--text); }
.prov-row-inactive { font-size: 11px; color: var(--red); font-style: italic; }
.prov-row-sub { font-size: 12px; color: var(--gray-400); margin-top: 3px; display: flex; gap: 12px; }
.prov-row-city::before { content: "📍 "; }
.prov-row-phone::before { content: "☎ "; }
.prov-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 18px;
  padding: 0 6px;
  background: var(--accent);
  color: #fff;
  border-radius: 9px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

/* Detail panel */
.prov-detail-panel {
  overflow-y: auto;
  background: var(--gray-50);
}
.prov-detail-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
}
.prov-detail-empty-inner {
  text-align: center;
  color: var(--gray-400);
}
.prov-detail-empty-icon {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.3;
}
.prov-detail-empty-msg {
  font-size: 15px;
  color: var(--gray-400);
}
.prov-detail-inner { padding: 24px 28px; }
.prov-detail-hdr {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
}
.prov-detail-name {
  font-size: 22px;
  font-family: var(--font-serif);
  color: var(--navy);
  margin: 0 0 6px;
}
.prov-detail-badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ── No-contact indicator in list ── */
.prov-no-contact-tag {
  font-size: 10px; font-weight: 500; color: var(--gray-400);
  background: var(--gray-100); border: 1px solid var(--gray-200);
  border-radius: 3px; padding: 1px 6px; white-space: nowrap;
}

/* ── Notes area (inline, below header) ── */
.prov-notes-area {
  margin-bottom: 18px;
}
.prov-notes-readonly {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--gray-700);
  white-space: pre-wrap;
}
.prov-notes-placeholder {
  font-size: 13px; color: var(--gray-300); font-style: italic;
  padding: 8px 14px; border: 1px dashed var(--gray-200); border-radius: 6px;
  cursor: pointer; transition: border-color .15s, color .15s;
}
.prov-notes-placeholder:hover {
  border-color: var(--accent); color: var(--accent);
}
.prov-notes-textarea {
  width: 100%; box-sizing: border-box;
  border: 1px solid var(--gray-200); border-radius: 6px;
  padding: 8px 12px; font-size: 13px; font-family: inherit;
  resize: vertical; min-height: 70px;
}
.prov-notes-textarea:focus { outline: none; border-color: var(--accent); }
.prov-notes-btns { display: flex; gap: 8px; margin-top: 6px; }

/* ── Prominent empty state inside sections ── */
.prov-no-data-section {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 24px 16px; text-align: center;
  background: var(--gray-50); border: 1px dashed var(--gray-200);
  border-radius: 8px;
}
.prov-no-data-icon { font-size: 22px; opacity: .45; }
.prov-no-data-msg { font-size: 13px; color: var(--gray-400); font-style: italic; }
.prov-detail-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 22px;
}
.prov-stat {
  flex: 1;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 14px 12px;
  text-align: center;
}
.prov-stat-val { font-size: 24px; font-weight: 700; color: var(--navy); }
.prov-stat-lbl { font-size: 12px; color: var(--gray-400); margin-top: 3px; }
.prov-detail-section { margin-bottom: 22px; }
.prov-detail-sec-hdr {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--gray-400);
  margin-bottom: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--gray-200);
}
.prov-detail-none {
  font-size: 13px;
  color: var(--gray-400);
  padding: 6px 0;
  display: flex;
  align-items: center;
}
.prov-sub-row {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 11px 14px;
  margin-bottom: 8px;
  font-size: 13px;
}
.prov-sub-row-main {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.prov-sub-row-actions { margin-left: auto; display: flex; gap: 4px; }
.prov-sub-row-addr { color: var(--gray-600); font-size: 13px; margin-bottom: 3px; }
.prov-sub-row-contact { display: flex; gap: 16px; font-size: 12px; color: var(--gray-500); }
.prov-sub-row-notes { font-size: 12px; color: var(--gray-400); margin-top: 5px; font-style: italic; }
.prov-flag {
  background: #f0f9ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 5px;
  white-space: nowrap;
}
.prov-flag-inactive { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.prov-inactive-banner {
  background: #fef9c3;
  border: 1px solid #fde68a;
  border-radius: 6px;
  padding: 9px 14px;
  font-size: 13px;
  color: #92400e;
  margin-bottom: 14px;
}
.prov-case-list { display: flex; flex-wrap: wrap; gap: 8px; }
.prov-case-link {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 4px;
  font-size: 12px;
  padding: 3px 9px;
  text-decoration: none;
}
.prov-case-link:hover { background: #dbeafe; }
.prov-case-link-open { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.prov-case-link-open:hover { background: #ffedd5; }
.prov-dupe-warn {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 4px;
  padding: 7px 11px;
  font-size: 12px;
  color: #92400e;
  margin-top: 4px;
}

/* Providers modal helpers */
.modal-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.modal-row-3 { display: grid; grid-template-columns: 1fr 70px 110px; gap: 14px; }
.prov-checks-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 4px 0;
}
.prov-check-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
}
.btn-sm-add {
  font-size: 11px;
  padding: 3px 9px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
}
.btn-sm-add:hover { opacity: 0.85; }
.btn-tiny-edit, .btn-tiny-del {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid var(--gray-200);
  cursor: pointer;
  background: var(--white);
  color: var(--gray-600);
}
.btn-tiny-edit:hover { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.btn-tiny-del:hover { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* ── Case detail provider widget ──────────────────────────────── */
.case-providers-list { display: flex; flex-direction: column; gap: 4px; min-height: 4px; }
.case-providers-loading { font-size: 12px; color: var(--gray-400); }
.case-provider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: var(--gray-50, #f9fafb);
  border: 1px solid var(--gray-200);
  border-radius: 5px;
  font-size: 13px;
}
.case-provider-row.inactive-provider { border-color: #fecaca; background: #fef2f2; }
.case-provider-name { font-weight: 600; color: var(--text); flex: 1; }
.case-provider-name a { color: var(--text); text-decoration: none; }
.case-provider-name a:hover { color: var(--accent); }
.case-provider-meta { font-size: 11px; color: var(--gray-400); }
.btn-case-prov-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  font-size: 13px;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
}
.btn-case-prov-remove:hover { color: var(--red); }
.case-providers-add { position: relative; }
.case-prov-ac-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 5px;
  font-size: 13px;
  box-sizing: border-box;
  background: var(--white);
}
.case-prov-ac-input:focus { outline: none; border-color: var(--accent); }
.case-prov-ac-drop {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.12);
  z-index: 1000;
  max-height: 220px;
  overflow-y: auto;
}
.case-prov-ac-item {
  padding: 7px 10px;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
}
.case-prov-ac-item:hover, .case-prov-ac-item.ac-focused { background: #eff6ff; }
.case-prov-ac-item.ac-inactive { color: var(--gray-400); }
.case-prov-inactive-warn {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 12px;
  color: #92400e;
  margin-top: 4px;
}

/* ── Attorney assignment chips ─────────────────────────────────────────────── */
.attorney-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 2px 8px 2px 10px;
  font-size: 12.5px;
  color: #1d4ed8;
  font-weight: 500;
}
.atty-rm-btn {
  background: none;
  border: none;
  color: #93c5fd;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0 1px;
}
.atty-rm-btn:hover { color: #1d4ed8; }
.btn-add-attorney {
  background: none;
  border: 1px dashed var(--gray-300);
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 12px;
  color: var(--gray-400);
  cursor: pointer;
}
.btn-add-attorney:hover { border-color: var(--accent); color: var(--accent); }

/* ── Manual contact button ─────────────────────────────────────────────────── */
.btn-manual-contact {
  padding: 6px 14px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  border-radius: 6px;
  color: #166534;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.btn-manual-contact:hover { background: #dcfce7; }

/* ── Check-in log rows ─────────────────────────────────────────────────────── */
.checkin-log-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 12.5px;
  border-bottom: 1px solid var(--gray-100);
}
.checkin-log-row:last-child { border-bottom: none; }
.checkin-method-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.checkin-method-email  { background: #dbeafe; color: #1e40af; }
.checkin-method-manual { background: #dcfce7; color: #166534; }
.checkin-log-who  { font-weight: 600; color: var(--gray-700); }
.checkin-log-date { color: var(--gray-400); }
.checkin-log-notes { color: var(--gray-600); font-style: italic; }

/* ═══════════════════════════════════════════════════════════════════════════
   NEW CASE DETAIL LAYOUT (cd2-*)
   ══════════════════════════════════════════════════════════════════════════ */

/* Empty fields hidden by default; revealed only in zone-edit or ci-edit mode */
.cd2-zone.zone-editing .f.empty { display: flex !important; }
.fv-empty { color: var(--gray-300); font-style: italic; }
.fv-unknown { color: var(--gray-400); font-style: italic; }

/* Per-field inline editing state (global fallback) */
.f.f-editing .fv { display: none !important; }
.f.f-editing .fe { display: flex !important; flex-direction: column; gap: 4px; }

/* Client Information section-edit mode */
.ci-editing .f { display: flex !important; }
.ci-editing .fv { display: none !important; }
.ci-editing .fe { display: flex !important; flex-direction: column; gap: 4px; }
/* Hide per-field Save/Cancel in CI mode — only the section-level Save button should be used */
.ci-editing .fe-btns { display: none !important; }

.fe-btns {
  display: flex;
  gap: 5px;
  margin-top: 3px;
}
.btn-field-save {
  font-size: 11px;
  padding: 2px 10px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-weight: 600;
}
.btn-field-save:hover { background: var(--accent-lt); }
.btn-field-save:disabled { opacity: 0.5; cursor: default; }
.btn-field-cancel {
  font-size: 11px;
  padding: 2px 8px;
  background: transparent;
  color: var(--gray-400);
  border: 1px solid var(--gray-200);
  border-radius: 3px;
  cursor: pointer;
}
.btn-field-cancel:hover { background: var(--gray-100); color: var(--gray-600); }

/* Header */
.cd2-header {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
}
.cd2-header-main { flex: 1; min-width: 0; }
.cd2-header-right { display: flex; gap: 12px; align-items: flex-start; flex-shrink: 0; }
.cd2-back { font-size: 12px; color: var(--gray-400); display: block; margin-bottom: 6px; }
.cd2-back:hover { color: var(--accent); text-decoration: none; }
.cd2-name {
  font-family: var(--font-serif);
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 5px;
  line-height: 1.2;
}
.cd2-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--gray-600);
}
.cd2-sep { color: var(--gray-200); }

/* Inline alert strips */
.cd2-alerts {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.cd2-alert {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 6px;
  font-size: 13px;
  flex-wrap: wrap;
}
.cd2-alert-warning {
  background: #fef9c3;
  border: 1px solid #fde68a;
  color: #78350f;
}
.cd2-alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a5f;
}

/* Zone container */
.cd2-zone {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 10px;
}

/* Zone label */
.cd2-zone-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--gray-400);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.internal-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background: var(--gray-100);
  color: var(--gray-400);
  border-radius: 3px;
  padding: 1px 5px;
}

/* Two-column grid */
.cd2-two-col {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  gap: 0 28px;
}

/* Three-column grid */
.cd2-three-col {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1fr) minmax(0,1fr);
  gap: 0 20px;
}

/* Referral sub-row */
.cd2-referral-row {
  display: flex;
  gap: 0 24px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--gray-100);
  flex-wrap: wrap;
}
.cd2-referral-row .f { flex: 1; min-width: 180px; }

/* Notes */
.cd2-zone-notes { }
.notes-wrap { position: relative; }
.notes-ta {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 5px;
  padding: 6px 8px;
  font-family: var(--font-sans);
  font-size: 13.5px;
  color: var(--text);
  resize: vertical;
  min-height: 68px;
  background: transparent;
  line-height: 1.55;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.notes-ta:hover { border-color: var(--gray-200); background: var(--gray-50); }
.notes-ta:focus { border-color: var(--accent); background: var(--white); box-shadow: 0 0 0 2px rgba(42,107,204,0.1); }
.notes-ta.notes-empty { color: var(--gray-400); }
.notes-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}

/* At-a-glance strip */
.cd2-atglance {
  display: flex;
  align-items: flex-start;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  padding: 10px 0;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.ag-item {
  padding: 4px 16px;
  border-right: 1px solid var(--gray-200);
  min-width: 0;
}
.ag-item:last-child { border-right: none; }
.ag-label {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-400);
  margin-bottom: 3px;
}
.ag-value { font-size: 13px; color: var(--text); }
.ag-buttons { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* Defendant cards (new layout) */
.def2-card {
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 6px;
  background: var(--gray-50);
}
.def2-card-grid {
  display: grid;
  grid-template-columns: minmax(0,1.1fr) minmax(0,0.9fr);
  gap: 0 24px;
}
.def2-sub {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--accent);
  padding: 8px 0 4px;
  border-top: 1px solid var(--gray-200);
  margin-top: 4px;
}
.def2-sub:first-child { border-top: none; margin-top: 0; padding-top: 2px; }
.def2-adjs { display: flex; flex-direction: column; gap: 8px; }

/* Compact adj-card in defendant zone */
.def2-adjs .adj-card { background: var(--white); }

/* Add defendant button */
.btn-add-def2 {
  display: inline-block;
  margin-top: 8px;
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 600;
  background: var(--white);
  border: 1px dashed var(--gray-300);
  border-radius: 5px;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.1s, border-color 0.1s;
}
.btn-add-def2:hover { background: var(--gray-50); border-color: var(--accent); }

/* Delete defendant button (inline in label) */
.btn-def-delete {
  font-size: 11px;
  padding: 2px 8px;
  border: 1px solid var(--red-bd);
  background: var(--red-bg);
  color: var(--red);
  border-radius: 3px;
  cursor: pointer;
  font-weight: 600;
}
.btn-def-delete:hover { background: #fde0de; }

/* ── cd2 field layout: compact inline two-column ───────────────────────────── */
/* One row = ~28px. All spacing lives on .f; children have zero vert padding. */

.cd2-body .f {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  padding: 4px 0 !important;
  gap: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  border-bottom: 1px solid rgba(0,0,0,0.05) !important;
}
.cd2-body .f:last-child { border-bottom: none !important; }
.cd2-body .f.empty { display: none !important; }

.cd2-body .fl {
  width: 150px !important;
  min-width: 150px !important;
  max-width: 150px !important;
  flex-shrink: 0 !important;
  padding: 0 10px 0 0 !important;
  margin: 0 !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  color: var(--gray-400) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.4px !important;
  line-height: 1.3 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}

.cd2-body .fv {
  flex: 1 !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 13px !important;
  color: var(--text) !important;
  line-height: 1.35 !important;
  white-space: normal;
  word-break: break-word;
  cursor: text;
}
.cd2-body .fv:hover { background: rgba(42,107,204,0.05); border-radius: 3px; }

.cd2-body .fe {
  flex: 1 !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
}
.cd2-body .fe input,
.cd2-body .fe select,
.cd2-body .fe textarea {
  width: 100%;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--white);
  outline: none;
  box-shadow: 0 0 0 2px rgba(42,107,204,0.1);
}
.cd2-body .fe textarea { min-height: 44px !important; }
.cd2-body .fe-btns { margin-top: 3px; }

/* Edit state */
.cd2-body .f.f-editing .fv { display: none !important; }
.cd2-body .f.f-editing .fe { display: flex !important; flex-direction: column; gap: 3px; }

/* Zone-edit mode: show empty fields */
.cd2-zone.zone-editing .f.empty { display: flex !important; }

/* Boolean flag row inside incident zone */
.cd2-flags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  padding-top: 2px;
  margin-top: 2px;
  border-top: 1px solid var(--gray-100);
}
.cd2-flags-row .f {
  flex: none !important;
  border-bottom: none !important;
}
.cd2-flags-row .fl {
  width: 65px !important;
  min-width: 65px !important;
  max-width: 65px !important;
}

/* Status zone — compact horizontal row */
.cd2-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0 8px;
}
.cd2-status-row .f {
  flex: 1;
  min-width: 150px;
  border-bottom: none !important;
}
.cd2-status-row .fl {
  width: 100px !important;
  min-width: 100px !important;
  max-width: 100px !important;
}

/* Zone-level edit button */
.btn-zone-edit {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 3px;
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-400);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  transition: color 0.1s, border-color 0.1s;
}
.btn-zone-edit:hover { color: var(--accent); border-color: var(--accent); }
.cd2-zone.zone-editing .btn-zone-edit {
  color: var(--accent);
  border-color: var(--accent);
  background: #eff6ff;
}

/* Clickable doc badges */
.doc-badges { display: flex; gap: 10px; flex-wrap: wrap; }
.doc-badge-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  background: var(--gray-50);
  cursor: pointer;
  font-size: 13px;
  transition: border-color 0.1s, background 0.1s;
}
.doc-badge-btn:hover { border-color: var(--accent); background: var(--white); }
.doc-badge-btn .doc-label { font-size: 11px; font-weight: 600; color: var(--gray-400); }

/* SOL In Suit state */
.sol-widget.in-suit {
  background: #1d4ed8;
  border-color: #1e40af;
  color: #fff;
}
.sol-widget.in-suit .sol-num { color: #fff; }
.sol-widget.in-suit .sol-lbl { color: rgba(255,255,255,0.85); }
.sol-widget.in-suit .sol-dt  { color: rgba(255,255,255,0.7); }
.sol-widget.in-suit .sol-type-lbl { color: rgba(255,255,255,0.7); }
.sol-widget.in-suit .btn-sol-edit {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.3);
  color: #fff;
}

/* In Suit toggle button */
.btn-sol-insuit {
  display: block;
  margin: 6px auto 0;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.3);
  background: transparent;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  white-space: nowrap;
}
.btn-sol-insuit:not(.active) {
  border-color: var(--gray-300);
  color: var(--gray-400);
}
.btn-sol-insuit:hover { opacity: 0.8; }

/* Edit history collapsible */
.cd2-collapse-hdr {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray-400);
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 0;
}
.cd2-collapse-hdr:hover { color: var(--accent); }
.cd2-collapse-chevron {
  font-size: 9px;
  transition: transform 0.2s;
  display: inline-block;
}
.cd2-collapse-hdr.open .cd2-collapse-chevron { transform: rotate(90deg); }
.cd2-collapse-body { padding-top: 8px; }

/* ── Dashboard recent contacts ─────────────────────────────────────────────── */
.recent-contact-row {
  padding: 8px 16px;
  border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.recent-contact-row:last-child { border-bottom: none; }
.recent-contact-who { font-weight: 600; color: var(--gray-700); }
.recent-contact-client { color: var(--accent); }
.recent-contact-date { color: var(--gray-400); font-size: 12px; margin-left: auto; }
.recent-contact-notes { color: var(--gray-500); font-style: italic; font-size: 12px; }

/* ── Compact .f fields inside case cards (belt-and-suspenders) ───────────── */
/* These override the base .f style for any legacy f() macro fields inside cards */
.case-card .f {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  padding: 3px 0 !important;
  gap: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  border-bottom: 1px solid rgba(0,0,0,0.04) !important;
}
.case-card .f:last-child { border-bottom: none !important; }
.case-card .f.empty { display: none !important; }
.case-card .fl {
  width: 130px !important;
  min-width: 130px !important;
  max-width: 130px !important;
  flex-shrink: 0 !important;
  padding: 0 8px 0 0 !important;
  margin: 0 !important;
  font-size: 10.5px !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .04em !important;
  color: var(--gray-400) !important;
  line-height: 1.3 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
}
.case-card .fv {
  flex: 1 !important;
  min-width: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 13px !important;
  line-height: 1.35 !important;
  color: var(--text) !important;
  cursor: text;
  word-break: break-word;
}
.case-card .fv:hover { background: rgba(42,107,204,0.05); border-radius: 3px; }
.case-card .fe {
  flex: 1 !important;
  min-width: 0 !important;
}
.case-card .fe input,
.case-card .fe select,
.case-card .fe textarea {
  width: 100%;
  border: 1px solid var(--accent);
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 13px;
  font-family: var(--font-sans);
}
.case-card .f.f-editing .fv { display: none !important; }
.case-card .f.f-editing .fe { display: flex !important; flex-direction: column; gap: 3px; }
/* cc-always: a section inside a case-card that stays visible in both view and edit mode */
.case-card .cc-always { display: block; }
.case-card.card-editing .cc-always { display: block; }

/* ── Case Card System (card-based case detail redesign) ──────────────────── */
.case-cards { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }

.case-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
}
.case-card.cc-hidden { display: none; }

.cc-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid var(--gray-100);
  min-height: 36px;
}
.cc-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gray-400);
}
.cc-hdr-actions { display: flex; gap: 6px; align-items: center; }
.cc-edit-btn {
  font-size: 12px;
  cursor: pointer;
  background: none;
  border: 1px solid var(--gray-200);
  color: var(--gray-500);
  padding: 2px 8px;
  border-radius: 4px;
  line-height: 1.4;
}
.cc-edit-btn:hover { background: var(--gray-100); color: var(--gray-800); border-color: var(--gray-300); }
.cc-save-btn {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.cc-save-btn:hover { background: var(--accent-lt); }
.cc-save-btn:disabled { opacity: .6; cursor: default; }
.cc-cancel-btn {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  background: var(--white);
  color: var(--gray-600);
  border: 1px solid var(--gray-300);
}

.cc-body { padding: 10px 16px; }
.cc-form { padding: 12px 16px; display: none; }
.case-card.card-editing .cc-body { display: none; }
.case-card.card-editing .cc-form { display: block; }

/* Prose elements inside card body */
.cc-line { font-size: 13px; line-height: 1.55; margin-bottom: 2px; color: var(--text); }
.cc-line:last-child { margin-bottom: 0; }
.cc-line-primary { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cc-muted { color: var(--gray-400); font-size: 12px; }
.cc-subtle { color: var(--gray-600); }
.cc-sep { color: var(--gray-300); margin: 0 5px; user-select: none; }
.cc-label-inline { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--gray-400); margin-right: 4px; }
.cc-desc { font-size: 13px; color: var(--gray-600); font-style: italic; margin-top: 4px; border-left: 2px solid var(--gray-200); padding-left: 8px; }

/* Pills */
.cc-pill {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 1px 7px;
  border-radius: 10px;
  vertical-align: middle;
  margin-left: 4px;
}
.cc-pill-red    { background: var(--red-bg);     color: var(--red);    }
.cc-pill-orange { background: var(--orange-bg);  color: var(--orange); }
.cc-pill-blue   { background: #eff6ff;           color: #1d4ed8;       }
.cc-pill-green  { background: var(--green-bg);   color: var(--green);  }
.cc-pill-gray   { background: var(--gray-100);   color: var(--gray-600); }

/* Badge/doc toggle row in body */
.cc-doc-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

/* Send Intake Form button */
.cc-intake-row { margin-top: 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn-send-intake {
  background: #1a3a5c; color: #fff; border: none; border-radius: 6px;
  padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap; transition: background 0.15s;
}
.btn-send-intake:hover { background: #143050; }
.btn-send-intake:disabled { background: #8a9ab2; cursor: not-allowed; }
.intake-link-box { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.intake-link-label { font-size: 12px; color: var(--gray-500); white-space: nowrap; }
.intake-link-input {
  font-size: 12px; padding: 5px 8px; border: 1px solid var(--gray-300);
  border-radius: 5px; width: 280px; max-width: 100%; color: var(--gray-700);
  background: var(--gray-50);
}
.btn-copy-intake {
  background: var(--gray-100); border: 1px solid var(--gray-300); border-radius: 5px;
  padding: 4px 10px; font-size: 12px; cursor: pointer; font-weight: 600;
}
.btn-copy-intake:hover { background: var(--gray-200); }
.intake-copy-ok { font-size: 12px; color: var(--green-600, #1a5c3a); font-weight: 600; }
/* ── Property Damage row (Case Management card) ─────────────── */
.cc-pd-row { margin-top: 10px; }
.btn-pd-prompt {
  background: none; border: 1px dashed var(--gray-300); border-radius: 5px;
  padding: 4px 10px; font-size: 12px; color: var(--gray-400); cursor: pointer;
  font-weight: 500;
}
.btn-pd-prompt:hover { border-color: var(--orange); color: var(--orange); background: var(--orange-bg); }
.cc-pd-form {
  margin-top: 6px; padding: 10px 12px; background: var(--gray-50);
  border: 1px solid var(--gray-200); border-radius: 6px;
}
.cc-pd-form input, .cc-pd-form textarea {
  border: 1px solid var(--gray-300); border-radius: 4px; padding: 5px 8px;
  font-size: 13px; font-family: inherit; background: var(--white);
}
.cc-pd-form input:focus, .cc-pd-form textarea:focus {
  outline: none; border-color: var(--accent);
}
.cc-pd-form textarea { resize: vertical; }
.btn-pd-save {
  background: var(--navy); color: #fff; border: none; border-radius: 5px;
  padding: 5px 14px; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.btn-pd-save:hover { background: #143050; }
.btn-pd-save:disabled { background: #8a9ab2; cursor: not-allowed; }
.btn-pd-cancel {
  background: var(--gray-100); color: var(--gray-700); border: 1px solid var(--gray-300);
  border-radius: 5px; padding: 5px 12px; font-size: 12.5px; cursor: pointer;
}
.btn-pd-cancel:hover { background: var(--gray-200); }
.btn-pd-remove {
  background: none; color: var(--red); border: none; font-size: 12px;
  cursor: pointer; padding: 5px 4px; text-decoration: underline; margin-left: auto;
}
.btn-pd-remove:hover { color: #7f1d1d; }
.cc-folder-row { margin-top: 10px; }
.btn-set-folder {
  background: var(--gray-100); border: 1px solid var(--gray-300); border-radius: 5px;
  padding: 5px 12px; font-size: 12.5px; cursor: pointer; font-weight: 600; color: var(--gray-700);
}
.btn-set-folder:hover { background: var(--gray-200); border-color: var(--gray-400); }
.cc-folder-name { font-size: 12.5px; color: var(--gray-700); font-weight: 600; }
.cc-folder-hint { font-size: 12px; color: var(--gray-400); }
.btn-open-finder {
  font-size: 12px; color: var(--blue-600); text-decoration: none;
  background: var(--blue-50); border: 1px solid var(--blue-200); border-radius: 5px;
  padding: 4px 10px; font-weight: 600; white-space: nowrap;
}
.btn-open-finder:hover { background: var(--blue-100); }
.btn-open-finder-hdr {
  font-size: 12px; color: #fff; background: var(--accent); border: none;
  border-radius: 5px; padding: 4px 11px; font-weight: 600; white-space: nowrap;
  cursor: pointer; line-height: 1.4;
}
.btn-open-finder-hdr:hover { background: var(--navy-lt); }
.btn-install-helper {
  font-size: 12px; color: var(--blue-600); font-weight: 600; text-decoration: underline;
  margin-left: 6px;
}

/* Section dividers inside card body */
.cc-section { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--gray-100); }
.cc-section:first-child { margin-top: 0; padding-top: 0; border-top: none; }

/* Form fields in card edit mode */
.cf-section { margin-bottom: 16px; }
.cf-section:last-child { margin-bottom: 0; }
.cf-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--gray-400);
  margin-bottom: 10px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--gray-100);
}
.cf-field { margin-bottom: 8px; }
.cf-field:last-child { margin-bottom: 0; }
.cf-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-400);
  margin-bottom: 3px;
  display: block;
}
.cf-field input[type=text],
.cf-field input[type=date],
.cf-field input[type=number],
.cf-field input[type=email],
.cf-field select,
.cf-field textarea {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--gray-200);
  border-radius: 5px;
  font-size: 13px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
}
.cf-field input:focus, .cf-field select:focus, .cf-field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(42,107,204,.12);
}
.cf-field textarea { resize: vertical; }
.cf-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cf-3col { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
.cf-check-row { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 4px; }
.cf-check-item { display: flex; align-items: center; gap: 5px; font-size: 13px; cursor: pointer; }
.cf-check-item input[type=checkbox] { width: 14px; height: 14px; cursor: pointer; }
.cf-check-item select { padding: 3px 6px; border: 1px solid var(--gray-200); border-radius: 4px; font-size: 12px; }

/* Narrative header */
.cd2-narrative {
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 4px;
  line-height: 1.4;
}

/* Compact notes card */
.cc-notes-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 14px;
}
.cc-notes-inner { padding: 10px 16px 12px; }
.cc-notes-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--gray-400);
  margin-bottom: 6px;
}
.cc-notes-sep { height: 1px; background: var(--gray-100); margin: 10px 0 8px; }

/* Staff Notes — 1-line default, JS auto-expands on focus/input */
.notes-ta[data-field="app_notes"] {
  min-height: 0;
  resize: none;
  overflow: hidden;
}

/* Incident type autocomplete dropdown */
.it-ac-wrap { position: relative; }
.it-ac-drop {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.10);
  z-index: 300;
  max-height: 210px;
  overflow-y: auto;
}
.it-ac-item {
  padding: 7px 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
}
.it-ac-item:hover,
.it-ac-item.ac-focused { background: var(--gray-50); }

/* cards whose dropdowns must escape the card boundary */
#card-providers { overflow: visible; }
/* Adjuster autocomplete dropdown must escape these cards' overflow:hidden */
#card-insurance, #card-defendants { overflow: visible; }
#card-insurance > .cc-hdr, #card-defendants > .cc-hdr { border-radius: 7px 7px 0 0; }
/* ── Medical Requests card ──────────────────────────────────────────────── */
#card-med-requests { overflow: visible; }
.med-req-list { min-height: 4px; }
.med-req-loading { font-size: 12px; color: var(--gray-400); }

.med-req-table {
  width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 8px;
}
.med-req-table th {
  text-align: left; font-size: 11px; font-weight: 600;
  color: var(--gray-400); text-transform: uppercase; letter-spacing: .4px;
  padding: 0 8px 6px; border-bottom: 1px solid var(--gray-100);
}
.med-req-row td {
  padding: 6px 8px; border-bottom: 1px solid var(--gray-100); vertical-align: middle;
}
.med-req-row:last-child td { border-bottom: none; }
.med-req-prov { font-weight: 600; }
.med-req-prov a { color: var(--text); text-decoration: none; }
.med-req-prov a:hover { color: var(--accent); }
.med-req-sentby { font-size: 11px; color: var(--gray-400); font-weight: 400; }
.med-req-what { font-size: 12px; color: var(--gray-600); }
.med-req-actions { white-space: nowrap; text-align: right; }

.btn-med-req-gen {
  font-size: 11px; padding: 2px 8px; border-radius: 4px; cursor: pointer;
  background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe;
  font-weight: 600; margin-right: 4px;
}
.btn-med-req-gen:hover { background: #dbeafe; }
.btn-med-req-recv {
  font-size: 11px; padding: 2px 8px; border-radius: 4px; cursor: pointer;
  background: var(--green-bg); color: var(--green); border: 1px solid var(--green-bd);
  font-weight: 600; margin-right: 4px;
}
.btn-med-req-recv:hover { background: #bbf7d0; }
.btn-med-req-del {
  background: none; border: none; cursor: pointer;
  color: var(--gray-400); font-size: 12px; padding: 2px 4px; border-radius: 3px;
}
.btn-med-req-del:hover { color: #dc2626; background: #fee2e2; }

.med-req-section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--gray-400); padding: 4px 0 4px; margin-top: 4px;
}
.med-req-add { margin-top: 10px; }
.med-req-add-toggle {
  font-size: 12px; color: var(--accent); cursor: pointer; display: inline-block;
}
.med-req-add-toggle:hover { text-decoration: underline; }
.med-req-form {
  margin-top: 10px; padding: 12px; background: var(--gray-50);
  border: 1px solid var(--gray-200); border-radius: 6px;
}
.med-req-form-row {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.med-req-label {
  font-size: 12px; font-weight: 600; color: var(--gray-600);
  width: 80px; flex-shrink: 0;
}
.med-req-select {
  height: 30px; padding: 0 8px; border: 1px solid var(--gray-200);
  border-radius: 5px; font-size: 13px; background: #fff; flex: 1; min-width: 0;
}
.med-req-select:focus { outline: none; border-color: var(--accent); }
.med-req-method-btns { display: flex; gap: 16px; font-size: 13px; }
.med-req-checkboxes { display: flex; gap: 16px; font-size: 13px; }
.med-req-date-input {
  height: 30px; padding: 0 8px; border: 1px solid var(--gray-200);
  border-radius: 5px; font-size: 13px; background: #fff;
}
.med-req-date-input:focus { outline: none; border-color: var(--accent); }
.med-req-notes-input {
  height: 30px; padding: 0 8px; border: 1px solid var(--gray-200);
  border-radius: 5px; font-size: 13px; background: #fff; flex: 1;
}
.med-req-notes-input:focus { outline: none; border-color: var(--accent); }

/* ── Mobile navigation elements (hidden on desktop) ──────────────── */
.mobile-topbar {
  display: none;
}
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 190;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}

.sidebar-close-btn {
  display: none;
}

.sidebar-logo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.hamburger-btn {
  display: none;
}

/* ── Layout Editor ───────────────────────────────────────────────── */

/* Edit Layout toolbar (partners only) */
.le-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}
#btn-edit-layout {
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-600);
  cursor: pointer;
}
#btn-edit-layout:hover { background: var(--gray-100); }
#btn-edit-layout.le-edit-active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}
#btn-reset-layout {
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--red);
  cursor: pointer;
}
#btn-reset-layout:hover { background: var(--red-bg); border-color: var(--red-bd); }
.le-toolbar-hint {
  font-size: 11px;
  color: var(--gray-400);
  font-style: italic;
}

/* Collapse toggle — the entire .cc-hdr is the tap target (see JS); button is visual only */
.le-collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  color: var(--gray-400);
  padding: 0 6px 0 0;
  flex-shrink: 0;
  /* Minimum touch target height handled by parent .cc-hdr min-height */
}
.le-collapse-btn:hover { color: var(--gray-700); }

/* Card header is the collapse tap target — pointer cursor when not in edit mode */
.case-cards .cc-hdr { cursor: pointer; }
/* But NOT in edit mode (dragging) or when the card-editing form is open */
.le-edit-mode .cc-hdr { cursor: default; }
.card-editing .cc-hdr { cursor: default; }

/* Collapsed card */
.le-card-collapsed .cc-body { display: none !important; }
.le-card-collapsed:not(.card-editing) .cc-form { display: none; }

/* Hidden cards (outside edit mode) */
.case-card.le-hidden { display: none !important; }

/* Edit mode — ALL cards visible so you can change settings on hidden/collapsed ones */
.le-edit-mode .case-card.le-hidden {
  display: block !important;
  opacity: 0.45;
  outline: 2px dashed var(--red) !important;
  outline-offset: 2px;
}
.le-edit-mode .case-card.le-card-collapsed .cc-body,
.le-edit-mode .case-card.le-card-collapsed .cc-form { display: block !important; }

/* Field-edit mode (settings panel open) — hidden fields appear ghosted so they can be un-hid */
.le-field-edit-active [data-le-field].le-field-hidden {
  display: block !important;
  opacity: 0.3;
  outline: 1px dashed #dc2626;
  outline-offset: 2px;
  pointer-events: auto;
}

/* Edit mode — dashed outline on each card */
.le-edit-mode .case-card {
  outline: 2px dashed var(--gray-200);
  outline-offset: 2px;
}
.le-edit-mode .case-card:hover { outline-color: var(--gray-400); }

/* Dragging ghost */
.case-card.le-dragging {
  opacity: 0.35;
  pointer-events: none;
}

/* Drop zone indicators — card level */
.case-card.le-drag-over-before { border-top: 3px solid var(--accent) !important; }
.case-card.le-drag-over-after  { border-bottom: 3px solid var(--accent) !important; }

/* Field-level drag states */
.le-field-draggable {
  position: relative;
  cursor: default;
}
.le-field-dragging {
  opacity: 0.4;
}
[data-le-field].le-field-drag-over-before { border-top: 2px solid var(--accent) !important; }
[data-le-field].le-field-drag-over-after  { border-bottom: 2px solid var(--accent) !important; }

/* Field drag handle */
.le-field-handle {
  display: inline-block;
  font-size: 13px;
  color: var(--gray-300);
  cursor: grab;
  user-select: none;
  margin-right: 4px;
  vertical-align: middle;
  flex-shrink: 0;
}
.le-field-handle:hover { color: var(--gray-500); }

/* Field active highlight */
.le-field-active {
  outline: 2px solid var(--accent) !important;
  outline-offset: 2px;
  border-radius: 3px;
}

/* Field label chip (shown when labelVis = 'show') */
.le-field-chip {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  margin-bottom: 4px;
  padding-bottom: 2px;
  opacity: .7;
}

/* Field size */
[data-le-field][data-le-size="small"],
[data-le-field][data-le-size="small"] * { font-size: 11px; }
[data-le-field][data-le-size="large"],
[data-le-field][data-le-size="large"] * { font-size: 16px; }

/* Field weight */
[data-le-field][data-le-weight="bold"] { font-weight: 700 !important; }

/* Field width */
[data-le-field][data-le-width="half"] {
  display: inline-block !important;
  width: 50% !important;
  vertical-align: top;
  box-sizing: border-box;
}

/* Field hidden */
[data-le-field].le-field-hidden { display: none !important; }

/* Field inline toolbar */
.le-field-toolbar {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  box-shadow: 0 4px 18px rgba(0,0,0,.14);
  margin-top: 8px;
  padding: 8px 10px 10px;
  font-size: 12px !important;
  font-weight: 400 !important;
  color: var(--gray-700) !important;
  cursor: default;
}
.le-ft-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--gray-100);
}
.le-ft-field-name {
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-500);
}
.le-ft-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px !important;
  color: var(--gray-400);
  padding: 3px 6px;
  border-radius: 3px;
  line-height: 1;
}
.le-ft-close:hover { background: var(--gray-100); color: var(--gray-700); }
.le-ft-rows { display: flex; flex-direction: column; gap: 6px; }
.le-ft-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.le-ft-label {
  font-size: 11px !important;
  font-weight: 600 !important;
  color: var(--gray-500);
  min-width: 46px;
  flex-shrink: 0;
}
.le-ft-btns { display: flex; gap: 3px; flex-wrap: wrap; }
.le-ft-btn {
  font-size: 11px !important;
  font-weight: 400 !important;
  padding: 4px 9px;
  border: 1px solid var(--gray-200);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  color: var(--gray-600);
}
.le-ft-btn:hover { background: var(--gray-100); }
.le-ft-btn.active { background: var(--navy); color: #fff !important; border-color: var(--navy); }
.le-ft-swatches { display: flex; gap: 4px; flex-wrap: wrap; }
.le-ft-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px !important;
  flex-shrink: 0;
}
.le-ft-swatch.active {
  border-color: var(--navy);
  box-shadow: 0 0 0 2px var(--navy);
}

/* Drag handle (shown only in edit mode) */
.le-drag-handle {
  display: none;
  font-size: 13px;
  color: var(--gray-300);
  cursor: grab;
  user-select: none;
  padding: 0 5px 0 2px;
  line-height: 1;
  align-items: center;
  flex-shrink: 0;
  letter-spacing: -2px;
}
.le-edit-mode .le-drag-handle { display: flex; }
.le-drag-handle:hover { color: var(--gray-500); }

/* Settings gear button (shown only in edit mode) */
.le-settings-btn {
  display: none;
  background: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 20px;
  color: var(--gray-400);
  padding: 4px 10px;
  border-radius: 6px;
  line-height: 1;
  margin-left: 4px;
  min-width: 40px;
  min-height: 36px;
  align-items: center;
  justify-content: center;
}
.le-edit-mode .le-settings-btn { display: flex; }
.le-settings-btn:hover {
  background: var(--gray-100);
  border-color: var(--gray-200);
  color: var(--gray-700);
}

/* Settings panel (inside card, below header) */
.le-settings-panel {
  border-top: 1px solid var(--gray-100);
  padding: 10px 16px 12px;
  background: var(--gray-50);
}
.le-sp-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.le-sp-row:last-child { margin-bottom: 0; }
.le-sp-label {
  min-width: 90px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--gray-400);
  flex-shrink: 0;
}
.le-sp-btns { display: flex; gap: 4px; flex-wrap: wrap; }
.le-prom-btn {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 4px;
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--gray-600);
  cursor: pointer;
}
.le-prom-btn:hover { background: var(--gray-100); }
.le-prom-btn.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Color swatches */
.le-sp-swatches { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.le-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--gray-200);
  cursor: pointer;
  font-size: 9px;
  color: var(--gray-400);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.le-swatch.active { border-color: var(--gray-700); }
.le-swatch:hover { border-color: var(--gray-500); }

/* ── Prominence levels ── */

/* Minimal — muted, compact */
.case-card[data-le-prominence="minimal"] { border-color: var(--gray-100); opacity: 0.82; }
.case-card[data-le-prominence="minimal"] .cc-hdr {
  background: var(--gray-50);
  min-height: 28px;
  padding: 5px 16px;
}
.case-card[data-le-prominence="minimal"] .cc-title {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: .04em;
}

/* Normal — default, no overrides needed */

/* Prominent — large bold header, blue border */
.case-card[data-le-prominence="prominent"] {
  border: 2px solid var(--accent) !important;
  box-shadow: 0 2px 10px rgba(42,107,204,0.12);
}
.case-card[data-le-prominence="prominent"] .cc-hdr {
  background: #f0f7ff;
  min-height: 42px;
  padding: 10px 16px;
}
.case-card[data-le-prominence="prominent"] .cc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gray-800);
  text-transform: none;
  letter-spacing: .01em;
}

/* Mobile layout editor adjustments */
@media (max-width: 768px) {
  .le-sp-label { min-width: 72px; }
  .le-settings-panel { padding: 8px 12px 10px; }
  .le-toolbar { gap: 6px; }
}

/* ── Mobile Responsive ───────────────────────────────────────────── */
@media (max-width: 768px) {

  /* Body — 16px prevents iOS Safari auto-zoom on input focus */
  body { font-size: 16px; }

  /* All form elements — 16px is critical; iOS zooms if <16px */
  input, select, textarea { font-size: 16px !important; }

  /* ── Mobile topbar ── */
  .mobile-topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--navy);
    color: var(--white);
    padding: 0 16px;
    height: 52px;
    position: sticky;
    top: 0;
    z-index: 80;
    flex-shrink: 0;
  }
  .hamburger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    margin-left: -8px;
  }
  .mobile-topbar-title {
    font-family: var(--font-serif);
    font-size: 17px;
    font-weight: 700;
    color: var(--white);
  }

  /* ── Un-hide sidebar text hidden by the 900px collapsed-sidebar rule ── */
  .sidebar-logo h1,
  .sidebar-logo span,
  .nav-item span,
  .sidebar-footer .user-name { display: block; }
  .nav-item span { display: inline; }

  /* ── Sidebar: instant show/hide, no animation, no transform ── */
  .sidebar {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    background-color: #1a2744 !important;
    z-index: 9999 !important;
  }
  .sidebar.mobile-open {
    display: flex !important;
  }

  /* Close (×) button inside sidebar — only visible on mobile */
  .sidebar-close-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 20px;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    margin-right: -8px;
    border-radius: 6px;
  }
  .sidebar-close-btn:hover { color: var(--white); background: rgba(255,255,255,0.1); }

  /* ── Main content: full width ── */
  .main-content {
    margin-left: 0;
    padding-bottom: env(safe-area-inset-bottom, 16px);
  }

  /* ── Page layout ── */
  .page-body { padding: 12px 16px; }
  .page-header {
    padding: 10px 16px;
    top: 52px; /* sticky below mobile topbar */
    gap: 8px;
    flex-wrap: wrap;
  }
  .page-header h2 { font-size: 17px; }

  /* ── Touch targets ≥ 44px ── */
  .nav-item { min-height: 44px; padding: 12px 20px; }
  .btn-save, .btn-cancel { min-height: 44px; padding: 10px 16px; }
  .btn-field-save, .btn-field-cancel { min-height: 36px; padding: 6px 14px; }
  .btn-new-intake { min-height: 40px; padding: 8px 14px; }
  .filter-chip { padding: 8px 12px; min-height: 36px; }
  .toggle-closed-btn { min-height: 36px; padding: 6px 12px; }

  /* ── Stats grid: 2 columns ── */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }

  /* ── Dashboard grid: single column ── */
  .dashboard-grid { grid-template-columns: 1fr; }

  /* ── Detail grid: single column ── */
  .detail-grid { grid-template-columns: 1fr !important; }

  /* ── Search bar: stack vertically ── */
  .search-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .search-bar input[type="text"],
  .search-bar select,
  #search-main,
  #filter-insurer,
  #filter-incident { width: 100% !important; }

  /* ── Filters: scroll horizontally, don't wrap to multiple lines ── */
  .filters-row {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    gap: 6px;
  }
  .filter-label { white-space: nowrap; }

  /* ── Table: scroll within container only, not the whole page ── */
  .table-wrap { -webkit-overflow-scrolling: touch; }

  /* ── Modals: full-width on mobile ── */
  .modal-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100svh - 48px);
    margin: 0;
  }
  .modal-body { padding: 14px 16px; }
  .modal-header { padding: 14px 16px 10px; }
  .modal-footer { padding: 10px 16px 14px; }

  /* ══════════════════════════════════════════════════════════
     CASE DETAIL
  ══════════════════════════════════════════════════════════ */

  /* Case detail header: stack name+info above SOL widget */
  .cd2-header {
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
  }
  .cd2-header-right {
    width: 100%;
    justify-content: space-between;
  }
  .cd2-name { font-size: 20px; }

  /* SOL widget: shrink so it fits next to action buttons */
  .sol-widget {
    min-width: 110px;
    padding: 10px 14px;
  }
  .sol-widget .sol-num { font-size: 28px; }

  /* Two-col and three-col: single column on mobile */
  .cd2-two-col {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }
  .cd2-three-col {
    grid-template-columns: 1fr !important;
    gap: 0 !important;
  }

  /* Field label: narrower to give values more room */
  .cd2-body .fl {
    width: 110px !important;
    min-width: 110px !important;
    max-width: 110px !important;
    font-size: 10px !important;
  }

  /* Card body: tighter padding */
  .cc-body { padding: 8px 12px; }

  /* At-a-glance strip: stack items vertically */
  .cd2-atglance {
    flex-direction: column;
    padding: 0;
  }
  .ag-item {
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
    padding: 10px 16px;
    width: 100%;
    box-sizing: border-box;
  }
  .ag-item:last-child { border-bottom: none; }

  /* Adjuster form: 2 cols (down from 3) */
  .adj-form-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  /* SOL monitor page: simplify row layout */
  .sol-table-row {
    grid-template-columns: 1fr 70px !important;
    gap: 8px;
  }
  .sol-table-row > *:nth-child(3),
  .sol-table-row > *:nth-child(4) {
    display: none;
  }
  .sol-table-row.header > *:nth-child(3),
  .sol-table-row.header > *:nth-child(4) {
    display: none;
  }

  /* SOL dashboard widget rows */
  .sol-row {
    grid-template-columns: 1fr 90px;
    gap: 8px;
  }

  /* Alerts on case detail */
  .cd2-alert { font-size: 14px; }

  /* Pending closure banner: stack on mobile */
  .pending-closure-banner {
    flex-direction: column;
    gap: 10px;
  }
  .pcb-actions { justify-content: flex-start; }

  /* Case header action buttons */
  .cd-header-actions { flex-wrap: wrap; }
  .btn-initiate-closure, .btn-flag-review, .btn-activate-case {
    min-height: 44px;
    padding: 10px 16px;
  }

  /* Notes textarea: readable on mobile */
  .notes-ta { font-size: 16px !important; }

  /* ── Expenses card ── */
  /* Table: horizontal scroll so all columns are reachable */
  .expense-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Add-expense form: CSS grid — row 1: checkbox + description, row 2: amount + date + Add */
  .expense-new-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 6px;
    align-items: center;
  }
  .expense-new-row .exp-paid-check-label  { grid-column: 1; grid-row: 1; }
  .expense-new-row .exp-input-desc        { grid-column: 2 / -1; grid-row: 1; width: 100%; flex: unset; }
  .expense-new-row .exp-input-amount      { grid-column: 1; grid-row: 2; width: 80px; }
  .expense-new-row .exp-date-wrap         { grid-column: 2; grid-row: 2; }
  .expense-new-row .exp-input-date        { width: 100%; min-width: 0; }
  .expense-new-row .exp-date-label-text   { display: none; } /* placeholder "MM/DD/YYYY" suffices */
  .expense-new-row .btn-exp-add           { grid-column: 3; grid-row: 2; min-height: 40px; }

  /* ── Medical Requests card ── */
  /* Table overflows on mobile — make the list container scroll horizontally */
  .med-req-list {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-left: -12px;
    margin-right: -12px;
    padding-left: 12px;
    padding-right: 12px;
  }

  /* ══════════════════════════════════════════════════════════
     PROVIDERS — mobile master-detail
  ══════════════════════════════════════════════════════════ */
  .prov-layout {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    overflow: visible !important;
  }
  .prov-list-panel { width: 100% !important; border-right: none !important; max-height: none !important; overflow: visible !important; }
  .prov-list-body { overflow-y: auto !important; height: auto !important; flex: none !important; -webkit-overflow-scrolling: touch !important; }
  .prov-detail-panel { width: 100% !important; display: none !important; }
  .prov-layout.mobile-detail .prov-list-panel { display: none !important; }
  .prov-layout.mobile-detail .prov-detail-panel { display: block !important; }
  .prov-mobile-back {
    display: flex; align-items: center; gap: 6px;
    background: none; border: none; color: var(--accent);
    font-size: 15px; font-weight: 600; cursor: pointer;
    padding: 8px 0 4px; min-height: 44px;
  }

  /* ══════════════════════════════════════════════════════════
     ADJUSTERS — mobile master-detail
  ══════════════════════════════════════════════════════════ */
  .adj-page-wrap {
    flex-direction: column !important;
    height: auto !important;
    overflow: visible !important;
  }
  .adj-list-col {
    flex: none !important; width: 100% !important; min-width: 0 !important;
    border-right: none !important; max-height: none !important;
    overflow: visible !important; height: auto !important;
  }
  .adj-list-scroll {
    flex: none !important; overflow-y: auto !important; height: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .adj-detail-col { display: none; width: 100%; }
  .adj-page-wrap.mobile-detail .adj-list-col { display: none; }
  .adj-page-wrap.mobile-detail .adj-detail-col { display: block; }
  .adj-mobile-back {
    display: flex; align-items: center; gap: 6px;
    background: none; border: none; color: var(--accent);
    font-size: 15px; font-weight: 600; cursor: pointer;
    padding: 8px 16px 4px; min-height: 44px;
  }

  /* ══════════════════════════════════════════════════════════
     LOGIN PAGE
  ══════════════════════════════════════════════════════════ */
  .login-box {
    width: calc(100vw - 32px);
    padding: 28px 24px;
  }
}
.med-req-form-btns { display: flex; gap: 8px; margin-top: 4px; }
