/* ══════════════════════════════════════════════
   Exam Center DMS — style.css
   Font: DM Sans + DM Mono
   Theme: Clean government-utility with warm tones
══════════════════════════════════════════════ */

:root {
  --bg:        #F5F3EE;
  --surface:   #FFFFFF;
  --surface2:  #F0EDE6;
  --border:    #E2DDD4;
  --border2:   #CCC7BC;
  --text:      #1A1714;
  --text2:     #6B6560;
  --text3:     #9C968F;
  --accent:    #2D5A8E;
  --accent-bg: #EBF1F9;
  --accent2:   #1D9E75;
  --accent2-bg:#E5F6EF;
  --warn:      #B45309;
  --warn-bg:   #FEF3C7;
  --danger:    #B91C1C;
  --danger-bg: #FEE2E2;
  --radius:    10px;
  --radius-lg: 14px;
  --shadow:    0 1px 3px rgba(0,0,0,.07), 0 4px 12px rgba(0,0,0,.05);
  --shadow-lg: 0 4px 20px rgba(0,0,0,.1);
}

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

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
}

/* ── NAV ──────────────────────────────────────── */
.nav {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 0 var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  margin-right: auto;
}
.nav-brand i { font-size: 20px; color: var(--accent); }

.nav-links { display: flex; gap: 4px; }

.nav-btn {
  height: 36px;
  padding: 0 14px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  background: none;
  border: none;
  border-radius: var(--radius);
  color: var(--text2);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all .15s;
}
.nav-btn:hover { background: var(--surface2); color: var(--text); }
.nav-btn.active { background: var(--accent-bg); color: var(--accent); }

.lock-pill {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  padding: 2px 6px;
  background: var(--surface2);
  border-radius: 20px;
  color: var(--text3);
}

/* ── PAGE & VIEWS ─────────────────────────────── */
.page { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; }

.page-header { margin-bottom: 1.5rem; }
.page-header h1 { font-size: 22px; font-weight: 600; margin-bottom: 4px; }
.page-header .sub { color: var(--text2); font-size: 14px; }

/* ── BREADCRUMB ───────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 1.25rem;
  font-size: 13px;
  color: var(--text3);
}
.breadcrumb button {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 6px;
  font-weight: 500;
}
.breadcrumb button:hover { background: var(--accent-bg); }
.breadcrumb span::before { content: '›'; margin-right: 8px; }

/* ── CARD GRID ────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 12px;
}

/* ── EXAM CARD ────────────────────────────────── */
.exam-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  cursor: pointer;
  transition: all .18s;
  box-shadow: var(--shadow);
}
.exam-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}
.exam-card-name { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.exam-card-meta { font-size: 12px; color: var(--text2); margin-bottom: 10px; }

/* ── CENTER CARD ──────────────────────────────── */
.center-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem;
  box-shadow: var(--shadow);
  transition: border-color .15s;
}
.center-card-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.center-card-info {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.center-card-info:hover .center-card-name { color: var(--accent); }
.center-card-name { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.center-card-docs { font-size: 12px; color: var(--text2); }

/* ── PROGRESS BAR ─────────────────────────────── */
.prog-bg {
  height: 5px;
  background: var(--surface2);
  border-radius: 3px;
  margin-top: 8px;
  overflow: hidden;
}
.prog-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .4s ease;
}

/* ── ZIP BUTTON ───────────────────────────────── */
.btn-zip {
  height: 32px;
  padding: 0 12px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  background: var(--accent2-bg);
  color: var(--accent2);
  border: 1px solid #9FD6C2;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: all .15s;
  flex-shrink: 0;
}
.btn-zip:hover { background: #C8EDE1; }
.btn-zip:disabled { opacity: .4; cursor: not-allowed; }

/* ── UPLOAD VIEW ──────────────────────────────── */
.upload-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.upload-header-left { display: flex; align-items: center; gap: 14px; }
.center-avatar {
  width: 44px; height: 44px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.upload-header h2 { font-size: 18px; font-weight: 600; }
.upload-header p { font-size: 13px; color: var(--text2); margin-top: 2px; }

/* ── STATS ROW ────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 1.25rem;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  text-align: center;
}
.stat-num { font-size: 22px; font-weight: 600; font-family: 'DM Mono', monospace; }
.stat-label { font-size: 11px; color: var(--text3); margin-top: 2px; text-transform: uppercase; letter-spacing: .04em; }

/* ── DOC UPLOAD ITEM ──────────────────────────── */
.doc-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color .15s;
}
.doc-item.done  { border-left: 3px solid var(--accent2); }
.doc-item.manual{ border-left: 3px solid var(--accent);  }

.doc-status {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.doc-status.s-done   { background: var(--accent2-bg); color: var(--accent2); }
.doc-status.s-manual { background: var(--accent-bg);  color: var(--accent);  }
.doc-status.s-pending{ background: var(--surface2);   color: var(--text3);   border: 1px solid var(--border2); }

.doc-info { flex: 1; min-width: 0; }
.doc-name { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-note { font-size: 12px; color: var(--text2); margin-top: 2px; display: flex; align-items: center; gap: 4px; }

.doc-actions { display: flex; gap: 6px; align-items: center; flex-shrink: 0; }

/* ── BUTTONS ──────────────────────────────────── */
.btn-upload {
  height: 32px; padding: 0 12px;
  font-family: inherit; font-size: 12px; font-weight: 600;
  background: var(--accent-bg); color: var(--accent);
  border: 1px solid #A8C4E4;
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  transition: all .15s;
  white-space: nowrap;
}
.btn-upload:hover { background: #D0E4F5; }

.btn-tick {
  height: 32px; padding: 0 10px;
  font-family: inherit; font-size: 12px; font-weight: 500;
  background: var(--surface2); color: var(--text2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  transition: all .15s;
  white-space: nowrap;
}
.btn-tick:hover { background: var(--accent2-bg); color: var(--accent2); border-color: #9FD6C2; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: 20px;
}
.pill-green { background: var(--accent2-bg); color: var(--accent2); }
.pill-blue  { background: var(--accent-bg);  color: var(--accent);  }

.btn-remove {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: none; color: var(--text3);
  border: 1px solid transparent;
  cursor: pointer; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.btn-remove:hover { background: var(--danger-bg); color: var(--danger); border-color: #FECACA; }

.file-hidden { display: none; }

/* ── CONFIG PAGE ──────────────────────────────── */
.pw-overlay {
  position: fixed; inset: 0;
  background: rgba(245,243,238,.92);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
}
.pw-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2.5rem 2rem;
  width: 340px;
  text-align: center;
  box-shadow: var(--shadow-lg);
}
.pw-icon {
  width: 56px; height: 56px;
  background: var(--surface2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; color: var(--text2);
  margin: 0 auto 1rem;
}
.pw-card h2 { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.pw-card > p { font-size: 13px; color: var(--text2); margin-bottom: 1.5rem; }

.pw-field {
  position: relative;
  margin-bottom: 10px;
}
.pw-field input {
  width: 100%;
  height: 42px;
  padding: 0 44px 0 14px;
  font-family: inherit;
  font-size: 15px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color .15s;
}
.pw-field input:focus { border-color: var(--accent); }
.pw-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text3); font-size: 17px; padding: 0;
}
.pw-eye:hover { color: var(--text); }
.pw-error { font-size: 13px; color: var(--danger); min-height: 20px; margin-bottom: 12px; }

.btn-unlock {
  width: 100%; height: 42px;
  font-family: inherit; font-size: 15px; font-weight: 600;
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: opacity .15s;
}
.btn-unlock:hover { opacity: .9; }

.config-blur {
  filter: blur(4px);
  pointer-events: none;
  opacity: .2;
  transition: all .3s;
}
.config-blur.unlocked { filter: none; pointer-events: auto; opacity: 1; }

.config-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem;
}
.unlocked-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500; color: var(--accent2);
  background: var(--accent2-bg); padding: 5px 12px; border-radius: 20px;
}
.btn-lock {
  height: 34px; padding: 0 14px;
  font-family: inherit; font-size: 13px; font-weight: 500;
  background: var(--danger-bg); color: var(--danger);
  border: 1px solid #FECACA; border-radius: var(--radius);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.btn-lock:hover { background: #FEE2E2; }

.config-section { margin-bottom: 1.5rem; }
.section-label {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .07em;
  color: var(--text3); margin-bottom: .75rem;
}

.input-row { display: flex; gap: 8px; margin-bottom: .75rem; }
.input-row input {
  flex: 1; height: 38px; padding: 0 12px;
  font-family: inherit; font-size: 14px;
  border: 1px solid var(--border2); border-radius: var(--radius);
  background: var(--surface); color: var(--text); outline: none;
  transition: border-color .15s;
}
.input-row input:focus { border-color: var(--accent); }

.btn-add {
  height: 38px; padding: 0 16px;
  font-family: inherit; font-size: 13px; font-weight: 600;
  background: var(--text); color: var(--surface);
  border: none; border-radius: var(--radius);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; transition: opacity .15s;
}
.btn-add:hover { opacity: .85; }

/* list rows */
.list-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  margin-bottom: 6px;
  background: var(--surface);
  transition: border-color .15s;
}
.list-row.selected { border-color: var(--accent); background: var(--accent-bg); }
.list-row-name { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.list-row-name i { font-size: 15px; color: var(--text3); }
.list-row-meta { font-size: 11px; color: var(--text3); font-weight: 400; margin-left: 4px; }
.list-row-actions { display: flex; gap: 6px; }
.btn-configure {
  height: 26px; padding: 0 10px;
  font-family: inherit; font-size: 12px; font-weight: 500;
  background: var(--accent-bg); color: var(--accent);
  border: 1px solid #A8C4E4; border-radius: 6px;
  cursor: pointer;
}
.btn-configure:hover { background: #D0E4F5; }
.btn-del {
  width: 26px; height: 26px;
  background: none; border: 1px solid transparent;
  border-radius: 6px; cursor: pointer;
  color: var(--text3); font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.btn-del:hover { background: var(--danger-bg); color: var(--danger); border-color: #FECACA; }

/* exam panel */
.exam-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  margin-top: 1rem;
  box-shadow: var(--shadow);
}
.exam-panel-header {
  display: flex; align-items: center; gap: 8px;
  font-size: 15px; font-weight: 600; margin-bottom: 1.25rem;
  color: var(--accent);
}
.panel-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.panel-col {}

.config-hint {
  text-align: center; padding: 2rem;
  color: var(--text3); font-size: 14px;
}
.config-hint i { font-size: 28px; display: block; margin-bottom: 8px; }

/* ── EMPTY STATE ──────────────────────────────── */
.empty-state {
  text-align: center; padding: 3rem 1rem;
  color: var(--text3);
}
.empty-state i { font-size: 40px; display: block; margin-bottom: 12px; }
.empty-state p { font-size: 15px; font-weight: 500; color: var(--text2); }
.empty-state span { font-size: 13px; }

/* ── TOAST ────────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--text); color: var(--surface);
  padding: 10px 18px; border-radius: var(--radius);
  font-size: 13px; font-weight: 500;
  display: none; align-items: center; gap: 8px;
  z-index: 999; box-shadow: var(--shadow-lg);
  animation: slideUp .2s ease;
}
.toast.show { display: flex; }
@keyframes slideUp { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── LOADING ──────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
}
.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── RESPONSIVE ───────────────────────────────── */
@media (max-width: 640px) {
  .nav { padding: 0 1rem; gap: 1rem; }
  .page { padding: 1.25rem 1rem; }
  .panel-cols { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .card-grid { grid-template-columns: 1fr 1fr; }
}
