:root {
  --primary: #2954e6;
  --primary-dark: #1c3fb8;
  --primary-light: #eef2ff;
  --accent: #10b981;
  --danger: #e11d48;
  --text: #1f2937;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f5f7fb;
  --card-bg: #ffffff;
  --radius: 12px;
  --shadow: 0 4px 20px rgba(31, 41, 55, 0.06);
  --shadow-lg: 0 10px 40px rgba(31, 41, 55, 0.12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

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

/* ============== Wizard Page Layout ============== */
.wizard-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wizard-topbar {
  background: #ffffff;
  padding: 18px 24px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  border-bottom: 3px solid var(--primary);
}

.topbar-logo {
  height: 42px;
  width: auto;
  display: block;
}

.wizard-topbar .subtitle {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding-left: 16px;
  border-left: 2px solid var(--border);
}

.wizard-container {
  max-width: 920px;
  margin: 28px auto 60px;
  padding: 0 16px;
  width: 100%;
  flex: 1;
}

.wizard-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Step progress bar */
.step-progress {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 24px 24px 0;
  gap: 4px;
  overflow-x: auto;
}

.step-progress li {
  flex: 1;
  text-align: center;
  position: relative;
  padding-bottom: 18px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 90px;
}

.step-progress li .dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #eef1f6;
  border: 2px solid var(--border);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px;
  font-weight: 600;
  font-size: 13px;
  transition: all .25s ease;
}

.step-progress li.active .dot {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px var(--primary-light);
}

.step-progress li.done .dot {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.step-progress li.active { color: var(--primary); font-weight: 600; }
.step-progress li.done { color: var(--accent); }

.step-progress li::after {
  content: '';
  position: absolute;
  top: 15px;
  right: -50%;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: -1;
}
.step-progress li:last-child::after { display: none; }
.step-progress li.done::after { background: var(--accent); }

/* Form sections */
.wizard-body { padding: 8px 24px 24px; }

.form-step { display: none; animation: fadeIn .3s ease; }
.form-step.active { display: block; }

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

.section-heading {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 22px 0 4px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-light);
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-heading:first-child { margin-top: 6px; }

.section-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

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

.form-grid .full { grid-column: 1 / -1; }

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

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.field label .req { color: var(--danger); margin-left: 2px; }

.field input[type="text"],
.field input[type="email"],
.field input[type="tel"],
.field input[type="date"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}

.field textarea { resize: vertical; min-height: 70px; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.field .error-msg {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
  min-height: 14px;
}

.field input.invalid,
.field select.invalid,
.field textarea.invalid {
  border-color: var(--danger);
}

/* File upload dropzone */
.upload-box {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 22px;
  text-align: center;
  cursor: pointer;
  background: #fafbfe;
  transition: border-color .2s, background .2s;
}
.upload-box:hover, .upload-box.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.upload-box input[type=file] { display: none; }
.upload-box .icon { font-size: 26px; margin-bottom: 6px; }
.upload-box .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.file-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.file-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}
.file-chip .remove-file {
  color: var(--danger);
  cursor: pointer;
  font-weight: 700;
  padding: 0 4px;
}

/* Nav buttons */
.wizard-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-top: 1px solid var(--border);
  background: #fafbfe;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: transform .1s, box-shadow .15s, background .15s;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--text); border: 1.5px solid var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-success { background: var(--accent); color: #fff; }
.btn-success:hover { filter: brightness(0.95); }
.btn-danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-sm { padding: 6px 14px; font-size: 13px; }

/* Attachment badges shown inline in dashboard tables */
.attach-badges { display: flex; gap: 6px; flex-wrap: wrap; }
.attach-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  background: #eef2ff;
  color: var(--primary-dark);
  border: 1px solid #c7d5ff;
  white-space: nowrap;
}
.attach-badge.visa { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.attach-badge-none { font-size: 11px; color: #9ca3af; }

/* Review step */
.review-block { background: #fafbfe; border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; margin-bottom: 14px; }
.review-block h4 { margin: 0 0 10px; font-size: 14px; color: var(--primary); }
.review-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.review-row:last-child { border-bottom: none; }
.review-row span:first-child { color: var(--text-muted); }
.review-row span:last-child { font-weight: 600; text-align: right; max-width: 60%; }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* Toast */
#toast {
  position: fixed;
  top: 20px; right: 20px;
  background: var(--text);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  display: none;
  z-index: 9999;
}
#toast.error { background: var(--danger); }
#toast.success { background: var(--accent); }

/* Thank you page */
.thankyou-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  text-align: center;
  padding: 24px;
}
.thankyou-card {
  background: #fff;
  padding: 48px 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  max-width: 480px;
}
.thankyou-card .icon { font-size: 56px; margin-bottom: 12px; }

/* ============== Admin / Superadmin Portal ============== */
.admin-shell { display: flex; min-height: 100vh; background: var(--bg); }

.admin-sidebar {
  width: 240px;
  background: #101a33;
  color: #cbd5e1;
  padding: 22px 16px;
  flex-shrink: 0;
}
.sidebar-logo-wrap {
  background: #ffffff;
  border-radius: 8px;
  padding: 10px 14px;
  display: inline-block;
  margin-bottom: 10px;
}
.sidebar-logo { height: 30px; width: auto; display: block; }
.admin-sidebar .subtitle-sidebar { color: #cbd5e1; font-size: 12px; font-weight: 600; margin-bottom: 4px; line-height: 1.4; }
.admin-sidebar .brand { color: #fff; font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.admin-sidebar .role-tag { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: #7c8db5; margin-bottom: 24px; }
.admin-sidebar nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  color: #cbd5e1;
  font-size: 14px;
  margin-bottom: 4px;
}
.admin-sidebar nav a:hover, .admin-sidebar nav a.active { background: #1c2a4d; color: #fff; }
.admin-sidebar .logout-link { margin-top: 24px; color: #fca5a5; }

.admin-main { flex: 1; padding: 24px 28px; min-width: 0; }

.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 10px;
}
.admin-topbar h1 { font-size: 20px; margin: 0; }
.admin-user-chip { font-size: 13px; color: var(--text-muted); }

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}
.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.stat-card .num { font-size: 26px; font-weight: 700; }
.stat-card .label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.table-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 700px; }
table.data-table th {
  text-align: left;
  background: #f8fafc;
  padding: 12px 14px;
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
table.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data-table tr:hover td { background: #fafbfe; }

.badge { padding: 4px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.badge-new { background: #fee2e2; color: #b91c1c; }
.badge-review { background: #fef9c3; color: #a16207; }
.badge-closed { background: #dcfce7; color: #15803d; }

.detail-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; margin-bottom: 18px; }
.detail-card h3 { font-size: 15px; color: var(--primary); margin: 0 0 14px; border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 22px; }
@media (max-width: 700px) { .detail-grid { grid-template-columns: 1fr; } }
.detail-row { font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--border); display: flex; justify-content: space-between; gap: 10px; }
.detail-row .k { color: var(--text-muted); }
.detail-row .v { font-weight: 600; text-align: right; }

.attach-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.attach-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fafbfe;
}

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1c3fb8, #4f6df5);
  padding: 20px;
}
.login-card {
  background: #fff;
  width: 100%;
  max-width: 380px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 34px 30px;
}
.login-logo { display: block; height: 46px; width: auto; margin: 0 auto 12px; }
.login-card .brand { text-align: center; font-weight: 700; font-size: 18px; margin-bottom: 4px; }
.login-card .sub { text-align: center; font-size: 12px; color: var(--text-muted); margin-bottom: 4px; }
.login-card .sub.login-portal-label { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 22px; }
.login-card .field { margin-bottom: 16px; }
.login-card .btn { width: 100%; justify-content: center; }

@media (max-width: 900px) {
  .admin-sidebar { display: none; }
  .admin-main { padding: 18px; }
}
