/* ===================================================================
   GIAO DIỆN MOBILE-FIRST 100% - 12D7 ĐIỂM DANH / LỜI NHẮC
   Thiết kế tối giản, dịu mắt, hỗ trợ chế độ Sáng / Tối
   Dành cho Boss Khang Nguyen
   =================================================================== */

:root, [data-theme="dark"] {
  --bg-app: #101216;
  --bg-card: #171a21;
  --bg-card-hover: #1e222b;
  --bg-elevated: #232834;
  --bg-input: #13161c;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-soft: rgba(255, 255, 255, 0.14);
  --border-focus: rgba(56, 189, 248, 0.4);

  --text-main: #f1f5f9;
  --text-sub: #94a3b8;
  --text-muted: #64748b;

  --color-present: #22c55e;
  --color-present-bg: rgba(34, 197, 94, 0.12);
  --color-present-border: rgba(34, 197, 94, 0.35);

  --color-absent: #fb7185;
  --color-absent-bg: rgba(251, 113, 133, 0.12);
  --color-absent-border: rgba(251, 113, 133, 0.35);

  --color-accent: #38bdf8;
  --bottom-bar-bg: rgba(16, 18, 22, 0.92);
  --bottom-btn-bg: #ffffff;
  --bottom-btn-text: #0b0d10;
  --sheet-bg: #171a21;
  --sheet-preview-bg: #0d0f12;
  --sheet-preview-text: #cbd5e1;
  --landmark-board-bg: #0d1015;
  --landmark-board-text: #ffffff;
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.25);
}

[data-theme="light"] {
  --bg-app: #f1f4f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-elevated: #e2e8f0;
  --bg-input: #ffffff;

  --border-subtle: rgba(0, 0, 0, 0.08);
  --border-soft: rgba(0, 0, 0, 0.15);
  --border-focus: rgba(2, 132, 199, 0.5);

  --text-main: #0f172a;
  --text-sub: #475569;
  --text-muted: #64748b;

  --color-present: #16a34a;
  --color-present-bg: rgba(22, 163, 74, 0.1);
  --color-present-border: rgba(22, 163, 74, 0.3);

  --color-absent: #e11d48;
  --color-absent-bg: rgba(225, 29, 72, 0.09);
  --color-absent-border: rgba(225, 29, 72, 0.28);

  --color-accent: #0284c7;
  --bottom-bar-bg: rgba(255, 255, 255, 0.94);
  --bottom-btn-bg: #0f172a;
  --bottom-btn-text: #ffffff;
  --sheet-bg: #ffffff;
  --sheet-preview-bg: #f8fafc;
  --sheet-preview-text: #334155;
  --landmark-board-bg: #1e293b;
  --landmark-board-text: #ffffff;
  --shadow-card: 0 2px 10px rgba(0, 0, 0, 0.06);
}

:root {
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-full: 999px;

  --spring-bounce: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --spring-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-fast: 0.2s;
  --duration-normal: 0.3s;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-app);
  color: var(--text-main);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  background-color: var(--bg-app);
  color: var(--text-main);
  padding-bottom: 110px;
  overflow-x: hidden;
  user-select: none;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.mobile-wrapper {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 14px 16px;
}

/* ===================================================================
   SIDEBAR DRAWER (Menu 3 gạch ngang)
   =================================================================== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 998;
  display: none;
  opacity: 0;
  transition: opacity 0.28s var(--spring-smooth);
}

.drawer-overlay.active {
  display: block;
  opacity: 1;
}

.drawer-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: 82%;
  max-width: 320px;
  background: var(--bg-card);
  border-right: 1px solid var(--border-soft);
  box-shadow: 10px 0 30px rgba(0, 0, 0, 0.4);
  z-index: 999;
  display: flex;
  flex-direction: column;
  padding: 20px 18px;
  transform: translateX(-100%);
  transition: transform 0.32s var(--spring-smooth);
}

.drawer-overlay.active .drawer-sidebar {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 18px;
}

.drawer-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.drawer-avatar {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-accent) 0%, #0284c7 100%);
  color: #fff;
  font-weight: 800;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.drawer-boss-name {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-main);
}

.drawer-role {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.drawer-close-btn {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  color: var(--text-sub);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.drawer-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.drawer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: left;
  transition: all var(--duration-fast) var(--spring-smooth);
  color: var(--text-main);
  width: 100%;
}

.drawer-item:hover, .drawer-item:active {
  background: var(--bg-elevated);
}

.drawer-item.active {
  background: var(--bg-elevated);
  border-color: var(--border-soft);
  box-shadow: var(--shadow-card);
}

.drawer-item-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.drawer-item-icon.attendance {
  background: var(--color-present-bg);
  color: var(--color-present);
}

.drawer-item-icon.reminders {
  background: rgba(56, 189, 248, 0.12);
  color: var(--color-accent);
}

.drawer-item-content {
  flex: 1;
  min-width: 0;
}

.drawer-item-title {
  display: block;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-main);
}

.drawer-item-desc {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.drawer-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--bg-app);
  color: var(--text-muted);
  border: 1px solid var(--border-subtle);
}

.drawer-badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
}

.drawer-footer {
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.drawer-app-info strong {
  font-size: 0.84rem;
  color: var(--text-main);
  display: block;
}

.drawer-app-info p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* ===================================================================
   HEADER
   =================================================================== */
.mobile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0 14px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.menu-btn {
  color: var(--text-main);
}

.header-title-group h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.header-title-group p {
  font-size: 0.74rem;
  color: var(--text-sub);
  margin-top: 1px;
}

.header-actions-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-action-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-sub);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--duration-fast) var(--spring-smooth);
  box-shadow: var(--shadow-card);
}

.header-action-btn:active {
  transform: scale(0.92);
}

.header-action-btn.muted {
  opacity: 0.45;
}

/* ===================================================================
   GIAO DIỆN MỚI VÔ: HI! BOSS KHANG NGUYEN
   =================================================================== */
.welcome-hero-banner {
  background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

.welcome-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--color-accent);
  background: rgba(56, 189, 248, 0.1);
  padding: 3px 9px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.welcome-wave {
  display: inline-block;
  animation: waveHands 2s infinite ease-in-out;
  transform-origin: 70% 70%;
}

@keyframes waveHands {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(14deg); }
  40% { transform: rotate(-8deg); }
  60% { transform: rotate(14deg); }
  80% { transform: rotate(-4deg); }
}

.active-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-sub);
  background: var(--bg-app);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.dot-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-present);
  box-shadow: 0 0 6px var(--color-present);
}

.welcome-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.welcome-sub {
  font-size: 0.8rem;
  color: var(--text-sub);
  margin-top: 4px;
  line-height: 1.4;
}

/* Quản lý 2 màn hình tính năng */
.feature-screen {
  display: none;
  animation: screenFadeIn var(--duration-normal) var(--spring-smooth);
}

.feature-screen.active {
  display: block;
}

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

/* ===================================================================
   MÀN HÌNH 1: ĐIỂM DANH
   =================================================================== */
.mini-stats-bar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.mini-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  text-align: center;
  box-shadow: var(--shadow-card);
  transition: background-color 0.25s, border-color 0.25s;
}

.mini-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 2px;
}

.mini-stat-val {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-main);
}

.mini-stat-card.present .mini-stat-val {
  color: var(--color-present);
}

.mini-stat-card.absent .mini-stat-val {
  color: var(--color-absent);
}

.segmented-tabs {
  display: flex;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
}

.segment-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  transition: all var(--duration-fast) var(--spring-smooth);
}

.segment-btn.active {
  background: var(--bg-elevated);
  color: var(--text-main);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .segment-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.segment-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.view-section {
  display: none;
  animation: fadeIn var(--duration-normal) var(--spring-smooth);
}

.view-section.active {
  display: block;
}

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

.search-container {
  position: relative;
  margin-bottom: 12px;
}

.search-input-mobile {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 40px 12px 42px;
  color: var(--text-main);
  font-size: 0.95rem;
  outline: none;
  box-shadow: var(--shadow-card);
  transition: border-color var(--duration-fast), background-color 0.25s;
}

.search-input-mobile:focus {
  border-color: var(--border-focus);
}

.search-input-mobile::placeholder {
  color: var(--text-muted);
}

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

.clear-search-btn-mobile {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 4px;
  cursor: pointer;
  display: none;
}

.list-quick-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding: 0 4px;
}

.instruction-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.quick-batch-btns {
  display: flex;
  gap: 8px;
}

.text-btn {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-btn:active {
  color: var(--text-main);
}

.student-list-mobile {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.student-row-mobile {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: transform var(--duration-fast) var(--spring-smooth), background-color var(--duration-fast), border-color var(--duration-fast);
  box-shadow: var(--shadow-card);
}

.student-row-mobile:active {
  transform: scale(0.985);
  background: var(--bg-card-hover);
}

.student-left-mobile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.custom-check-box {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--duration-fast) var(--spring-bounce);
  background: var(--bg-input);
}

.custom-check-box svg {
  width: 15px;
  height: 15px;
  stroke: #fff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0;
  transform: scale(0.4);
  transition: all var(--duration-fast) var(--spring-bounce);
}

.student-row-mobile.is-checked {
  border-color: var(--color-present-border);
  background: linear-gradient(90deg, var(--color-present-bg) 0%, var(--bg-card) 100%);
}

.student-row-mobile.is-checked .custom-check-box {
  background: var(--color-present);
  border-color: var(--color-present);
  transform: scale(1.05);
}

.student-row-mobile.is-checked .custom-check-box svg {
  opacity: 1;
  transform: scale(1);
}

.student-row-mobile.is-unchecked {
  border-color: var(--color-absent-border);
  background: linear-gradient(90deg, var(--color-absent-bg) 0%, var(--bg-card) 100%);
}

.student-row-mobile.is-unchecked .custom-check-box {
  border-color: var(--color-absent-border);
}

.student-info-mobile {
  min-width: 0;
}

.student-name-mobile {
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.student-sub-mobile {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.status-pill-mobile {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  transition: all var(--duration-fast);
}

.student-row-mobile.is-checked .status-pill-mobile {
  background: var(--color-present-bg);
  color: var(--color-present);
  border: 1px solid var(--color-present-border);
}

.student-row-mobile.is-unchecked .status-pill-mobile {
  background: var(--color-absent-bg);
  color: var(--color-absent);
  border: 1px solid var(--color-absent-border);
}

/* Sơ đồ lớp */
.group-selector-pills {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.group-selector-pills::-webkit-scrollbar {
  display: none;
}

.group-pill-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-sub);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--duration-fast);
  box-shadow: var(--shadow-card);
}

.group-pill-btn.active {
  background: var(--color-accent);
  color: #ffffff;
  border-color: var(--color-accent);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

.mobile-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 12px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
  transition: background-color 0.25s, border-color 0.25s;
}

.chart-header-hint {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  color: var(--text-muted);
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.chart-legend-dots {
  display: flex;
  gap: 12px;
}

.dot-legend {
  display: flex;
  align-items: center;
  gap: 5px;
}

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

.dot-legend.present span.dot { background: var(--color-present); }
.dot-legend.absent span.dot { background: var(--color-absent); }

.single-group-layout {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-desk-row {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  position: relative;
  transition: background-color 0.25s;
}

.mobile-desk-num-tag {
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.68rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.mobile-seat-box {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  min-height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: transform var(--duration-fast) var(--spring-smooth), background-color var(--duration-fast), border-color var(--duration-fast);
}

.mobile-seat-box:active {
  transform: scale(0.94);
}

.mobile-seat-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.25;
}

.mobile-seat-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.mobile-seat-box.is-present {
  background: var(--color-present-bg);
  border-color: var(--color-present-border);
}

.mobile-seat-box.is-present::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-present);
}

.mobile-seat-box.is-absent {
  background: var(--color-absent-bg);
  border-color: var(--color-absent-border);
}

.mobile-seat-box.is-absent::after {
  content: "Vắng";
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--color-absent);
}

.mobile-seat-box.is-empty {
  background: transparent;
  border: 1px dashed var(--border-subtle);
  opacity: 0.5;
  cursor: default;
}

.mobile-landmarks-bar {
  display: grid;
  grid-template-columns: 1.1fr 1.8fr 1.1fr;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--border-subtle);
}

.mobile-landmark-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
  text-align: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-sub);
}

.mobile-landmark-box.blackboard {
  background: var(--landmark-board-bg);
  color: var(--landmark-board-text);
  letter-spacing: 0.15em;
}

.mobile-landmark-box.door {
  color: var(--color-accent);
  background: rgba(56, 189, 248, 0.1);
}

/* ===================================================================
   MÀN HÌNH 2: NHẮC NHỞ & THÔNG BÁO
   =================================================================== */
.reminders-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.reminders-title-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.reminders-title-group p {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.btn-add-reminder {
  background: var(--color-accent);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  font-size: 0.84rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: 0 3px 12px rgba(56, 189, 248, 0.3);
  flex-shrink: 0;
}

[data-theme="light"] .btn-add-reminder {
  color: #ffffff;
}

.btn-add-reminder:active {
  transform: scale(0.95);
}

.reminders-filter-pills {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.rem-filter-pill {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 7px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  text-align: center;
  transition: all var(--duration-fast);
  box-shadow: var(--shadow-card);
}

.rem-filter-pill.active {
  background: var(--bg-elevated);
  color: var(--text-main);
  border-color: var(--border-soft);
}

.reminders-actions-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  align-items: stretch;
}

.btn-broadcast-zalo {
  flex: 1;
  background: var(--bg-card);
  border: 1px dashed var(--color-accent);
  color: var(--color-accent);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.84rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: all var(--duration-fast);
}

.btn-broadcast-zalo:active {
  background: rgba(56, 189, 248, 0.1);
  transform: scale(0.98);
}

.btn-clear-all-reminders {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--color-absent);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  white-space: nowrap;
  transition: all var(--duration-fast);
  flex-shrink: 0;
}

.btn-clear-all-reminders:hover,
.btn-clear-all-reminders:active {
  background: var(--color-absent-bg);
  border-color: var(--color-absent-border);
  transform: scale(0.97);
}

.reminders-list-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reminder-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform var(--duration-fast), border-color var(--duration-fast);
  position: relative;
}

.reminder-card.done {
  opacity: 0.6;
  border-color: var(--border-subtle);
}

.reminder-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.rem-subject-headline {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.rem-index-num {
  color: var(--color-accent);
  font-weight: 800;
  font-size: 1.02rem;
}

.rem-subject-box {
  color: var(--color-accent);
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.28);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.94rem;
  font-weight: 700;
}

[data-theme="light"] .rem-subject-box {
  color: #0284c7;
  background: #e0f2fe;
  border-color: #bae6fd;
}

.reminder-content-block {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background-color 0.25s, border-color 0.25s;
}

.rem-line-item {
  font-size: 0.88rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.rem-line-content {
  color: var(--text-main);
  font-weight: 600;
}

.rem-line-deadline {
  color: #f59e0b;
  font-weight: 600;
}

[data-theme="light"] .rem-line-deadline {
  color: #d97706;
}

.reminder-card.done .rem-line-content {
  text-decoration: line-through;
  opacity: 0.65;
}

.reminder-card.done .rem-line-deadline {
  opacity: 0.65;
}

.reminder-footer-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.rem-status-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.rem-status-badge.is-pending {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.rem-status-badge.is-done {
  background: var(--color-present-bg);
  color: var(--color-present);
  border: 1px solid var(--color-present-border);
}

.rem-toggle-status {
  background: var(--bg-app);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 6px 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-sub);
  transition: all var(--duration-fast);
}

.rem-toggle-status:active {
  transform: scale(0.95);
}

.rem-toggle-status.is-done {
  background: var(--color-present-bg);
  border-color: var(--color-present-border);
  color: var(--color-present);
}

.rem-check-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  transition: all var(--duration-fast);
  flex-shrink: 0;
}

.rem-check-icon.checked,
.rem-toggle-status.is-done .rem-check-icon,
.reminder-card.done .rem-check-icon {
  background: var(--color-present);
  border-color: var(--color-present);
}

.rem-check-icon svg {
  width: 13px;
  height: 13px;
  stroke: #fff;
  stroke-width: 3;
  opacity: 0;
  transform: scale(0.4);
  transition: all var(--duration-fast);
}

.rem-check-icon.checked svg,
.rem-toggle-status.is-done .rem-check-icon svg,
.reminder-card.done .rem-check-icon svg {
  opacity: 1;
  transform: scale(1);
}

.rem-btn-group {
  display: flex;
  gap: 8px;
}

.rem-action-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-sub);
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.74rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.rem-action-btn:active {
  transform: scale(0.95);
  color: var(--text-main);
}

.rem-action-btn.delete:hover, .rem-action-btn.delete:active {
  color: var(--color-absent);
  border-color: var(--color-absent-border);
}

/* Form thêm nhắc nhở */
.add-reminder-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-sub);
}

.form-input {
  width: 100%;
  background: var(--bg-app);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 0.92rem;
  color: var(--text-main);
  outline: none;
  transition: border-color var(--duration-fast);
}

.form-input:focus {
  border-color: var(--border-focus);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* ===================================================================
   STICKY BOTTOM BAR
   =================================================================== */
.sticky-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bottom-bar-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--border-subtle);
  padding: 10px 16px;
  padding-bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 100;
  display: flex;
  justify-content: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  transition: background-color 0.25s, transform 0.25s;
}

.bottom-bar-inner {
  width: 100%;
  max-width: 600px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.bottom-stat-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.bottom-stat-main {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.bottom-stat-main span.pill-absent {
  font-size: 0.72rem;
  color: var(--color-absent);
  background: var(--color-absent-bg);
  border: 1px solid var(--color-absent-border);
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.bottom-stat-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-complete-attendance {
  flex: 1;
  background: var(--bottom-btn-bg);
  color: var(--bottom-btn-text);
  border: none;
  border-radius: var(--radius-full);
  padding: 13px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
  transition: transform var(--duration-fast) var(--spring-smooth), background-color var(--duration-fast);
}

.btn-complete-attendance:active {
  transform: scale(0.96);
  opacity: 0.9;
}

.btn-complete-attendance svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

/* ===================================================================
   BOTTOM SHEET MODAL
   =================================================================== */
.sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 999;
}

.sheet-overlay.active {
  display: flex;
}

.bottom-sheet-card {
  background: var(--sheet-bg);
  border: 1px solid var(--border-soft);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4);
  padding: 14px 20px 24px;
  animation: slideSheetUp 0.32s var(--spring-smooth);
  transition: background-color 0.25s;
}

@keyframes slideSheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-drag-handle {
  width: 40px;
  height: 4px;
  background: var(--border-soft);
  border-radius: var(--radius-full);
  margin: 0 auto 16px;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.sheet-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.sheet-close-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-sub);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sheet-metric-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.sheet-metric-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: center;
}

.sheet-metric-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.sheet-metric-num {
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.sheet-metric-box.present .sheet-metric-num {
  color: var(--color-present);
}

.sheet-metric-box.absent .sheet-metric-num {
  color: var(--color-absent);
}

.absent-section-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.absent-list-mobile {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  margin-bottom: 18px;
  max-height: 180px;
  overflow-y: auto;
}

.absent-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.absent-item-row:last-child {
  border-bottom: none;
}

.absent-item-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
}

.all-present-banner {
  padding: 18px;
  text-align: center;
  color: var(--color-present);
  font-weight: 600;
  font-size: 0.95rem;
}

.zalo-preview-box {
  background: var(--sheet-preview-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--sheet-preview-text);
  white-space: pre-wrap;
  user-select: all;
  margin-bottom: 20px;
}

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn-copy-zalo {
  background: var(--color-accent);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.3);
}

.btn-copy-zalo:active {
  transform: scale(0.97);
}

.btn-close-sheet {
  background: var(--bg-elevated);
  color: var(--text-sub);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.mobile-toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  padding: 10px 20px;
  font-size: 0.86rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 1000;
  opacity: 0;
  transition: all var(--duration-normal) var(--spring-smooth);
}

.mobile-toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.mobile-toast svg {
  stroke: var(--color-present);
}

/* ===================================================================
   MODAL XÁC NHẬN RIÊNG CHO TOÀN TRANG (Custom Confirm Dialog)
   =================================================================== */
.custom-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--duration-normal) var(--spring-smooth);
}

.custom-dialog-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.custom-dialog-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  padding: 26px 20px;
  width: 100%;
  max-width: 350px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
  transform: scale(0.9) translateY(16px);
  transition: transform var(--duration-normal) var(--spring-smooth), background-color 0.25s, border-color 0.25s;
}

.custom-dialog-overlay.active .custom-dialog-card {
  transform: scale(1) translateY(0);
}

.dialog-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #f59e0b;
  transition: all var(--duration-fast);
}

.dialog-icon-circle svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
}

.dialog-icon-circle.danger {
  background: var(--color-absent-bg);
  border-color: var(--color-absent-border);
  color: var(--color-absent);
}

.dialog-icon-circle.info {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--color-accent);
}

.dialog-text-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dialog-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.01em;
  line-height: 1.25;
}

.dialog-message {
  font-size: 0.88rem;
  color: var(--text-sub);
  line-height: 1.5;
  word-break: break-word;
}

.dialog-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  width: 100%;
  margin-top: 6px;
}

.dialog-btn {
  padding: 12px 16px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--duration-fast);
}

.dialog-btn:active {
  transform: scale(0.95);
}

.dialog-btn.cancel {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  color: var(--text-sub);
}

.dialog-btn.cancel:active {
  color: var(--text-main);
}

.dialog-btn.confirm.danger {
  background: var(--color-absent);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(244, 63, 94, 0.35);
}

.dialog-btn.confirm.primary {
  background: var(--color-accent);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(56, 189, 248, 0.35);
}
