/* ==========================================================================
   ZOOM ATTENDANCE & STUDENT MANAGEMENT SYSTEM
   Design System: Teal & Warm Bronze Gold, Glassmorphism, Micro-Interactions
   ========================================================================== */

:root {
  /* TYD Brand Palette */
  --tyd-teal: #008799;
  --tyd-teal-dark: #006674;
  --tyd-teal-light: #e6f6f8;
  --tyd-teal-glow: rgba(0, 135, 153, 0.16);

  --tyd-gold: #cd7f32;
  --tyd-gold-dark: #a96320;
  --tyd-gold-light: #fdf5ec;
  --tyd-gold-glow: rgba(205, 127, 50, 0.18);

  --tyd-gradient: linear-gradient(135deg, #008799 0%, #cd7f32 100%);
  --tyd-gradient-subtle: linear-gradient(135deg, rgba(0, 135, 153, 0.08) 0%, rgba(205, 127, 50, 0.08) 100%);

  /* Backgrounds & Surfaces */
  --bg-body: #f4f7fc;
  --bg-card: #ffffff;
  --bg-input: #f8fafc;
  --bg-hover: #f1f5f9;
  --bg-subtle: #f8fafc;

  /* Borders & Glass */
  --border-card: rgba(0, 135, 153, 0.1);
  --border-subtle: #e2e8f0;
  --border-color: #e2e8f0;

  /* Typography */
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Status Colors */
  --color-success: #059669;
  --color-success-bg: #ecfdf5;
  --color-success-border: #a7f3d0;

  --color-warning: #d97706;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;

  --color-danger: #dc2626;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;

  /* Primary aliases */
  --primary: var(--tyd-teal);
  --primary-hover: var(--tyd-teal-dark);
  --primary-light: var(--tyd-teal-light);
  --accent: var(--tyd-gold);

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 135, 153, 0.08);
  --shadow-lg: 0 10px 30px rgba(0, 135, 153, 0.12);
  --shadow-card: 0 4px 20px rgba(15, 23, 42, 0.04);

  /* Dimensions & Curves */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 9999px;

  --font-family: 'Inter', 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-display: 'Outfit', 'Plus Jakarta Sans', sans-serif;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.hidden {
  display: none !important;
}

/* Cosmic Ambient Glows */
body::before, body::after {
  content: '';
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  filter: blur(140px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.12;
}

body::before {
  top: 5%;
  left: 10%;
  background: var(--tyd-teal);
}

body::after {
  bottom: 10%;
  right: 10%;
  background: var(--tyd-gold);
}

/* Layout Container */
.app-container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 28px 60px;
}

.view-section {
  display: none;
  width: 100%;
}

.view-section.active {
  display: block;
  animation: fadeIn 0.25s ease-out;
}

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

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

/* ==========================================================================
   HEADER SECTION - BRANDING & TEACHER SWITCHER
   ========================================================================== */
.header-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 20px 28px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--tyd-teal-light);
  color: var(--tyd-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  border: 1.5px solid rgba(0, 135, 153, 0.2);
  flex-shrink: 0;
}

.brand-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--tyd-teal);
  background: var(--tyd-teal-light);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  width: fit-content;
}

.brand-title,
.brand-title-link {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  transition: var(--transition);
}

.brand-title-link:hover {
  color: var(--tyd-teal);
}

.brand-title-link svg {
  color: var(--tyd-teal);
  transition: transform 0.2s;
}

.brand-title-link:hover svg {
  transform: translateX(3px) translateY(-3px);
}

.meeting-meta-line {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.meeting-id-pill {
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 6px;
  font-family: monospace;
  font-weight: 600;
  color: var(--tyd-teal-dark);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-copy-pill {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: var(--transition);
}

.btn-copy-pill:hover {
  color: var(--tyd-teal);
  background: rgba(0, 135, 153, 0.1);
}

/* ==========================================================================
   TEACHER SWITCHER CUSTOM DROPDOWN (MỤC CHỌN GIÁO VIÊN)
   ========================================================================== */
.class-switcher-container {
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}

.class-switcher-label {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.class-dropdown-wrapper {
  position: relative;
  min-width: 360px;
}

@media (max-width: 768px) {
  .class-dropdown-wrapper {
    min-width: 100%;
    width: 100%;
  }
}

.class-dropdown-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 16px;
  background: #ffffff;
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  text-align: left;
}

.class-dropdown-trigger:hover,
.class-dropdown-trigger.open {
  border-color: var(--tyd-teal);
  box-shadow: 0 4px 16px var(--tyd-teal-glow);
}

.class-dropdown-trigger-content {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.class-dropdown-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--tyd-teal-light);
  color: var(--tyd-teal-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 20px;
}

.class-dropdown-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.class-dropdown-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.class-dropdown-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.class-dropdown-arrow {
  color: var(--text-muted);
  transition: transform 0.25s ease;
  flex-shrink: 0;
}

.class-dropdown-arrow.rotated {
  transform: rotate(180deg);
  color: var(--tyd-teal);
}

/* Dropdown Menu Overlay */
.class-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 380px;
  width: 100%;
  background: #ffffff;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.16);
  z-index: 100;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: dropdownFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.class-dropdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  width: 100%;
}

.class-dropdown-item:hover {
  background: #f8fbff;
  border-color: rgba(0, 135, 153, 0.15);
}

.class-dropdown-item.selected {
  background: var(--tyd-teal-light);
  border-color: var(--tyd-teal);
}

.class-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
  overflow: hidden;
}

.class-item-avatar {
  font-size: 20px;
  flex-shrink: 0;
}

.class-item-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  background: #f1f5f9;
  color: var(--text-muted);
  white-space: nowrap;
}

.class-dropdown-item.selected .class-item-badge {
  background: #ffffff;
  color: var(--tyd-teal);
}

.class-item-check {
  color: var(--tyd-teal);
  flex-shrink: 0;
}

@keyframes dropdownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header Sub-bar: Schedule Tabs & Action Buttons */
.header-sub-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.schedule-tabs-container {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.schedule-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.schedule-pill-btn:hover {
  border-color: var(--tyd-teal);
  color: var(--tyd-teal);
}

.schedule-pill-btn.active {
  background: var(--tyd-teal);
  color: #ffffff;
  border-color: var(--tyd-teal);
  box-shadow: 0 4px 12px var(--tyd-teal-glow);
}

.schedule-pill-btn .pill-badge {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.06);
  font-weight: 700;
}

.schedule-pill-btn.active .pill-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.header-action-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-header-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-header-action:hover {
  background: var(--bg-hover);
  border-color: var(--tyd-teal);
  color: var(--tyd-teal);
}

.btn-header-action.btn-user-admin {
  background: #f8fafc;
  color: #334155;
  border-color: #cbd5e1;
}

.btn-header-action.btn-user-admin.active {
  background: var(--tyd-gold-light);
  border-color: var(--tyd-gold);
  color: var(--tyd-gold-dark);
}

.btn-header-action.btn-logout:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.btn-sync-spin svg {
  transition: transform 0.5s ease;
}

.btn-sync-spin.loading svg {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   KPI SUMMARY CARDS GRID
   ========================================================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

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

.kpi-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.kpi-icon-teal {
  background: var(--tyd-teal-light);
  color: var(--tyd-teal);
}

.kpi-icon-gold {
  background: var(--tyd-gold-light);
  color: var(--tyd-gold);
}

.kpi-icon-green {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.kpi-icon-orange {
  background: var(--color-warning-bg);
  color: var(--color-warning);
}

.kpi-icon-red {
  background: var(--color-danger-bg);
  color: var(--color-danger);
}

.kpi-content {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.kpi-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
}

.kpi-subtext {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ==========================================================================
   TOOLBAR & FILTER SECTION
   ========================================================================== */
.toolbar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.toolbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 11px 40px 11px 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-main);
  transition: var(--transition);
}

.search-input:focus {
  outline: none;
  border-color: var(--tyd-teal);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--tyd-teal-glow);
}

.btn-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: #e2e8f0;
  color: var(--text-muted);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.btn-clear:hover {
  background: #cbd5e1;
  color: var(--text-main);
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.btn-export {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  color: #ffffff;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.25);
  transition: var(--transition);
}

.btn-export:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

/* Filter Chips */
.filter-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.chip {
  border: 1px solid var(--border-subtle);
  background: #ffffff;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.chip:hover {
  border-color: var(--tyd-teal);
  color: var(--tyd-teal);
}

.chip.active {
  background: var(--tyd-teal-light);
  border-color: var(--tyd-teal);
  color: var(--tyd-teal-dark);
  font-weight: 700;
}

.chip-success.active {
  background: var(--color-success-bg);
  border-color: var(--color-success);
  color: var(--color-success);
}

.chip-warning.active {
  background: var(--color-warning-bg);
  border-color: var(--color-warning);
  color: var(--color-warning);
}

.chip-danger.active {
  background: var(--color-danger-bg);
  border-color: var(--color-danger);
  color: var(--color-danger);
}

/* ==========================================================================
   TABLE CARD & MATRIX TABLE
   ========================================================================== */
.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.table-header-bar {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  background: #fafcff;
}

.table-counter {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.table-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot-green { background: var(--color-success); }
.dot-orange { background: var(--color-warning); }
.dot-red { background: var(--color-danger); }
.dot-gray { background: #cbd5e1; }

.table-responsive {
  width: 100%;
  overflow-x: auto;
  position: relative;
}

.matrix-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}

.matrix-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 12px;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.matrix-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: var(--text-main);
  vertical-align: middle;
  background: #ffffff;
  transition: background 0.15s ease;
}

.matrix-table tbody tr:hover td {
  background: #f8fbff;
}

/* Sticky Columns */
.col-sticky-1 {
  position: sticky;
  left: 0;
  z-index: 5;
  width: 50px;
  text-align: center !important;
}

.col-sticky-2 {
  position: sticky;
  left: 50px;
  z-index: 5;
  min-width: 220px;
  max-width: 320px;
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.04);
}

.matrix-table th.col-sticky-1,
.matrix-table th.col-sticky-2 {
  background: #f8fafc;
  z-index: 10;
}

/* Roll Pill & Student Name */
.roll-pill {
  display: inline-block;
  background: var(--tyd-teal-light);
  color: var(--tyd-teal-dark);
  font-family: monospace;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid rgba(0, 135, 153, 0.2);
  margin-right: 6px;
}

.student-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.student-fullname {
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.student-submail {
  font-size: 11px;
  color: var(--text-muted);
}

/* Badge Group */
.badge-group {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-room1 {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.badge-room2 {
  background: var(--tyd-gold-light);
  color: var(--tyd-gold-dark);
  border: 1px solid rgba(205, 127, 50, 0.3);
}

.badge-room3 {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-room4 {
  background: #fdf2f8;
  color: #be185d;
  border: 1px solid #fbcfe8;
}

/* Diligence Qualification Badges */
.qual-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.qual-dat {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.qual-nhacnho {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.qual-nguyco {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid var(--color-danger-border);
}

/* Weekly / Session Cell Badges */
.week-cell-clickable {
  cursor: pointer;
  padding: 8px 10px !important;
  text-align: center;
}

.week-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  min-width: 65px;
  transition: var(--transition);
}

.week-badge:hover {
  transform: scale(1.05);
}

.badge-excellent {
  background: var(--color-success-bg);
  color: var(--color-success);
  border: 1px solid var(--color-success-border);
}

.badge-good {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-warning {
  background: var(--color-warning-bg);
  color: var(--color-warning);
  border: 1px solid var(--color-warning-border);
}

.badge-absent {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.badge-current {
  background: var(--tyd-teal-light);
  color: var(--tyd-teal-dark);
  border: 1px solid var(--tyd-teal);
}

.badge-future {
  background: #f8fafc;
  color: #cbd5e1;
  border: 1px dotted #e2e8f0;
}

.week-badge-time {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.85;
}

/* Empty State & Loading State */
.loading-state, .empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

.spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(0, 135, 153, 0.15);
  border-top-color: var(--tyd-teal);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

/* ==========================================================================
   DRILLDOWN MODAL
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 650px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  animation: slideUp 0.25s ease-out;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  border: none;
  background: #e2e8f0;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: var(--transition);
}

.modal-close:hover {
  background: #cbd5e1;
  color: var(--text-main);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
}

.day-log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  margin-bottom: 10px;
}

.day-log-date {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-main);
}

.day-log-times {
  font-size: 12px;
  color: var(--text-muted);
}

.day-log-duration {
  font-family: monospace;
  font-weight: 700;
  font-size: 13px;
  color: var(--tyd-teal-dark);
}

/* ==========================================================================
   LOGIN VIEW STYLING (TYD THEME)
   ========================================================================== */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px 16px;
}

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

.login-brand-icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  border-radius: 18px;
  background: var(--tyd-teal-light);
  color: var(--tyd-teal);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px var(--tyd-teal-glow);
  border: 1.5px solid rgba(0, 135, 153, 0.25);
}

.login-brand-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
}

.login-brand-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-card {
  width: 100%;
  max-width: 460px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 30px 28px;
  box-shadow: var(--shadow-lg);
}

.quick-accounts {
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px dashed var(--border-subtle);
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  display: block;
  margin-bottom: 10px;
}

.account-chips {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: #f8fafc;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}

.account-chip:hover {
  background: var(--tyd-teal-light);
  border-color: var(--tyd-teal);
  color: var(--tyd-teal-dark);
  transform: translateY(-1px);
}

.chip-avatar {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.form-group {
  margin-bottom: 18px;
}

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

.input-with-icon {
  position: relative;
  display: flex;
  align-items: center;
}

.input-with-icon svg {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
}

.input-with-icon input {
  width: 100%;
  padding: 11px 40px 11px 42px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-main);
  font-family: inherit;
  transition: var(--transition);
}

.input-with-icon input:focus {
  outline: none;
  border-color: var(--tyd-teal);
  background: #ffffff;
  box-shadow: 0 0 0 3px var(--tyd-teal-glow);
}

.btn-icon-subtle {
  position: absolute;
  right: 12px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.btn-primary-block {
  width: 100%;
  padding: 12px;
  background: var(--tyd-gradient);
  border: none;
  border-radius: 10px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--tyd-teal-glow);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-primary-block:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px var(--tyd-teal-glow);
}

.alert-box {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
}

.alert-box.error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
}

.security-badge {
  margin-top: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
}

/* ==========================================================================
   ADMIN USER MANAGEMENT SUBVIEW
   ========================================================================== */
.user-page-hero {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.user-page-hero-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.user-page-hero-badge {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--tyd-teal-light);
  color: var(--tyd-teal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-page-hero-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-main);
}

.user-page-hero-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.user-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.user-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-card);
}

.user-stat-num {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--text-main);
}

.user-stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.user-toolbar-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.user-page-form-card {
  background: var(--bg-card);
  border: 1.5px solid var(--tyd-teal);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-md);
}

.user-form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.form-grid-2col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.form-select {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text-main);
  outline: none;
}

.meetings-checklist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
}

.meeting-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.user-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 20px;
}

.users-page-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.users-page-table th {
  background: #f8fafc;
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.users-page-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1e293b;
  color: #ffffff;
  padding: 12px 20px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  z-index: 2000;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp 0.25s ease-out;
}

/* Responsive queries */
@media (max-width: 992px) {
  .app-container {
    padding: 16px 14px 40px;
  }
  .header-wrapper {
    padding: 16px;
  }
  .header-top {
    flex-direction: column;
    align-items: stretch;
  }
  .class-switcher-container {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
  }
  .class-dropdown-wrapper {
    min-width: 100%;
  }
  .class-dropdown-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    border: 1px solid var(--border-subtle);
    margin-top: 8px;
  }
}
