:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #0ea5e9;
  --primary-dark: #0284c7;
  --primary-contrast: #ffffff;
  --danger: #ef4444;
  --success: #10b981;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* Navbar */
.navbar {
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.navbar-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 64px;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 32px;
  margin: 0;
  padding: 0;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
  cursor: pointer;
  font-size: 0.95rem;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Main Layout */
.page {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 24px;
  width: 100%;
}

.page-section {
  display: none;
}

.page-section.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section Headers */
.section-header {
  margin-bottom: 32px;
}

.section-header h2 {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
}

.section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
}

/* Hero Section */
.hero {
  padding: 0 0 32px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 32px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
}

.hero p {
  margin: 0;
  max-width: 600px;
  color: var(--muted);
  font-size: 1.1rem;
}

/* Dashboard Cards Grid */
.dashboard-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 32px;
}

.dashboard-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
}

.dashboard-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.dashboard-card h3 {
  margin: 0 0 12px;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
}

.dashboard-card p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.95rem;
}

/* Buttons */
.btn-primary {
  background: var(--primary);
  color: var(--primary-contrast);
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Card Grid */
.card-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  margin-top: 32px;
}

/* Cards */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 16px;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
}

.card p.minor {
  margin: 12px 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

/* Form Elements */
label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

input,
select {
  width: 100%;
  margin-bottom: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font: inherit;
  background: var(--bg);
  color: var(--text);
  transition: all 0.2s ease;
  font-size: 0.95rem;
}

input::placeholder {
  color: var(--muted);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--panel);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

button {
  width: 100%;
  margin-top: 8px;
  margin-bottom: 0;
  border-radius: 8px;
  border: none;
  padding: 11px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--primary);
  color: var(--primary-contrast);
  font-size: 0.95rem;
}

button:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  background: var(--muted);
  cursor: not-allowed;
  transform: none;
}

/* Checkbox */
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  margin-bottom: 12px;
  font-size: 0.95rem;
}

.checkbox input {
  width: auto;
  margin: 4px 0 0;
  padding: 0;
  cursor: pointer;
  border-radius: 4px;
}

/* Result Output */
.result {
  min-height: 48px;
  margin: 16px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0c4a6e;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.85rem;
  font-family: "Monaco", "Menlo", "Courier New", monospace;
  line-height: 1.5;
}

.result.error {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--danger);
}

form + .result {
  margin-bottom: 24px;
}

.hidden {
  display: none !important;
}

/* Footer */
.footer {
  background: var(--panel);
  border-top: 1px solid var(--line);
  padding: 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: auto;
  flex-shrink: 0;
}

.footer a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.footer a:hover {
  text-decoration: underline;
}

/* ── Auth Screen ──────────────────────────────────────────────────────────── */

.auth-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0ea5e9 100%);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  overflow-y: auto;
  padding: 48px 24px;
}

.auth-container {
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.auth-left {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.auth-brand {
  text-align: left;
  color: #ffffff;
}

.auth-logo {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -1px;
  color: #ffffff;
  margin-bottom: 8px;
}

.auth-tagline {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  margin: 0;
}

.auth-card {
  background: var(--panel);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
}

.auth-tab {
  flex: 1;
  padding: 14px 8px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 0;
  margin-top: 0;
  box-shadow: none;
  transform: none;
}

.auth-tab:hover {
  color: var(--primary);
  background: none;
  box-shadow: none;
  transform: none;
}

.auth-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: none;
  box-shadow: none;
  transform: none;
}

.auth-panel {
  display: none;
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

.auth-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

.auth-note {
  margin: 0 0 16px;
  padding: 10px 12px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: 8px;
  color: #0c4a6e;
  font-size: 0.9rem;
}

/* ── Nav User Area ─────────────────────────────────────────────────────────── */

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.nav-username {
  font-weight: 600;
  color: var(--text);
  font-size: 0.95rem;
}

.role-badge {
  background: var(--primary);
  color: var(--primary-contrast);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.btn-signout {
  width: auto;
  padding: 6px 14px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 500;
  box-shadow: none;
}

.btn-signout:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: var(--danger);
  transform: none;
  box-shadow: none;
}

/* ── Misc Fintech Components ───────────────────────────────────────────────── */

.badge-zero {
  display: inline-block;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  vertical-align: middle;
}

.notice-inline {
  margin: 0 0 16px;
  padding: 10px 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  color: #7c2d12;
  font-size: 0.88rem;
  font-weight: 400;
}

.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 20px 0;
}

textarea {
  width: 100%;
  margin-bottom: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  padding: 10px 12px;
  font: inherit;
  font-family: "Monaco", "Menlo", "Courier New", monospace;
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  transition: border-color 0.2s ease;
}

textarea:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--panel);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.1);
}

.btn-danger {
  background: var(--danger);
}

.btn-danger:hover {
  background: #dc2626;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar-container {
    padding: 0 16px;
  }

  .nav-links {
    gap: 16px;
    font-size: 0.9rem;
  }

  .page {
    padding: 24px 16px;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }

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

  .hero h1 {
    font-size: 1.8rem;
  }

  .section-header h2 {
    font-size: 1.5rem;
  }
}

/* ── Action Bar ──────────────────────────────────────────────────────────── */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 24px 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  min-width: 130px;
  transition: all 0.25s ease;
  box-shadow: var(--shadow);
  width: auto;
  margin: 0;
}

.action-btn:hover {
  border-color: var(--primary);
  background: #f0f9ff;
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.action-icon {
  font-size: 1.8rem;
  line-height: 1;
}

/* ── Info Banner ─────────────────────────────────────────────────────────── */
.info-banner {
  margin-top: 24px;
  padding: 14px 18px;
  border-radius: 10px;
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  color: #0c4a6e;
  font-size: 0.95rem;
  line-height: 1.6;
}

.info-banner.warning {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #7c2d12;
}

/* ── Admin Layout ────────────────────────────────────────────────────────── */
.section-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 16px;
}

.section-header-row h2 { margin: 0 0 6px; font-size: 2rem; font-weight: 700; }
.section-header-row p  { margin: 0; color: var(--muted); }

.btn-create {
  background: var(--primary);
  color: var(--primary-contrast);
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-size: 0.95rem;
  transition: all 0.2s;
  flex-shrink: 0;
  width: auto;
  margin: 0;
}
.btn-create:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: var(--shadow-lg); }

/* ── Admin Tabs ──────────────────────────────────────────────────────────── */
.admin-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 2px solid var(--line);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tab {
  padding: 10px 18px;
  border: none;
  background: none;
  color: var(--muted);
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  white-space: nowrap;
  font-size: 0.9rem;
  width: auto;
  border-radius: 0;
  box-shadow: none;
}
.admin-tab:hover { color: var(--primary); background: none; transform: none; box-shadow: none; }
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.admin-panel { display: none; }
.admin-panel.active { display: block; }

/* ── Data Grid ───────────────────────────────────────────────────────────── */
.grid-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.grid-count { font-size: 0.85rem; color: var(--muted); font-weight: 500; }

.btn-refresh {
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  width: auto;
  margin: 0;
}
.btn-refresh:hover { border-color: var(--primary); color: var(--primary); background: var(--panel); transform: none; box-shadow: none; }

.grid-wrapper {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.data-grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.data-grid th {
  background: #f8fafc;
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.data-grid td {
  padding: 10px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text);
  vertical-align: middle;
}

.data-grid tr:last-child td { border-bottom: none; }
.data-grid tbody tr:hover td { background: #f8fafc; }

.grid-placeholder td,
.grid-loading td   { text-align: center; padding: 32px; color: var(--muted); font-style: italic; }
.grid-error td     { text-align: center; padding: 32px; color: var(--danger); }

.cell-empty { color: var(--muted); font-style: italic; }
.badge-yes  { color: var(--success); font-weight: 600; }
.badge-no   { color: var(--muted); }

.actions-cell { white-space: nowrap; }

.btn-grid-edit,
.btn-grid-delete {
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  margin: 0 2px;
  width: auto;
  transition: all 0.15s;
}

.btn-grid-edit   { background: #f0f9ff; color: var(--primary); border: 1px solid #bae6fd; }
.btn-grid-edit:hover { background: var(--primary); color: white; transform: none; box-shadow: none; }

.btn-grid-delete { background: #fef2f2; color: var(--danger); border: 1px solid #fecaca; }
.btn-grid-delete:hover { background: var(--danger); color: white; transform: none; box-shadow: none; }

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
}

.modal {
  background: var(--panel);
  border-radius: 14px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.modal-header h3 { margin: 0; font-size: 1.15rem; font-weight: 600; }

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--muted);
  width: auto;
  margin: 0;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
  transition: all 0.15s;
}
.modal-close:hover { background: #f1f5f9; color: var(--text); transform: none; box-shadow: none; }

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-section { display: none; }
.modal-section.active { display: block; }

.modal-note {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.5;
  background: #f8fafc;
  border: 1px solid var(--line);
  color: var(--muted);
}
.modal-note.badge-info    { background: #f0f9ff; border-color: #bae6fd; color: #0c4a6e; }
.modal-note.badge-warning { background: #fff7ed; border-color: #fed7aa; color: #7c2d12; }

.modal-divider {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  margin: 4px 0 12px;
}

.modal-context {
  font-size: 0.8rem;
  color: var(--muted);
  font-family: monospace;
  margin: 0 0 16px;
}

.edit-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.edit-field-label {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
}

/* ── Delete Confirm ──────────────────────────────────────────────────────── */
.delete-warning { text-align: center; padding: 16px 0; }
.delete-icon    { font-size: 2.5rem; margin-bottom: 12px; }
.delete-warning p { margin: 8px 0; color: var(--text); line-height: 1.6; }
.delete-target  { font-size: 0.85rem; color: var(--muted); font-family: monospace; }

.delete-actions { display: flex; gap: 12px; margin-top: 24px; }

.btn-cancel {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
  transition: all 0.2s;
  width: auto;
}
.btn-cancel:hover { background: #f1f5f9; transform: none; box-shadow: none; }

.btn-danger {
  flex: 1;
  background: var(--danger);
  border: none;
  color: white;
  padding: 10px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font: inherit;
  transition: all 0.2s;
  width: auto;
}
.btn-danger:hover { background: #dc2626; transform: none; }

body.modal-open { overflow: hidden; }

/* ── Theme Toggle Button ────────────────────────────────────────────────────── */
.btn-theme-toggle {
  width: auto;
  padding: 5px 10px;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 1rem;
  margin-top: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: none;
  line-height: 1.4;
}
.btn-theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: transparent;
  transform: none;
  box-shadow: none;
}

/* ── Dark Mode Variables ────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg: #0f172a;
  --panel: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --line: #334155;
  --primary: #38bdf8;
  --primary-dark: #7dd3fc;
  --primary-contrast: #0f172a;
  --danger: #f87171;
  --success: #34d399;
  --shadow: 0 1px 3px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5), 0 4px 6px -2px rgba(0,0,0,0.3);
}

/* ── Dark Mode: hardcoded-color overrides ───────────────────────────────────── */

[data-theme="dark"] .result {
  background: #0c1929;
  border-color: #1e4a6a;
  color: #7dd3fc;
}
[data-theme="dark"] .result.error {
  background: #1c0a0a;
  border-color: #7f1d1d;
  color: #f87171;
}

[data-theme="dark"] .auth-note {
  background: #0c1929;
  border-color: #1e4a6a;
  color: #7dd3fc;
}

[data-theme="dark"] .info-banner {
  background: #0c1929;
  border-color: #1e4a6a;
  color: #7dd3fc;
}
[data-theme="dark"] .info-banner.warning {
  background: #1a1000;
  border-color: #7c3c00;
  color: #fdba74;
}

[data-theme="dark"] .badge-zero {
  background: #0a1f17;
  border-color: #064e3b;
  color: #34d399;
}
[data-theme="dark"] .notice-inline {
  background: #1a1000;
  border-color: #7c3c00;
  color: #fdba74;
}

[data-theme="dark"] .data-grid th {
  background: #151f2e;
}
[data-theme="dark"] .data-grid td {
  border-bottom-color: #243447;
}
[data-theme="dark"] .data-grid tbody tr:hover td {
  background: #243447;
}

[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.75);
}
[data-theme="dark"] .modal-note {
  background: #151f2e;
}
[data-theme="dark"] .modal-note.badge-info {
  background: #0c1929;
  border-color: #1e4a6a;
  color: #7dd3fc;
}
[data-theme="dark"] .modal-note.badge-warning {
  background: #1a1000;
  border-color: #7c3c00;
  color: #fdba74;
}
[data-theme="dark"] .modal-close:hover {
  background: #243447;
  color: var(--text);
}

[data-theme="dark"] .btn-grid-edit {
  background: #0c1929;
  border-color: #1e4a6a;
  color: #38bdf8;
}
[data-theme="dark"] .btn-grid-delete {
  background: #1c0a0a;
  border-color: #7f1d1d;
  color: #f87171;
}

[data-theme="dark"] .btn-cancel:hover {
  background: #243447;
}
[data-theme="dark"] .btn-signout:hover {
  background: #1c0a0a;
  border-color: #7f1d1d;
  color: #f87171;
}
[data-theme="dark"] .action-btn:hover {
  background: #162032;
}

/* ── Auth: Public Landing Info ──────────────────────────────────────────── */

.auth-info {
  margin-top: 0;
}

.auth-info-lead {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.75;
  margin: 0 0 20px;
  font-size: 0.97rem;
}

/* ── Auth Feature Cards Grid ─────────────────────────────────────────────── */

.auth-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.auth-card-item {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 12px;
  padding: 18px 20px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-card-item:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.auth-card-item strong {
  display: block;
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.3;
}

.auth-card-item p {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.83rem;
  margin: 0;
  line-height: 1.6;
}

.auth-card-full {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  padding: 20px 22px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.auth-how-title {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 10px;
}

.auth-steps {
  margin: 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-steps li {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.88rem;
  line-height: 1.5;
}

.auth-steps li span {
  color: #ffffff;
  font-weight: 600;
}

.auth-disclosure {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.77rem;
  color: rgba(255, 255, 255, 0.48);
  line-height: 1.65;
}

.auth-disclosure strong {
  color: rgba(255, 255, 255, 0.65);
}

@media (max-width: 860px) {
  .auth-container {
    grid-template-columns: 1fr;
    max-width: 520px;
    gap: 32px;
  }

  .auth-left { order: 2; }
  .auth-right { order: 1; }

  .auth-brand { text-align: center; }

  .auth-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Debtor Promise Grid ─────────────────────────────────────────────────── */

.debtor-promise-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.debtor-promise {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.debtor-promise-icon {
  font-size: 1.5rem;
  margin-bottom: 10px;
  line-height: 1;
}

.debtor-promise h4 {
  margin: 0 0 8px;
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--text);
}

.debtor-promise p {
  margin: 0;
  font-size: 0.87rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── Compliance Section ──────────────────────────────────────────────────── */

.compliance-block {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.compliance-block h3 {
  margin: 0 0 14px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.compliance-block > p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.93rem;
}

.compliance-block > p:last-child { margin-bottom: 0; }

.compliance-rule {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}

.compliance-block > .compliance-rule:first-of-type {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.compliance-rule-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.compliance-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-contrast);
  font-size: 0.78rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.compliance-rule-header strong {
  font-size: 0.93rem;
  color: var(--text);
}

.compliance-rule p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.68;
  padding-left: 38px;
}

.compliance-standard {
  border-color: var(--primary);
  border-width: 2px;
}

.compliance-footnote {
  font-size: 0.82rem !important;
  font-style: italic;
  opacity: 0.8;
}

/* ── Dark Mode: new component overrides ─────────────────────────────────── */

[data-theme="dark"] .info-banner a { color: #7dd3fc; }

[data-theme="dark"] .compliance-num {
  background: var(--primary);
  color: #0f172a;
}
