:root {
  --navy:       #0D2B4E;
  --navy-mid:   #1A3D6B;
  --navy-light: #254E86;
  --blue:       #3B82C4;
  --blue-light: #EAF2FB;
  --blue-pale:  #F0F6FE;
  --bg:         #F4F7FC;
  --white:      #FFFFFF;
  --border:     #E2E8F0;
  --border-mid: #CBD5E1;
  --text:       #0D2B4E;
  --text-mid:   #334155;
  --text-muted: #64748B;
  --text-faint: #94A3B8;
  --success:    #16A34A;
  --success-bg: #DCFCE7;
  --warning:    #D97706;
  --warning-bg: #FEF3C7;
  --error:      #DC2626;
  --error-bg:   #FEE2E2;
  --orange:     #F97316;
  --shadow-sm:  0 1px 3px rgba(13,43,78,0.06), 0 1px 2px rgba(13,43,78,0.04);
  --shadow:     0 4px 16px rgba(13,43,78,0.08), 0 1px 4px rgba(13,43,78,0.04);
  --shadow-lg:  0 12px 40px rgba(13,43,78,0.10), 0 4px 12px rgba(13,43,78,0.05);
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ─── SCROLLBAR ─────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-mid); border-radius: 99px; }

/* ─── DOT GRID BACKGROUND ───────────────────── */
.dot-bg {
  background-color: var(--bg);
  background-image: radial-gradient(circle, #CBD5E1 1px, transparent 1px);
  background-size: 22px 22px;
}

/* ─── LAYOUT ─────────────────────────────────── */
#app { min-height: 100vh; }

.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

/* ─── SIDEBAR ─────────────────────────────────── */
.sidebar {
  background: var(--navy);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-backdrop {
  display: none;
}

.sidebar-logo {
  padding: 28px 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-mobile-close {
  display: none;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 9px;
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.sidebar-mobile-close:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.3);
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 52px;
  height: 52px;
  background: transparent;
  border-radius: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon svg { width: 20px; height: 20px; fill: white; }

.logo-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 0;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: white;
  letter-spacing: -0.3px;
}

.logo-sub {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 500;
  margin-top: 1px;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 0.62rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.3);
  font-weight: 600;
  padding: 12px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  user-select: none;
}

.nav-item svg { width: 17px; height: 17px; flex-shrink: 0; }

.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.nav-item.active {
  background: rgba(59,130,196,0.25);
  color: white;
  font-weight: 600;
}

.nav-item.active svg { color: var(--blue); }

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid rgba(255,255,255,0.08);
}

.user-menu {
  width: 100%;
}

.user-menu summary {
  list-style: none;
  cursor: pointer;
}

.user-menu summary::-webkit-details-marker {
  display: none;
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: background 0.15s, border-color 0.15s;
}

.user-card:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.14);
}

.user-menu[open] .user-card {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
}

.user-menu-actions {
  margin-top: 6px;
  padding: 0 4px;
}

.user-menu-btn {
  width: 100%;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.82);
  border-radius: 8px;
  padding: 8px 10px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background 0.15s, color 0.15s;
}

.user-menu-btn:hover {
  background: rgba(255,255,255,0.08);
  color: white;
}

.user-menu-logout svg {
  width: 16px;
  height: 16px;
  color: rgba(142,193,242,0.95);
}

.user-avatar {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--blue), #2563EB);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-name { font-size: 0.8rem; font-weight: 600; color: white; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { font-size: 0.7rem; color: rgba(255,255,255,0.4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ─── TOPBAR ─────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border-mid);
  border-radius: 10px;
  background: var(--white);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-menu-btn span {
  width: 16px;
  height: 2px;
  border-radius: 99px;
  background: var(--navy);
}

.mobile-menu-btn:hover {
  background: var(--blue-pale);
  border-color: var(--blue);
}

.page-title { font-size: 1.15rem; font-weight: 700; color: var(--navy); }
.page-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 1px; }

.credits-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--blue-pale);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--navy);
}

.credits-dot { width: 8px; height: 8px; background: var(--blue); border-radius: 50%; }

.add-credits-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--blue);
  font-size: 1.1rem;
  padding: 0 4px;
  line-height: 1;
  font-weight: 700;
}

/* ─── MAIN CONTENT ───────────────────────────── */
.main-content {
  padding: 28px 32px;
  overflow-y: auto;
}

/* ─── CARDS ──────────────────────────────────── */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.card-header {
  padding: 20px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
}

.card-body { padding: 20px 24px; }

/* ─── BUTTONS ─────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  border: none;
  white-space: nowrap;
  text-decoration: none;
}

.btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.btn-primary {
  background: var(--navy);
  color: white;
}
.btn-primary:hover { background: var(--navy-mid); transform: translateY(-1px); box-shadow: var(--shadow); }

.btn-blue {
  background: var(--blue);
  color: white;
}
.btn-blue:hover { background: #2563EB; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59,130,196,0.35); }

.btn-orange {
  background: var(--orange);
  color: white;
}
.btn-orange:hover { background: #EA6B0E; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(249,115,22,0.35); }

.btn-dual {
  background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 100%);
  color: white;
  box-shadow: 0 8px 20px rgba(59,130,196,0.22);
}

.btn-dual:hover {
  background: linear-gradient(135deg, var(--navy-mid) 0%, #2563EB 100%);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(37,99,235,0.28);
}

.btn-dual-icons {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-right: 2px;
}

.btn-dual-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-dual-plus {
  font-size: 0.8rem;
  font-weight: 800;
  opacity: 0.85;
  line-height: 1;
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--border-mid);
}
.btn-outline:hover { border-color: var(--navy); background: var(--blue-pale); }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn-danger {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid #FECACA;
}
.btn-danger:hover { background: #FCA5A5; }

.btn-sm { padding: 6px 13px; font-size: 0.78rem; }
.btn-lg { padding: 12px 24px; font-size: 0.95rem; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

/* ─── FORM INPUTS ─────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-label.required::after {
  content: ' *';
  color: var(--error);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 10px 13px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.875rem;
  color: var(--text);
  transition: all 0.15s ease;
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--blue);
  background: white;
  box-shadow: 0 0 0 3px rgba(59,130,196,0.12);
}

.form-input::placeholder { color: var(--text-faint); }
.form-select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748B'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 36px; }

.form-input.error, .form-textarea.error { border-color: var(--error); }
.form-input.success, .form-textarea.success { border-color: var(--success); }

.form-hint { font-size: 0.72rem; color: var(--text-muted); }
.form-error { font-size: 0.72rem; color: var(--error); }

.form-group.field-missing-highlight,
.section-accordion.field-missing-highlight {
  outline: 2px solid rgba(220, 38, 38, 0.5);
  outline-offset: 4px;
  border-radius: var(--radius-sm);
}

.form-group.field-missing-highlight,
.section-accordion.field-missing-highlight {
  scroll-margin-top: 120px;
}

.form-grid { display: grid; gap: 12px; }
.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid-4 { grid-template-columns: 1fr 1fr 1fr 1fr; }

/* ─── TOGGLE ─────────────────────────────────── */
.toggle-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.toggle-option {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1.5px solid var(--border-mid);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: all 0.15s ease;
  user-select: none;
}

.toggle-option:hover { border-color: var(--blue); color: var(--navy); }

.toggle-option.selected {
  border-color: var(--blue);
  background: var(--blue-pale);
  color: var(--navy);
  font-weight: 600;
}

.toggle-option input { display: none; }

.toggle-check {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.toggle-option.selected .toggle-check::after {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--blue);
  border-radius: 50%;
}

/* ─── BADGE / STATUS ─────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.73rem;
  font-weight: 600;
}

.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-blue { background: var(--blue-pale); color: var(--blue); border: 1px solid #BFDBFE; }
.badge-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ─── TABLE ──────────────────────────────────── */
.table-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

table { width: 100%; border-collapse: collapse; }

thead {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

th {
  padding: 11px 16px;
  text-align: left;
  font-size: 0.73rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

td {
  padding: 13px 16px;
  font-size: 0.84rem;
  color: var(--text-mid);
  border-bottom: 1px solid var(--border);
}

tbody tr:last-child td { border-bottom: none; }

tbody tr {
  transition: background 0.1s;
  cursor: pointer;
}

tbody tr:hover { background: var(--blue-pale); }

.td-name { font-weight: 600; color: var(--navy); }

/* ─── COLLAPSIBLE SECTION ─────────────────────── */
.section-accordion {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: white;
  margin-bottom: 12px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  cursor: pointer;
  transition: background 0.12s;
  user-select: none;
  background: white;
}

.section-header:hover { background: var(--blue-pale); }

.section-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-accent {
  width: 4px;
  height: 20px;
  background: var(--blue);
  border-radius: 2px;
}

.section-title-text {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
}

.section-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 99px;
}

.progress-green { background: var(--success-bg); color: var(--success); }
.progress-yellow { background: var(--warning-bg); color: var(--warning); }
.progress-red { background: var(--error-bg); color: var(--error); }

.section-arrow {
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.section-arrow.open { transform: rotate(90deg); }

.section-body {
  padding: 0 20px;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.section-body.open {
  max-height: 2000px;
  padding: 0 20px 20px;
}

/* ─── RADIO / CHECKBOX ───────────────────────── */
.radio-group, .check-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--text-mid);
}

.radio-option input { accent-color: var(--blue); width: 15px; height: 15px; }

/* ─── LOGIN PAGE ─────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.login-left {
  background: var(--navy);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 60px;
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 80% 20%, rgba(59,130,196,0.3) 0%, transparent 50%),
                    radial-gradient(circle at 20% 80%, rgba(59,130,196,0.2) 0%, transparent 50%);
}

.login-left-content {
  position: relative;
  z-index: 1;
  transform: translateY(-38px);
}

.login-logo {
  display: flex;
  align-items: center;
  margin-bottom: 60px;
}

.login-logo-image {
  display: block;
  width: min(180px, 100%);
  height: auto;
  object-fit: contain;
}

.login-logo-icon {
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-heading {
  font-size: 2.4rem;
  font-weight: 800;
  color: white;
  line-height: 1.15;
  letter-spacing: -0.5px;
}

.login-heading span { color: #7BB8F0; }

.login-desc {
  margin-top: 20px;
  font-size: 1rem;
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
  max-width: 400px;
}

.login-features {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
}

.login-feature-dot {
  width: 8px;
  height: 8px;
  background: #7BB8F0;
  border-radius: 50%;
  flex-shrink: 0;
}

.login-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 60px;
  background: var(--bg);
}

.login-form-card {
  width: 100%;
  max-width: 400px;
}

.login-form-card-register {
  max-width: 520px;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 18px;
}

.auth-switch-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s;
}

.auth-switch-btn:hover {
  color: var(--navy);
}

.auth-switch-btn.active {
  color: var(--navy);
  background: white;
  box-shadow: 0 1px 4px rgba(13,43,78,0.08);
}

.auth-grid {
  gap: 12px;
  margin-bottom: 12px;
}

.auth-checkbox {
  margin-top: 2px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.auth-checkbox input {
  margin-top: 2px;
  width: 14px;
  height: 14px;
  accent-color: var(--blue);
}

.auth-inline-link {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.auth-inline-link:hover {
  text-decoration: underline;
}

.auth-helper-text {
  margin-top: 12px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.auth-helper-text a {
  color: var(--blue);
  font-weight: 700;
  text-decoration: none;
}

.auth-helper-text a:hover {
  text-decoration: underline;
}

.auth-contact-row {
  text-align: center;
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.auth-contact-link {
  color: var(--blue);
  font-weight: 600;
  text-decoration: none;
}

.auth-contact-link:hover {
  text-decoration: underline;
}

.login-form-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.3px;
}

.login-form-sub {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 6px;
  margin-bottom: 32px;
}

.login-separator {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.75rem;
  margin: 6px 0 14px;
}

/* ─── HOME / TOOL SELECTOR ───────────────────── */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.tool-card {
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.tool-card:hover {
  border-color: var(--blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.tool-card.selected {
  border-color: var(--blue);
  background: var(--blue-pale);
}

.tool-icon {
  width: 48px;
  height: 48px;
  background: var(--blue-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}

.tool-icon svg { width: 24px; height: 24px; color: var(--blue); }

.tool-name { font-size: 1rem; font-weight: 700; color: var(--navy); }
.tool-desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }

.tool-select-check {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 2px solid var(--border-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.tool-card.selected .tool-select-check {
  background: var(--blue);
  border-color: var(--blue);
}

.tool-card.selected .tool-select-check::after {
  content: '✓';
  font-size: 0.75rem;
  color: white;
  font-weight: 700;
}

.tool-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
}

/* ─── DASHBOARD ──────────────────────────────── */
.dashboard-grid {
  display: grid;
  gap: 20px;
}

.send-method-section {
  margin: 16px 0;
  padding: 16px;
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.send-method-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.generated-link-box {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  align-items: center;
}

.link-input {
  flex: 1;
  padding: 10px 13px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Mono', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ─── FILTERS BAR ─────────────────────────────── */
.filters-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  width: 15px;
  height: 15px;
}

.search-input {
  width: 100%;
  padding: 9px 13px 9px 34px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.84rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.search-input:focus { border-color: var(--blue); }

.filter-select {
  padding: 9px 34px 9px 12px;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.84rem;
  color: var(--text-mid);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2364748B'%3E%3Cpath fill-rule='evenodd' d='M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  transition: border-color 0.15s;
}

.filter-select:focus { border-color: var(--blue); }

/* ─── COMPLETED FORMS ───────────────────────── */
.completed-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.completed-hero-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.2px;
}

.completed-hero-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.completed-kpis {
  margin-top: 14px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.completed-kpi {
  min-width: 150px;
  padding: 11px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: white;
  box-shadow: var(--shadow-sm);
}

.completed-kpi-accent {
  border-color: #BFDBFE;
  background: linear-gradient(135deg, #F8FBFF 0%, #EEF4FF 100%);
}

.completed-kpi-value {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
  color: var(--navy);
}

.completed-kpi-label {
  margin-top: 5px;
  font-size: 0.74rem;
  color: var(--text-muted);
  font-weight: 600;
}

.completed-id {
  margin-top: 2px;
  color: var(--text-faint);
  font-size: 0.72rem;
  font-family: 'DM Mono', monospace;
}

.completed-method-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 99px;
  border: 1px solid #BFDBFE;
  background: var(--blue-pale);
  color: var(--blue);
  font-size: 0.73rem;
  font-weight: 700;
}

.completed-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.completed-table tbody tr {
  cursor: default;
}

.completed-table tbody tr:hover {
  background: #F8FBFF;
}

.modal-card.completed-preview-modal-card {
  width: min(1260px, calc(100vw - 56px));
  max-width: min(1260px, calc(100vw - 56px));
  max-height: calc(100vh - 36px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-card.completed-preview-modal-card .modal-header {
  padding: 20px 24px 10px;
  border-bottom: 1px solid var(--border);
}

.modal-card.completed-preview-modal-card .modal-body {
  padding: 16px 24px 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-card.completed-preview-modal-card .modal-sub {
  margin-top: 4px;
  font-size: 0.8rem;
}

.modal-card.completed-preview-modal-card .modal-actions {
  margin-top: 0;
  padding-top: 14px;
  position: sticky;
  bottom: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.8) 0%, #FFFFFF 34%);
}

.completed-preview-loading,
.completed-preview-empty {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius);
  padding: 14px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.completed-preview-grid {
  display: grid;
  gap: 12px;
}

.completed-preview-grid-main {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
}

.completed-preview-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.completed-preview-section-third {
  grid-column: span 1;
}

.completed-preview-section-wide {
  grid-column: 1 / -1;
}

.completed-preview-section-title {
  padding: 10px 13px;
  background: linear-gradient(135deg, #F8FBFF 0%, #EEF4FF 100%);
  border-bottom: 1px solid var(--border);
  color: var(--navy);
  font-size: 0.8rem;
  font-weight: 700;
}

.completed-preview-section-title-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.completed-preview-inline-btn {
  padding: 6px 10px;
  font-size: 0.73rem;
}

.completed-download-choice {
  display: none;
  margin: 10px;
  border: 1px solid #CFE0FA;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #F7FAFF 0%, #EEF4FF 100%);
  padding: 10px;
}

.completed-download-choice.is-open {
  display: block;
}

.completed-download-choice-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--navy);
}

.completed-download-choice-actions {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.completed-preview-kv-grid {
  padding: 11px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  align-content: start;
}

.completed-preview-kv-item {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 9px;
  min-height: 66px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.completed-preview-kv-item.wide {
  grid-column: 1 / -1;
}

.completed-preview-kv-label {
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.45px;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.1;
  min-height: 15px;
}

.completed-preview-kv-value {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.completed-preview-dependent-list {
  padding: 11px;
  display: grid;
  gap: 8px;
}

.completed-preview-dependent-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--blue-pale);
  padding: 9px 11px;
}

.completed-preview-dependent-title {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--navy);
}

.completed-preview-dependent-meta {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.completed-preview-dependent-meta span {
  font-size: 0.7rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  background: white;
  border-radius: 999px;
  padding: 2px 7px;
}

.completed-docs-grid {
  padding: 11px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.completed-doc-item {
  border: 1px solid var(--border);
  background: #FAFCFF;
  border-radius: var(--radius-sm);
  padding: 8px;
  min-height: 156px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.completed-doc-meta {
  min-width: 0;
  flex: 1;
}

.completed-doc-label {
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--text-muted);
  font-weight: 700;
  line-height: 1.2;
  min-height: 34px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.completed-doc-name {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text);
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
  min-height: 38px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.completed-doc-size {
  margin-top: 4px;
  font-size: 0.69rem;
  color: var(--text-faint);
  font-family: 'DM Mono', monospace;
}

.completed-doc-download-btn {
  justify-content: center;
  width: 100%;
  padding: 6px 8px;
  font-size: 0.73rem;
}

/* ─── MODAL ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13,43,78,0.45);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
  background: white;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 24px 60px rgba(13,43,78,0.2);
  animation: slideUp 0.2s ease;
  max-height: 85vh;
  overflow-y: auto;
}

@keyframes slideUp {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.modal-header {
  padding: 24px 24px 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.modal-title { font-size: 1.05rem; font-weight: 700; color: var(--navy); }
.modal-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

.modal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--bg);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: background 0.12s;
}

.modal-close:hover { background: var(--error-bg); color: var(--error); }

.modal-body { padding: 20px 24px 24px; }

.support-modal-card { max-width: 560px; }

.support-modal-form { gap: 12px; }

.support-modal-textarea {
  min-height: 120px;
  resize: vertical;
}

.support-modal-success {
  background: var(--success-bg);
  border: 1px solid #BBF7D0;
  color: #166534;
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.85rem;
  line-height: 1.5;
}

.support-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}

.legal-modal-card {
  max-width: 760px;
}

.legal-modal-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.legal-modal-tab {
  border: 1px solid var(--border);
  background: #F8FAFC;
  color: var(--text-muted);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.legal-modal-tab.active {
  background: #EAF2FF;
  border-color: #BDD4FF;
  color: var(--blue);
}

.legal-doc-body {
  max-height: 52vh;
  overflow-y: auto;
  padding-right: 6px;
  color: var(--text);
  font-size: 0.84rem;
  line-height: 1.55;
}

.legal-doc-body h4 {
  margin: 14px 0 6px;
  font-size: 0.86rem;
  color: var(--navy);
}

.legal-doc-body p {
  margin: 0 0 10px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.detail-row:last-child { border-bottom: none; }
.detail-label { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }
.detail-value { font-size: 0.85rem; color: var(--text); font-weight: 600; }

.submission-stage-box {
  margin-top: 14px;
  background: linear-gradient(135deg, #F8FBFF 0%, #EEF4FF 100%);
  border: 1px solid #D7E4FF;
  border-radius: var(--radius);
  padding: 12px 14px;
}

.submission-stage-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--navy);
}

.submission-stage-hint {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-mid);
  line-height: 1.45;
}

.modal-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.modal-actions-priority {
  margin-top: 16px;
}

.modal-actions-secondary {
  margin-top: 12px;
}

/* ─── TOAST ──────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--navy);
  color: white;
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 250px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--error); }
.toast.warning { background: var(--warning); }

@keyframes toastIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ─── PROFILE ─────────────────────────────────── */
.profile-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.profile-tab {
  padding: 10px 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
}

.profile-tab:hover { color: var(--navy); }
.profile-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.credit-card-visual {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  border-radius: var(--radius-lg);
  padding: 28px;
  color: white;
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

.credit-card-visual::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 180px;
  height: 180px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.credit-number { font-family: 'DM Mono', monospace; font-size: 1.1rem; letter-spacing: 3px; margin-top: 20px; }
.credit-info { display: flex; justify-content: space-between; margin-top: 16px; font-size: 0.78rem; opacity: 0.7; }

/* ─── FORM PAGE ──────────────────────────────── */
.form-page-header {
  background: var(--navy);
  padding: 32px;
  color: white;
}

.form-company-name {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.form-page-content {
  max-width: 780px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.form-submit-bar {
  position: sticky;
  bottom: 0;
  background: white;
  border-top: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 -4px 20px rgba(13,43,78,0.08);
}

.form-progress-overall {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.form-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  width: 160px;
  margin-top: 6px;
}

.form-progress-fill {
  height: 100%;
  background: var(--blue);
  border-radius: 2px;
  transition: width 0.3s ease;
}

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

.dependent-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dependent-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--blue-pale);
  padding: 14px;
}

.dependent-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  color: var(--navy);
}

/* ─── EMPTY STATE ─────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-icon {
  width: 64px;
  height: 64px;
  background: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.empty-icon svg { width: 28px; height: 28px; color: var(--text-faint); }
.empty-title { font-size: 0.95rem; font-weight: 700; color: var(--navy); }
.empty-desc { font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

/* ─── INVOICE TABLE ─────────────────────────── */
.invoice-status { font-size: 0.73rem; font-weight: 600; }

/* ─── ANIMATIONS ─────────────────────────────── */
.fade-in {
  animation: fadeIn 0.2s ease;
}

/* ─── MISC ───────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.text-muted { color: var(--text-muted); font-size: 0.82rem; }
.mt-4 { margin-top: 4px; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mb-16 { margin-bottom: 16px; }

.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-8 { gap: 8px; }
.items-center { align-items: center; }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* ─── ADMIN AREA ────────────────────────────── */
.admin-hero-card {
  border: 1px solid #cfe2ff;
  background: linear-gradient(135deg, #f8fbff 0%, #eef5ff 100%);
}

.admin-hero-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.admin-hero-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.2px;
}

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

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

.admin-kpi-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--white);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}

.admin-kpi-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--navy);
  background: var(--blue-pale);
  border: 1px solid #bfdbfe;
}

.admin-kpi-icon svg {
  width: 18px;
  height: 18px;
}

.admin-kpi-value {
  margin-top: 10px;
  font-size: 1.2rem;
  line-height: 1.2;
  font-weight: 800;
  color: var(--navy);
}

.admin-kpi-label {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.admin-alert-row {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-alert-row.success {
  background: var(--success-bg);
  color: var(--success);
}

.admin-alert-row.warning {
  background: var(--warning-bg);
  color: var(--warning);
}

.admin-alert-icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
}

.admin-alert-icon svg {
  width: 100%;
  height: 100%;
}

/* ─── RESPONSIVE ─────────────────────────────── */
@media (max-width: 1180px) {
  .admin-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .completed-preview-grid-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .completed-preview-section-third {
    grid-column: span 1;
  }

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

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

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: min(84vw, 320px);
    height: 100dvh;
    z-index: 180;
    transform: translateX(-104%);
    transition: transform 0.22s ease;
    box-shadow: 0 22px 50px rgba(2, 16, 35, 0.38);
  }

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

  .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(5, 18, 36, 0.45);
    backdrop-filter: blur(2px);
    z-index: 170;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .sidebar-backdrop.open {
    opacity: 1;
    pointer-events: auto;
  }

  .sidebar-mobile-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-menu-btn {
    display: inline-flex;
  }

  .topbar {
    padding: 12px 16px;
  }

  .page-title {
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 47vw;
  }

  .page-sub {
    display: none;
  }

  .credits-pill {
    padding: 5px 11px;
    font-size: 0.75rem;
  }

  .login-page { grid-template-columns: 1fr; }
  .login-left { display: none; }
  .form-grid-3, .form-grid-4 { grid-template-columns: 1fr 1fr; }
  .completed-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .modal-card.completed-preview-modal-card {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .modal-card.completed-preview-modal-card .modal-header {
    padding: 14px 16px 8px;
  }

  .modal-card.completed-preview-modal-card .modal-body {
    padding: 10px 16px 14px;
  }

  .completed-docs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .completed-preview-grid-main {
    grid-template-columns: 1fr;
  }

  .completed-preview-section-third,
  .completed-preview-section-wide {
    grid-column: 1 / -1;
  }

  .completed-preview-kv-grid {
    grid-template-columns: 1fr;
  }

  .completed-docs-grid {
    grid-template-columns: 1fr 1fr;
  }

  .completed-preview-section-title-actions {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .completed-download-choice-actions {
    flex-direction: column;
  }

  .completed-download-choice-actions .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 600px) {
  .admin-kpi-grid {
    grid-template-columns: 1fr;
  }

  .main-content { padding: 16px; }
  .form-grid-2, .form-grid-3, .form-grid-4 { grid-template-columns: 1fr; }
  .form-submit-bar {
    padding: 12px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .completed-kpis {
    display: grid;
    grid-template-columns: 1fr;
  }

  .completed-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .completed-docs-grid {
    grid-template-columns: 1fr;
  }

  .modal-actions .btn {
    width: 100%;
    justify-content: center;
  }
}
