*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textbox; }

:root {
  --bg: #f7f5f2;
  --surface: #ffffff;
  --surface2: #f0ede9;
  --border: #e2dbd3;
  --text: #1c1917;
  --text-muted: #78716c;
  --primary: #c9a96e;
  --primary-hover: #dfc07e;
  --primary-text: #1a1209;
  --danger: #dc2626;
  --success: #16a34a;
  --accent: #c9a96e;
  --gold: #c9a96e;
  --muted: #78716c;
  --primary-dark: #b8944f;
  --nav-bg: #1c1917;
  --radius: 8px;
}

body.admin-body {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --surface2: #f5f4f2;
  --border: #e8e5e1;
  --text: #1a1612;
  --text-muted: #7a7470;
  --primary-text: #1a1209;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Legacy top-nav (kept for non-admin pages) ── */
.top-nav { display: none; }

main { max-width: 900px; margin: 0 auto; padding: 2rem 1.5rem; }
main:has(.intake-form) { max-width: 100%; }
main:has(.dashboard) { max-width: 100%; padding: 0.75rem 2rem; }
main:has(.cd-page) { max-width: 100%; padding: 1.5rem 2rem; }
main:has(.sub-page) { max-width: 100%; padding: 1rem 2rem; }

/* ════════════════════════════════════════════
   ADMIN SIDEBAR LAYOUT
   ════════════════════════════════════════════ */
body.admin-body {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: #f3f4f6;
}

/* ── Sidebar ── */
/* ══════════════════════════════════════════
   SIDEBAR — OwnerIQ Admin & Dealer Portals
   ══════════════════════════════════════════ */
.admin-sidebar {
  width: 240px;
  min-width: 240px;
  background: #ffffff;
  border-right: 1px solid #e4e2de;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 200;
  transition: width 0.22s ease, min-width 0.22s ease;
  overflow: hidden;
  box-shadow: 4px 0 24px rgba(0,0,0,0.07);
}

.admin-sidebar.collapsed {
  width: 64px;
  min-width: 64px;
}

/* ── iPad portrait / tablet ≤ 820px: auto-collapse admin sidebar ── */
@media (max-width: 820px) {
  .admin-sidebar {
    width: 64px !important;
    min-width: 64px !important;
  }
  .admin-sidebar .sidebar-label,
  .admin-sidebar .sidebar-logo,
  .admin-sidebar .sidebar-role-label,
  .admin-sidebar .sidebar-users-link span,
  .admin-sidebar .sidebar-signout-link span {
    display: none !important;
  }
  .admin-sidebar .sidebar-header {
    justify-content: center;
    padding: 1rem 0.5rem;
  }
  .admin-sidebar .sidebar-collapse-btn { display: none; }
  .admin-sidebar .sidebar-nav { padding: 0.75rem 0.35rem; }
  .admin-sidebar .sidebar-link {
    justify-content: center;
    padding: 0.75rem 0.5rem;
    border-radius: 8px;
  }
  .admin-sidebar .sidebar-user-row { justify-content: center; }
  .admin-sidebar .sidebar-footer { padding: 0.5rem 0.35rem; gap: 0.25rem; }
  .admin-sidebar .sidebar-signout-link { justify-content: center; padding: 0.75rem 0.5rem; }
  .admin-sidebar .sidebar-divider { margin: 0.3rem 0; }
  main.admin-main {
    margin-left: 64px !important;
  }
}

/* ── Main content area ── */
main.admin-main {
  flex: 1;
  overflow-y: auto;
  margin-left: 240px;
  min-height: 100vh;
  background: #f3f4f6;
  transition: margin-left 0.22s ease;
  max-width: none;
  padding: 0;
}

main.admin-main.sb-collapsed {
  margin-left: 64px;
}

/* ── Logo / header area ── */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1rem 1.15rem 1.2rem;
  border-bottom: 1px solid #eae8e4;
  flex-shrink: 0;
  background: #ffffff;
}

.sidebar-logo-link {
  display: flex;
  align-items: center;
  overflow: hidden;
  flex: 1;
  min-width: 0;
  text-decoration: none;
}

/* Logo used exactly as provided — fits the grey header zone */
.sidebar-logo {
  width: 180px;
  height: auto;
  flex-shrink: 0;
  object-fit: contain;
  display: block;
  transition: opacity 0.15s;
}
.sidebar-logo-link:hover .sidebar-logo { opacity: 0.88; }

.admin-sidebar.collapsed .sidebar-logo { display: none; }

/* Collapse toggle */
.sidebar-collapse-btn {
  background: none;
  border: none;
  color: #b0a8a0;
  cursor: pointer;
  padding: 0.3rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-left: 0.3rem;
  transition: color 0.15s, background 0.15s;
}
.sidebar-collapse-btn:hover { background: rgba(0,0,0,0.05); color: #4a4540; }

/* ── Navigation ── */
.sidebar-nav {
  flex: 1;
  padding: 1rem 0.6rem;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.72rem 1rem;
  color: #7a7470;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border-left: 2px solid transparent;
  border-radius: 8px;
  transition: background 0.14s, color 0.14s, border-color 0.14s;
  white-space: nowrap;
}

.sidebar-link:hover {
  background: #f4f2ef;
  color: #1a1612;
}

.sidebar-link-active {
  color: #b5883a;
  background: rgba(201,169,110,0.10);
  border-left: 2px solid #c9a96e;
  border-radius: 0 9px 9px 0;
  margin-left: -0.6rem;
  padding-left: calc(1rem + 0.6rem);
  font-weight: 600;
}

.sidebar-icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: #b0a8a0;
  transition: color 0.14s;
}

.sidebar-link:hover .sidebar-icon { color: #4a4540; }
.sidebar-link-active .sidebar-icon { color: #c9a96e; }

.sidebar-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-sidebar.collapsed .sidebar-label { display: none; }

/* ── Footer / user section ── */
.sidebar-footer {
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid #eae8e4;
  flex-shrink: 0;
  background: #faf9f8;
}

.sidebar-user-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.65rem;
  overflow: hidden;
  padding: 0.1rem 0;
}

.sidebar-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, #c9a96e 0%, #8a6228 100%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sidebar-role-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #9a9490;
  white-space: nowrap;
  overflow: hidden;
  letter-spacing: 0.01em;
}

.admin-sidebar.collapsed .sidebar-role-label { display: none; }

.sidebar-signout-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #9a9490;
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.45rem 0.6rem;
  border-radius: 7px;
  transition: color 0.14s, background 0.14s;
  white-space: nowrap;
}

.sidebar-signout-link:hover { background: rgba(239,68,68,0.07); color: #dc2626; }
.sidebar-signout-link:hover .sidebar-icon { color: #dc2626; }
.sidebar-users-link:hover { background: #f4f2ef; color: #1a1612; }
.sidebar-users-link:hover .sidebar-icon { color: #4a4540; }
.admin-sidebar.collapsed .sidebar-signout-link span { display: none; }

.sidebar-divider {
  height: 1px;
  background: #eae8e4;
  margin: 0.35rem 0;
}

.sidebar-link-accent {
  color: #b5883a;
  font-weight: 600;
}
.sidebar-link-accent .sidebar-icon { color: #c9a96e; }
.sidebar-link-accent:hover { background: rgba(201,169,110,0.08); color: #a07520; }
.admin-sidebar.collapsed .sidebar-divider { margin: 0.3rem 0; }

/* Intake form pages share the admin sidebar */

/* ── Page content wrapper ── */
.page-content {
  padding: 2rem 2.5rem;
}

.page-title-row {
  margin-bottom: 1.75rem;
  border-bottom: 1px solid #2e2e33;
  padding-bottom: 1.25rem;
}

.page-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #e8e4df;
  letter-spacing: -0.03em;
  margin-bottom: 0.2rem;
}

.page-subtitle {
  font-size: 0.83rem;
  color: #9d9189;
  font-weight: 400;
}

.section-label {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #b0a89e;
  margin-bottom: 0.75rem;
}

/* Ensure existing page containers get padding inside the new sidebar layout */
main.admin-main > .dashboard,
main.admin-main > .um-page,
main.admin-main > .sub-page,
main.admin-main > .cd-page,
main.admin-main > .sl-page {
  padding: 2rem 2.5rem;
  max-width: none;
}

main.admin-main > .dashboard { padding: 1.5rem 2.5rem; }

main.admin-main > .orders-container,
main.admin-main > .sl-panel,
main.admin-main > .um-page {
  padding: 2rem 2.5rem;
  max-width: none;
}

.orders-container h1 { color: var(--text) !important; }

/* Setup Links panel inside admin */
.sl-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.75rem;
  border: 1px solid var(--border);
  max-width: 680px;
  margin-bottom: 2rem;
}

h1 { font-size: 1.8rem; font-weight: 700; letter-spacing: -0.03em; margin-bottom: 0.5rem; }
h2 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.75rem; color: var(--text-muted); }

label { display: block; font-size: 0.85rem; font-weight: 500; color: var(--text-muted); margin-bottom: 0.35rem; margin-top: 1rem; }
.required { color: var(--danger); }

input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="number"], textarea, select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: var(--surface2);
  text-transform: uppercase;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
input[type="email"] {
  text-transform: none;
}
input:focus, textarea:focus, select:focus { border-color: var(--primary); }
textarea { resize: vertical; }

button, .btn {
  display: inline-block;
  padding: 0.65rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, transform 0.1s;
  text-align: center;
}
button:active, .btn:active { transform: scale(0.98); }

button, .btn-primary {
  background: var(--primary);
  color: var(--primary-text);
}
button:hover, .btn-primary:hover { background: var(--primary-hover); }
button:disabled, .btn-primary:disabled { opacity: 0.38; cursor: not-allowed; pointer-events: none; }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); }

.btn-small {
  padding: 0.35rem 0.8rem;
  font-size: 0.8rem;
}

.error {
  background: rgba(231, 76, 60, 0.15);
  color: #e74c3c;
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

/* Login Background */
.login-page {
  min-height: 100vh;
  background: url('/login-bg.png') center center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
}
.client-login-page {
  background: #18181c;
  overflow: hidden;
}
.client-login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('/client-login-bg.png') center right / cover no-repeat;
  filter: grayscale(100%) brightness(0.28);
  z-index: 0;
}
.client-login-page::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, #18181c 30%, transparent 70%, #18181c 100%);
  z-index: 1;
}
.client-login-page .auth-container {
  position: relative;
  z-index: 2;
}
.client-login-page .login-thank-you {
  position: absolute;
  z-index: 2;
}
.client-login-page .login-side-text {
  position: absolute;
  left: clamp(2rem, 4vw, 4.5rem);
  top: 50%;
  transform: translateY(-50%);
  max-width: 240px;
  z-index: 2;
}
.login-side-text {
  position: absolute;
  left: clamp(2rem, 5vw, 6rem);
  top: 50%;
  transform: translateY(-50%);
  max-width: 460px;
  z-index: 1;
}
.login-headline {
  font-size: clamp(1.8rem, 3vw, 2.6rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: rgba(255,255,255,0.92);
  margin-bottom: 1.75rem;
}
.login-headline br + * {
  display: inline;
}
.login-body {
  font-size: 0.92rem;
  line-height: 1.7;
  color: rgba(255,255,255,0.55);
  font-weight: 300;
  margin-bottom: 1.25rem;
  letter-spacing: 0.01em;
}
.login-body-accent {
  color: #c9a96e;
  font-weight: 400;
  font-size: 0.95rem;
  opacity: 0.85;
  margin-top: 0.5rem;
}
.login-thank-you {
  position: absolute;
  bottom: 1.75rem;
  right: clamp(1.5rem, 3vw, 3rem);
  font-size: 0.72rem;
  color: rgba(255,255,255,0.3);
  font-weight: 300;
  letter-spacing: 0.03em;
}
@media (max-width: 1100px) {
  .login-side-text { display: none; }
  .login-thank-you { right: 50%; transform: translateX(50%); }
}

/* Auth */
.auth-container {
  max-width: 380px;
  width: 100%;
  margin: 8vh auto;
  padding: 2.5rem;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.login-page .auth-container {
  margin: 0;
  padding: 2.5rem 2.5rem 2rem;
  background: rgba(26, 26, 30, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: none;
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.25);
}
.login-logo-wrap {
  text-align: center;
  padding: 1rem 0 2rem;
}
.login-logo {
  max-width: 300px;
  width: 100%;
  height: auto;
}
.login-field {
  margin-bottom: 0.75rem;
}
.login-field input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--surface);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
  text-transform: none;
}
.login-field input:-webkit-autofill,
.login-field input:-webkit-autofill:hover,
.login-field input:-webkit-autofill:focus,
.login-field input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px #f5f3f0 inset !important;
  -webkit-text-fill-color: #1c1917 !important;
  border: 1px solid rgba(255,255,255,0.2) !important;
  transition: background-color 5000s ease-in-out 0s;
  caret-color: #1c1917;
}
.login-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(223, 192, 158, 0.25);
  background: var(--surface);
}
.login-field input::placeholder {
  color: #aaa;
  font-weight: 400;
}
.login-btn {
  width: 100%;
  margin-top: 1rem;
  padding: 0.75rem;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  letter-spacing: 0.03em;
}
.login-btn:hover {
  background: var(--primary-hover);
}
.login-btn:active {
  transform: scale(0.99);
}
.auth-container h1 { text-align: center; margin-bottom: 0.25rem; }
.auth-container h2 { display: none; }
.auth-container button { width: 100%; }

.signup-info {
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.success-box {
  text-align: center;
  padding: 1.5rem;
  margin-top: 1.5rem;
  background: rgba(39, 174, 96, 0.1);
  border: 1px solid rgba(39, 174, 96, 0.3);
  border-radius: var(--radius);
}
.success-box h2 { color: var(--success); }
.success-box p { color: var(--text-muted); margin-top: 0.5rem; }

/* Dashboard */
.dashboard { }
.dash-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  gap: 1rem;
}
.btn-new-deal {
  padding: 0.55rem 1.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: none;
  background: var(--primary);
  color: var(--primary-text);
  border-radius: 6px;
  text-transform: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-new-deal:hover {
  background: var(--primary-hover);
}
.dash-search-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  margin-left: auto;
}
.search-by-select {
  width: auto;
  min-width: 100px;
  padding: 0.45rem 0.6rem;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface2);
  color: var(--text);
  text-transform: none;
  margin-top: 0;
}
.search-input {
  width: 180px;
  padding: 0.45rem 0.75rem;
  font-size: 0.82rem;
  margin-top: 0 !important;
  border-radius: 6px;
  background: var(--surface2);
}
.btn-search {
  padding: 0.45rem 1.2rem;
  font-size: 0.82rem;
  margin-top: 0;
  border-radius: 6px;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.clients-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--surface);
}
.clients-table thead th {
  background: #1c1917;
  color: #c9a96e;
  padding: 0.7rem 0.8rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.72rem;
  white-space: nowrap;
  border-right: 1px solid rgba(201,169,110,0.1);
  position: sticky;
  top: 0;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.clients-table thead th:last-child { border-right: none; }
.clients-table thead th a {
  color: #c9a96e;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.clients-table thead th a:hover { color: #e8c98a; }
.clients-table tbody td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
  text-transform: uppercase;
}
.clients-table tbody tr:nth-child(even) {
  background: var(--surface2);
}
.clients-table tbody tr:hover {
  background: rgba(201,169,110,0.1);
  color: var(--text);
}
.clients-table tbody tr:hover td {
  color: var(--text);
}
.empty-cell {
  text-align: center;
  color: var(--text-muted);
  padding: 3rem 0 !important;
  font-style: italic;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
  border: none;
}
.btn-danger:hover { background: #c0392b; }

.empty { text-align: center; color: var(--text-muted); padding: 3rem 0; }

/* New Client Form */
.form-container {
  max-width: 550px;
  margin: 0 auto;
  background: var(--surface);
  padding: 2rem 2.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.form-actions { display: flex; gap: 0.75rem; justify-content: flex-end; margin-top: 2rem; }

/* Client Detail Page */
.cd-page { max-width: 100%; padding: 0 1rem; }
.back-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.85rem;
  display: inline-block;
  margin-bottom: 0.75rem;
}
.back-link:hover { color: var(--text); }

.cd-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.cd-header-left { flex: 1; min-width: 0; }
.cd-name { font-size: 1.5rem; font-weight: 700; margin: 0 0 0.15rem; text-transform: uppercase; }
.cd-app-num {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--surface2);
  padding: 0.15rem 0.6rem;
  border-radius: 3px;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}
.cd-contact-info {
  margin-top: 0.5rem;
}
.cd-contact-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.2rem 0;
  font-size: 0.9rem;
}
.cd-contact-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  min-width: 3.5rem;
}
.cd-contact-value {
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
}
.cd-contact-email {
  text-transform: none;
}
.cd-created {
  margin-top: 0.4rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.cd-header-right {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-shrink: 0;
}

.cd-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.cd-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.cd-card-header {
  background: #1c1917;
  color: #c9a96e;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 0.6rem 1rem;
}
.cd-card-body {
  padding: 0.75rem 1rem;
}
.cd-big-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
}
.cd-empty {
  color: var(--text-muted);
  font-style: italic;
  font-weight: 400;
  font-size: 0.85rem;
  text-transform: none;
}
.cd-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.cd-summary-table tr { border-bottom: 1px solid var(--border); }
.cd-summary-table tr:last-child { border-bottom: none; }
.cd-summary-table td { padding: 0.25rem 0; vertical-align: top; }
.cd-summary-table .sr-label {
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  padding-right: 0.75rem;
  width: 45%;
}
.cd-summary-table .sr-value {
  color: var(--text);
  font-weight: 500;
  text-align: right;
  text-transform: uppercase;
}
.cd-summary-table tr.sr-bold td {
  font-weight: 700;
  border-top: 1px solid var(--border);
  padding-top: 0.35rem;
}

.cd-product-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
}
.cd-product-item:last-child { border-bottom: none; }
.cd-product-type {
  font-weight: 600;
  color: var(--text);
  min-width: 0;
  text-transform: uppercase;
}
.cd-product-detail {
  flex: 1;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}
.cd-product-price {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.cd-details-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
}
.cd-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}
.cd-panel.collapsed .cd-panel-body { display: none; }
.cd-panel.collapsed .cd-chevron { transform: rotate(-90deg); }
.cd-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: #1c1917;
  border-bottom: 1px solid rgba(201,169,110,0.15);
  cursor: pointer;
  user-select: none;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #c9a96e;
}
.cd-panel-header:hover { background: #252220; }
.cd-chevron {
  font-size: 0.6rem;
  transition: transform 0.2s;
  color: rgba(201,169,110,0.6);
}
.cd-panel-body {
  padding: 0.75rem 1rem;
}
.cd-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.cd-detail-table tr { border-bottom: 1px solid var(--border); }
.cd-detail-table tr:last-child { border-bottom: none; }
.cd-detail-table td { padding: 0.3rem 0; vertical-align: top; }
.cd-detail-table .sr-label {
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
  padding-right: 0.75rem;
  width: 40%;
}
.cd-detail-table .sr-value {
  color: var(--text);
  font-weight: 500;
  text-transform: uppercase;
}

.cd-changes-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.cd-changes-table th {
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  padding: 0.3rem 0.4rem;
  border-bottom: 2px solid var(--border);
}
.cd-changes-table td {
  padding: 0.25rem 0.4rem;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-transform: uppercase;
}

@media (max-width: 700px) {
  .cd-header { flex-direction: column; gap: 1rem; }
}

.collapsible-header {
  border-bottom: 2px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}
.collapsible-header:hover {
  color: var(--accent);
}
.collapsible-header .collapse-arrow {
  color: var(--muted);
}
.collapsible-header:hover .collapse-arrow {
  color: var(--accent);
}
.subsection-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--primary);
  margin: 1.5rem 0 0.75rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--primary);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin: 1.5rem 0 2rem;
  background: var(--surface);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.detail-item .label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
  margin-top: 0;
}
.detail-item.full { grid-column: 1 / -1; }

.section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
.section h2 { margin-bottom: 1rem; }

.status-badge {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}
.status-badge.active { background: rgba(39, 174, 96, 0.15); color: var(--success); }
.status-badge.pending { background: rgba(139, 143, 163, 0.15); color: var(--text-muted); }

.invite-list { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.5rem; }
.invite-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0;
}
.invite-row.used { opacity: 0.5; }
.invite-status {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  min-width: 50px;
}
.invite-url {
  flex: 1;
  font-size: 0.8rem;
  padding: 0.4rem 0.6rem;
  margin-top: 0;
}

/* Intake Form */
.intake-form {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 1.5rem;
  padding-bottom: 5rem;
}
.intake-form h1 {
  margin-bottom: 0.5rem;
}
.application-number {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.app-num-badge {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
  margin-top: 0.25rem;
}

.header-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 0;
  background: var(--surface2);
}
.dealer-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  align-items: flex-end;
}
.dealer-field { min-width: 110px; }
.dealer-row-bottom {
  border-bottom: none;
  background: rgba(0,0,0,0.015);
}
.dealer-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
}
.dealer-field label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.dealer-field input {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  font-size: 0.82rem;
  background: var(--surface);
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
}
.dealer-field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(223, 192, 158, 0.2);
}
.dealer-name-field {
  flex: 2;
}
.dealer-row-top .dealer-field:not(.dealer-name-field) {
  flex: 1;
}

.intake-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1rem;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.5rem;
  cursor: pointer;
  user-select: none;
  background: #1c1917;
  transition: background 0.15s;
}
.section-header:hover {
  background: #252220;
}
.section-header h2 {
  margin: 0;
  font-size: 0.82rem;
  color: #c9a96e;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.section-header .chevron {
  font-size: 0.8rem;
  color: rgba(201,169,110,0.55);
  transition: transform 0.2s;
}
.section-header .chevron.collapsed {
  transform: rotate(-90deg);
}

.section-body {
  padding: 0 1.5rem 1.5rem;
}
.section-body.collapsed {
  display: none;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.25rem;
}

.field-group {
  margin-bottom: 0;
}
.field-group label {
  margin-top: 0.75rem;
  margin-bottom: 0.3rem;
}
.field-group.full {
  grid-column: 1 / -1;
}

.toggle-switch {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.75rem 0;
  cursor: pointer;
}
.toggle-switch input[type="checkbox"] {
  display: none;
}
.toggle-switch .slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--border);
  border-radius: 12px;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle-switch .slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--surface);
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .slider {
  background: var(--primary);
}
.toggle-switch input:checked + .slider::after {
  transform: translateX(20px);
}
.toggle-switch .toggle-label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.co-fields {
  display: none;
}
.co-fields.visible {
  display: block;
}

.coverage-card {
  position: relative;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
}
.coverage-card .remove-coverage {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: none;
  border: none;
  color: var(--danger);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  line-height: 1;
  border-radius: 4px;
}
.coverage-card .remove-coverage:hover {
  background: rgba(192, 57, 43, 0.1);
}

.add-coverage-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.sticky-footer {
  position: fixed;
  bottom: 0;
  left: 220px;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.75rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  z-index: 100;
  transition: left 0.2s;
}
.admin-main.sb-collapsed ~ * .sticky-footer,
main.sb-collapsed .sticky-footer { left: 60px; }
.footer-left {
  display: flex;
  gap: 0.75rem;
}
.footer-right {
  display: flex;
  gap: 0.75rem;
}
.btn-print {
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
}
.btn-print:hover {
  background: var(--primary);
  color: var(--primary-text);
  border-color: var(--primary);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.06);
}

.toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: var(--success);
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9rem;
  z-index: 200;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.upload-section {
  margin-bottom: 1.5rem;
}
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  background: var(--surface);
  transition: all 0.2s;
  cursor: pointer;
}
.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--primary);
  background: rgba(223, 192, 158, 0.08);
}
.upload-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}
.upload-area p {
  margin: 0.3rem 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.upload-hint {
  font-size: 0.8rem !important;
  color: var(--muted);
  margin-top: 0.5rem !important;
}
.upload-btn-label {
  display: inline-block;
  margin: 0.5rem 0;
  cursor: pointer;
}
.documents-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.documents-table th {
  background: #1c1917;
  padding: 0.55rem 0.8rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #c9a96e;
  border-bottom: 1px solid rgba(201,169,110,0.15);
}
.documents-table td {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  font-size: 0.85rem;
}
.documents-table a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 500;
}
.documents-table a:hover {
  text-decoration: underline;
}
/* Tab document section */
.tab-doc-section {
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
  padding-top: 0.25rem;
}
/* Doc type badges */
.doc-type-badge {
  display: inline-block;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.doc-type-drivers-license { background: rgba(59,130,246,0.12); color: #2563eb; }
.doc-type-ownership       { background: rgba(16,185,129,0.12); color: #059669; }
.doc-type-insurance       { background: rgba(245,158,11,0.12); color: #b45309; }
.doc-type-hard-copies     { background: rgba(107,114,128,0.12); color: #4b5563; }
.btn-sm {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  border-radius: var(--radius);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
  border: none;
  cursor: pointer;
}
.btn-danger:hover {
  background: #c9302c;
}

.detail-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.tab-bar {
  display: flex;
  gap: 0;
  border-bottom: none;
  margin-top: 0.75rem;
  margin-bottom: 0;
  background: transparent;
  overflow-x: hidden;
}
.tab-btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: var(--radius) var(--radius) 0 0;
  color: var(--primary-text);
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  position: relative;
  top: 1px;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.06);
  white-space: nowrap;
  text-transform: uppercase;
  transition: all 0.2s;
  margin-bottom: -2px;
  text-align: center;
}
.tab-btn:hover { color: var(--text); background: rgba(201,169,110,0.15); }
.tab-btn.active {
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom: 1px solid var(--surface);
  box-shadow: 0 -3px 6px rgba(0,0,0,0.08);
  z-index: 1;
}
.tab-content {
  display: none;
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.25rem 1.5rem;
  margin-top: 0;
}
.tab-content.active { display: block; }
.sec-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 0.75rem;
  overflow: hidden;
}
.sec-panel-hdr {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  text-align: left;
  gap: 0.5rem;
  transition: background 0.15s;
}
.sec-panel-hdr:hover { background: var(--surface2); }
.tab-ind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
  margin-left: 5px;
  transition: background 0.2s, color 0.2s;
}
.tab-ind-ok  { color: #4ade80; background: rgba(74,222,128,0.18); }
.tab-ind-err { color: #f87171; background: rgba(248,113,113,0.18); }

.messages-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.messages-table th, .messages-table td {
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.messages-table th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.messages-table tr:hover td { background: var(--surface2); }

/* Two-column layout */
.two-col-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 2.5rem;
  align-items: start;
}
.three-col-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
.col-vehicle, .col-deal, .col-lender, .col-account {
  min-width: 0;
}
.two-col-layout.applicant-layout {
  grid-template-columns: 1fr 1fr;
}
.col-left, .col-right {
  min-width: 0;
  max-width: 420px;
}
.applicant-layout .col-left,
.applicant-layout .col-right {
  max-width: none;
}
.field-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.field-stack .field-group {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0;
}
.field-stack .field-group label {
  margin: 0;
  min-width: 140px;
  flex-shrink: 0;
  font-size: 0.82rem;
  white-space: nowrap;
}
.field-stack .field-group input,
.field-stack .field-group select {
  flex: 1;
  min-width: 0;
  padding: 0.45rem 0.6rem;
  font-size: 0.85rem;
  text-align: right;
  background: var(--surface);
  border: 1px solid var(--border);
}
.field-stack .field-group input[type="date"] {
  text-align: left;
}
.field-stack .field-group input[type="text"] {
  text-align: left;
}
.field-stack .field-group select {
  text-align: left;
}
.field-stack .field-group input[readonly] {
  background: var(--surface2);
  font-weight: 600;
}
.field-stack .field-group.calc-result {
  border-top: 1px dashed var(--border);
  margin-top: 2px;
}
.field-stack .field-group.calc-grand {
  border-top: 2px solid var(--primary);
  padding-top: 0.5rem;
}
.field-stack .field-group.calc-grand label {
  font-weight: 700;
}
.field-stack .field-group.calc-grand input {
  font-weight: 700;
}
.field-stack .field-group .radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}
.field-stack .field-group .radio-group .radio-label {
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
  flex: none;
}
.field-stack .field-group .radio-group .radio-label input[type="radio"] {
  flex: none;
  width: auto;
  min-width: auto;
}
.field-row {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0;
  align-items: center;
}
.field-row .field-group {
  flex: 1;
  min-width: 0;
  border-bottom: none;
  padding: 0;
}
.field-row .field-group label {
  min-width: 60px;
  font-size: 0.78rem;
}
.field-row .field-group input {
  max-width: 120px;
}
.subsection-title-sm {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 1.25rem;
  margin-bottom: 0.15rem;
  padding-bottom: 0.35rem;
  border-bottom: 2px solid var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.field-note {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* Line Items (Taxable / Non-Taxable) */
.ledger-block {
  margin-top: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem;
  background: var(--surface);
}
.ledger-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}
.ledger-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.2rem 0;
}
.ledger-row label {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
}
.ledger-row input, .ledger-row select {
  width: 120px;
  flex-shrink: 0;
  text-align: right;
  font-size: 0.8rem;
  padding: 0.25rem 0.4rem;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--surface);
}
.ledger-row input[readonly] {
  background: var(--surface2);
  font-weight: 600;
}
.ledger-row.ledger-add label { color: var(--success); }
.ledger-row.ledger-sub label { color: var(--danger); }
.ledger-row.ledger-total {
  border-top: 1px solid var(--border);
  padding-top: 0.35rem;
  margin-top: 0.15rem;
}
.ledger-row.ledger-total label { font-weight: 700; }
.ledger-row.ledger-grand {
  border-top: 2px solid var(--primary);
  padding-top: 0.5rem;
  margin-top: 0.35rem;
}
.ledger-row.ledger-grand label { font-weight: 700; font-size: 0.9rem; }
.ledger-row.ledger-grand input { font-weight: 700; font-size: 0.9rem; }
.ledger-divider {
  border-top: 1px dashed var(--border);
  margin: 0.5rem 0;
}
.ledger-label-sm {
  font-size: 0.8rem;
  color: var(--success);
  font-weight: 600;
}
.deal-type-section { margin-top: 0.5rem; }
.line-items-section {
  margin-top: 1rem;
}
.line-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}
.line-items-header .subsection-title-sm {
  margin: 0;
  border: none;
  padding: 0;
}
.btn-add-line {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  background: var(--surface);
  color: var(--primary);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-add-line:hover {
  background: var(--primary);
  color: #fff;
}
.line-item-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}
.line-item-row input[type="text"] {
  flex: 2;
  max-width: none;
  text-align: left;
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
}
.line-item-row input[type="number"] {
  flex: 1;
  max-width: 110px;
  text-align: right;
  padding: 0.4rem 0.5rem;
  font-size: 0.85rem;
}
.line-item-tax-cb {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.line-item-tax-cb input[type="checkbox"] {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
  cursor: pointer;
}
.btn-remove-line {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--danger);
  padding: 0.2rem;
  border-radius: 4px;
  transition: background 0.2s;
  line-height: 1;
}
.btn-remove-line:hover {
  background: rgba(192, 57, 43, 0.1);
}

/* Radio group for payment frequency */
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.35rem 0;
}
.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  margin: 0;
  flex: none;
}
.radio-label input[type="radio"] {
  width: auto;
  margin: 0;
}

@media (max-width: 900px) {
  .two-col-layout,
  .three-col-layout {
    grid-template-columns: 1fr;
  }
  .col-left, .col-right, .col-lender, .col-vehicle, .col-deal, .col-account {
    max-width: 100%;
  }
}

.paid-in-full-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  margin-top: 0.5rem;
  background: rgba(46,204,113,0.1);
  border: 2px solid var(--success);
  border-radius: 8px;
  min-height: 120px;
}
.paid-in-full-banner span {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--success);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--border);
  border-radius: 22px;
  transition: 0.3s;
}
.toggle-slider::before {
  content: "";
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: var(--surface);
  border-radius: 50%;
  transition: 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--accent);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
}
/* Vehicle Protections layout */
.vp-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  background: var(--surface2);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.vp-details-grid .field-group {
  margin-bottom: 0;
}
.vp-details-grid .field-group label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
  margin-bottom: 4px;
  display: block;
}
.vp-details-grid .field-group input,
.vp-details-grid .field-group select {
  width: 100%;
  padding: 6px 10px;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}
.vp-extra-provider {
  margin-top: 8px;
}
.vp-extra-provider .vp-details-grid {
  margin-bottom: 0;
}
.vp-remove-provider-btn {
  padding: 0.4rem 1rem;
  font-size: 0.8rem;
  white-space: nowrap;
}
.vp-categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.vp-category-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface);
}
.vp-category-header {
  background: #1c1917;
  padding: 10px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #c9a96e;
  border-bottom: 1px solid rgba(201,169,110,0.15);
}
.vp-category-body {
  padding: 12px 16px;
}
.vp-category-body .field-stack .field-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0;
  margin-bottom: 0;
}
.vp-category-body .field-stack .field-group:last-child {
  border-bottom: none;
}
.vp-category-body .field-stack .field-group label {
  font-size: 0.78rem;
  color: var(--muted);
  min-width: 80px;
  flex-shrink: 0;
  margin: 0;
}
.vp-category-body .field-stack .field-group input,
.vp-category-body .field-stack .field-group select,
.vp-category-body .field-stack .field-group textarea {
  flex: 1;
  padding: 5px 8px;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}
.vp-add-btn {
  margin-top: 10px;
  font-size: 12px;
  padding: 4px 14px;
}
.vp-na-label {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  margin-left: 8px;
}
.expiry-label {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}
@media (max-width: 900px) {
  .vp-categories {
    grid-template-columns: 1fr;
  }
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 0;
}
.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
}
.checkbox-expiry-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.checkbox-expiry-row:last-of-type {
  border-bottom: none;
}
.checkbox-expiry-row .checkbox-row {
  min-width: 150px;
}
.expiry-field {
  display: flex;
  align-items: center;
  gap: 6px;
}
.expiry-field input[type="date"] {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.um-page { max-width: 700px; margin: 0 auto; padding: 1rem 0; }
.um-header { margin-bottom: 1.5rem; }
.um-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0; }
.um-alert {
  padding: 0.65rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}
.um-alert-success { background: rgba(46,204,113,0.12); color: #2ecc71; border: 1px solid rgba(46,204,113,0.3); }
.um-alert-error { background: rgba(231,76,60,0.12); color: #e74c3c; border: 1px solid rgba(231,76,60,0.3); }
.um-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.um-add-section { border: 1px dashed var(--border); background: var(--surface2); }
.um-section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  padding: 0.75rem 1.25rem;
  margin: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.um-count {
  font-size: 0.7rem;
  font-weight: 600;
  background: var(--primary);
  color: var(--primary-text);
  padding: 0.1rem 0.5rem;
  border-radius: 10px;
}
.um-add-form { padding: 1rem 1.25rem; }
.um-add-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}
.um-add-row:last-child { margin-bottom: 0; }
.um-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  background: var(--surface);
  flex: 1;
  min-width: 140px;
  text-transform: none;
}
.um-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.85rem;
  background: var(--surface);
  text-transform: none;
  min-width: 90px;
}
.um-input-wide { flex: 2; }
.um-add-btn { padding: 0.5rem 1.25rem; font-size: 0.85rem; border-radius: 6px; white-space: nowrap; }
.um-list { }
.um-name { font-size: 0.92rem; font-weight: 600; color: var(--text); }
.um-no-name { color: var(--text-muted); font-style: italic; font-weight: 400; }
.um-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
}
.um-card:last-child { border-bottom: none; }
.um-card-info { display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.um-email { font-size: 0.88rem; font-weight: 500; color: var(--text); word-break: break-all; }
.um-meta { font-size: 0.75rem; color: var(--text-muted); }
.um-card-actions { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.um-reset-form { display: flex; align-items: center; gap: 0.35rem; }
.um-pw-input {
  width: 130px;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  font-size: 0.8rem;
  background: var(--surface2);
  text-transform: none;
}
.um-btn { padding: 0.35rem 0.75rem; font-size: 0.78rem; border-radius: 5px; }
.um-delete-form { margin: 0; }
.um-empty { padding: 1.5rem 1.25rem; color: var(--text-muted); font-size: 0.85rem; font-style: italic; }

.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
/* ── Pipeline stat row ───────────────────────────────────── */
.stat-pipeline-row {
  display: flex;
  gap: 0.65rem;
  margin-bottom: 1.5rem;
  align-items: stretch;
}
.stat-pipeline {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex: 1;
  overflow: hidden;
}
.stat-pipe-item {
  flex: 1;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
}
.stat-pipe-divider {
  width: 1px;
  background: var(--border);
  flex-shrink: 0;
  margin: 0.75rem 0;
}
.stat-pipe-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-bottom: 0.25rem;
}
.stat-pipe-val {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-pipe-label {
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.stat-secondary-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 130px;
}
.stat-secondary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.38rem 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex: 1;
}
.stat-secondary-val {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.stat-secondary-label {
  font-size: 0.67rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  text-align: center;
  border-left: 3px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  transition: box-shadow 0.15s;
}
.stat-card:hover { box-shadow: 0 3px 10px rgba(0,0,0,0.08); }
.stat-card.stat-wide {
  grid-column: span 2;
  text-align: left;
}
.stat-value {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-top: 0.25rem;
  font-weight: 600;
}
.stat-new  { border-left-color: #c9a96e; }
.stat-claimed { border-left-color: #2563eb; }
.stat-awaiting { border-left-color: #d97706; }
.stat-incomplete { border-left-color: #e74c3c; }
.stat-completed { border-left-color: #16a34a; }
.stat-new .stat-value { color: #c9a96e; }
.stat-claimed .stat-value { color: #2563eb; }
.stat-awaiting .stat-value { color: #d97706; }
.stat-incomplete .stat-value { color: #e74c3c; }
.stat-completed .stat-value { color: #16a34a; }
.stat-staff {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Dashboard page styling */
.dashboard-header {
  margin-bottom: 2rem;
}

.dashboard-header h1 {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.dashboard-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  font-weight: 500;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
  gap: 2.5rem;
  margin-bottom: 2rem;
}

.dash-stats-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.75rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.stats-section-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 1.25rem;
  letter-spacing: -0.01em;
}

/* Dashboard sidebar layout */
.dashboard-page {
  display: flex;
  height: calc(100vh - 54px);
}

.dashboard-sidebar {
  width: 240px;
  min-width: 240px;
  background: linear-gradient(180deg, #0f0d0a 0%, #1a1410 100%);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 10;
  scrollbar-width: none;
  border-right: 1px solid rgba(201,169,110,0.12);
}

.dashboard-sidebar::-webkit-scrollbar {
  display: none;
}

.dashboard-sidebar-top {
  padding: 1.75rem 1.25rem 1.25rem;
  border-bottom: 1px solid rgba(201,169,110,0.12);
}

.dashboard-sidebar-brand {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #c9a96e;
  margin-bottom: 0.5rem;
  margin-top: 1rem;
}

.dashboard-sidebar-subtitle {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 0.04em;
  margin-bottom: 1.25rem;
}

.dashboard-nav {
  flex: 1;
  padding: 1rem 0;
}

.dashboard-nav-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  color: rgba(255,255,255,0.38);
  text-decoration: none;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-left: 2px solid transparent;
  transition: all 0.2s;
}

.dashboard-nav-item:hover {
  color: rgba(255,255,255,0.7);
  border-left-color: rgba(201,169,110,0.3);
}

.dashboard-nav-item.active {
  color: #c9a96e;
  border-left-color: #c9a96e;
  background: rgba(201,169,110,0.08);
}

.dashboard-sidebar-foot {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(201,169,110,0.12);
}

.dashboard-toggle-btn {
  width: 100%;
  padding: 0.65rem;
  background: rgba(201,169,110,0.1);
  border: 1px solid rgba(201,169,110,0.3);
  color: #c9a96e;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.dashboard-toggle-btn:hover {
  background: rgba(201,169,110,0.2);
  border-color: rgba(201,169,110,0.5);
}

.dashboard-main {
  flex: 1;
  overflow-y: auto;
  background: var(--bg);
  padding: 2rem;
}

.dashboard-section {
  margin-bottom: 3rem;
  scroll-margin-top: 2rem;
}

.dashboard-section:last-child {
  margin-bottom: 0;
}

/* Responsive: collapse sidebar on mobile */
@media (max-width: 768px) {
  .dashboard-sidebar {
    position: absolute;
    left: 0;
    top: 54px;
    height: calc(100vh - 54px);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 100;
  }

  .dashboard-sidebar.open {
    transform: translateX(0);
  }

  .dashboard-page {
    position: relative;
  }

  .dashboard-main {
    padding: 1.5rem;
  }
}

.stat-staff-item {
  font-size: 0.78rem;
  color: var(--text);
  background: var(--surface2);
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
}

.sub-page { max-width: 100%; padding: 0 1rem; }
.sub-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.sub-title { font-size: 1.5rem; font-weight: 700; margin: 0; }
.sub-toolbar-actions { display: flex; gap: 0.5rem; }
.sub-sync-form { margin: 0; }

.sub-add-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
}
.sub-add-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem;
}
.sub-add-input {
  padding: 0.5rem 0.75rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 0.85rem;
}
.sub-add-input:focus {
  outline: none;
  border-color: var(--primary);
}

.sub-pipeline {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.sub-pipeline-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.sub-pipeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.sub-pipeline-header h3 {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  margin: 0;
}
.sub-pipeline-count {
  background: var(--primary);
  color: var(--primary-text);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 10px;
}
.sub-pipeline-cards { padding: 0.5rem; }
.sub-pipeline-empty {
  padding: 1rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
}

.sub-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s;
}
.sub-card:last-child { margin-bottom: 0; }
.sub-card:hover { border-color: var(--primary); }
.sub-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}
.sub-card-info { display: flex; flex-direction: column; gap: 0.15rem; }
.sub-card-name { font-weight: 600; font-size: 0.9rem; color: var(--text); }
.sub-card-email { font-size: 0.78rem; color: var(--text-muted); }
.sub-card-pkg {
  font-size: 0.72rem;
  color: var(--primary);
  font-weight: 500;
}
.sub-card-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}
.sub-card-staff {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.sub-card-date {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.sub-card-vehicle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
}
.sub-vin { font-family: monospace; font-size: 0.76rem; letter-spacing: 0.03em; }
.sub-card-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}
.sub-action-form { margin: 0; }
.sub-action-btn {
  padding: 0.25rem 0.65rem;
  font-size: 0.72rem;
  border-radius: 5px;
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: opacity 0.15s;
}
.sub-action-btn:hover { opacity: 0.85; }
.sub-btn-progress { background: #5dade2; color: #fff; }
.sub-btn-awaiting { background: #f39c12; color: #fff; }
.sub-btn-complete { background: var(--success); color: #fff; }

.sub-status {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sub-status-new { background: rgba(201,169,110,0.15); color: #9a6f3a; }
.sub-status-claimed { background: rgba(37,99,235,0.1); color: #1d4ed8; }
.sub-status-progress { background: rgba(37,99,235,0.1); color: #1d4ed8; }
.sub-status-awaiting { background: rgba(217,119,6,0.1); color: #b45309; }
.sub-status-completed { background: rgba(22,163,74,0.1); color: #15803d; }

.sub-detail-hidden { display: none; }
.sub-card-details {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}
.sub-card-details p { margin-bottom: 0.4rem; font-size: 0.82rem; }
.sub-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-top: 0.4rem;
}
.sub-detail-label {
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.25rem 0.6rem 0.25rem 0;
  white-space: nowrap;
  width: 150px;
  vertical-align: top;
  text-transform: capitalize;
}
.sub-detail-value {
  padding: 0.25rem 0;
  color: var(--text);
  word-break: break-word;
}

@media (max-width: 768px) {
  .um-card { flex-direction: column; align-items: flex-start; }
  .um-card-actions { width: 100%; }
  .um-add-row { flex-direction: column; align-items: stretch; }
  .um-input, .um-select { width: 100%; }
  .um-input-wide { flex: 1; }
  .sub-page { padding: 0; }
  .top-nav { padding: 0.5rem 1rem; }
  .nav-logo { height: 28px; }
  .nav-right { gap: 0.5rem; }
  .nav-role-badge { font-size: 0.6rem; padding: 0.15rem 0.5rem; }
  .dash-top-bar { flex-direction: column; align-items: stretch; }
  .dash-search-form { flex-wrap: wrap; margin-left: 0; }
  .search-input { width: 100%; flex: 1; }
}
@media (max-width: 600px) {
  main { padding: 1rem; }
  .top-nav { padding: 0.4rem 0.75rem; }
  .detail-grid { grid-template-columns: 1fr; }
  .auth-container { margin: 4vh 1rem; padding: 1.5rem; }
  .form-container { padding: 1.5rem; }
  .field-grid { grid-template-columns: 1fr; }
  .section-header { padding: 0.75rem 1rem; }
  .section-body { padding: 0 1rem 1rem; }
  .sticky-footer { padding: 0.75rem 1rem; }
  .active-sub-staff-col { display: none; }
}

/* ============================================================
   ACTIVE SUBMISSIONS PANEL
   ============================================================ */
.active-subs-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.active-subs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.active-subs-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
}
.active-subs-count {
  background: var(--primary);
  color: var(--primary-text);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.5rem;
  border-radius: 10px;
  min-width: 1.4rem;
  text-align: center;
}
.active-subs-empty {
  padding: 0.9rem 1rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-style: italic;
}
.active-subs-list { }
.active-sub-header-row {
  display: grid;
  grid-template-columns: 14px 1fr 180px 130px 80px;
  gap: 0.75rem;
  padding: 0.4rem 1rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.active-subs-list:not(.is-admin) .active-sub-header-row {
  grid-template-columns: 14px 1fr 180px 80px;
}
.active-sub-row {
  display: grid;
  grid-template-columns: 14px 1fr 180px 130px 80px;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.active-sub-row:last-child { border-bottom: none; }
.active-sub-row:hover { background: var(--surface2); }
.active-subs-list:not(.is-admin) .active-sub-row {
  grid-template-columns: 14px 1fr 180px 80px;
}

/* Pulsing dot indicator */
.active-sub-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.5s;
}
.active-sub-dot.timer-green {
  background: #2ecc71;
  box-shadow: 0 0 0 0 rgba(46,204,113,0.5);
  animation: pulse-green 2.5s ease-in-out infinite;
}
.active-sub-dot.timer-yellow {
  background: #f39c12;
  box-shadow: 0 0 6px rgba(243,156,18,0.4);
  animation: pulse-yellow 2s ease-in-out infinite;
}
.active-sub-dot.timer-red {
  background: #e74c3c;
  box-shadow: 0 0 0 0 rgba(231,76,60,0.5);
  animation: pulse-red 1.2s ease-in-out infinite;
}
@keyframes pulse-green {
  0%,100% { box-shadow: 0 0 0 0 rgba(46,204,113,0.4); }
  50% { box-shadow: 0 0 0 5px rgba(46,204,113,0); }
}
@keyframes pulse-yellow {
  0%,100% { box-shadow: 0 0 4px rgba(243,156,18,0.3); }
  50% { box-shadow: 0 0 8px rgba(243,156,18,0.6); }
}
@keyframes pulse-red {
  0%,100% { box-shadow: 0 0 0 0 rgba(231,76,60,0.5); }
  50% { box-shadow: 0 0 0 6px rgba(231,76,60,0); }
}

.active-sub-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.active-sub-name {
  font-weight: 600;
  font-size: 0.87rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active-sub-pkg {
  font-size: 0.7rem;
  color: var(--primary);
}
.active-sub-status-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.active-sub-staff-col {
  font-size: 0.78rem;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.active-sub-timer {
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  text-align: right;
  padding: 0.2rem 0.5rem;
  border-radius: 5px;
  white-space: nowrap;
  justify-self: end;
  transition: color 0.5s, background 0.5s;
}
.active-sub-timer.timer-green { color: #2ecc71; background: rgba(46,204,113,0.1); }
.active-sub-timer.timer-yellow { color: #f39c12; background: rgba(243,156,18,0.1); }
.active-sub-timer.timer-red { color: #e74c3c; background: rgba(231,76,60,0.12); }

/* ============================================================
   NOTIFICATION BANNER (staff alerts)
   ============================================================ */
.notif-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: rgba(243,156,18,0.1);
  border: 1px solid rgba(243,156,18,0.35);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}
.notif-icon {
  font-size: 1.1rem;
  color: #f39c12;
  flex-shrink: 0;
  line-height: 1.4;
}
.notif-content { flex: 1; }
.notif-item {
  font-size: 0.84rem;
  color: var(--text);
  line-height: 1.5;
}
.notif-item + .notif-item { margin-top: 0.3rem; }
.notif-item strong { color: #f39c12; }
.notif-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
  opacity: 0.7;
}
.notif-dismiss:hover { opacity: 1; color: var(--text); }

/* ============================================================
   SUBMISSIONS PIPELINE — DASHBOARD INTEGRATION
   ============================================================ */
.hidden { display: none !important; }

/* "New" unassigned dot — gold static */
.active-sub-dot.new-dot {
  background: var(--primary);
  box-shadow: 0 0 5px rgba(201,169,110,0.4);
  animation: none;
}

/* New-submission row highlight */
.new-sub-row {
  background: rgba(201,169,110,0.04);
}
.new-sub-row:hover { background: rgba(201,169,110,0.09); }

/* Status + inline action buttons column */
.active-sub-status-col {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}
.active-sub-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}
.btn-status-action {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-status-action:hover { background: var(--surface); color: var(--text); border-color: var(--text-muted); }
.btn-status-action.btn-status-await { border-color: rgba(243,156,18,0.3); color: #f39c12; }
.btn-status-action.btn-status-await:hover { background: rgba(243,156,18,0.1); }
.btn-status-action.btn-status-done { border-color: rgba(46,204,113,0.3); color: #2ecc71; }
.btn-status-action.btn-status-done:hover { background: rgba(46,204,113,0.1); }

/* Claim button column (replaces timer for new rows) */
.active-sub-claim { justify-self: end; }
.btn-sm-claim {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.7rem;
  border-radius: 5px;
  background: var(--primary);
  color: var(--primary-text);
  border: none;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: opacity 0.15s;
}
.btn-sm-claim:hover { opacity: 0.85; }

/* Admin toolbar controls (sync / add) */
.sub-dash-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-sm-ctrl {
  font-size: 0.72rem !important;
  padding: 0.22rem 0.65rem !important;
  border-radius: 5px !important;
}

/* Collapsible add-submission form inside the panel */
.dash-add-form {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(201,169,110,0.04);
}
.dash-add-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}
@media (max-width: 720px) {
  .dash-add-grid { grid-template-columns: 1fr 1fr; }
}

/* Completed submissions summary bar */
.sub-completed-bar {
  padding: 0.55rem 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ============================================================
   SUBMISSIONS PIPELINE — 3-SECTION LAYOUT
   ============================================================ */
.pipe-panel {
  background: #ffffff;
  border: 1px solid #e8e5e1;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
}
.pipe-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: #ffffff;
  border-bottom: 1px solid #edeae6;
}
.pipe-panel-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #3a3630;
}

/* Section blocks */
.pipe-section {
  border-top: 1px solid var(--border);
}
.pipe-section:first-of-type { border-top: none; }
.pipe-section-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 1rem;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.pipe-label-new  { background: rgba(201,169,110,0.08); color: #c9a96e; border-bottom: 1px solid rgba(201,169,110,0.2); }
.pipe-label-active { background: rgba(37,99,235,0.08); color: #6b9fff; border-bottom: 1px solid rgba(37,99,235,0.2); }
.pipe-label-done { background: rgba(22,163,74,0.08); color: #4ade80; border-bottom: 1px solid rgba(22,163,74,0.2); }
.pipe-section-count {
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(255,255,255,0.07);
  padding: 0.1rem 0.45rem;
  border-radius: 8px;
}
.pipe-empty-msg {
  padding: 0.6rem 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
}

/* Row base */
.pipe-row {
  display: grid;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.1s;
}
.pipe-row:last-child { border-bottom: none; }
.pipe-row:hover { background: var(--surface2); }

/* NEW rows: dot / info / date / claim-btn / timer */
.pipe-row-new  { grid-template-columns: 10px 1fr auto auto auto; }
/* ACTIVE rows: dot / info / staff / status-badge / timer */
.pipe-row-active { grid-template-columns: 10px 1fr 140px auto auto; }
/* DONE rows: dot / info / date / done-badge */
.pipe-row-done { grid-template-columns: 10px 1fr auto auto; }

/* Dot */
.pipe-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pipe-dot.new-dot {
  background: var(--primary);
  box-shadow: 0 0 5px rgba(201,169,110,0.5);
}
.pipe-dot.timer-green {
  background: #2ecc71;
  animation: pulse-green 2.5s ease-in-out infinite;
}
.pipe-dot.timer-yellow {
  background: #f39c12;
  animation: pulse-yellow 2s ease-in-out infinite;
}
.pipe-dot.timer-red {
  background: #e74c3c;
  animation: pulse-red 1.2s ease-in-out infinite;
}
.pipe-dot.pipe-dot-done {
  background: #2ecc71;
  opacity: 0.5;
}

/* Info */
.pipe-info {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}
.pipe-name {
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pipe-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pipe-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Status badge */
.pipe-status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.2rem 0.55rem;
  border-radius: 5px;
  white-space: nowrap;
}
.pipe-badge-claimed        { background: rgba(37,99,235,0.1);   color: #1d4ed8; }
.pipe-badge-in_progress    { background: rgba(109,40,217,0.1);  color: #6d28d9; }
.pipe-badge-awaiting_client{ background: rgba(217,119,6,0.1);   color: #b45309; }

/* Timer */
.pipe-timer {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.18rem 0.45rem;
  border-radius: 5px;
  white-space: nowrap;
  text-align: right;
}
.pipe-timer.timer-green  { color: #2ecc71; background: rgba(46,204,113,0.1); }
.pipe-timer.timer-yellow { color: #f39c12; background: rgba(243,156,18,0.1); }
.pipe-timer.timer-red    { color: #e74c3c; background: rgba(231,76,60,0.12); }

/* Timer columns */
.pipe-timer-col {
  justify-self: end;
  display: flex;
  align-items: center;
}
.claimed-timer-col {
  white-space: nowrap;
  text-align: right;
}

/* Action area */
.pipe-actions { display: flex; gap: 0.35rem; justify-content: flex-end; }
.pipe-claim-col { 
  justify-self: end; 
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.pipe-claim-col form {
  display: inline;
}

/* Claim button */
.btn-pipe-claim {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.28rem 0.8rem;
  border-radius: 5px;
  background: var(--primary);
  color: #1a1a1e;
  border: none;
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: opacity 0.15s;
}
.btn-pipe-claim:hover { opacity: 0.82; }

/* Mark Complete button */
.btn-pipe-complete {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  border: 1px solid rgba(46,204,113,0.3);
  background: rgba(46,204,113,0.08);
  color: #2ecc71;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-pipe-complete:hover { background: rgba(46,204,113,0.18); }

/* Done badge */
.pipe-done-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #2ecc71;
  background: rgba(46,204,113,0.1);
  padding: 0.18rem 0.5rem;
  border-radius: 5px;
  white-space: nowrap;
}

/* Staff name column (In Progress rows) */
.pipe-staff-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Complete section table — fits inside pipe-panel without double borders */
.comp-table-wrapper {
  margin: 0;
  border-radius: 0;
  border: none;
  border-top: none;
}
.comp-table-wrapper .clients-table { border-radius: 0; }
.comp-table-wrapper .clients-table thead th:first-child { border-radius: 0; }
.comp-table-wrapper .clients-table thead th:last-child  { border-radius: 0; }

/* ============================================================
   PIPELINE VERTICAL STACK (Submissions → Claimed → Complete)
   ============================================================ */
.pipe-stack {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.pipe-stage {
  display: flex;
  flex-direction: column;
}
.pipe-stage-body {
  padding: 0;
}
.pipe-stage-arrow {
  text-align: center;
  font-size: 1.1rem;
  color: var(--primary);
  padding: 0.15rem 0;
  background: var(--surface2);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  letter-spacing: 0.05em;
  user-select: none;
}
.pipe-section-complete {
  border-top: 1px solid var(--border);
}

/* ============================================================
   SETUP LINKS PAGE
   ============================================================ */
.sl-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  margin: 1.5rem auto;
  max-width: 860px;
}
.sl-result-panel {
  border-color: var(--primary);
  background: #fdfaf5;
}
.sl-heading {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 1.1rem;
  letter-spacing: 0.01em;
}
.sl-result-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 0.4rem;
}
.sl-result-meta {
  font-size: 0.88rem;
  color: var(--text);
  margin: 0 0 0.9rem;
}
.sl-flash {
  font-size: 0.88rem;
  padding: 0.55rem 0.9rem;
  border-radius: 6px;
  margin-bottom: 1rem;
}
.sl-flash-ok   { background: #edfbf3; color: #166534; border: 1px solid #bbf7d0; }
.sl-flash-warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.sl-flash-error{ background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.sl-form { display: flex; flex-direction: column; gap: 0.85rem; }
.sl-form-row { display: flex; flex-direction: column; gap: 0.3rem; }
.sl-label { font-size: 0.82rem; font-weight: 600; color: var(--text); }
.sl-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
  width: 100%;
  max-width: 420px;
  box-sizing: border-box;
}
.sl-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(201,169,110,0.2); }
.sl-submit-btn { align-self: flex-start; margin-top: 0.2rem; }
.sl-link-box {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.sl-link-input {
  flex: 1;
  padding: 0.48rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.83rem;
  background: var(--surface2);
  color: var(--text);
  min-width: 0;
}
.sl-copy-btn, .sl-email-btn { white-space: nowrap; }
.sl-email-form { margin-top: 0.1rem; }
.sl-empty { color: #888; font-size: 0.9rem; }
.sl-table .sl-action-cell { display: flex; gap: 0.4rem; align-items: center; }
.btn-xs { font-size: 0.78rem !important; padding: 0.25rem 0.65rem !important; }

/* Source badges (Wix / Manual) */
.sl-source-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.55rem;
  border-radius: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.sl-source-wix    { background: #e8f0fe; color: #1a56db; }
.sl-source-manual { background: var(--surface2); color: #6b7280; }

/* Webhook URL display box */
.sl-webhook-url-box {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.6rem;
  padding: 0.75rem 1rem;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.sl-webhook-url {
  font-size: 0.83rem;
  color: var(--text);
  word-break: break-all;
  flex: 1;
}

/* Warn badge for webhook errors */
.badge-warn { background: #fff7ed; color: #92400e; border: 1px solid #fde68a; }

/* ============================================================
   ONBOARDING SUBMISSIONS PANEL
   ============================================================ */
.ob-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 1.5rem;
  overflow: hidden;
}
.ob-panel-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.ob-panel-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}
.ob-count {
  font-size: 0.78rem;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  border-radius: 20px;
  padding: 0.1rem 0.55rem;
  min-width: 22px;
  text-align: center;
}
.ob-empty {
  color: #888;
  font-size: 0.9rem;
  padding: 1rem 1.25rem;
  margin: 0;
}
.ob-status-form {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}
.ob-status-select {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  color: var(--text);
}

/* ── Claimed IQ Table ── */
.claimed-table-wrapper { margin: 0; }
.claimed-table { width: 100%; }
.claimed-table thead th {
  background: #1c1917;
  color: #c9a96e;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 9px 12px;
  white-space: nowrap;
  border-right: 1px solid rgba(201,169,110,0.1);
}
.claimed-table tbody tr:hover { background: var(--surface2); }
.claimed-table td {
  padding: 9px 12px;
  font-size: 0.82rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  white-space: nowrap;
}
.claimed-iq {
  font-weight: 700;
  font-family: monospace;
  color: var(--gold);
  font-size: 0.8rem !important;
}
.claimed-vin {
  font-family: monospace;
  font-size: 0.78rem !important;
  color: var(--text-muted);
}
.claimed-actions { width: 1px; padding-right: 14px !important; }
.claimed-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

/* Delete Modal */
.delete-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.delete-modal-content {
  background: var(--surface);
  padding: 2rem;
  border-radius: var(--radius);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  max-width: 400px;
  width: 90%;
  border: 1px solid var(--border);
}

.delete-modal-content h2 {
  margin-bottom: 0.75rem;
  color: var(--text);
}

.delete-modal-content p {
  margin-bottom: 1rem;
  color: var(--text-muted);
}

/* ── View Modal ─────────────────────────────────────────── */
.view-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(2px);
}

.view-modal-content {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.22);
  width: 92%;
  max-width: 720px;
  max-height: 92vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.view-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.5rem;
  border-bottom: 2px solid #c9a96e;
  background: var(--surface);
  border-radius: 12px 12px 0 0;
  position: sticky;
  top: 0;
  z-index: 2;
}

.vmo-header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.vmo-logo-text {
  font-size: 1.15rem;
  font-weight: 900;
  color: #c9a96e;
  letter-spacing: 0.5px;
  border-right: 2px solid var(--border);
  padding-right: 0.85rem;
}

.vmo-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.vmo-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2px;
}

.vmo-id {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}

.vmo-header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.btn-print-pdf {
  background: #c9a96e;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
  transition: background 0.15s;
}

.btn-print-pdf:hover { background: #b8925a; }

.modal-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.modal-close:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--text-muted);
}

.view-modal-body {
  padding: 0;
  flex: 1;
}

/* ── Submission view body ────────────────────────────────── */
.vmo-body {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.vmo-section {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.vmo-section-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #c9a96e;
  padding: 0.55rem 1rem;
  background: rgba(201,169,110,0.07);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.vmo-section-icon { font-size: 0.9rem; }

.vmo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.vmo-field {
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.vmo-field:nth-child(even) { border-right: none; }
.vmo-field:nth-last-child(-n+2) { border-bottom: none; }
.vmo-field:only-child,
.vmo-grid:has(.vmo-field:only-child) .vmo-field { grid-column: 1 / -1; border-right: none; }

.vmo-field-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 2px;
}

.vmo-field-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.vmo-field-value:empty::before,
.vmo-field-value.empty { content: '—'; color: var(--text-muted); font-weight: 400; }

/* status badges used inside modal meta */
.sub-status-badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 4px;
}
.badge-new    { background: rgba(201,169,110,0.15); color: #c9a96e; }
.badge-claimed  { background: rgba(37,99,235,0.12); color: #2563eb; }
.badge-completed { background: rgba(22,163,74,0.12); color: #16a34a; }

/* legacy — keep for any other usage */
.submission-details { font-size: 0.9rem; }
.detail-section { margin-bottom: 2rem; }
.detail-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 0.75rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem; }
.detail-row { display: flex; padding: 0.5rem 0; border-bottom: 1px solid var(--surface2); }
.detail-row .label { font-weight: 600; min-width: 120px; color: var(--text-muted); }
.detail-row span:last-child { flex: 1; word-break: break-word; }
.raw-data { display: grid; grid-template-columns: 1fr; gap: 0.5rem; }
.raw-item { padding: 0.5rem; background: var(--surface2); border-radius: 4px; font-size: 0.85rem; }

.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1rem;
}

.doc-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.doc-thumbnail {
  width: 100px;
  height: 100px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: opacity 0.2s;
}

.doc-thumbnail:hover {
  opacity: 0.8;
}

.doc-file {
  font-size: 3rem;
  margin-bottom: 0.5rem;
}

.doc-name {
  font-size: 0.75rem;
  word-break: break-word;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

.doc-name a {
  color: var(--primary);
  text-decoration: none;
}

.doc-name a:hover {
  text-decoration: underline;
}

.btn-pipe-view {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.28rem 0.8rem;
  border-radius: 5px;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  cursor: pointer;
  letter-spacing: 0.03em;
  transition: opacity 0.15s, background 0.15s;
  margin-right: 0.4rem;
}

.btn-pipe-view:hover {
  background: var(--border);
  opacity: 0.9;
}

/* ══════════════════════════════════════════════════════════

/* ── Live section search + edit ── */
.comp-search-wrap {
  padding: 0.6rem 0.75rem 0.4rem;
}
.comp-search-input {
  width: 100%;
  max-width: 320px;
  padding: 0.4rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 0.85rem;
  outline: none;
  box-sizing: border-box;
}
.comp-search-input:focus {
  border-color: #c9a96e;
  box-shadow: 0 0 0 2px rgba(201,169,110,0.15);
}
.comp-edit-btn {
  font-size: 0.75rem !important;
  padding: 0.25rem 0.7rem !important;
  white-space: nowrap;
  background: #1c1917;
  color: #c9a96e;
  border: 1px solid rgba(201,169,110,0.4);
  border-radius: 5px;
  text-decoration: none;
  display: inline-block;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.comp-edit-btn:hover {
  background: #2d2620;
  border-color: #c9a96e;
  color: #e0c07a;
}
