/* ==========================================================
   Shumard Foundation – Design System
   ========================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --font: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;

  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --brand:       #1e40af;
  --brand-light: #3b82f6;
  --brand-bg:    #eff6ff;

  --green:       #16a34a;
  --green-light: #22c55e;
  --green-bg:    #f0fdf4;

  --red:     #dc2626;
  --red-bg:  #fef2f2;

  --amber:     #d97706;
  --amber-bg:  #fffbeb;

  --white: #ffffff;

  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shadow:    0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px rgba(0,0,0,0.04);

  --ease: cubic-bezier(.4,0,.2,1);
}

html { font-size: 15px; }
body {
  font-family: var(--font);
  color: var(--slate-800);
  background: var(--slate-50);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 20px;
  border: none; border-radius: var(--radius);
  font: 600 0.9rem/1.4 var(--font);
  cursor: pointer;
  transition: all .15s var(--ease);
  white-space: nowrap;
}
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--brand);
  color: var(--white);
  box-shadow: 0 1px 2px rgba(30,64,175,.3);
}
.btn-primary:hover:not(:disabled) { background: #1e3a8a; }

.btn-green {
  background: var(--green);
  color: var(--white);
  box-shadow: 0 1px 2px rgba(22,163,74,.3);
}
.btn-green:hover:not(:disabled) { background: #15803d; }

.btn-ghost {
  background: var(--white);
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
}
.btn-ghost:hover { background: var(--slate-50); border-color: var(--slate-300); }

.btn-sm { padding: 5px 12px; font-size: 0.8rem; }
.btn-outline {
  background: transparent; color: var(--slate-600);
  border: 1px solid var(--slate-200);
}
.btn-outline:hover { background: var(--slate-50); border-color: var(--slate-300); }

.btn-danger {
  background: var(--red); color: var(--white);
  border: 1px solid var(--red);
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }

.btn-delete-row {
  background: none; border: none; cursor: pointer;
  color: var(--slate-400); padding: 4px; border-radius: 4px;
  display: flex; align-items: center; line-height: 1;
}
.btn-delete-row:hover { color: var(--red); background: var(--red-bg); }

/* ---------- Tags ---------- */
.tag { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.tag-req { background: var(--red-bg); color: var(--red); }

.req { color: var(--red); font-weight: 700; }

/* ==========================================================
   FORM PAGE
   ========================================================== */

.form-page {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ---- Top Bar ---- */
.topbar {
  background: var(--slate-900);
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logo {
  height: 30px;
  filter: brightness(0) invert(1);
  opacity: .9;
}

.topbar-text {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-size: 0.88rem;
}

.topbar-name { font-weight: 600; }
.topbar-sep  { opacity: .3; }
.topbar-page { opacity: .6; font-weight: 400; }

/* ---- Shell ---- */
.form-shell {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 28px 20px 40px;
  flex: 1;
}

/* ---- Intro Section ---- */
.intro-section {
  text-align: left;
  margin-bottom: 8px;
}
.intro-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 4px;
}
.intro-subtitle {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 12px;
}
.intro-mission {
  font-size: 0.95rem;
  color: var(--green);
  margin-bottom: 16px;
  line-height: 1.6;
}
.intro-deadline strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.95rem;
  color: var(--slate-800);
}
.intro-deadline p {
  font-size: 0.95rem;
  color: var(--slate-600);
  line-height: 1.6;
  margin-bottom: 0;
}

/* ---- Stepper ---- */
.steps {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}

.steps-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  font: 500 0.82rem/1 var(--font);
  color: var(--slate-400);
  cursor: default;
  padding: 0;
  transition: color .2s var(--ease);
}

.steps-bar {
  flex: 1;
  height: 2px;
  background: var(--slate-200);
  margin: 0 10px;
  border-radius: 1px;
  transition: background .3s var(--ease);
}
.steps-bar.active { background: var(--brand); }

.steps-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--slate-100);
  color: var(--slate-400);
  font-size: 0.78rem; font-weight: 700;
  transition: all .25s var(--ease);
  flex-shrink: 0;
  border: 2px solid transparent;
}

.steps-tick { display: none; }

.steps-item.active .steps-dot {
  background: var(--brand);
  color: var(--white);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(30,64,175,.18);
}
.steps-item.active { color: var(--brand); font-weight: 600; }

.steps-item.completed .steps-dot {
  background: var(--green);
  color: var(--white);
  border-color: var(--green);
}
.steps-item.completed .steps-num { display: none; }
.steps-item.completed .steps-tick { display: block; }
.steps-item.completed { color: var(--green); }

/* ---- Banner ---- */
.banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  margin-bottom: 20px;
}
.banner-warn {
  background: var(--amber-bg);
  border: 1px solid #fbbf24;
  color: #92400e;
}
.banner-icon { flex-shrink: 0; }
.banner span { flex: 1; }
.banner-action {
  background: none; border: none;
  color: var(--amber);
  font: 600 0.82rem var(--font);
  cursor: pointer;
  text-decoration: underline;
  flex-shrink: 0;
}
.banner-action:hover { color: #b45309; }

/* ---- Panel (form step) ---- */
.panel {
  display: none;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel.active {
  display: block;
  animation: panelIn .25s var(--ease);
}
@keyframes panelIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.panel-head {
  padding: 24px 28px 20px;
  border-bottom: 1px solid var(--slate-100);
}
.panel-head h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 2px;
  color: var(--slate-900);
}
.panel-head p {
  font-size: 0.85rem;
  color: var(--slate-500);
}

.panel-foot {
  display: flex;
  justify-content: space-between;
  padding: 16px 28px;
  border-top: 1px solid var(--slate-100);
  background: var(--slate-50);
}

/* ---- Fieldsets & fields ---- */
.fieldset {
  padding: 20px 28px;
}

.divider {
  border: none;
  height: 1px;
  background: var(--slate-100);
  margin: 0;
}

.field {
  margin-bottom: 14px;
}
.field:last-child { margin-bottom: 0; }

.field label, .field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--slate-600);
  margin-bottom: 5px;
}

.input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  font: 400 0.9rem/1.5 var(--font);
  color: var(--slate-800);
  background: var(--white);
  outline: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input::placeholder { color: var(--slate-400); }
.input:focus {
  border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.input:disabled {
  background: var(--slate-50);
  color: var(--slate-500);
}
.input-error {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,.1) !important;
}

textarea.input { resize: vertical; min-height: 72px; }
select.input { cursor: pointer; background: #fff; }

.row {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}
.row:last-child { margin-bottom: 0; }
.row-2 { grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: 1fr 1fr 1fr; }

/* ---- Choice cards (step 1 grantee) ---- */
.choice-group {
  padding: 0 28px 20px;
  display: flex;
  gap: 12px;
}

.choice {
  flex: 1;
  cursor: pointer;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }

.choice-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-lg);
  transition: all .2s var(--ease);
  background: var(--white);
}
.choice-box:hover {
  border-color: var(--slate-300);
}

.choice-radio {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid var(--slate-300);
  flex-shrink: 0;
  position: relative;
  transition: all .15s var(--ease);
}
.choice-radio::after {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: var(--brand);
  transform: scale(0);
  transition: transform .15s var(--ease);
}

.choice input:checked ~ .choice-box {
  border-color: var(--brand);
  background: var(--brand-bg);
  box-shadow: 0 0 0 3px rgba(30,64,175,.08);
}
.choice input:checked ~ .choice-box .choice-radio {
  border-color: var(--brand);
}
.choice input:checked ~ .choice-box .choice-radio::after {
  transform: scale(1);
}

.choice-content strong {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--slate-800);
}
.choice-content small {
  font-size: 0.78rem;
  color: var(--slate-500);
}

/* ---- Dropzones ---- */
.dz-card {
  padding: 0 28px;
  margin-bottom: 16px;
}

.dz-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--slate-700);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dz {
  border: 1.5px dashed var(--slate-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all .2s var(--ease);
  text-align: center;
  background: var(--slate-50);
}
.dz:hover {
  border-color: var(--brand-light);
  background: var(--brand-bg);
}
.dz.dragover {
  border-color: var(--brand);
  border-style: solid;
  background: var(--brand-bg);
  box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}

.dz-icon { color: var(--slate-400); margin-bottom: 2px; }
.dz span { font-size: 0.85rem; color: var(--slate-500); }
.dz span u { color: var(--brand); text-decoration-color: rgba(59,130,246,.4); font-weight: 500; }
.dz small { font-size: 0.73rem; color: var(--slate-400); }

.file-list { padding: 0 28px; }

.file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--slate-50);
  border: 1px solid var(--slate-100);
  border-radius: var(--radius);
  margin-bottom: 6px;
  font-size: 0.82rem;
}

.file-item-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  margin-right: 8px;
  color: var(--slate-700);
}

.file-item-remove {
  background: none; border: none;
  color: var(--red); cursor: pointer;
  font-size: 1.1rem; padding: 0 2px; flex-shrink: 0;
}
.file-item-remove:hover { color: #b91c1c; }

/* ---- Segmented control (purpose) ---- */
.seg-group {
  display: inline-flex;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--slate-50);
}

.seg {
  cursor: pointer;
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }

.seg-btn {
  display: block;
  padding: 8px 20px;
  font: 500 0.85rem/1.4 var(--font);
  color: var(--slate-500);
  transition: all .15s var(--ease);
  border-right: 1px solid var(--slate-200);
}
.seg:last-child .seg-btn { border-right: none; }
.seg-btn:hover { background: var(--slate-100); }

.seg input:checked + .seg-btn {
  background: var(--brand);
  color: var(--white);
  box-shadow: var(--shadow-xs);
}

.project-fields { display: none; }
.project-fields.visible { display: block; }

/* ---- Signature ---- */
.sig-wrap {
  border: 1.5px solid var(--slate-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  background: var(--white);
}
.sig-wrap canvas {
  display: block;
  width: 100%;
  height: 140px;
}
.sig-clear {
  position: absolute;
  top: 6px; right: 6px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-sm);
  padding: 3px 10px;
  font: 500 0.72rem var(--font);
  color: var(--slate-500);
  cursor: pointer;
  transition: all .15s var(--ease);
}
.sig-clear:hover { background: var(--red-bg); color: var(--red); border-color: var(--red); }

/* ---- Footer ---- */
.site-foot {
  text-align: center;
  padding: 20px;
  font-size: 0.75rem;
  color: var(--slate-400);
}

/* ==========================================================
   END-OF-GRANT REPORT PAGE
   ========================================================== */

.eog-shell {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 32px 20px 48px;
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(360px, 1.1fr);
  gap: 22px;
  flex: 1;
}

.eog-sidebar {
  background: var(--amber-bg);
  border: 1px solid #fbbf24;
  border-radius: var(--radius-xl);
  padding: 24px;
  align-self: start;
  color: #78350f;
}

.eog-sidebar h1 {
  color: #451a03;
  font-size: 1.45rem;
  line-height: 1.2;
  margin-bottom: 14px;
}

.eog-sidebar h2 {
  color: #92400e;
  font-size: 0.9rem;
  margin: 16px 0 4px;
}

.eog-sidebar p {
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 10px;
}

.eog-sidebar .eog-deadline {
  margin-top: 18px;
  font-weight: 700;
  color: #451a03;
}

.eog-panel {
  align-self: start;
}

.eog-status {
  min-height: 20px;
  margin-top: 6px;
  font-size: 0.82rem;
  color: var(--slate-500);
}

.eog-status-info { color: var(--brand); }
.eog-status-success { color: var(--green); }
.eog-status-error { color: var(--red); }

.eog-matches {
  margin-top: 16px;
}

.eog-match-list {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.eog-match {
  width: 100%;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}

.eog-match:hover,
.eog-match.selected {
  border-color: var(--brand);
  background: var(--brand-bg);
  box-shadow: 0 0 0 3px rgba(30,64,175,.08);
}

.eog-match strong,
.eog-match span,
.eog-match small {
  display: block;
}

.eog-match strong {
  font: 700 0.9rem/1.4 var(--font);
  color: var(--slate-800);
}

.eog-match span {
  font-size: 0.8rem;
  color: var(--slate-600);
  margin-top: 2px;
}

.eog-match small {
  font-size: 0.76rem;
  color: var(--slate-500);
  margin-top: 2px;
}

.eog-upload-form {
  margin-top: 18px;
}

.eog-file-list {
  padding: 8px 0 0;
}

/* ==========================================================
   LOGIN PAGE
   ========================================================== */

.login-page {
  margin: 0; padding: 0;
  min-height: 100vh;
  background: var(--slate-50);
}

.login-split {
  display: flex;
  min-height: 100vh;
}

.login-hero {
  flex: 1;
  background: linear-gradient(160deg, var(--slate-900) 0%, var(--slate-800) 100%);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 60px 40px;
  position: relative; overflow: hidden;
}
.login-hero::before {
  content: '';
  position: absolute; top: -50%; right: -50%;
  width: 100%; height: 200%;
  background: radial-gradient(circle, rgba(59,130,246,.08) 0%, transparent 70%);
  pointer-events: none;
}

.login-hero-content {
  text-align: center;
  color: var(--white);
  position: relative; z-index: 1;
}
.login-hero-logo {
  height: 100px;
  margin-bottom: 24px;
  filter: brightness(0) invert(1);
  opacity: .9;
}
.login-hero-content h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.login-hero-content p {
  font-size: 1rem;
  opacity: .6;
}
.login-hero-footer {
  position: absolute; bottom: 24px;
  font-size: 0.75rem;
  color: rgba(255,255,255,.3);
  z-index: 1;
}

.login-form-side {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
  background: var(--slate-50);
}

.login-card { width: 100%; max-width: 380px; }

.login-card-header {
  text-align: center;
  margin-bottom: 32px;
}
.login-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--brand);
  color: var(--white);
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(30,64,175,.25);
}
.login-title {
  font-size: 1.4rem; font-weight: 700;
  color: var(--slate-900); margin-bottom: 4px;
}
.login-subtitle {
  font-size: 0.88rem; color: var(--slate-500);
}

.login-card-body {
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-200);
}
.login-label {
  font-size: 0.82rem; font-weight: 600;
  color: var(--slate-600);
  display: block; margin-bottom: 6px;
}
.login-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  font: 400 1rem/1.5 var(--font);
  letter-spacing: 3px;
  text-align: center;
  color: var(--slate-800);
  outline: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.login-input:focus {
  border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.login-btn { margin-top: 14px; padding: 10px; font-size: .95rem; width: 100%; }
.login-error {
  color: var(--red); font-size: 0.82rem;
  text-align: center; margin-top: 14px;
  padding: 8px; background: var(--red-bg);
  border-radius: var(--radius);
}

@media (max-width: 900px) {
  .login-split { flex-direction: column; }
  .login-hero { padding: 36px 20px; min-height: auto; }
  .login-hero-logo { height: 56px; margin-bottom: 16px; }
  .login-hero-content h2 { font-size: 1.3rem; }
  .login-hero-footer { display: none; }
  .login-form-side { padding: 24px 20px 40px; }
}

/* ==========================================================
   ADMIN PAGE
   ========================================================== */

.admin-page {
  display: flex; flex-direction: column;
  min-height: 100vh;
}

.admin-header {
  background: var(--slate-900);
  color: var(--white);
  padding: 14px 28px;
  display: flex; align-items: center;
  justify-content: space-between;
}
.admin-brand { display: flex; align-items: center; gap: 12px; }
.admin-logo { height: 30px; filter: brightness(0) invert(1); opacity: .9; }
.admin-header h1 { font-size: 1rem; font-weight: 600; }

.admin-header nav {
  display: flex; align-items: center; gap: 16px;
  font-size: 0.85rem;
}
.admin-header nav span { opacity: .6; }
.admin-header .btn-outline {
  color: var(--white);
  border-color: rgba(255,255,255,.2);
}
.admin-header .btn-outline:hover {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.3);
}

.admin-main { flex: 1; padding: 24px 28px; }
.admin-footer {
  text-align: center; padding: 16px;
  font-size: 0.75rem; color: var(--slate-400);
}

/* ---- Cards ---- */
.card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--slate-100);
}
.card-header h2 { font-size: 1.05rem; font-weight: 700; }

.form-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius);
  font: 400 0.88rem/1.5 var(--font);
  color: var(--slate-800);
  background: var(--white);
  outline: none;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.form-input:focus {
  border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(59,130,246,.12);
}
.form-input:disabled {
  background: var(--slate-50);
  color: var(--slate-500);
}
.form-input-sm { padding: 5px 10px; font-size: 0.82rem; width: 200px; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group label {
  font-size: 0.8rem; font-weight: 600; color: var(--slate-600);
}
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.form-grid .full-width { grid-column: 1 / -1; }

.error-text { color: var(--red); font-size: 0.82rem; margin-top: 4px; }

.radio-display { display: flex; gap: 16px; padding: 6px 0; }
.radio-display label {
  display: flex; align-items: center; gap: 6px;
  font-weight: 400; color: var(--slate-700); cursor: pointer;
}

/* ---- Table ---- */
.table-wrap { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; }

thead th {
  background: var(--slate-50);
  padding: 9px 14px;
  font-size: 0.73rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--slate-500);
  text-align: left; white-space: nowrap;
  cursor: pointer; user-select: none;
  border-bottom: 1px solid var(--slate-200);
}
thead th:hover { color: var(--brand); }

tbody tr {
  cursor: pointer;
  transition: background .12s var(--ease);
}
tbody tr:hover { background: var(--slate-50); }

tbody td {
  padding: 10px 14px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--slate-100);
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--slate-700);
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000; padding: 20px;
}
.modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  width: 100%; max-width: 700px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--slate-200);
}
.modal-header {
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--slate-100);
}
.modal-header h3 { font-size: 1.05rem; font-weight: 700; }
.modal-close {
  background: none; border: none;
  font-size: 1.3rem; cursor: pointer;
  color: var(--slate-400); padding: 0 4px;
}
.modal-close:hover { color: var(--slate-700); }

.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 24px;
  border-top: 1px solid var(--slate-100);
  display: flex; justify-content: flex-end;
  background: var(--slate-50);
}

/* ---- Tabs ---- */
.tabs {
  display: flex; gap: 2px;
  margin-bottom: 20px;
  background: var(--slate-100);
  border-radius: var(--radius);
  padding: 3px;
}
.tab {
  flex: 1;
  padding: 7px 12px;
  background: none; border: none;
  font: 600 0.82rem var(--font);
  color: var(--slate-500);
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all .15s var(--ease);
  text-align: center;
}
.tab:hover { color: var(--slate-700); }
.tab.active {
  background: var(--white);
  color: var(--slate-800);
  box-shadow: var(--shadow-xs);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ---- File Grid ---- */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.file-card {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  padding: 18px 10px;
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all .15s var(--ease);
  color: var(--slate-600);
  font-size: 0.82rem; font-weight: 500;
  cursor: pointer;
  background: var(--white);
  text-decoration: none;
}
.file-card:hover {
  border-color: var(--brand-light);
  background: var(--brand-bg);
  text-decoration: none;
  color: var(--brand);
}
.file-card .file-icon { font-size: 1.8rem; }
.file-card-action {
  border-color: var(--green);
  color: var(--green);
  font-family: var(--font);
}
.file-card-action:hover {
  background: var(--green);
  color: var(--white);
}
.file-card-eog {
  border-color: var(--amber);
  color: var(--amber);
}
.file-card-eog:hover {
  background: var(--amber-bg);
  border-color: var(--amber);
  color: #92400e;
}
.file-card.hidden { display: none; }

/* ---- Signature Display ---- */
.signature-display {
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  width: 100%; height: 110px;
  background: var(--white);
}

/* ==========================================================
   RESPONSIVE
   ========================================================== */

@media (max-width: 768px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full-width { grid-column: 1; }

  .row-2, .row-3 { grid-template-columns: 1fr; }

  .choice-group { flex-direction: column; }

  .steps-label { display: none; }
  .steps-bar { flex: 1; min-width: 0; }

  .panel-head, .fieldset, .dz-card, .file-list { padding-left: 20px; padding-right: 20px; }
  .panel-foot { padding: 14px 20px; }

  .admin-header { padding: 12px 16px; flex-wrap: wrap; gap: 8px; }
  .admin-main { padding: 16px; }

  .modal { max-width: 100%; max-height: 100vh; border-radius: 0; }

  .card-header { flex-direction: column; gap: 10px; align-items: flex-start; }
  .form-input-sm { width: 100%; }

  .file-grid { grid-template-columns: 1fr 1fr; }

  .eog-shell {
    grid-template-columns: 1fr;
    padding: 20px 12px 36px;
  }

  .seg-group { display: flex; width: 100%; }
  .seg { flex: 1; }
  .seg-btn { text-align: center; padding: 8px 12px; }
}

@media (max-width: 480px) {
  .topbar-sep, .topbar-page { display: none; }
  .form-shell { padding: 16px 12px 32px; }
}
