:root {
  --primary: #4F46E5;
  --primary-dark: #4338CA;
  --primary-light: #EEF2FF;
  --success: #16A34A;
  --success-light: #DCFCE7;
  --danger: #DC2626;
  --danger-light: #FEE2E2;
  --warning: #D97706;
  --warning-light: #FEF3C7;
  --info: #0891B2;
  --sidebar-bg: #1E1B4B;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-active: rgba(99,102,241,0.3);
  --bg: #F1F5F9;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --text-primary: #1E293B;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.06);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* LOGIN */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 1rem;
}

.login-container {
  background: white;
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.login-logo h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -1px;
}

.login-form {
  padding: 2rem 1.5rem;
}

.lang-toggle-login {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
  padding-bottom: 1rem;
}

.lang-btn {
  flex: 1;
  padding: 0.5rem 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border-bottom: 3px solid transparent;
  margin-bottom: -1rem;
  padding-bottom: 1.5rem;
}

.lang-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.login-form h2 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--text-secondary);
}

.form-group input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  transition: border-color 0.15s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

.form-group input[type="checkbox"] {
  width: auto;
  margin-right: 0.5rem;
  cursor: pointer;
}

.btn-login {
  width: 100%;
  padding: 0.85rem 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 1rem;
}

.btn-login:hover {
  background: var(--primary-dark);
}

.demo-creds {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.demo-creds p {
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.demo-creds code {
  display: block;
  background: white;
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  font-family: monospace;
  color: var(--primary);
  font-weight: 600;
  word-break: break-all;
}

/* MAIN APP */
.app-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* SIDEBAR */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}

.lang-toggle-mini {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 600;
  transition: all 0.15s;
}

.lang-toggle-mini:hover {
  background: rgba(255,255,255,0.2);
}

.nav-menu {
  padding: 1rem 0.75rem;
  flex: 1;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.35);
  padding: 0.75rem 0.5rem 0.35rem;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.65rem 0.75rem;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.88rem;
  transition: all 0.18s;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  font-weight: 500;
}

.nav-item.danger:hover {
  background: rgba(220, 38, 38, 0.2);
  color: #FECACA;
}

.nav-item svg {
  flex-shrink: 0;
}

/* MAIN */
.main-content {
  margin-left: 260px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* TOPBAR */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px;
}

.page-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

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

.user-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}

/* CONTENT */
.content-area {
  padding: 1.75rem;
  flex: 1;
  overflow-y: auto;
}

.module {
  display: none;
  animation: fadeIn 0.2s ease;
}

.module.active {
  display: block;
}

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

.module-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.module-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* STATS */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

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

.stat-card.indigo .stat-icon {
  background: var(--primary-light);
  color: var(--primary);
}

.stat-card.green .stat-icon {
  background: var(--success-light);
  color: var(--success);
}

.stat-card.amber .stat-icon {
  background: var(--warning-light);
  color: var(--warning);
}

.stat-card.red .stat-icon {
  background: var(--danger-light);
  color: var(--danger);
}

.stat-value {
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* QUICK ACTIONS */
.quick-actions {
  margin-bottom: 1.5rem;
}

.quick-actions h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1rem;
}

.action-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s;
  color: var(--text-primary);
}

.action-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.action-card svg {
  color: var(--primary);
}

.action-card span {
  font-size: 0.82rem;
  font-weight: 500;
}

/* CARD */
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  font-size: 0.95rem;
  font-weight: 600;
}

/* TABLE */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  flex: 1;
  max-width: 320px;
}

.search-box svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-box input {
  border: none;
  background: none;
  padding: 0.5rem 0;
  font-size: 0.875rem;
  width: 100%;
  outline: none;
}

.filter-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

select, input[type="date"], input[type="time"] {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background: var(--surface);
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

select:focus, input:focus {
  border-color: var(--primary);
}

.table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.data-table th {
  background: #F8FAFC;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text-primary);
}

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

.data-table tbody tr:hover {
  background: #FAFAFA;
}

.table-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border);
  background: #F8FAFC;
}

.count-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* BADGES */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 600;
}

.badge.active, .badge.paid {
  background: var(--success-light);
  color: var(--success);
}

.badge.inactive {
  background: #F1F5F9;
  color: var(--text-secondary);
}

.badge.pending {
  background: var(--warning-light);
  color: var(--warning);
}

.badge.overdue {
  background: var(--danger-light);
  color: var(--danger);
}

/* BUTTONS */
.btn-primary, .btn-outline, .btn-sm, .btn-success, .btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0.55rem 1.1rem;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

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

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

.btn-outline {
  background: var(--surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  background: var(--bg);
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.82rem;
}

.btn-success {
  background: var(--success-light);
  color: var(--success);
  border: none;
}

.btn-danger {
  background: var(--danger-light);
  color: var(--danger);
  border: none;
}

.btn-block {
  width: 100%;
}

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
  padding: 0;
  gap: 0;
}

.btn-icon:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.btn-icon.edit:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-icon.del:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* ATTENDANCE */
.date-picker-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  color: var(--text-secondary);
}

.date-picker-wrap input {
  border: none;
  background: none;
  outline: none;
  font-size: 0.88rem;
}

.attendance-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.att-stat {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.1rem 1rem;
  text-align: center;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.att-stat.present {
  border-top: 3px solid var(--success);
}

.att-stat.absent {
  border-top: 3px solid var(--danger);
}

.att-stat.late {
  border-top: 3px solid var(--warning);
}

.att-stat.percentage {
  border-top: 3px solid var(--primary);
}

.att-num {
  font-size: 1.8rem;
  font-weight: 700;
}

.att-stat.present .att-num {
  color: var(--success);
}

.att-stat.absent .att-num {
  color: var(--danger);
}

.att-stat.late .att-num {
  color: var(--warning);
}

.att-stat.percentage .att-num {
  color: var(--primary);
}

.att-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 4px;
}

.bulk-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.status-header {
  display: flex;
  gap: 1.5rem;
}

.sh {
  font-size: 0.73rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sh.present-h {
  color: var(--success);
}

.sh.absent-h {
  color: var(--danger);
}

.sh.late-h {
  color: var(--warning);
}

.radio-group {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.radio-group input[type="radio"] {
  display: none;
}

.radio-group label {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  font-size: 0.7rem;
  font-weight: 600;
  background: white;
}

.radio-group input[value="present"] + label {
  border-color: #D1FAE5;
}

.radio-group input[value="present"]:checked + label {
  background: var(--success);
  border-color: var(--success);
  color: white;
}

.radio-group input[value="absent"] + label {
  border-color: #FEE2E2;
}

.radio-group input[value="absent"]:checked + label {
  background: var(--danger);
  border-color: var(--danger);
  color: white;
}

.radio-group input[value="late"] + label {
  border-color: #FEF3C7;
}

.radio-group input[value="late"]:checked + label {
  background: var(--warning);
  border-color: var(--warning);
  color: white;
}

.att-note-input {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.8rem;
  outline: none;
}

/* QR ATTENDANCE */
.qr-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.qr-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.qr-camera-wrapper {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  margin-bottom: 1rem;
}

.qr-camera-wrapper video {
  width: 100%;
  height: auto;
  display: block;
}

.qr-guide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.qr-square {
  width: 200px;
  height: 200px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: none;
}

.qr-guide p {
  color: white;
  font-size: 0.9rem;
  margin-top: 1rem;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.qr-controls {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.qr-results {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.qr-results h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.scanned-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.scanned-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg);
  border-radius: 6px;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.qr-summary {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-weight: 500;
}

/* TIMETABLE */
.timetable-table {
  display: grid;
  gap: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.tt-row {
  display: grid;
  grid-template-columns: 80px repeat(5, 1fr);
  border-bottom: 1px solid var(--border);
}

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

.tt-cell {
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 0.85rem;
  border-right: 1px solid var(--border);
}

.tt-cell:last-child {
  border-right: none;
}

.tt-time {
  background: #F8FAFC;
  font-weight: 600;
  color: var(--text-secondary);
}

.tt-header {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  text-align: center;
}

.tt-class {
  background: var(--bg);
  cursor: pointer;
  transition: background 0.15s;
}

.tt-class:hover {
  background: #E7F5FF;
}

.tt-class strong {
  color: var(--primary);
  display: block;
}

.tt-class small {
  color: var(--text-secondary);
  font-size: 0.75rem;
  display: block;
  margin-top: 2px;
}

.tt-class tiny {
  color: var(--text-muted);
  font-size: 0.7rem;
  display: block;
}

/* FORM */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.4rem;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--surface);
  outline: none;
  transition: border-color 0.15s;
  font-family: var(--font);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
}

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

/* MODAL */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-overlay.open {
  display: flex;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 100%;
  max-width: 620px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  margin: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.modal-header h3 {
  font-size: 1rem;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--bg);
  color: var(--text-primary);
}

.modal-body {
  padding: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  background: #F8FAFC;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* REPORTS */
.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.report-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  cursor: pointer;
  transition: all 0.18s;
  box-shadow: var(--shadow);
}

.report-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--primary);
}

.report-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.att-icon {
  background: #DBEAFE;
  color: #1D4ED8;
}

.fees-icon {
  background: var(--success-light);
  color: var(--success);
}

.student-icon {
  background: var(--primary-light);
  color: var(--primary);
}

.report-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.report-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.report-table th {
  background: var(--bg);
  font-weight: 600;
  padding: 0.6rem 1rem;
  text-align: left;
  border-bottom: 2px solid var(--border);
  font-size: 0.8rem;
}

.report-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border);
}

/* STUDENT CARDS */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 2rem;
  padding: 1rem;
}

.student-card-print {
  break-inside: avoid;
  page-break-inside: avoid;
}

.card-front {
  width: 350px;
  height: 220px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 12px;
  padding: 1.25rem;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.card-header-color {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 30%;
  background: rgba(255,255,255,0.1);
}

.card-logo {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.card-school {
  font-size: 0.7rem;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.card-photo {
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

.card-info {
  font-size: 0.8rem;
}

.card-field {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  align-items: center;
}

.card-label {
  opacity: 0.8;
  font-weight: 500;
}

.card-value {
  font-weight: 600;
}

.card-qr {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: white;
  padding: 4px;
  border-radius: 4px;
}

.card-qr img {
  width: 80px;
  height: 80px;
}

/* TOAST */
#toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.75rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--text-primary);
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  animation: slideIn 0.25s ease;
  min-width: 260px;
}

.toast.success {
  background: var(--success);
}

.toast.error {
  background: var(--danger);
}

.toast.info {
  background: var(--primary);
}

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

/* PRINT */
@media print {
  .sidebar, .topbar, .module:not(.active), .table-toolbar, .modal-overlay {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
  }

  body {
    background: white;
  }

  .student-card-print {
    page-break-after: always;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
  }
}

/* RESPONSIVE */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
  }

  .qr-container {
    grid-template-columns: 1fr;
  }

  .attendance-stats {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-area {
    padding: 1rem;
  }

  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-box {
    max-width: 100%;
  }

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

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

  .module-header {
    flex-direction: column;
  }
}
