/* ============================================================
   出席登録システム — Modern Minimal Design
   ============================================================ */

/* ---------- Reset & Base ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --c-bg: #f0f2f5;
  --c-surface: rgba(255, 255, 255, 0.72);
  --c-surface-solid: #ffffff;
  --c-primary: #4f46e5;
  --c-primary-light: #818cf8;
  --c-primary-dark: #3730a3;
  --c-accent: #06b6d4;
  --c-success: #10b981;
  --c-success-light: #d1fae5;
  --c-warning: #f59e0b;
  --c-warning-light: #fef3c7;
  --c-danger: #ef4444;
  --c-danger-light: #fee2e2;
  --c-text: #1e293b;
  --c-text-secondary: #64748b;
  --c-text-muted: #94a3b8;
  --c-border: rgba(0, 0, 0, 0.06);
  --c-glass-border: rgba(255, 255, 255, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 24px rgba(79, 70, 229, 0.15);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --blur: 16px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family:
    "Noto Sans JP",
    "Inter",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  background: linear-gradient(135deg, #e0e7ff 0%, #dbeafe 40%, #cffafe 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--c-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px;
}

/* ---------- Glass Card Mixin ---------- */
.glass {
  background: var(--c-surface);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--c-glass-border);
  box-shadow: var(--shadow-md);
}

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-card {
  background: var(--c-surface);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--c-glass-border);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  max-width: 480px;
  margin: 80px auto;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: cardEnter 0.5s ease-out;
}

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

.login-card h1 {
  font-size: 26px;
  font-weight: 700;
  color: var(--c-primary);
  margin-bottom: 6px;
}

.subtitle {
  color: var(--c-text-secondary);
  font-size: 14px;
  margin-bottom: 32px;
}

/* Course selection */
.course-prompt {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 16px;
}

.course-buttons {
  display: flex;
  gap: 12px;
}

.course-btn {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 12px;
  border: 2px solid var(--c-border);
  border-radius: var(--radius-md);
  background: #f8fafc;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.course-btn:hover {
  border-color: var(--c-primary-light);
  background: #eef2ff;
  box-shadow: var(--shadow-md);
}

.course-btn-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--c-text);
}

.course-btn-sub {
  font-size: 13px;
  color: var(--c-text-muted);
  font-weight: 500;
}

@media (max-width: 480px) {
  .course-buttons {
    flex-direction: column;
  }
}

.course-selected {
  font-size: 14px;
  font-weight: 600;
  color: var(--c-primary);
  background: #eef2ff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(79, 70, 229, 0.12);
  margin-bottom: 4px;
}

.course-change-link {
  background: none;
  border: none;
  color: var(--c-text-muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
  padding: 0;
  margin-bottom: 8px;
}

.course-change-link:hover {
  color: var(--c-primary);
}

.login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--c-text-muted);
  font-size: 13px;
}

.login-divider::before,
.login-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--c-border);
}

.error {
  background: var(--c-danger-light);
  color: var(--c-danger);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid rgba(239, 68, 68, 0.15);
}

.error.hidden {
  display: none;
}

.google-signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 24px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  background: white;
  cursor: pointer;
  font-size: 15px;
  font-family: inherit;
  color: var(--c-text);
  transition: var(--transition);
  width: 100%;
  max-width: 400px;
  justify-content: center;
}

.google-signin-btn:hover {
  background: #f8fafc;
  border-color: #9ca3af;
  box-shadow: var(--shadow-sm);
}

.info {
  margin-top: 24px;
  font-size: 13px;
  color: var(--c-text-muted);
  line-height: 1.5;
}

.info strong {
  color: var(--c-text-secondary);
}

/* ============================================================
   DASHBOARD — Header
   ============================================================ */
header {
  background: var(--c-surface);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--c-glass-border);
  border-radius: var(--radius-md);
  padding: 16px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

#user-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  border: 2px solid var(--c-border);
  object-fit: cover;
}

#user-name {
  font-weight: 600;
  font-size: 15px;
  flex: 1;
}

#user-email {
  color: var(--c-text-muted);
  font-size: 13px;
}

/* Shared button styles */
.btn {
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

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

.btn-primary:hover {
  background: var(--c-primary-dark);
  box-shadow: var(--shadow-glow);
}

.btn-accent {
  background: #d97706;
  color: white;
}

.btn-accent:hover {
  background: #b45309;
}

.btn-success {
  background: var(--c-success);
  color: white;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: var(--c-danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-ghost {
  background: transparent;
  color: var(--c-text-secondary);
  border: 1px solid var(--c-border);
}

.btn-ghost:hover {
  background: rgba(0, 0, 0, 0.04);
}

#logout-btn {
  background: transparent;
  color: var(--c-danger);
  border: 1px solid rgba(239, 68, 68, 0.2);
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: var(--transition);
}

#logout-btn:hover {
  background: var(--c-danger-light);
}

#back-btn {
  background: var(--c-primary);
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: var(--transition);
}

#back-btn:hover {
  background: var(--c-primary-dark);
}

/* ============================================================
   DASHBOARD — Main
   ============================================================ */
main {
  background: var(--c-surface);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--c-glass-border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-md);
  animation: cardEnter 0.4s ease-out;
}

h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--c-primary);
  margin-bottom: 8px;
}

h2 {
  color: var(--c-text);
  font-size: 17px;
  font-weight: 600;
  margin-top: 28px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--c-primary), var(--c-accent));
}

section {
  margin-bottom: 36px;
}

/* Current time */
.current-time {
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--c-primary);
  margin-bottom: 20px;
  padding: 12px;
  background: linear-gradient(135deg, #eef2ff 0%, #e0f2fe 100%);
  border-radius: var(--radius-md);
  border: 1px solid rgba(79, 70, 229, 0.08);
  font-family: "JetBrains Mono", "Courier New", Consolas, monospace;
  letter-spacing: 0.5px;
}

/* ============================================================
   Lecture Info
   ============================================================ */
.lecture-info {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
}

#lecture-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--c-text);
}

#lecture-date {
  color: var(--c-text-secondary);
  margin-top: 4px;
  font-size: 14px;
}

.current-registration {
  margin-top: 16px;
  padding: 16px;
  background: var(--c-success-light);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.current-registration p {
  margin: 0 0 10px 0;
  color: #065f46;
  font-size: 15px;
}

#registered-seat {
  font-weight: 700;
  font-size: 17px;
  color: #047857;
}

.cancel-btn {
  background: var(--c-danger);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: var(--transition);
}

.cancel-btn:hover {
  background: #dc2626;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

/* Online attendance */
.online-attendance {
  background: linear-gradient(135deg, #f0fdf4, #ecfdf5);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(16, 185, 129, 0.15);
}

.online-desc {
  font-size: 14px;
  color: var(--c-text-secondary);
  margin-bottom: 14px;
}

.online-btn {
  padding: 12px 28px;
  font-size: 15px;
}

/* Registration status badges */
.registration-status {
  margin-top: 14px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  text-align: center;
}

.registration-status.available {
  background: var(--c-success-light);
  color: #065f46;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.registration-status.before {
  background: var(--c-warning-light);
  color: #92400e;
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.registration-status.closed {
  background: var(--c-danger-light);
  color: #991b1b;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ============================================================
   CLASSROOM FRONT (blackboard & podium)
   ============================================================ */
.classroom-front {
  position: relative;
  width: 100%;
  max-width: 800px;
  margin: 0 auto 24px auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.blackboard {
  background: linear-gradient(180deg, #2d5016 0%, #1a3d0a 100%);
  border: 6px solid #a07d3c;
  border-radius: var(--radius-sm);
  height: 80px;
  width: 100%;
  max-width: 480px;
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.15),
    inset 0 0 20px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.85);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 3px;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.podium {
  background: linear-gradient(180deg, #b8977a 0%, #9e7e64 100%);
  border: 2px solid #7d6652;
  width: 90px;
  height: 60px;
  border-radius: 4px 4px 0 0;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  position: relative;
}

.podium::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: #6d5a4a;
}

/* ============================================================
   LEGEND
   ============================================================ */
.legend {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin: 20px 0;
  padding: 14px 20px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  flex-wrap: wrap;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--c-text-secondary);
}

.legend-color {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  border: 2px solid transparent;
}

.legend-color.available {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.legend-color.occupied {
  background: var(--c-warning);
  border-color: var(--c-warning);
}

.legend-color.my-seat {
  background: var(--c-success);
  border-color: var(--c-success);
}

/* ============================================================
   SEAT MAP
   ============================================================ */
.seat-map {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.section {
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
}

.section h3 {
  color: var(--c-primary);
  margin-bottom: 14px;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.section-front {
  background: linear-gradient(135deg, #f8faff 0%, #eef2ff 100%);
}

.section-front .blocks-container {
  display: flex;
  justify-content: safe center;
  gap: 25px;
  overflow-x: auto;
  padding: 10px;
}

.section-rear {
  background: linear-gradient(135deg, #fefce8 0%, #fff7ed 100%);
}

.section-rear .blocks-container {
  display: flex;
  justify-content: safe center;
  gap: 25px;
  overflow-x: auto;
  padding: 10px;
}

.block {
  margin-bottom: 0;
  min-width: 0;
  flex-shrink: 0;
}

.block h4 {
  color: var(--c-text-secondary);
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  letter-spacing: 0.5px;
}

.seat-grid {
  display: grid;
  gap: 4px;
  width: 100%;
}

/* ---------- Seat button ---------- */
.seat {
  width: 38px;
  height: 38px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  background: #e2e8f0;
  color: var(--c-text-secondary);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  font-family: "JetBrains Mono", "Consolas", "Courier New", monospace;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  padding: 0;
  flex-shrink: 0;
  position: relative;
}

.seat.available {
  background: #e2e8f0;
  color: var(--c-text-secondary);
  border-color: #cbd5e1;
}

.seat.available:hover {
  background: #cbd5e1;
  border-color: var(--c-primary-light);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.15);
}

.seat.occupied {
  background: var(--c-warning);
  color: white;
  border-color: var(--c-warning);
  cursor: not-allowed;
}

.seat.my-seat {
  background: var(--c-success);
  color: white;
  border-color: var(--c-success);
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.25);
}

.seat.my-seat:hover {
  background: #059669;
  border-color: #047857;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.35);
}

.seat.unavailable {
  background: #f1f5f9;
  color: #cbd5e1;
  border-color: #e2e8f0;
  cursor: not-allowed;
}

/* Regional course — larger seats */
.seat-map.regional .seat {
  width: 54px;
  height: 54px;
  font-size: 17px;
  font-weight: 600;
  border-radius: 8px;
}

@media (max-width: 768px) {
  .seat-map.regional .blocks-container {
    gap: 30px !important;
  }
}

@media (max-width: 480px) {
  .seat-map.regional .blocks-container {
    gap: 24px !important;
  }
}

/* ============================================================
   ATTENDANCE HISTORY TABLE
   ============================================================ */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 10px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  border: 1px solid var(--c-border);
}

thead {
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: white;
}

th {
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.3px;
}

td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--c-border);
  font-size: 14px;
}

tbody tr {
  transition: var(--transition);
}

tbody tr:hover {
  background: #f8fafc;
}

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

/* ============================================================
   MODALS
   ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: overlayIn 0.2s ease-out;
}

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

.modal-overlay .modal,
.modal-content {
  background: var(--c-surface-solid);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 440px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: modalSlideUp 0.3s ease-out;
  position: relative;
}

#seat-info-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
}

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

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

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

.modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.modal-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--c-primary), var(--c-accent));
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px auto;
  font-size: 26px;
  color: white;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.25);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--c-text);
  margin: 0 0 6px 0;
}

.modal-subtitle {
  font-size: 13px;
  color: var(--c-text-muted);
  margin: 0;
}

.modal-body {
  margin-bottom: 24px;
}

.modal-info {
  background: #f8fafc;
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 14px;
  border: 1px solid var(--c-border);
}

.modal-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.modal-info-row:last-child {
  margin-bottom: 0;
}

.modal-info-label {
  font-size: 13px;
  color: var(--c-text-muted);
  font-weight: 500;
}

.modal-info-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--c-text);
}

.modal-seat-code {
  display: inline-block;
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: white;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 16px;
}

.modal-warning {
  background: var(--c-warning-light);
  border-left: 3px solid var(--c-warning);
  padding: 12px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13px;
  color: #92400e;
  margin-top: 14px;
  font-weight: 500;
}

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.modal-btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.modal-btn:hover {
  transform: translateY(-1px);
}

.modal-btn-cancel {
  background: #f1f5f9;
  color: var(--c-text-secondary);
}

.modal-btn-cancel:hover {
  background: #e2e8f0;
}

.modal-btn-confirm {
  background: var(--c-primary);
  color: white;
}

.modal-btn-confirm:hover {
  background: var(--c-primary-dark);
  box-shadow: var(--shadow-glow);
}

.modal-btn-change {
  background: var(--c-warning);
  color: white;
}

.modal-btn-change:hover {
  background: #d97706;
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.3);
}

.btn-secondary {
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  background: linear-gradient(135deg, var(--c-primary), var(--c-primary-dark));
  color: white;
  box-shadow: var(--shadow-glow);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
}

/* ============================================================
   ADMIN PAGE
   ============================================================ */

/* Course tabs */
.course-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.course-tab {
  padding: 9px 20px;
  border: 2px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--c-text-secondary);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}

.course-tab:hover {
  border-color: var(--c-primary-light);
  color: var(--c-primary);
}

.course-tab.active {
  background: var(--c-primary);
  color: white;
  border-color: var(--c-primary);
}

.admin-stats,
.admin-attendance {
  margin-bottom: 36px;
}

.filter-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
  padding: 14px 18px;
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 1px solid var(--c-border);
  flex-wrap: wrap;
}

.filter-controls label {
  font-weight: 600;
  font-size: 14px;
  color: var(--c-text-secondary);
}

.filter-controls select {
  padding: 8px 14px;
  border: 1px solid #d1d5db;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  min-width: 200px;
  background: white;
  color: var(--c-text);
  transition: var(--transition);
}

.filter-controls select:focus {
  outline: none;
  border-color: var(--c-primary-light);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.export-btn {
  background: var(--c-success);
  color: white;
  border: none;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: var(--transition);
  margin-left: auto;
}

.export-btn:hover {
  background: #059669;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.stat-card {
  background: white;
  border: 1px solid var(--c-border);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: var(--transition);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.stat-card h3 {
  color: var(--c-primary);
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 600;
}

.stat-card .date {
  color: var(--c-text-muted);
  font-size: 13px;
  margin-bottom: 12px;
}

.stat-card .count {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--c-success), var(--c-accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-card .label {
  color: var(--c-text-muted);
  font-size: 13px;
  font-weight: 500;
}

/* ============================================================
   SEAT VIEW (Admin)
   ============================================================ */
.lecture-selector {
  margin-bottom: 28px;
}

#seat-view-section .container {
  max-width: 100%;
}

.seat-map-view {
  width: 100%;
  max-width: none;
}

.seat-map-view .seat {
  width: 38px;
  height: 38px;
  font-size: 10px;
  line-height: 1.3;
  padding: 4px 1px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}

.seat-map-view .seat.occupied {
  background: var(--c-success);
  color: white;
  border-color: var(--c-success);
}

.seat-map-view .seat.occupied .seat-code {
  font-weight: bold;
  margin-bottom: 2px;
  font-size: 10px;
}

.seat-map-view .seat.occupied .student-id {
  font-size: 9px;
  opacity: 0.9;
  margin-bottom: 1px;
}

.seat-map-view .seat.occupied .student-name {
  font-size: 10px;
  opacity: 0.9;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.seat-map-view .seat.available {
  background: #e2e8f0;
  color: var(--c-text-muted);
  border-color: #cbd5e1;
}

.seat-map-view .seat.available .seat-code {
  font-size: 11px;
}

.seat-map-view .seat-grid {
  gap: 6px;
}

.seat-map-view .blocks-container {
  display: flex;
  justify-content: safe center;
  gap: 25px;
  overflow-x: auto;
  padding: 10px;
}

.seat-map-view .block {
  flex-shrink: 0;
}

/* Regional course — larger seats in seat-view */
.seat-map-view.regional .seat {
  width: 54px;
  height: 54px;
  font-size: 17px;
  font-weight: 600;
  border-radius: 8px;
}

.seat-map-view.regional .blocks-container {
  gap: 40px;
}

/* Seat tooltip */
.seat-map-view .seat {
  position: relative;
  cursor: pointer;
}

.seat-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--c-text);
  color: white;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  white-space: normal;
  line-height: 1.8;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s,
    visibility 0.2s;
  z-index: 10000;
  min-width: 200px;
  text-align: left;
  box-shadow: var(--shadow-lg);
  font-weight: normal;
}

.seat-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--c-text);
}

.seat-tooltip.show {
  opacity: 1;
  visibility: visible;
  bottom: calc(100% + 8px);
}

.seat-tooltip-row {
  margin-bottom: 4px;
}

.seat-tooltip-row:last-child {
  margin-bottom: 0;
}

.seat-tooltip-label {
  color: #94a3b8;
  font-size: 11px;
  margin-right: 8px;
}

.seat-tooltip-value {
  color: white;
  font-weight: 500;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
/* @media (max-width: 1400px) {
  .section-front .blocks-container,
  .section-rear .blocks-container {
    gap: 10px;
  }

  .seat-grid {
    gap: 3px;
  }

  .seat {
    max-width: 38px;
    max-height: 38px;
    font-size: 8px;
  }

  .seat-map-view .seat {
    min-width: 45px;
    min-height: 45px;
    max-width: 60px;
    max-height: 60px;
  }

  .seat-map-view .seat.occupied .seat-code {
    font-size: 9px;
  }

  .seat-map-view .seat.occupied .student-id {
    font-size: 8px;
  }

  .seat-map-view .seat.occupied .student-name {
    font-size: 9px;
  }
} */
/* 
@media (max-width: 1200px) {
  .seat {
    max-width: 35px;
    max-height: 35px;
    font-size: 7px;
  }

  .block h4 {
    font-size: 12px;
  }

  .seat-map-view .blocks-container {
    grid-template-columns: repeat(2, 1fr);
  }

  .seat-map-view .seat {
    min-width: 50px;
    min-height: 50px;
    max-width: 65px;
    max-height: 65px;
  }
} */

@media (max-width: 768px) {
  .container {
    padding: 12px;
  }

  .login-card {
    padding: 28px 24px;
    margin: 40px auto;
    border-radius: var(--radius-md);
  }

  .login-card h1 {
    font-size: 22px;
  }

  .user-info {
    flex-wrap: wrap;
  }

  header {
    padding: 14px 16px;
  }

  main {
    padding: 20px;
    border-radius: var(--radius-md);
  }

  h1 {
    font-size: 18px;
  }

  h2 {
    font-size: 15px;
  }

  .classroom-front {
    margin-bottom: 16px;
  }

  .blackboard {
    height: 65px;
    font-size: 15px;
    max-width: 380px;
  }

  .podium {
    width: 72px;
    height: 52px;
  }

  .legend {
    gap: 14px;
    padding: 12px;
  }

  .legend-item {
    font-size: 12px;
  }

  .legend-color {
    width: 18px;
    height: 18px;
  }

  .section-front .blocks-container,
  .section-rear .blocks-container {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  .seat {
    max-width: 40px;
    max-height: 40px;
    font-size: 11px !important;
  }

  table {
    font-size: 13px;
  }

  th,
  td {
    padding: 10px 12px;
  }

  .seat-map-view .blocks-container {
    grid-template-columns: 1fr;
  }

  .filter-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-controls select {
    min-width: unset;
    width: 100%;
  }

  .export-btn {
    margin-left: 0;
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .blackboard {
    height: 55px;
    font-size: 13px;
    max-width: 280px;
  }

  .podium {
    width: 56px;
    height: 44px;
  }

  .legend {
    gap: 10px;
    padding: 10px;
  }

  .legend-item {
    font-size: 11px;
    gap: 6px;
  }

  .legend-color {
    width: 16px;
    height: 16px;
  }

  .section-front .blocks-container,
  .section-rear .blocks-container {
    grid-template-columns: 1fr;
  }

  header {
    padding: 12px;
  }

  main {
    padding: 16px;
  }

  .modal-overlay .modal,
  .modal-content {
    padding: 24px;
    width: 95%;
  }

  .modal-icon {
    width: 48px;
    height: 48px;
    font-size: 22px;
  }

  .modal-title {
    font-size: 18px;
  }

  .modal-actions {
    flex-direction: column;
  }

  .modal-btn {
    width: 100%;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}
