/* ═══════════════════════════════════════════════════════════
   ExamBooking — Design System (παλέτα: indigo / violet)
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg:          #f5f4fb;
  --surface:     #ffffff;
  --surface-2:   #f2f1f9;
  --border:      #e3e1f0;
  --text:        #201c33;
  --text-muted:  #6c6680;
  --primary:     #6366f1;
  --primary-dk:  #4f46e5;
  --primary-lt:  #eef0fe;
  --accent:      #14b8a6;
  --accent-dk:   #0d9488;
  --accent-lt:   #ecfdfa;
  --success:     #10b981;
  --success-lt:  #ecfdf5;
  --warning:     #f59e0b;
  --warning-lt:  #fffbeb;
  --danger:      #f43f5e;
  --danger-lt:   #fff1f3;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow:      0 1px 4px rgba(32,28,51,.08);
  --shadow-lg:   0 4px 24px rgba(32,28,51,.12);
  --transition:  .16s ease;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
}

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

/* ── Layout ── */
.app-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px 100px;
}

/* ── Top Bar ── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 56px;
}

.topbar-logo {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -.3px;
  flex-shrink: 0;
}

.topbar-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; }

/* ── Back button ── */
.btn-back {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  padding: 6px 4px;
  border: none;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}
.btn-back svg { width: 18px; height: 18px; }

/* ── Cards ── */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-body { padding: 20px; }
.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.card-header h2 { font-size: 15px; font-weight: 600; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background var(--transition), transform var(--transition);
  text-align: center;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn-primary   { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dk); }

.btn-accent    { background: var(--accent); color: white; }
.btn-accent:hover { background: var(--accent-dk); }

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }

.btn-danger  { background: var(--danger); color: white; }
.btn-danger:hover { background: #e11d48; }

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  padding: 8px;
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 16px 20px; font-size: 16px; }
.btn-full { width: 100%; justify-content: center; }

.btn svg { width: 16px; height: 16px; }

/* ── Big action tiles (dashboard κουμπιά) ── */
.action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 20px;
}
@media (max-width: 480px) {
  .action-grid { grid-template-columns: 1fr; }
}
.action-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.action-tile:active { transform: scale(.98); }
.action-tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.action-tile-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
  background: var(--primary-lt);
  color: var(--primary);
}
.action-tile.tile-accent .action-tile-icon { background: var(--accent-lt); color: var(--accent-dk); }
.action-tile-icon svg { width: 26px; height: 26px; }
.action-tile-title { font-size: 16px; font-weight: 700; }
.action-tile-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ── Toggle chip group ── */
.chip-group { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  padding: 6px 12px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  white-space: nowrap;
}
.chip:active { transform: scale(.95); }
.chip.active { border-color: var(--primary); background: var(--primary); color: white; }
.chip.active-warn { border-color: var(--warning); background: var(--warning); color: white; }
.chip.active-danger { border-color: var(--danger); background: var(--danger); color: white; }

/* ── Forms ── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.form-control {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  transition: border-color var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
}
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236c6680' stroke-width='2'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* ── Lists ── */
.list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--surface-2); }
.list-item-main { flex: 1; min-width: 0; }
.list-item-title { font-size: 15px; font-weight: 500; }
.list-item-sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.list-actions { display: flex; gap: 4px; align-items: center; flex-shrink: 0; }

/* ── Badges ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}
.badge-blue  { background: var(--primary-lt); color: var(--primary-dk); }
.badge-teal  { background: var(--accent-lt);  color: var(--accent-dk); }
.badge-green { background: var(--success-lt); color: #15803d; }
.badge-warn  { background: var(--warning-lt); color: #b45309; }
.badge-red   { background: var(--danger-lt);  color: #be123c; }
.badge-gray  { background: var(--surface-2);  color: var(--text-muted); }

/* ── Weekend date picker (Διαγώνισμα / Κρατήσεις) ── */
.date-pick-list { max-height: 380px; overflow-y: auto; }
.date-pick-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--transition);
}
.date-pick-item:last-child { border-bottom: none; }
.date-pick-item:hover { background: var(--primary-lt); }
.date-pick-item.disabled { cursor: not-allowed; opacity: .5; }
.dpi-date { font-size: 15px; font-weight: 600; }
.dpi-weekday { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.dpi-avail { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.dpi-avail-num { font-size: 18px; font-weight: 700; }
.dpi-arrow { color: var(--primary); flex-shrink: 0; }

/* ── Wizard steps ── */
.wizard-step { display: none; }
.wizard-step.active { display: block; }

/* ── Progress / remaining banner ── */
.remaining-box {
  background: var(--primary-lt);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.remaining-box.done { background: var(--success-lt); }
.remaining-label { font-size: 13px; color: var(--primary-dk); font-weight: 500; }
.remaining-box.done .remaining-label { color: #15803d; }
.remaining-num { font-size: 22px; font-weight: 800; color: var(--primary-dk); }
.remaining-box.done .remaining-num { color: #15803d; }
.progress-bar {
  height: 8px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
  margin-top: 10px;
}
.progress-bar-fill { height: 100%; background: var(--primary); transition: width .25s ease; }
.remaining-box.done .progress-bar-fill { background: var(--success); }

/* ── Stats row ── */
.stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.stat-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
}
.stat-num  { font-size: 22px; font-weight: 700; color: var(--primary); }
.stat-lbl  { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ── Login page ── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #eef0fe 0%, #f5f4fb 100%);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px 32px;
}
.login-logo {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: -.5px;
}
.login-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 32px;
}
.login-error {
  background: var(--danger-lt);
  color: #be123c;
  padding: 10px 14px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
}

/* ── Modal ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(32,28,51,.5);
  z-index: 200;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.modal-overlay.open { display: flex; align-items: flex-start; justify-content: center; padding-top: 60px; }

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  animation: slideUp .2s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 6px;
}
.modal-close:hover { background: var(--surface-2); }
.modal-body  { padding: 20px; }
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── Section heading ── */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 24px 0 12px;
}
.section-head h2 { font-size: 16px; font-weight: 700; }

/* ── Empty state ── */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
}
.empty-icon { font-size: 40px; margin-bottom: 12px; }
.empty p { font-size: 14px; margin-top: 6px; }

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  margin-bottom: 16px;
}
.alert-success { background: var(--success-lt); color: #15803d; }
.alert-danger  { background: var(--danger-lt);  color: #be123c; }
.alert-info    { background: var(--primary-lt); color: var(--primary-dk); }

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

/* ── Room cards (admin) ── */
.room-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.room-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 18px;
}
.room-card-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.room-card-seats { font-size: 13px; color: var(--text-muted); }
.room-card-actions { display: flex; gap: 6px; margin-top: 12px; }

/* ── Booking row (teacher detail in Κρατήσεις) ── */
.booking-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.booking-row:last-child { border-bottom: none; }
.booking-row-name { font-size: 14px; font-weight: 600; }
.booking-row-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.booking-row-seats { font-size: 15px; font-weight: 700; color: var(--primary); flex-shrink: 0; }

/* ── User avatar ── */
.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-lt);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

/* ── Utility ── */
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: 13px; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ── Scrollable table wrapper ── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; padding: 10px 12px; font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .4px; border-bottom: 1.5px solid var(--border); background: var(--surface-2); }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface-2); }

/* ── Responsive tweaks ── */
@media (max-width: 480px) {
  .form-row { grid-template-columns: 1fr; }
  .room-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(3, 1fr); }
  .modal-overlay.open { padding-top: 20px; }
  .modal { max-height: 90vh; overflow-y: auto; }
  .login-card { padding: 32px 24px; }
}

@media (max-width: 360px) {
  .chip { padding: 5px 9px; font-size: 12px; }
}
