:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #eff6ff;
  --emerald: #10b981;
  --emerald-soft: #ecfdf5;
  --danger: #ef4444;
  --danger-soft: #fef2f2;
  --amber: #d97706;
  --amber-soft: #fffbeb;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.08);
  --nav-height: 64px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: #e2e8f0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  overscroll-behavior-y: none;
}

.app-shell {
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  background-color: var(--bg);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(15, 23, 42, 0.12);
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 14px;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.2);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.header-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.header-subtitle {
  margin: 2px 0 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
}

.btn-install {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
}

.btn-install:active {
  background: rgba(255, 255, 255, 0.3);
}

/* Main */
.app-main {
  flex: 1;
  padding: 14px 14px calc(var(--nav-height) + 24px + env(safe-area-inset-bottom, 0px));
}

.tab-panel {
  display: none;
  animation: fadeIn 0.16s ease-out;
}

.tab-panel.active {
  display: block;
}

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

/* Segmented Control */
.segment-control {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #e2e8f0;
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  gap: 4px;
}

.segment-btn {
  border: none;
  background: transparent;
  padding: 10px 8px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.segment-btn.active {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* Date Strip */
.date-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 9px 12px;
  margin-bottom: 14px;
}

.date-strip-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.date-input {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: var(--surface-muted);
  font-family: inherit;
}

.btn-link-sm {
  border: none;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
}

/* Area Section */
.area-section {
  display: none;
}

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

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

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* Buttons */
.btn-primary-sm {
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 13px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-primary-sm:active {
  transform: scale(0.97);
}

.btn-primary-full {
  width: 100%;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 8px;
}

.btn-primary-full:active {
  background: var(--primary-dark);
}

.btn-secondary-full {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-danger-full {
  width: 100%;
  border: none;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 14px;
  font-weight: 600;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  margin-top: 8px;
}

/* Cards */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.entity-card {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.entity-card.checked-today {
  border-color: #a7f3d0;
  background: linear-gradient(to bottom right, #ffffff, #f0fdf4);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.card-name {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}

.badge-blue {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-green {
  background: var(--emerald-soft);
  color: #059669;
}

.badge-amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge-red {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-gray {
  background: #f1f5f9;
  color: var(--text-secondary);
}

.card-note {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.today-status-box {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--emerald-soft);
  border: 1px solid #a7f3d0;
  font-size: 13px;
  color: #065f46;
}

.today-status-box .absent-inline {
  color: #b91c1c;
  font-weight: 600;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn-checkin {
  flex: 1;
  border: none;
  background: var(--primary);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 12px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-checkin:active {
  background: var(--primary-dark);
  transform: scale(0.98);
}

.btn-checkin.emerald {
  background: var(--emerald);
}

.btn-checkin.emerald:active {
  background: #059669;
}

.btn-checkin-outline {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
}

.icon-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.icon-btn:active {
  background: #e2e8f0;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 36px 20px;
  background: var(--surface);
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
}

.empty-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

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

.empty-desc {
  font-size: 13px;
  margin: 0 0 14px;
}

/* Month Bar */
.month-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  margin-bottom: 12px;
}

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

/* Filter Bar */
.filter-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.chip-group {
  display: flex;
  gap: 6px;
}

.filter-chip {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.filter-chip.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.select-sm {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  padding: 9px 12px;
  border-radius: 10px;
  font-family: inherit;
}

/* History List */
.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.history-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.history-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 2px 0;
}

.history-detail {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.absent-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.absent-pill {
  background: var(--danger-soft);
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

.history-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #f1f5f9;
  font-size: 13px;
}

.money-text {
  font-weight: 700;
  color: #059669;
}

/* Stats */
.stats-hero {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  color: #ffffff;
  border-radius: var(--radius-lg);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
}

.hero-total-label {
  font-size: 13px;
  opacity: 0.85;
}

.hero-total-value {
  font-size: 28px;
  font-weight: 800;
  margin: 4px 0 12px;
  letter-spacing: -0.5px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.hero-sub {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  padding: 10px 12px;
}

.hero-sub-label {
  font-size: 12px;
  opacity: 0.88;
}

.hero-sub-val {
  font-size: 16px;
  font-weight: 700;
  margin-top: 2px;
}

.hero-sub-count {
  font-size: 12px;
  opacity: 0.85;
  margin-top: 2px;
}

.export-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.export-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

.export-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.btn-zalo {
  border: none;
  background: #0068ff;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 10px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-excel {
  border: none;
  background: #16a34a;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 10px;
  border-radius: 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.stats-section {
  margin-bottom: 16px;
}

.stats-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  margin: 0 0 8px;
}

.stat-row-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.stat-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.stat-row-name {
  font-size: 15px;
  font-weight: 700;
}

.stat-row-money {
  font-size: 15px;
  font-weight: 700;
  color: #059669;
}

.stat-row-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* Settings */
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 12px;
}

.settings-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 700;
}

.settings-desc {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-secondary);
}

.install-steps {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: 13px;
  color: var(--text);
}

.install-steps li {
  margin-bottom: 4px;
}

.settings-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-outline {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
}

.btn-danger-outline {
  border: 1px solid #fecaca;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 13px;
  font-weight: 600;
  padding: 10px;
  border-radius: 10px;
  cursor: pointer;
}

.app-version {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin: 16px 0 4px;
}

/* Bottom Navigation */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  z-index: 30;
}

.nav-item {
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
}

.nav-item.active {
  color: var(--primary);
}

/* Modal Bottom Sheet */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeOverlay 0.15s ease;
}

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

.modal-sheet {
  width: 100%;
  max-width: 480px;
  max-height: 90dvh;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  animation: slideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.modal-handle {
  width: 40px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 999px;
  margin: 2px auto 10px;
}

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

.modal-title {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
}

/* Form Elements inside Modal */
.form-group {
  margin-bottom: 12px;
}

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

.form-input, .form-select, .form-textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 15px;
  color: var(--text);
  background: var(--surface);
  font-family: inherit;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

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

.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Quick Attendance Counter Box */
.attendance-counter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

.counter-box {
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.counter-box.present {
  background: var(--emerald-soft);
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.counter-box.absent {
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  color: #991b1b;
}

.counter-num {
  font-size: 24px;
  font-weight: 800;
}

.counter-lbl {
  font-size: 12px;
  font-weight: 600;
}

/* Absent Tag Chips */
.tag-input-row {
  display: flex;
  gap: 8px;
}

.tag-input-row .form-input {
  flex: 1;
}

.btn-add-tag {
  border: none;
  background: var(--danger);
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  padding: 0 14px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--danger-soft);
  color: #b91c1c;
  border: 1px solid #fca5a5;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
}

.tag-chip button {
  border: none;
  background: transparent;
  color: #b91c1c;
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.suggest-box {
  margin-top: 8px;
}

.suggest-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.suggest-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.suggest-chip {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
}

.suggest-chip:active {
  background: #e2e8f0;
}

/* Session Count Selector (Center) */
.session-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 8px;
}

.preset-btn {
  border: 1px solid var(--border);
  background: var(--surface-muted);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 4px;
  border-radius: 10px;
  cursor: pointer;
}

.preset-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

/* Zalo Report Box */
.report-preview {
  width: 100%;
  min-height: 220px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.5;
  background: var(--surface-muted);
  color: var(--text);
  resize: vertical;
}

/* Toast */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + 16px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  z-index: 80;
  max-width: 90%;
  text-align: center;
  animation: fadeIn 0.15s ease;
}

/* Student Tap Grid (Home Attendance) */
.student-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 6px;
}

.student-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1.5px solid #a7f3d0;
  background: var(--emerald-soft);
  color: #065f46;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s ease;
}

.student-tile .tile-status {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(16, 185, 129, 0.18);
  color: #047857;
  white-space: nowrap;
}

.student-tile.is-absent {
  border-color: #fca5a5;
  background: var(--danger-soft);
  color: #991b1b;
}

.student-tile.is-absent .tile-status {
  background: rgba(239, 68, 68, 0.16);
  color: #b91c1c;
}

.student-tile:active {
  transform: scale(0.97);
}

.auto-list-box {
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  font-size: 13px;
}

.auto-list-box.present-box {
  background: var(--emerald-soft);
  border: 1px solid #a7f3d0;
  color: #065f46;
}

.auto-list-box.absent-box {
  background: var(--danger-soft);
  border: 1px solid #fecaca;
  color: #991b1b;
}

.auto-list-title {
  font-weight: 700;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.auto-list-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.present-pill {
  background: #ffffff;
  color: #047857;
  border: 1px solid #a7f3d0;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
}

/* Attendance Matrix Table */
.matrix-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  margin: 10px 0 12px;
  -webkit-overflow-scrolling: touch;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  white-space: nowrap;
}

.matrix-table th,
.matrix-table td {
  padding: 8px 9px;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f1f5f9;
  text-align: center;
}

.matrix-table th {
  background: #f8fafc;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 12px;
}

.matrix-table th.sticky-col,
.matrix-table td.sticky-col {
  position: sticky;
  left: 0;
  z-index: 2;
  background: #ffffff;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  border-right: 1.5px solid var(--border);
  min-width: 110px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matrix-table th.sticky-col {
  background: #f8fafc;
  z-index: 3;
}

.cell-present {
  color: #059669;
  font-weight: 800;
  background: #f0fdf4;
}

.cell-absent {
  color: #dc2626;
  font-weight: 800;
  background: #fef2f2;
}

.cell-total {
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-soft);
}

.sheet-export-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

.btn-html-export {
  border: none;
  background: #7c3aed;
  color: #ffffff;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 10px;
  border-radius: 10px;
  cursor: pointer;
}

.hidden {
  display: none !important;
}
