/* ════════════════════════════════════════════════════════════════════════
   attendance-mvp — Consolidated Stylesheet
   Generated: 2026-03-04
   ════════════════════════════════════════════════════════════════════════ */

/* ════════════════════════════════════════════════════════════════════════
   1. FONTS & BASE
   ════════════════════════════════════════════════════════════════════════ */

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Python source shown in the parent cabinet runner. */
.python-source .py-token-comment { color: #94a3b8; font-style: italic; }
.python-source .py-token-keyword { color: #7dd3fc; font-weight: 700; }
.python-source .py-token-builtin { color: #67e8f9; }
.python-source .py-token-string { color: #86efac; }
.python-source .py-token-number { color: #fbbf24; }
.python-source .py-token-operator { color: #e2e8f0; }

#dashboard {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* ════════════════════════════════════════════════════════════════════════
   2. STATUS BADGES (Attendance colors)
   ════════════════════════════════════════════════════════════════════════ */

.status-present { background-color: #dcfce7; color: #166534; }
.status-absent  { background-color: #fee2e2; color: #991b1b; }
.status-excused { background-color: #fef3c7; color: #92400e; }
.status-holiday { background-color: #f3e8ff; color: #7e22ce; }

/* For attendance table with !important override */
.att-status-present  { background-color: #dcfce7 !important; color: #166534; }
.att-status-absent   { background-color: #fee2e2 !important; color: #991b1b; }
.att-status-excused  { background-color: #fef9c3 !important; color: #854d0e; }
.att-status-holiday  { background-color: #f1f5f9 !important; color: #475569; }

/* For JS dynamic class application in attendance.html */
.status-present.att-cell { background-color: #dcfce7 !important; color: #166534; }
.status-absent.att-cell  { background-color: #fee2e2 !important; color: #991b1b; }
.status-excused.att-cell { background-color: #fef9c3 !important; color: #854d0e; }
.status-holiday.att-cell { background-color: #f1f5f9 !important; color: #475569; }

/* Payment/Badge variants */
.badge-paid,    .badge-attend { background: #dcfce7; color: #166534; }
.badge-partial                  { background: #fef9c3; color: #854d0e; }
.badge-pending, .badge-error    { background: #fee2e2; color: #991b1b; }
.badge-none                     { background: #f1f5f9; color: #94a3b8; }
.badge-updated                  { background: #dbeafe; color: #1e40af; }
.badge-created                  { background: #dcfce7; color: #166534; }

/* ════════════════════════════════════════════════════════════════════════
   3. TABLES — BASE STYLES
   ════════════════════════════════════════════════════════════════════════ */

table {
  font-size: 0.75rem;
  line-height: 1.2;
}

th, td {
  padding: 0.1rem 0;
}

/* First column — sticky with ellipsis */
td:first-child, .names-col {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

td:not(:first-child) {
  width: 30px;
  text-align: center;
}

/* Sticky names column */
.names-col, .student-col {
  position: sticky;
  left: 0;
  background-color: white;
  z-index: 10;
  border-right: 2px solid #e2e8f0;
  min-width: 150px;
  max-width: 600px;
  width: auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 8px;
}

/* ════════════════════════════════════════════════════════════════════════
   4. MOBILE NAVIGATION
   ════════════════════════════════════════════════════════════════════════ */

#mobileHeader {
  display: none;
  position: sticky;
  top: 0;
  z-index: 50;
  background: #1e293b;
  height: 52px;
  padding: 0 16px;
  align-items: center;
  justify-content: space-between;
}

#navOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 60;
}

#navOverlay.open {
  display: block;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 767px) {
  #mobileHeader { display: flex; }
  #appShell {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }
  #sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 70;
    width: 220px !important;
    transform: translateX(-100%);
    transition: transform 0.24s cubic-bezier(.4,0,.2,1);
  }
  #sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }
  #mainContent { overflow-y: visible !important; }
}

/* ════════════════════════════════════════════════════════════════════════
   5. MAX BOT MODAL
   ════════════════════════════════════════════════════════════════════════ */

#maxBotModal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(15,23,42,0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#maxBotBox {
  background: #fff;
  border-radius: 20px;
  width: 80vw;
  height: 80vh;
  box-shadow: 0 32px 80px rgba(0,0,0,0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#maxBotHead {
  padding: 16px 20px 13px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-shrink: 0;
}

#maxBotLabel {
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #a5b4fc;
  margin-bottom: 3px;
}

#maxBotRecipient {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.2;
}

#maxBotPhone {
  font-size: 0.8rem;
  color: #6366f1;
  margin-top: 1px;
  font-family: monospace;
}

#maxBotClose {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #cbd5e1;
  cursor: pointer;
  line-height: 1;
  padding: 2px 0 0 8px;
  transition: color .15s;
}

#maxBotClose:hover { color: #64748b; }

#maxBotToolbar {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.mb-tool {
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 28px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #475569;
  transition: all .13s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mb-tool:hover { background: #e0e7ff; color: #4f46e5; }
.mb-tool.active { background: #e0e7ff; color: #4f46e5; }
.mb-sep {
  width: 1px;
  height: 18px;
  background: #e2e8f0;
  margin: 0 4px;
  flex-shrink: 0;
}

#maxBotTabs {
  display: flex;
  gap: 0;
  padding: 0 20px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  flex-shrink: 0;
}

.mb-tab {
  padding: 8px 14px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #94a3b8;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .15s;
  user-select: none;
}

.mb-tab.on { color: #6366f1; border-bottom-color: #6366f1; }

#maxBotEditor {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#maxBotText {
  flex: 1;
  width: 100%;
  padding: 14px 16px;
  border: none;
  outline: none;
  font-size: 0.9rem;
  line-height: 1.65;
  resize: none;
  font-family: 'Courier New', monospace;
  color: #1e293b;
  background: #fff;
  box-sizing: border-box;
  overflow-y: auto;
}

#maxBotPreview {
  flex: 1;
  padding: 14px 18px;
  overflow-y: auto;
  font-size: 0.9rem;
  line-height: 1.65;
  color: #1e293b;
  display: none;
}

#maxBotPreview b,
#maxBotPreview strong { font-weight: 700; color: #1e293b; }
#maxBotPreview em,
#maxBotPreview i { font-style: italic; color: #475569; }
#maxBotPreview code {
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: monospace;
  font-size: 0.85em;
  color: #e11d48;
}
#maxBotPreview s { color: #94a3b8; }
#maxBotPreview a { color: #6366f1; }
#maxBotPreview p { margin: 0 0 10px; }
#maxBotPreview p:last-child { margin: 0; }

#maxBotFoot {
  padding: 10px 16px 14px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

#maxBotCount {
  font-size: 0.72rem;
  color: #cbd5e1;
  font-family: monospace;
  transition: color .2s;
}

#maxBotCount.warn { color: #f59e0b; }
#maxBotCount.over { color: #ef4444; }

#maxBotStatus {
  display: none;
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 16px 10px;
  flex-shrink: 0;
}

.mb-btn {
  padding: 8px 18px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 700;
  transition: all .15s;
}

.mb-btn-cancel { background: #f1f5f9; color: #64748b; }
.mb-btn-cancel:hover { background: #e2e8f0; }

.mb-btn-send {
  background: #6366f1;
  color: white;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mb-btn-send:hover {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}

.mb-btn-send:disabled {
  background: #a5b4fc;
  transform: none;
  box-shadow: none;
  cursor: not-allowed;
}

@media (max-width: 639px) {
  #maxBotModal { align-items: flex-end; }
  #maxBotBox {
    border-radius: 20px 20px 0 0;
    width: 100vw;
    height: 85vh;
  }
}

/* ════════════════════════════════════════════════════════════════════════
   6. DASHBOARD STYLES
   ════════════════════════════════════════════════════════════════════════ */

/* Animations */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card { animation: fadeUp 0.4s ease both; }
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.10s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.20s; }
.card:nth-child(5) { animation-delay: 0.25s; }
.card:nth-child(6) { animation-delay: 0.30s; }

/* Base tile */
.tile {
  background: white;
  border-radius: 16px;
  padding: 20px 22px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  transition: box-shadow 0.2s, transform 0.2s;
}

.tile:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,0.10);
  transform: translateY(-2px);
}

/* KPI tiles */
.kpi-value {
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}

.kpi-label {
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-top: 6px;
}

.kpi-sub {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 4px;
}

/* Trends */
.trend-up    { color: #16a34a; font-weight: 700; font-size: 0.8rem; }
.trend-down  { color: #dc2626; font-weight: 700; font-size: 0.8rem; }
.trend-flat  { color: #94a3b8; font-weight: 700; font-size: 0.8rem; }

/* KPI icons */
.kpi-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}

/* Progress bar */
.progress-track {
  height: 8px;
  background: #f1f5f9;
  border-radius: 99px;
  overflow: hidden;
  margin-top: 10px;
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.8s cubic-bezier(0.4,0,0.2,1);
}

/* Group table row */
.group-row:hover { background: #f8fafc; }

.pct-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

/* Schedule */
.schedule-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}

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

.schedule-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Payment item */
.payment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.85rem;
}

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

/* Radial progress */
.radial-wrap {
  position: relative;
  display: inline-flex;
}

.radial-wrap svg { transform: rotate(-90deg); }

.radial-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Section title */
.section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  margin-bottom: 14px;
}

/* Payment blur */
.pay-blur-content {
  filter: blur(7px);
  transition: filter 0.5s ease;
  user-select: none;
  pointer-events: none;
}

.pay-blur-content.revealed { filter: blur(0); }

.pay-tile { position: relative; }

/* Responsive dashboard */
@media (max-width: 899px) {
  .kpi-grid { grid-template-columns: repeat(2,1fr) !important; gap: 10px !important; }
  .mid-grid  { grid-template-columns: 1fr !important; gap: 12px !important; }
}

@media (max-width: 479px) {
  .kpi-value { font-size: 1.7rem !important; }
}

/* ════════════════════════════════════════════════════════════════════════
   7. ATTENDANCE TABLE
   ════════════════════════════════════════════════════════════════════════ */

.today-highlight {
  border: 2px solid #a1c4fc !important;
  background-color: #eff6ff;
}

#attendanceTable {
  width: auto;
  border-collapse: separate;
  border-spacing: 0;
}

.date-cell {
  width: 48px;
  min-width: 48px;
  height: 32px;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
  cursor: pointer;
  position: relative;
}

/* Comment indicator dot */
.has-comment::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 4px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #94a3b8;
  pointer-events: none;
}

/* A separate marker for the comment visible to parents. */
.has-parent-comment::before {
  content: '✉';
  position: absolute;
  top: 1px;
  left: 3px;
  color: #1d4ed8;
  font-size: 9px;
  line-height: 1;
  pointer-events: none;
}

.att-status-present.has-comment::after  { background: #16a34a; }
.att-status-absent.has-comment::after   { background: #dc2626; }
.att-status-excused.has-comment::after  { background: #ca8a04; }
.att-status-holiday.has-comment::after  { background: #64748b; }

/* Tooltip balloons */
#studentNoteTooltipAtt,
#commentTooltip,
#attTooltip {
  position: fixed;
  z-index: 9998;
  background: #1e293b;
  color: #f8fafc;
  font-size: 0.78rem;
  line-height: 1.5;
  padding: 8px 12px;
  border-radius: 8px;
  max-width: 260px;
  pointer-events: none;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  white-space: pre-wrap;
  word-break: break-word;
  display: none;
}

#commentTooltip { z-index: 9999; }
#commentTooltip::before {
  content: '💬 ';
  font-size: 0.72rem;
}

/* ════════════════════════════════════════════════════════════════════════
   8. REPORTS
   ════════════════════════════════════════════════════════════════════════ */

/* Print styles */
@media print {
  @page { margin: 12mm 14mm; size: A4; }
  body, html { background: white !important; }
  body * { visibility: hidden !important; }
  #printArea, #printArea * { visibility: visible !important; }
  #printArea {
    position: absolute; top: 0; left: 0; width: 100%; padding: 0;
    font-family: 'Times New Roman', serif; font-size: 10pt; color: #000;
  }
  .no-print { display: none !important; }
  tr { page-break-inside: avoid; }
  .rpt-group { page-break-inside: auto; }
  .rpt-group-header { page-break-after: avoid; }
  .rpt-day + .rpt-day { page-break-before: always; }
  table { border-collapse: collapse; width: 100%; font-size: 9pt; }
  th, td { border: 0.5pt solid #bbb; padding: 2pt 5pt; }
  th {
    background: #f0f0f0 !important;
    font-weight: bold;
    text-align: left;
  }
  .rpt-summary {
    border: 1pt solid #ccc;
    padding: 5pt 10pt;
    margin-bottom: 8pt;
    font-size: 9pt;
  }
  .rpt-total-row { font-weight: bold; background: #f5f5f5 !important; }
  .rpt-group-header {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Report cards */
.report-card {
  transition: all 0.16s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.report-card:hover {
  border-color: #6366f1;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99,102,241,0.12);
}

.report-card.active {
  border-color: #6366f1;
  background: #eef2ff;
}

.report-card.active .card-icon {
  background: #6366f1;
  color: white;
}

/* Filter pills */
.filter-pill {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.14s;
}

.filter-pill.off { background: #f1f5f9; color: #64748b; }
.filter-pill.off:hover { background: #dbeafe; color: #1d4ed8; }
.filter-pill.on { background: #1e293b; color: white; }
.filter-pill.on-blue { background: #2563eb; color: white; }

#monthPickerArea { display: none; }
#monthPickerArea.show { display: block; }

#reportArea {
  display: none;
  animation: fadeIn 0.2s ease;
}

#reportArea.visible { display: block; }

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

/* Report tables */
.rpt-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.82rem;
}

.rpt-table th {
  background: #f8fafc;
  font-size: 0.67rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  font-weight: 700;
  padding: 6px 10px;
  border-bottom: 2px solid #e2e8f0;
  text-align: left;
}

.rpt-table td {
  padding: 5px 10px;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
}

.rpt-table tbody tr:hover td { background: #fafafa; }
.rpt-table-row:hover td { background: #eff6ff !important; }

.rpt-table .num-col {
  text-align: center;
  color: #94a3b8;
  font-size: 0.72rem;
  width: 32px;
}

.rpt-table .name-cell {
  width: 30%;
  text-align: left;
  padding-left: 8px;
}

.rpt-table .right { text-align: right; }
.rpt-table .center { text-align: center; }

/* Attendance cells in reports */
.att-cell {
  position: relative;
  text-align: center;
  padding: 4px 2px;
}

.att-cell.has-comment::after {
  content: '';
  position: absolute;
  top: 3px; right: 3px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #94a3b8;
  pointer-events: none;
}

.att-cell.st-present.has-comment::after  { background: #16a34a; }
.att-cell.st-absent.has-comment::after   { background: #dc2626; }
.att-cell.st-excused.has-comment::after  { background: #ca8a04; }
.att-cell.st-holiday.has-comment::after  { background: #64748b; }

/* Sessions tooltip */
#sessionsTooltip {
  position: fixed;
  z-index: 9999;
  background: #1e293b;
  padding: 10px 12px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  pointer-events: none;
  display: none;
  width: max-content;
}

#sessionsTooltip .st-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 6px;
}

#sessionsTooltip .st-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 3px;
}

/* Report groups */
.rpt-group {
  margin-bottom: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}

.rpt-group-header {
  background: linear-gradient(90deg, #f8fafc, #ffffff);
  border-left: 4px solid #3b82f6;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
}

.rpt-group-header:hover {
  background: linear-gradient(90deg, #f1f5f9, #f8fafc);
}

/* Report days */
.rpt-day { margin-bottom: 20px; }

.rpt-day-header {
  margin-bottom: 8px;
  padding: 6px 14px;
  background: #f8fafc;
  border-radius: 8px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.rpt-day-header:hover { background: #f1f5f9; }

/* Inactive tag */
.inactive-tag {
  font-size: 0.65rem;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 3px;
}

/* Summary */
.rpt-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px 20px;
  margin-bottom: 14px;
}

.rpt-summary-item .lbl {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}

.rpt-summary-item .val {
  font-size: 1.2rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.2;
}

.rpt-summary-item .val.green { color: #15803d; }
.rpt-summary-item .val.blue  { color: #1d4ed8; }
.rpt-summary-item .val.red   { color: #dc2626; }

/* Subject dot */
.subject-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  flex-shrink: 0;
}

/* Document header */
.rpt-doc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #1e293b;
}

/* Collapse all button */
.rpt-collapse-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
  user-select: none;
  white-space: nowrap;
  align-self: flex-end;
}

.rpt-collapse-all:hover { background: #e2e8f0; color: #1e293b; }

.rpt-collapse-all .ca-icon {
  font-size: 0.7rem;
  transition: transform 0.18s;
}

.rpt-collapse-all.all-collapsed .ca-icon {
  transform: rotate(-90deg);
}

@media print {
  .rpt-collapse-all { display: none !important; }
}

/* Collapse toggle */
.rpt-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 5px;
  background: rgba(0,0,0,0.05);
  color: #64748b;
  font-size: 0.65rem;
  flex-shrink: 0;
  transition: transform 0.18s ease, background 0.14s;
  line-height: 1;
}

.rpt-group-header:hover .rpt-toggle,
.rpt-day-header:hover   .rpt-toggle {
  background: rgba(0,0,0,0.10);
}

.rpt-collapsed .rpt-toggle { transform: rotate(-90deg); }

.rpt-group-body.collapsed { display: none; }
.rpt-day-body.collapsed   { display: none; }

@media print {
  .rpt-group-body.collapsed,
  .rpt-day-body.collapsed { display: block !important; }
  .rpt-toggle { display: none !important; }
}

/* ════════════════════════════════════════════════════════════════════════
   9. PAYMENTS
   ════════════════════════════════════════════════════════════════════════ */

.group-header {
  background: linear-gradient(90deg, #f1f5f9, #f8fafc);
  border-left: 4px solid #3b82f6;
}

.payment-row {
  transition: background 0.1s;
}

.payment-row:hover { background: #f8fafc; }

.summary-card {
  background: linear-gradient(135deg, #eff6ff 0%, #f0fdf4 100%);
  border: 1.5px solid #bfdbfe;
  border-radius: 6px;
  padding: 16px 20px;
}

#paymentsContainer table { font-size: 0.875rem; }
#paymentsContainer td { padding: 0; }
#paymentsContainer td:first-child { max-width: none; width: auto; }
#paymentsContainer td:not(:first-child) { width: auto; text-align: left; }

/* Payments popup */
.payments-popup {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.45);
  backdrop-filter: blur(3px);
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
}

.payments-popup-inner {
  background: white;
  border-radius: 14px;
  width: 100%;
  max-width: 460px;
  margin: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  overflow: hidden;
}

.popup-payment-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 18px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background 0.12s;
}

.popup-payment-item:last-child { border-bottom: none; }
.popup-payment-item:hover { background: #f0f9ff; }

/* Import badge */
.import-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.import-badge-created { background: #dcfce7; color: #166534; }
.import-badge-updated  { background: #dbeafe; color: #1e40af; }
.import-badge-error    { background: #fee2e2; color: #991b1b; }

.import-row-created td { background: #f0fdf4; }
.import-row-updated td { background: #eff6ff; }
.import-row-error   td { background: #fff1f2; }

/* ════════════════════════════════════════════════════════════════════════
   10. SUBJECTS TABLE
   ════════════════════════════════════════════════════════════════════════ */

#subjectsTable {
  table-layout: fixed;
  width: 100%;
}

.subject-name-col        { width: 30%; }
.subject-description-col { width: auto; word-wrap: break-word; overflow-wrap: break-word; }
.subject-groups-col      { width: 90px; }
.subject-color-col       { width: 70px; }
.subject-actions-col     { width: 90px; }

/* ════════════════════════════════════════════════════════════════════════
   11. GROUP FORM — DAY SELECTOR
   ════════════════════════════════════════════════════════════════════════ */

.day-sq {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 9px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
  cursor: pointer;
  transition: all 0.14s;
  user-select: none;
}

.day-sq:hover {
  border-color: #6366f1;
  color: #6366f1;
}

.day-sq input { display: none; }

.day-sq:has(input:checked) {
  background: #6366f1;
  border-color: #6366f1;
  color: white;
}

/* ════════════════════════════════════════════════════════════════════════
   12. ERROR PAGES (404/500)
   ════════════════════════════════════════════════════════════════════════ */

.error-page-body {
  font-family: 'Inter', system-ui, sans-serif;
}
