:root {
  --sidebar-w: 260px;
  --topbar-h: 60px;
  --teal: #006680;
  --header-bg: #005f6b;
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #0f172a;
  --muted: #64748b;
  --sidebar-bg: #ffffff;
  --input-bg: #ffffff;
  --surface-hover: #f1f5f9;
  --surface-muted: #f8fafc;
  --table-head-bg: #f8fafc;
  --table-row-hover: #fafafa;
  --header-search-bg: #ffffff;
  --header-search-text: #0f172a;
}

html.dark {
  --bg: #0b1220;
  --card: #111827;
  --border: #1f2937;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --sidebar-bg: #0f172a;
  --input-bg: #1a2234;
  --surface-hover: #1f2937;
  --surface-muted: #0f172a;
  --table-head-bg: #1a2234;
  --table-row-hover: #1f2937;
  --header-bg: #004d40;
  --header-search-bg: rgba(0, 0, 0, 0.28);
  --header-search-text: #f1f5f9;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[x-cloak] { display: none !important; }

body.app-body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
}

/* Sidebar — full height, left */
.app-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  z-index: 50;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.app-sidebar-brand {
  padding: 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--topbar-h);
}

.app-sidebar-brand img {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  object-fit: cover;
  flex-shrink: 0;
}

.app-sidebar-brand span {
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  text-transform: uppercase;
  color: var(--text);
}

.app-sidebar-nav {
  flex: 1;
  overflow-y: auto;
  overflow-anchor: none;
  padding: 12px;
  overscroll-behavior: contain;
}

.app-sidebar-footer {
  padding: 12px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.app-nav-logout {
  color: #dc2626 !important;
  margin-bottom: 0;
}

.app-nav-logout:hover {
  background: #fef2f2 !important;
  color: #b91c1c !important;
}

.app-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 4px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.app-nav-link:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.app-nav-link.active {
  background: #f0fdfa;
  color: #006680;
  border: 1px solid #ccfbf1;
}

.app-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 8px;
}

.app-nav-chevron.open { transform: rotate(90deg); }

.app-nav-link svg,
.app-nav-link i {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Content shell — right of sidebar */
.app-shell {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  background: var(--header-bg);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
}

.app-topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.app-topbar-brand {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #ffffff;
}

.app-topbar-center {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
  max-width: 640px;
  margin: 0 auto;
}

.app-topbar-search {
  position: relative;
  width: 100%;
}

.app-topbar-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #94a3b8;
  pointer-events: none;
}

.app-topbar-search input {
  width: 100%;
  height: 40px;
  padding: 0 18px 0 44px;
  border: none;
  border-radius: 999px;
  background: var(--header-search-bg);
  color: var(--header-search-text);
  font-size: 14px;
  outline: none;
}

.app-topbar-search input::placeholder { color: #94a3b8; }

.app-topbar-search input:focus {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.app-topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.app-topbar-icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
}

.app-topbar-icon-btn:hover { background: rgba(255, 255, 255, 0.12); }

.app-topbar-icon-btn i {
  width: 20px;
  height: 20px;
}

.app-notify-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--header-bg);
}

.theme-icon-sun { display: none; }

html.dark .theme-icon-moon { display: none; }

html.dark .theme-icon-sun { display: block; }

.app-topbar-user-wrap { position: relative; }

.app-topbar-user-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 4px 4px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
}

.app-topbar-user-btn:hover { background: rgba(255, 255, 255, 0.12); }

.app-topbar-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #16a34a;
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

.app-topbar-user-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  text-align: left;
}

.app-topbar-user-text strong {
  font-size: 14px;
  font-weight: 700;
}

.app-topbar-user-text small {
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
}

.app-topbar-user-chevron {
  width: 16px;
  height: 16px;
  opacity: 0.85;
}

.app-topbar-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  padding: 6px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.15);
  z-index: 50;
}

.app-topbar-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}

.app-topbar-dropdown a:hover { background: var(--bg); }

.app-topbar-dropdown a i {
  width: 16px;
  height: 16px;
  color: var(--muted);
}

.app-topbar-dropdown-logout { color: #dc2626 !important; }

.app-topbar-dropdown-logout i { color: #dc2626 !important; }

.app-menu-btn {
  display: none;
  border: none;
  background: transparent;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  color: #ffffff;
}

.app-menu-btn:hover { background: rgba(255, 255, 255, 0.12); }

.app-menu-btn i {
  width: 22px;
  height: 22px;
}

.app-main {
  flex: 1;
  padding: 24px;
  background: var(--bg);
}

.app-page {
  max-width: 1400px;
  margin: 0 auto;
}

.app-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.app-page-header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.app-page-header p {
  margin: 4px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
}

.app-btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.app-btn-outline:hover { background: var(--surface-hover); }

/* Grid helpers */
.app-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.app-grid-3 {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.app-grid-1 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.app-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.app-grid-5 {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 1200px) {
  .app-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .app-sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .app-sidebar.open { transform: translateX(0); }
  .app-shell { margin-left: 0; }
  .app-menu-btn { display: inline-flex; }
  .app-topbar { padding: 0 12px; gap: 10px; }
  .app-topbar-center { display: none; }
  .app-topbar-user-text { display: none; }
  .app-topbar-user-chevron { display: none; }
  .app-grid-4,
  .app-grid-2 { grid-template-columns: 1fr; }
  .app-grid-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-main { padding: 16px; }
}

.app-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 45;
}

.app-overlay.show { display: block; }

/* Cards */
.app-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.app-card-pad { padding: 24px; }

.app-card-header {
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 700;
}

.app-stat-card {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.app-stat-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.app-stat-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  margin: 0;
}

.app-stat-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text);
  margin: 8px 0 0;
  line-height: 1.2;
}

.app-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.app-stat-icon svg { width: 24px; height: 24px; color: #fff; }

.app-stat-sub {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--muted);
}

.bg-blue-500 { background: #3b82f6; }
.bg-indigo-500 { background: #6366f1; }
.bg-emerald-500 { background: #10b981; }
.bg-purple-500 { background: #a855f7; }

.app-day-card {
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  text-align: center;
}

.app-day-card.muted { opacity: 0.6; }

.app-day-name {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 8px;
}

.app-day-pct {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.app-day-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

.app-list { border-top: 1px solid var(--border); }

.app-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
}

.app-list-item:hover { background: var(--surface-hover); }

.app-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.app-avatar.blue { background: #dbeafe; color: #1d4ed8; }
.app-avatar.green { background: #d1fae5; color: #047857; }

.app-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.app-badge.purple { background: #f3e8ff; color: #7e22ce; }
.app-badge.amber { background: #fef3c7; color: #b45309; }
.app-badge.blue { background: #dbeafe; color: #1d4ed8; }

.app-empty {
  padding: 40px 24px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

/* Tabs */
.app-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}

.app-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.app-tab:hover { color: var(--teal); }

.app-tab.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
}

.app-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.app-form-grid .full { grid-column: 1 / -1; }

.app-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}

.app-field input,
.app-field select,
.app-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text);
}

.app-field textarea { min-height: 80px; resize: vertical; }

.app-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: none;
  border-radius: 10px;
  background: #006680;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.app-btn-primary:hover { background: #005266; }

.app-btn-danger {
  background: #dc2626;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12px;
  cursor: pointer;
}

.app-alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 16px;
}

.app-alert.success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.app-alert.error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

@media (max-width: 768px) {
  .app-form-grid { grid-template-columns: 1fr; }
}

/* Sidebar accordion */
.app-nav-group-wrap { margin-bottom: 4px; }

.app-nav-toggle {
  width: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.app-nav-toggle-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-nav-chevron {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
  opacity: 0.6;
}

.app-nav-sub {
  padding: 4px 0 4px 12px;
  margin-left: 12px;
  border-left: 2px solid #e2e8f0;
}

.app-nav-sublink {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin-bottom: 2px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
}

.app-nav-sublink:hover { background: var(--surface-hover); color: var(--text); }

.app-nav-sublink.active {
  background: #eff6ff;
  color: #006680;
  font-weight: 600;
}

html.dark .app-sidebar {
  background: var(--sidebar-bg);
  border-right-color: var(--border);
}

html.dark .app-sidebar-brand {
  border-bottom-color: var(--border);
}

html.dark .app-sidebar-brand span {
  color: var(--text);
}

html.dark .app-nav-link {
  color: #cbd5e1;
}

html.dark .app-nav-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
}

html.dark .app-nav-link.active {
  background: var(--teal);
  color: #ffffff;
  border-color: transparent;
}

html.dark .app-nav-sublink {
  color: var(--muted);
}

html.dark .app-nav-sublink:hover,
html.dark .app-nav-sublink.active {
  background: rgba(0, 102, 128, 0.22);
  color: #7dd3fc;
}

html.dark .app-nav-divider {
  background: var(--border);
}

html.dark .app-sidebar-footer {
  border-top-color: var(--border);
}

html.dark .app-nav-logout:hover {
  background: rgba(220, 38, 38, 0.15) !important;
}

html.dark .app-card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

html.dark .app-topbar-search input {
  border: 1px solid rgba(255, 255, 255, 0.12);
}

html.dark .app-topbar-search input::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

html.dark .app-topbar-search input:focus {
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.18);
}

/* Student Management page */
.stu-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.stu-header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
}

.stu-header p {
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 520px;
}

.stu-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stu-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.stu-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.stu-stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.stu-stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-top: 4px;
}

.stu-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stu-stat-icon.blue { background: #dbeafe; color: #2563eb; }
.stu-stat-icon.green { background: #d1fae5; color: #059669; }
.stu-stat-icon.gray { background: var(--surface-hover); color: #64748b; }
.stu-stat-icon.teal { background: #ccfbf1; color: #0d9488; }

.tea-payroll { font-size: 1.75rem !important; }

.tea-qual-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tea-contact { display: flex; flex-direction: column; gap: 3px; }
.tea-contact-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
}
.tea-login-muted { color: #94a3b8; }
.tea-login-ok { color: #059669; }

.tea-salary {
  font-weight: 700;
  color: var(--text);
  font-size: 14px;
}

.tea-status-inactive {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.tea-form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 32px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.tea-form-card h2 {
  margin: 0 0 24px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
}

.tea-form { display: flex; flex-direction: column; gap: 20px; }

.tea-login-box {
  border: 1px solid #bfdbfe;
  background: linear-gradient(180deg, #eff6ff 0%, #f8fafc 100%);
  border-radius: 14px;
  padding: 20px;
}

.tea-login-box-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 16px;
}

.tea-login-box-title svg { width: 16px; height: 16px; }

.field-hint {
  margin: 4px 0 0;
  font-size: 11px;
  color: #94a3b8;
}

.field-hint.accent { color: #1d4ed8; }

.app-field label .req { color: #dc2626; }

.app-field input.readonly,
.app-field input[readonly] {
  background: var(--surface-hover);
  color: #64748b;
  cursor: not-allowed;
}

.tea-reset-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 12px;
  color: #64748b;
  cursor: pointer;
}

.tea-salary-input {
  position: relative;
}

.tea-salary-input svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
}

.tea-salary-input input {
  padding-left: 36px !important;
}

.tea-qual-row {
  grid-template-columns: 2fr 1fr 1fr;
}

.tea-qual-field { grid-column: span 1; }

@media (max-width: 900px) {
  .tea-qual-row { grid-template-columns: 1fr; }
  .tea-qual-field { grid-column: span 1; }
}

.stu-toolbar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.stu-search-wrap {
  flex: 1;
  min-width: 220px;
  position: relative;
}

.stu-search-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #94a3b8;
}

.stu-search-wrap input {
  width: 100%;
  padding: 11px 14px 11px 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text);
}

.stu-filter-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 180px;
}

.stu-filter-wrap select {
  flex: 1;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text);
}

.stu-table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.stu-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.stu-table thead th {
  text-align: left;
  padding: 14px 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--table-head-bg);
  border-bottom: 1px solid var(--border);
}

.stu-table tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}

.stu-table tbody tr:hover { background: var(--table-row-hover); }

.stu-name-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stu-avatar {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: lowercase;
}

.stu-class-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.stu-parent-name { font-weight: 500; color: var(--text); }
.stu-parent-phone {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.stu-status-active {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #059669;
}

.stu-status-inactive {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.stu-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.stu-action-form {
  display: inline-flex;
  margin: 0;
}

.stu-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
}

.stu-action-btn i,
.stu-action-btn svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.stu-action-btn:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.stu-action-edit {
  color: #006680;
  border-color: rgba(0, 102, 128, 0.25);
}

.stu-action-edit:hover {
  background: rgba(0, 102, 128, 0.08);
  color: #006680;
}

.stu-action-info {
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.25);
}

.stu-action-info:hover {
  background: rgba(37, 99, 235, 0.08);
  color: #2563eb;
}

.stu-action-warn {
  color: #b45309;
  border-color: rgba(245, 158, 11, 0.35);
}

.stu-action-warn:hover {
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
}

.stu-action-ok {
  color: #059669;
  border-color: rgba(16, 185, 129, 0.35);
}

.stu-action-ok:hover {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

.stu-action-danger {
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.25);
}

.stu-action-danger:hover {
  background: rgba(220, 38, 38, 0.08);
  color: #dc2626;
}

.stu-icon-btn {
  border: none;
  background: transparent;
  padding: 6px;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}

.stu-icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.stu-icon-btn.danger:hover { color: #dc2626; background: rgba(220, 38, 38, 0.12); }

/* Register form */
.reg-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.reg-card h2 {
  margin: 0 0 24px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
}

.reg-field input::placeholder,
.reg-field select option[value=""] {
  color: #94a3b8;
}

.reg-field input:disabled {
  background: var(--surface-hover);
  color: #94a3b8;
}

.reg-hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 4px;
}

.fee-section {
  margin-top: 8px;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #fafafa;
}

.fee-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.fee-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.fee-card {
  position: relative;
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 20px 16px;
  background: var(--card);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.fee-card:hover { border-color: #93c5fd; }

.fee-card.selected {
  border-color: #006680;
  box-shadow: 0 0 0 3px rgba(0, 102, 128, 0.12);
}

.fee-card-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #006680;
  display: none;
}

.fee-card.selected .fee-card-dot { display: block; }

.fee-card-icon {
  width: 28px;
  height: 28px;
  margin: 0 auto 8px;
  color: #64748b;
}

.fee-card.selected .fee-card-icon { color: #006680; }

.fee-card-label {
  font-size: 14px;
  font-weight: 700;
  color: #334155;
}

.fee-info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  font-size: 13px;
  color: #1e40af;
}

.reg-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* Register form v2 */
.reg-page {
  max-width: 100%;
  min-width: 0;
}

.reg-form,
.reg-layout,
.reg-main {
  min-width: 0;
  max-width: 100%;
}

.reg-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.reg-page-header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
}

.reg-page-header p {
  margin: 6px 0 0;
  font-size: 0.875rem;
  color: #64748b;
}

.reg-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}

.reg-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.reg-section-head {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.reg-section-head h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.reg-section-head p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #94a3b8;
}

.reg-section-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.reg-section-icon svg { width: 20px; height: 20px; }
.reg-section-icon.teal { background: #e0f2f1; color: #006680; }
.reg-section-icon.blue { background: #dbeafe; color: #2563eb; }
.reg-section-icon.green { background: #d1fae5; color: #059669; }
.reg-section-icon.amber { background: #fef3c7; color: #d97706; }
.reg-section-icon.purple { background: #f3e8ff; color: #7c3aed; }

.reg-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}

.reg-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.reg-grid .full { grid-column: 1 / -1; }

.reg-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reg-field label .req { color: #dc2626; }

.reg-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.reg-input-wrap > i,
.reg-input-wrap > svg {
  position: absolute;
  left: 12px;
  width: 16px;
  height: 16px;
  color: #94a3b8;
  pointer-events: none;
  z-index: 1;
}

.reg-input-wrap input,
.reg-input-wrap select {
  width: 100%;
  padding: 11px 12px 11px 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: #fafafa;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.reg-input-wrap input:focus,
.reg-input-wrap select:focus,
.reg-input-plain:focus {
  outline: none;
  border-color: #006680;
  background: var(--card);
  box-shadow: 0 0 0 3px rgba(0, 102, 128, 0.1);
}

.reg-input-wrap input:disabled {
  background: var(--surface-hover);
  color: #64748b;
  cursor: not-allowed;
}

.reg-input-plain {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: #fafafa;
}

.reg-textarea-wrap textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  background: #fafafa;
  resize: vertical;
  min-height: 88px;
  font-family: inherit;
}

.reg-hint {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

.fee-section-v2 {
  margin-top: 8px;
  padding: 20px;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  background: linear-gradient(180deg, #fafafa 0%, #fff 100%);
}

.fee-card-desc {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

.fee-info-box {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  font-size: 13px;
  color: #1e40af;
}

.fee-info-box svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.fee-info-box.discount { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.fee-info-box.scholarship { background: #f3e8ff; border-color: #e9d5ff; color: #6b21a8; }

.reg-aside {
  position: sticky;
  top: 72px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.reg-photo-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.reg-photo-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #64748b;
  margin-bottom: 12px;
}

.reg-photo-box {
  width: 100%;
  aspect-ratio: 1;
  max-height: 200px;
  border: 2px dashed #cbd5e1;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-hover);
  margin-bottom: 12px;
  transition: border-color 0.15s;
}

.reg-photo-box.has-photo { border-style: solid; border-color: #006680; }

.reg-photo-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #94a3b8;
  font-size: 13px;
}

.reg-photo-empty svg { width: 32px; height: 32px; }

.reg-photo-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.reg-photo-input { display: none; }

.reg-photo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  background: var(--card);
  transition: background 0.15s, border-color 0.15s;
}

.reg-photo-btn:hover { background: var(--surface-hover); border-color: #006680; color: #006680; }

.reg-photo-clear {
  margin-top: 8px;
  background: none;
  border: none;
  color: #dc2626;
  font-size: 12px;
  cursor: pointer;
  font-weight: 600;
}

.reg-aside-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.reg-submit {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  color: #fff !important;
}

.reg-submit .reg-submit-label {
  color: #fff;
  font-weight: 700;
  font-size: 15px;
}

.reg-submit:disabled { opacity: 0.7; cursor: wait; }

.reg-cancel {
  width: 100%;
  justify-content: center;
  text-align: center;
}

.reg-tip {
  display: flex;
  gap: 10px;
  padding: 14px;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 12px;
  font-size: 12px;
  color: #0f766e;
  line-height: 1.5;
}

.reg-tip svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; }

/* Login page — same register form design system */
.login-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(ellipse 80% 60% at 0% 100%, rgba(0, 102, 128, 0.08), transparent 55%),
    radial-gradient(ellipse 70% 50% at 100% 100%, rgba(112, 173, 71, 0.06), transparent 50%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
}

.login-wrap {
  width: 100%;
  max-width: 420px;
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-brand img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 8px;
}

.login-brand h1 {
  margin: 0 0 6px;
  font-size: 1.75rem;
  font-weight: 800;
  color: #006680;
  letter-spacing: -0.02em;
}

.login-brand p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.login-card {
  margin-bottom: 0;
}

.login-card .reg-section-head {
  margin-bottom: 24px;
}

.login-fields {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-actions {
  margin-top: 24px;
}

.login-alert {
  margin-top: 16px;
}

/* Hankaab paper registration form */
.hk-form {
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 4px;
  padding: 24px 28px 32px;
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}

.hk-form-logo {
  display: block;
  width: 100%;
  max-height: 90px;
  object-fit: contain;
  margin: 0 auto 8px;
}

.hk-form-divider {
  border: none;
  border-top: 2px solid #c8962e;
  margin: 8px 0 16px;
}

.hk-form-top {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}

.hk-form-title {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 800;
  color: #1b2a6b;
  text-align: center;
  letter-spacing: 0.02em;
}

.hk-form-subtitle {
  margin: 0 0 12px;
  font-size: 0.75rem;
  color: #666;
  text-align: center;
}

.hk-form-year .hk-label {
  margin-bottom: 6px;
}

.hk-form-photo {
  border: 2px solid #1b2a6b;
  background: #e8ebf5;
  border-radius: 4px;
  min-height: 130px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  position: relative;
  overflow: hidden;
}

.hk-form-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}

.hk-form-photo-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #1b2a6b;
  line-height: 1.35;
  z-index: 1;
}

.hk-form-photo.has-photo .hk-form-photo-label { display: none; }

.hk-form-photo-btn {
  margin-top: 8px;
  font-size: 0.68rem;
  font-weight: 600;
  color: #006680;
  cursor: pointer;
  z-index: 2;
  background: rgba(255,255,255,0.9);
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 8px;
}

.hk-form-photo input[type="file"] { display: none; }

.hk-section-bar {
  background: #1b2a6b;
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 12px;
  margin: 16px 0 12px;
  letter-spacing: 0.02em;
}

.hk-section-bar.gold {
  background: #c8962e;
}

.hk-field {
  margin-bottom: 12px;
}

.hk-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  color: #1b2a6b;
  margin-bottom: 6px;
}

.hk-label em {
  font-weight: 400;
  font-style: italic;
  color: #64748b;
}

.hk-input,
.hk-select,
.hk-textarea {
  width: 100%;
  border: none;
  border-bottom: 1px solid #ccc;
  background: transparent;
  padding: 6px 2px 8px;
  font-size: 0.875rem;
  color: var(--text);
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s;
}

.hk-input:focus,
.hk-select:focus,
.hk-textarea:focus {
  border-bottom-color: #1b2a6b;
}

.hk-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  padding-right: 20px;
}

.hk-textarea {
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 10px;
  min-height: 90px;
  resize: vertical;
}

.hk-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.hk-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  padding: 4px 0 8px;
}

.hk-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
}

.hk-check input {
  width: 16px;
  height: 16px;
  accent-color: #1b2a6b;
}

.hk-declaration {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 16px;
}

.hk-declaration em {
  display: block;
  margin-top: 8px;
  font-style: italic;
  color: #475569;
}

.hk-office-field .hk-input:disabled,
.hk-office-field .hk-input[readonly] {
  color: #64748b;
  background: #f8fafc;
}

.hk-form-footer {
  margin-top: 20px;
  padding-top: 12px;
  border-top: 1px solid #1b2a6b;
  text-align: center;
  font-size: 0.68rem;
  color: #666;
}

.hk-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

@media (max-width: 720px) {
  .hk-form-top,
  .hk-row-2 {
    grid-template-columns: 1fr;
  }
  .hk-form-photo {
    min-height: 100px;
  }
}

/* Classes & Subjects page */
.cls-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.cls-stat-grid .stu-stat {
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
}

.cls-stat-sm {
  font-size: 1.5rem !important;
}

.stu-stat-icon.violet { background: #ede9fe; color: #7c3aed; }
.stu-stat-icon.indigo { background: #e0e7ff; color: #4338ca; }
.stu-stat-icon.amber { background: #fef3c7; color: #d97706; }

.cls-tabs { overflow-x: auto; flex-wrap: nowrap; }

.cls-avatar {
  background: #ede9fe !important;
  color: #6d28d9 !important;
}

.cls-subject-avatar {
  background: #fef3c7 !important;
  color: #b45309 !important;
}

.cls-dept-pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: var(--surface-hover);
  color: var(--muted);
}

.cls-shift-pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eef2ff;
  color: #4338ca;
}

.cls-count-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.cls-count-pill.blue { background: #eff6ff; color: #1d4ed8; }
.cls-count-pill.amber { background: #fffbeb; color: #b45309; }

.cls-expand-btn {
  border: none;
  background: transparent;
  padding: 4px;
  border-radius: 8px;
  color: #94a3b8;
  cursor: pointer;
  transition: transform 0.15s, background 0.15s;
}

.cls-expand-btn:hover { background: var(--surface-hover); }
.cls-expand-btn.open { transform: rotate(90deg); }
.cls-expand-btn svg { width: 16px; height: 16px; }

.cls-expand-cell {
  background: var(--surface-hover) !important;
  padding: 0 !important;
}

.cls-expand-inner {
  padding: 16px 24px 20px 56px;
}

.cls-expand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 10px;
}

.cls-expand-title svg { width: 16px; height: 16px; }
.cls-expand-empty { font-size: 13px; color: #94a3b8; margin: 0; }

.cls-subject-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cls-subject-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: #334155;
}

.cls-chip-teacher { color: #64748b; font-weight: 500; }

.cls-form-card { max-width: 720px; }

.cls-info-box {
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 13px;
  color: var(--muted);
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.cls-info-box.violet {
  background: #f5f3ff;
  border-color: #ddd6fe;
  color: #5b21b6;
}

@media (max-width: 1200px) {
  .cls-stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .cls-stat-grid { grid-template-columns: 1fr 1fr; }
}

.tt-cell { min-width: 120px; vertical-align: top; }
.tt-subject { font-weight: 700; font-size: 13px; color: var(--text); }
.tt-teacher { font-size: 11px; color: #64748b; margin-top: 2px; }

/* School Timetable page */
.tt-page { max-width: 1400px; }

.tt-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.tt-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.tt-title-icon { width: 32px; height: 32px; color: #006680; margin-top: 4px; }

.tt-page-header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
}

.tt-page-header p {
  margin: 4px 0 0;
  font-size: 14px;
  color: #64748b;
}

.tt-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tt-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.tt-btn svg { width: 16px; height: 16px; }

.tt-btn-generate {
  background: #059669;
  color: #fff;
}

.tt-btn-generate:hover { background: #047857; }

.tt-btn-outline {
  background: var(--card);
  color: #334155;
  border: 1px solid var(--border);
}

.tt-btn-outline:hover { background: var(--surface-hover); }

.tt-btn-teal {
  background: var(--card);
  color: #0f766e;
  border: 1px solid #99f6e4;
}

.tt-btn-teal:hover { background: #f0fdfa; }

.tt-filter-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}

.tt-filter-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 16px;
  align-items: end;
}

.tt-hint {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
}

.tt-grid-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow-x: auto;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.tt-grid-table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

.tt-grid-table thead th {
  background: #1e293b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 12px 10px;
  border: 1px solid #334155;
  text-align: center;
}

.tt-grid-table thead th:first-child { text-align: left; width: 110px; }

.tt-period-cell {
  padding: 10px 12px;
  background: var(--surface-hover);
  border: 1px solid var(--border);
  vertical-align: top;
  min-width: 100px;
}

.tt-period-name { font-size: 12px; font-weight: 700; color: var(--text); }
.tt-period-time { font-size: 10px; color: #64748b; margin-top: 2px; }

.tt-slot {
  padding: 4px;
  border: 1px solid var(--border);
  vertical-align: top;
  min-width: 120px;
  height: 72px;
}

.tt-lesson {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 64px;
  padding: 8px 10px;
  border: none;
  border-radius: 10px;
  text-align: left;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  transition: transform 0.1s, box-shadow 0.1s;
}

button.tt-lesson:hover { transform: translateY(-1px); box-shadow: 0 4px 8px rgba(0,0,0,0.12); }

.tt-lesson-subject {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.tt-lesson-teacher {
  font-size: 10px;
  opacity: 0.92;
  margin-top: 4px;
  text-transform: lowercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tt-empty {
  width: 100%;
  height: 100%;
  min-height: 64px;
  border: none;
  background: transparent;
  color: #cbd5e1;
  font-size: 12px;
  cursor: pointer;
  border-radius: 10px;
}

.tt-empty:hover { background: #eff6ff; color: #64748b; }

.tt-empty-readonly { color: #cbd5e1; font-size: 12px; padding: 8px; display: block; text-align: center; }

.tt-break-row { background: #fffbeb; }
.tt-break-cell {
  text-align: center;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #b45309;
  border: 1px solid #fde68a;
  padding: 12px;
}

/* Teacher color palette */
.c-blue { background: #2563eb; }
.c-emerald { background: #059669; }
.c-violet { background: #7c3aed; }
.c-amber { background: #d97706; }
.c-rose { background: #e11d48; }
.c-cyan { background: #0891b2; }
.c-indigo { background: #4f46e5; }
.c-orange { background: #ea580c; }
.c-teal { background: #0d9488; }
.c-pink { background: #db2777; }
.c-lime { background: #65a30d; }
.c-sky { background: #0284c7; }
.c-gray { background: #94a3b8; }

.tt-legend {
  margin-top: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
}

.tt-legend h3 { margin: 0 0 12px; font-size: 14px; font-weight: 700; }

.tt-legend-items { display: flex; flex-wrap: wrap; gap: 12px 20px; }

.tt-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.tt-legend-dot {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  flex-shrink: 0;
}

.tt-inline-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.tt-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tt-modal {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.tt-modal h3 { margin: 0 0 4px; font-size: 1.125rem; }
.tt-modal-sub { margin: 0 0 16px; font-size: 13px; color: #64748b; }

.tt-print-header { display: none; margin-bottom: 16px; }
.tt-print-header h2 { margin: 0; font-size: 1.5rem; }

.cal-filter-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.cal-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.cal-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.cal-pill-holiday { background: #fef3c7; color: #b45309; }
.cal-pill-exam { background: #fee2e2; color: #b91c1c; }
.cal-pill-event { background: #dbeafe; color: #1d4ed8; }
.cal-pill-other { background: var(--surface-hover); color: #475569; }

/* School Calendar page */
.sc-page { max-width: 1280px; }

.sc-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.sc-title-row { display: flex; align-items: flex-start; gap: 12px; }
.sc-title-icon { width: 32px; height: 32px; color: #006680; margin-top: 4px; }

.sc-page-header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
}

.sc-page-header p {
  margin: 4px 0 0;
  font-size: 14px;
  color: #64748b;
}

.sc-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.sc-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
}

.sc-btn svg { width: 16px; height: 16px; }

.sc-btn-outline {
  background: var(--card);
  color: #334155;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.sc-btn-outline:hover { background: var(--surface-hover); }

.sc-btn-primary {
  background: #006680;
  color: #fff;
  box-shadow: 0 1px 2px rgba(0, 102, 128, 0.2);
}

.sc-btn-primary:hover { background: #005266; }

.sc-calendar-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.sc-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-hover);
  border-bottom: 1px solid var(--border);
}

.sc-cal-nav h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.sc-cal-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  color: #64748b;
  text-decoration: none;
  transition: background 0.15s;
}

.sc-cal-arrow:hover { background: #e2e8f0; color: #334155; }
.sc-cal-arrow svg { width: 20px; height: 20px; }

.sc-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--border);
}

.sc-weekday {
  padding: 10px 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #64748b;
}

.sc-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.sc-cell {
  min-height: 88px;
  padding: 6px;
  border-top: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  text-align: left;
  background: var(--card);
  transition: background 0.12s;
}

.sc-cell:nth-child(7n) { border-right: none; }

button.sc-cell {
  width: 100%;
  font: inherit;
  cursor: pointer;
}

button.sc-cell:hover { background: rgba(0, 102, 128, 0.04); }

.sc-cell-empty {
  background: var(--surface-hover);
  min-height: 88px;
  border-top: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
}

.sc-cell-empty:nth-child(7n) { border-right: none; }

.sc-day-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 14px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
}

.sc-day-today {
  background: #006680;
  color: #fff;
  border-radius: 999px;
}

.sc-day-events { display: flex; flex-direction: column; gap: 2px; }

.sc-event-chip {
  display: block;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  padding: 2px 4px;
  border-radius: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cal-chip-holiday { background: #d1fae5; color: #065f46; }
.cal-chip-exam { background: #ffe4e6; color: #be123c; }
.cal-chip-event { background: #dbeafe; color: #1d4ed8; }
.cal-chip-other { background: var(--surface-hover); color: #475569; }

.sc-event-more {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
  padding: 0 4px;
}

.sc-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.sc-legend-chip {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.sc-upcoming {
  margin-top: 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
}

.sc-upcoming h3 {
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
}

.sc-upcoming-list { display: flex; flex-direction: column; gap: 10px; }

.sc-upcoming-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  font-size: 14px;
}

.sc-upcoming-date {
  font-size: 13px;
  color: #64748b;
  min-width: 96px;
}

.sc-upcoming-edit {
  margin-left: auto;
  background: none;
  border: none;
  color: #64748b;
  cursor: pointer;
  padding: 4px;
}

.sc-upcoming-edit:hover { color: #006680; }
.sc-upcoming-edit svg { width: 16px; height: 16px; }

.sc-modal { max-width: 480px; }

.sc-btn-delete {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #dc2626;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}

.sc-btn-delete svg { width: 16px; height: 16px; }

/* Fees page */
.fee-page { max-width: 1280px; }

.fee-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.fee-title-block h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.fee-title-icon {
  width: 28px;
  height: 28px;
  color: #006680;
  flex-shrink: 0;
}

.fee-page-header p {
  margin: 4px 0 0 38px;
  font-size: 14px;
  color: var(--muted);
}

.fee-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.fee-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.fee-stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fee-stat-value {
  margin-top: 4px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

.fee-stat-green { color: #059669; }
.fee-stat-red { color: #dc2626; }

.fee-stat-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fee-stat-icon svg { width: 20px; height: 20px; }
.fee-stat-icon.teal { background: rgba(0, 102, 128, 0.1); color: #006680; }
.fee-stat-icon.blue { background: rgba(37, 99, 235, 0.1); color: #2563eb; }
.fee-stat-icon.green { background: rgba(16, 185, 129, 0.12); color: #059669; }
.fee-stat-icon.red { background: rgba(220, 38, 38, 0.1); color: #dc2626; }

.fee-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.fee-btn svg { width: 16px; height: 16px; }

.fee-btn-outline {
  background: var(--card);
  color: #334155;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.fee-btn-outline:hover { background: var(--surface-hover); }

.fee-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.fee-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.fee-search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #94a3b8;
  pointer-events: none;
}

.fee-search-wrap input {
  width: 100%;
  padding: 10px 14px 10px 42px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  background: var(--surface-hover);
}

.fee-search-wrap input:focus {
  outline: none;
  border-color: #006680;
  background: var(--card);
}

.fee-filter-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fee-filter-icon { width: 18px; height: 18px; color: #94a3b8; }

.fee-filter-right select {
  min-width: 180px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  background: var(--surface-hover);
}

.fee-table-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.fee-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.fee-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
  font-size: 14px;
}

.fee-table thead th {
  padding: 12px 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--table-head-bg);
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

.fee-table thead th.fee-num { text-align: right; }
.fee-table thead th.fee-actions-col { text-align: right; min-width: 260px; }

.fee-table tbody td {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
  color: var(--text);
}

.fee-table tbody tr:last-child td { border-bottom: none; }
.fee-table tbody tr:hover { background: var(--table-row-hover); }
.fee-table tbody tr.fee-row-debt { background: rgba(220, 38, 38, 0.03); }
.fee-table tbody tr.fee-row-debt:hover { background: rgba(220, 38, 38, 0.06); }

.fee-student-cell {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 200px;
}

.fee-student-avatar {
  width: 38px;
  height: 38px;
  font-size: 15px;
}

.fee-student-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  line-height: 1.3;
}

.fee-student-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.fee-id-tag {
  font-family: ui-monospace, monospace;
  font-size: 11px;
  font-weight: 600;
  color: #006680;
  background: rgba(0, 102, 128, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
}

.fee-meta-dot { opacity: 0.5; }

.fee-badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.fee-badge-purple { background: #ede9fe; color: #6d28d9; }
.fee-badge-amber { background: #fef3c7; color: #b45309; }
.fee-badge-blue { background: #dbeafe; color: #1d4ed8; }
.fee-badge-green { background: #d1fae5; color: #047857; }
.fee-badge-muted { color: var(--muted); font-size: 13px; }

.fee-num {
  text-align: right;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.fee-paid { color: #059669; }
.fee-debt { color: #dc2626; }
.fee-zero { color: var(--muted); font-weight: 600; }

.fee-actions-cell {
  text-align: right;
  white-space: nowrap;
}

.fee-row-actions {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.fee-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.fee-action-btn svg,
.fee-action-btn i {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

.fee-action-months {
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.25);
}

.fee-action-months:hover {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.4);
}

.fee-action-history {
  color: #64748b;
  border-color: var(--border);
}

.fee-action-history:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.fee-action-pay {
  color: #fff;
  background: #006680;
  border-color: #006680;
}

.fee-action-pay:hover {
  background: #005266;
  border-color: #005266;
}

.fee-table-footer {
  padding: 10px 18px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: var(--surface-hover);
}

.fee-empty {
  text-align: center;
  padding: 48px 20px;
  color: #94a3b8;
}

.fee-empty-inline { color: #94a3b8; font-size: 14px; margin: 0; }

.fee-modal-wide { max-width: 520px; max-height: 90vh; overflow-y: auto; }

.fee-months-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.fee-month-chip {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 13px;
}

.fee-month-chip strong { display: block; font-size: 13px; }
.fee-month-chip span { font-size: 11px; color: #64748b; }
.fee-month-chip.paid { background: #ecfdf5; border-color: #a7f3d0; }
.fee-month-chip.unpaid { background: var(--surface-hover); }

.fee-hist-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }

.fee-hist-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
}

.fee-hist-main {
  min-width: 0;
}

.fee-hist-receipt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0, 102, 128, 0.25);
  background: rgba(0, 102, 128, 0.06);
  color: #006680;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.fee-hist-receipt:hover {
  background: rgba(0, 102, 128, 0.12);
  border-color: #006680;
}

.fee-hist-receipt svg {
  width: 14px;
  height: 14px;
}

.fee-hist-date { display: block; font-size: 12px; color: #64748b; font-weight: 400; }
.fee-hist-method { font-size: 12px; color: #64748b; }

.fee-pay-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-size: 13px;
  color: #1e40af;
}

.fee-pay-banner strong { display: block; margin-bottom: 4px; color: #1e3a8a; }
.fee-pay-monthly { display: block; margin-top: 4px; font-size: 12px; opacity: 0.9; }

.fee-months-select {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.fee-month-pick {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-hover);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.fee-month-pick strong { display: block; font-size: 13px; }
.fee-month-pick small { font-size: 11px; color: #64748b; }
.fee-month-pick.is-selected { background: #006680; border-color: #006680; color: #fff; }
.fee-month-pick.is-selected small { color: rgba(255,255,255,0.85); }
.fee-month-pick.is-paid { background: #ecfdf5; opacity: 0.7; cursor: not-allowed; }

.fee-amount-readonly {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-hover);
  font-weight: 700;
  font-size: 14px;
}

.fee-hint { margin: 6px 0 0; font-size: 12px; color: #64748b; }

@media (max-width: 768px) {
  .fee-page-header { flex-direction: column; align-items: stretch; }
  .fee-page-header p { margin-left: 0; }
  .fee-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .fee-filter-bar { flex-direction: column; align-items: stretch; }
  .fee-filter-right { width: 100%; }
  .fee-filter-right select { width: 100%; }
  .fee-search-wrap { min-width: 0; width: 100%; }
}

@media (max-width: 480px) {
  .fee-stat-grid { grid-template-columns: 1fr; }
}

/* Salary / Mushaar page */
.sal-page { max-width: 1280px; }

.sal-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.sal-title-block h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
}

.sal-title-block h1 svg { width: 28px; height: 28px; color: #006680; }

.sal-title-block p {
  margin: 4px 0 0;
  font-size: 14px;
  color: #64748b;
}

.sal-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s;
}

.sal-btn svg { width: 16px; height: 16px; }

.sal-btn-outline {
  background: var(--card);
  color: #334155;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.sal-btn-outline:hover { background: var(--surface-hover); }

.sal-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.sal-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.sal-stat-label {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.sal-stat-value {
  margin-top: 6px;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}

.sal-stat-blue { color: #006680; }
.sal-stat-green { color: #059669; }

.sal-stat-sub {
  margin-top: 4px;
  font-size: 12px;
  color: #94a3b8;
}

.sal-table-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  overflow: hidden;
}

.sal-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.sal-table-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.sal-period {
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
}

.sal-table {
  width: 100%;
  border-collapse: collapse;
}

.sal-table thead th {
  padding: 12px 20px;
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #94a3b8;
  background: #fafafa;
  border-bottom: 1px solid var(--border);
}

.sal-table tbody td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.sal-table tbody tr:last-child td { border-bottom: none; }
.sal-table tbody tr:hover { background: #fafafa; }

.sal-teacher-name { font-weight: 700; font-size: 14px; color: var(--text); }
.sal-teacher-meta { font-size: 12px; color: #64748b; margin-top: 2px; }

.sal-num { text-align: right; font-size: 14px; font-weight: 600; color: #334155; }
.sal-salary { color: #006680; font-weight: 700; font-size: 15px; }
.sal-actions-col { width: 180px; text-align: center; }

.sal-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.sal-badge-gray { background: var(--surface-hover); color: #64748b; }
.sal-badge-blue { background: #dbeafe; color: #1d4ed8; }
.sal-badge-amber { background: #fef3c7; color: #b45309; }
.sal-badge-green { background: #d1fae5; color: #047857; }

.sal-pay-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: none;
  border-radius: 10px;
  background: #006680;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.sal-pay-btn svg { width: 14px; height: 14px; }
.sal-pay-btn:hover { background: #005266; }

.sal-paid-done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #059669;
}

.sal-paid-done svg { width: 14px; height: 14px; }

.sal-empty {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
}

.sal-modal { max-width: 480px; }

.sal-pay-banner {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  font-size: 13px;
  color: #1e40af;
}

.sal-pay-banner strong { color: #1e3a8a; }
.sal-hint { margin: -4px 0 14px; font-size: 12px; color: #64748b; }

@media (max-width: 900px) {
  .sal-stat-grid { grid-template-columns: 1fr; }
}

/* Financial statement */
.fin-page, .rpt-page, .rc-page, .idc-page, .usr-page { max-width: 1280px; }

.fin-page-header, .rpt-page-header, .rc-page-header, .idc-page-header, .usr-page-header {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px;
}

.fin-title-block h1, .rpt-title-block h1, .rc-title-block h1, .idc-title-block h1, .usr-title-block h1 {
  display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.75rem; font-weight: 800; color: var(--text);
}
.fin-title-block h1 svg, .rpt-title-block h1 svg, .rc-title-block h1 svg, .idc-title-block h1 svg, .usr-title-block h1 svg { width: 28px; height: 28px; color: #006680; }
.fin-title-block p, .rpt-title-block p, .rc-title-block p, .idc-title-block p, .usr-title-block p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }

.fin-btn, .rpt-btn, .usr-btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; text-decoration: none; border: 1px solid var(--border); background: var(--card); color: var(--text); }
.fin-btn svg, .rpt-btn svg, .usr-btn svg { width: 16px; height: 16px; }

.fin-filter-bar, .rpt-filter-bar, .usr-filter-bar {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 14px 16px; margin-bottom: 16px;
}

.fin-period-label { font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 16px; }

.fin-stat-grid, .rpt-stat-grid, .usr-stat-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px;
}
.fin-stat, .rpt-stat, .usr-stat { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; }
.fin-stat-label, .rpt-stat-label, .usr-stat-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.fin-stat-value, .rpt-stat-value, .usr-stat-value { margin-top: 6px; font-size: 1.75rem; font-weight: 800; color: var(--text); }
.fin-stat-green, .rpt-stat-green { color: #059669; }
.fin-stat-red, .rpt-stat-red { color: #dc2626; }
.fin-stat-blue, .rpt-stat-blue { color: #006680; }
.rpt-stat-sub, .usr-stat-sub { margin-top: 4px; font-size: 12px; color: #94a3b8; }

.fin-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.fin-panel, .fin-table-card, .rpt-table-card, .usr-table-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; margin-bottom: 16px;
}
.fin-panel h3, .fin-table-head h2, .rpt-table-head h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.fin-table-head, .rpt-table-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.fin-mini-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fin-mini-table td { padding: 8px 0; border-bottom: 1px solid var(--border); }
.fin-mini-table .fin-num { text-align: right; font-weight: 600; }
.fin-total-row td { border-bottom: none; padding-top: 12px; }
.fin-num { text-align: right; }
.fin-pos { color: #059669; font-weight: 700; }
.fin-neg { color: #dc2626; font-weight: 700; }

.fin-table, .rpt-table, .usr-table { width: 100%; border-collapse: collapse; }
.fin-table thead th, .rpt-table thead th, .usr-table thead th {
  padding: 12px 16px; text-align: left; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--table-head-bg); border-bottom: 1px solid var(--border);
}
.fin-table tbody td, .rpt-table tbody td, .usr-table tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }

.rpt-search-wrap { position: relative; min-width: 200px; }
.rpt-search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--muted); }
.rpt-search-wrap input { width: 100%; padding: 10px 12px 10px 36px; border: 1px solid var(--border); border-radius: 10px; background: var(--input-bg); color: var(--text); }

.rpt-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.rpt-chip { padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.rpt-chip.green { background: #d1fae5; color: #047857; }
.rpt-chip.gray { background: var(--surface-hover); color: #64748b; }
.rpt-chip.red { background: #fee2e2; color: #b91c1c; }

.rpt-student-name, .usr-name { font-weight: 700; font-size: 14px; }
.rpt-student-meta, .usr-meta { font-size: 12px; color: var(--muted); }
.rpt-num { text-align: right; font-weight: 600; }
.rpt-paid { color: #059669; }
.rpt-debt { color: #dc2626; }
.rpt-badge, .usr-badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.rpt-badge-green, .usr-badge-green { background: #d1fae5; color: #047857; }
.rpt-badge-red { background: #fee2e2; color: #b91c1c; }
.rpt-badge-gray, .usr-badge-gray { background: var(--surface-hover); color: var(--muted); }
.rpt-empty, .usr-empty { text-align: center; padding: 32px; color: #94a3b8; }

.usr-code { font-size: 12px; background: var(--surface-hover); color: var(--teal); padding: 2px 6px; border-radius: 4px; }
.usr-actions { display: flex; gap: 6px; }
.usr-action-btn { padding: 6px 10px; border: none; border-radius: 8px; background: #006680; color: #fff; font-size: 11px; font-weight: 700; cursor: pointer; }
.usr-action-btn.outline { background: var(--card); color: var(--text); border: 1px solid var(--border); }

/* Report cards */
.rc-page { max-width: 900px; margin: 0 auto; }

.rc-hero {
  text-align: center;
  padding: 48px 20px 56px;
}

.rc-hero-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: #ecfccb;
  color: #65a30d;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rc-hero-icon svg { width: 28px; height: 28px; }

.rc-hero h1 {
  margin: 0 0 8px;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.rc-hero p {
  margin: 0 auto 32px;
  max-width: 520px;
  font-size: 14px;
  line-height: 1.6;
  color: #64748b;
}

.rc-search-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.rc-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.rc-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #94a3b8;
  pointer-events: none;
}

.rc-search-wrap input {
  width: 100%;
  padding: 14px 16px 14px 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 15px;
  color: var(--text);
  background: var(--card);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.rc-search-wrap input:focus {
  border-color: #84cc16;
  box-shadow: 0 0 0 3px rgba(132, 204, 22, 0.15);
}

.rc-generate-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 22px;
  border: none;
  border-radius: 12px;
  background: #84cc16;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}

.rc-generate-btn svg { width: 18px; height: 18px; }
.rc-generate-btn:hover { background: #65a30d; }

.rc-result-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.rc-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.rc-cards-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
.rc-card { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--card); page-break-inside: avoid; }
.rc-head { display: flex; justify-content: space-between; gap: 12px; padding: 16px 18px; background: #006680; color: #fff; }
.rc-head strong { display: block; font-size: 16px; }
.rc-head span { font-size: 12px; opacity: 0.9; }
.rc-head-right { text-align: right; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; }
.rc-student-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 12px 18px; background: var(--surface-hover); border-bottom: 1px solid var(--border); }
.rc-student-bar small { display: block; font-size: 10px; color: #64748b; text-transform: uppercase; }
.rc-subjects { width: 100%; border-collapse: collapse; font-size: 13px; }
.rc-subjects th, .rc-subjects td { padding: 8px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.rc-subjects thead th { background: #fafafa; font-size: 11px; text-transform: uppercase; color: #64748b; }
.rc-foot { display: flex; justify-content: space-between; padding: 10px 18px; font-size: 12px; color: #64748b; background: #fafafa; }

/* ID cards */
.idc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.idc-card { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--card); page-break-inside: avoid; }
.idc-card-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: #006680; color: #fff; }
.idc-logo { width: 36px; height: 36px; border-radius: 999px; object-fit: cover; background: #fff; }
.idc-card-head strong { display: block; font-size: 13px; }
.idc-card-head span { font-size: 10px; opacity: 0.9; }
.idc-card-body { display: flex; gap: 12px; padding: 14px; }
.idc-photo-wrap { width: 72px; height: 88px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); flex-shrink: 0; }
.idc-photo { width: 100%; height: 100%; object-fit: cover; }
.idc-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.idc-name { font-size: 15px; color: var(--text); }
.idc-id, .idc-class, .idc-phone { font-size: 12px; color: #64748b; }
.idc-card-foot { display: flex; justify-content: space-between; padding: 8px 14px; background: var(--surface-hover); font-size: 10px; color: #64748b; border-top: 1px solid #e2e8f0; }

@media (max-width: 900px) {
  .fin-stat-grid, .rpt-stat-grid, .usr-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .fin-grid-2 { grid-template-columns: 1fr; }
  .rc-student-bar { grid-template-columns: repeat(2, 1fr); }
  .idc-grid { grid-template-columns: 1fr; }
  .sr-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .sr-charts-grid { grid-template-columns: 1fr; }
}

/* School Reports page */
.sr-page { max-width: 1280px; }

.sr-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.sr-title-block h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
}

.sr-title-block h1 svg { width: 24px; height: 24px; color: #006680; }
.sr-title-block p { margin: 4px 0 0; font-size: 14px; color: #64748b; }

.sr-export-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: none;
  border-radius: 12px;
  background: #006680;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 102, 128, 0.2);
}

.sr-export-btn svg { width: 16px; height: 16px; }
.sr-export-btn:hover { background: #005266; }

.sr-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.sr-tab {
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}

.sr-tab:hover { color: #006680; }
.sr-tab.active { color: #006680; border-bottom-color: #006680; }

.sr-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.sr-stat-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.sr-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.sr-stat-card.compact { padding: 16px 18px; }

.sr-stat-label { font-size: 13px; font-weight: 600; color: #64748b; }
.sr-stat-value { margin-top: 4px; font-size: 1.75rem; font-weight: 800; color: var(--text); line-height: 1.1; }
.sr-stat-sub { margin-top: 4px; font-size: 12px; color: #94a3b8; }

.sr-stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sr-stat-icon svg { width: 20px; height: 20px; color: #fff; }
.sr-stat-icon.green { background: #10b981; }
.sr-stat-icon.teal { background: #006680; }
.sr-stat-icon.purple { background: #8b5cf6; }
.sr-stat-icon.orange { background: #f59e0b; }

.sr-charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.sr-chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.sr-chart-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.sr-chart-card h3 svg { width: 18px; height: 18px; color: #64748b; }
.sr-chart { min-height: 280px; }

.sr-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.sr-table-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 16px;
}

.sr-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.sr-table-head h2 { margin: 0; font-size: 1rem; font-weight: 700; }
.sr-table-head span { font-size: 13px; color: #64748b; }
.sr-empty { text-align: center; padding: 40px 20px; color: #94a3b8; font-size: 14px; }

.yp-status {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.yp-status-planned { background: var(--surface-hover); color: #475569; }
.yp-status-ongoing { background: #dbeafe; color: #1d4ed8; }
.yp-status-done { background: #dcfce7; color: #15803d; }
.yp-status-cancelled { background: #fee2e2; color: #b91c1c; }

.yp-calendar-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.yp-month-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
}

.yp-month-card h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

/* Year Plan page — Academic Calendar */
.yp-page { max-width: 1280px; }

.yp-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.yp-title-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.yp-title-icon { width: 32px; height: 32px; color: #006680; margin-top: 4px; }

.yp-page-header h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
}

.yp-page-header p {
  margin: 4px 0 0;
  font-size: 14px;
  color: #64748b;
}

.yp-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.yp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.yp-btn svg { width: 16px; height: 16px; }

.yp-btn-outline {
  background: var(--card);
  color: #334155;
  border: 1px solid var(--border);
}

.yp-btn-outline:hover { background: var(--surface-hover); }

.yp-btn-save {
  background: #006680;
  color: #fff;
}

.yp-btn-save:hover { background: #005266; }

.yp-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.yp-year-select label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 6px;
}

.yp-year-select select {
  min-width: 200px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  background: var(--card);
}

.yp-mode-tabs {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--card);
}

.yp-mode-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: #64748b;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.yp-mode-tab:hover { background: var(--surface-hover); color: #334155; }

.yp-mode-tab.active {
  background: var(--surface-hover);
  color: var(--text);
}

.yp-mode-tab.yp-mode-view.active {
  background: #006680;
  color: #fff;
}

.yp-mode-tab svg { width: 16px; height: 16px; }

.yp-register-hint,
.yp-short-hint {
  font-size: 13px;
  color: #64748b;
  margin: 0 0 16px;
}

.yp-alert-warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 16px 20px;
  border-radius: 16px;
  font-size: 14px;
}

.yp-empty {
  text-align: center;
  padding: 48px 20px;
  color: #94a3b8;
  font-size: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.yp-academic-card {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  background: linear-gradient(135deg, #f0f9ff 0%, #fff 50%, #eef2ff 100%);
}

.yp-academic-head {
  text-align: center;
  padding: 24px 20px 20px;
  background: rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid var(--border);
}

.yp-academic-head h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
}

.yp-academic-head p {
  margin: 6px 0 0;
  font-size: 12px;
  color: #64748b;
}

.yp-table-wrap { overflow-x: auto; background: var(--card); }

.yp-academic-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 14px;
}

.yp-academic-table thead th {
  background: #1e3a5f;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 12px 14px;
  text-align: left;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  vertical-align: middle;
}

.yp-academic-table thead th:last-child { border-right: none; }

.yp-th-inner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.yp-th-inner svg { width: 16px; height: 16px; opacity: 0.9; }

.yp-col-month { width: 140px; }

.yp-academic-table tbody td {
  padding: 10px 12px;
  vertical-align: top;
  border-right: 1px solid #e2e8f0;
  border-bottom: 1px solid var(--border);
}

.yp-academic-table tbody td:last-child { border-right: none; }

.yp-academic-table tbody tr.yp-row-alt { background: rgba(240, 249, 255, 0.8); }

.yp-month-cell {
  font-weight: 700;
  color: #1e3a5f;
  white-space: nowrap;
}

.yp-cell-text {
  color: #334155;
  line-height: 1.5;
  min-height: 48px;
  white-space: pre-wrap;
}

.yp-cell-input {
  width: 100%;
  min-height: 72px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  background: var(--card);
}

.yp-cell-input:focus {
  outline: none;
  border-color: #006680;
  box-shadow: 0 0 0 3px rgba(0, 102, 128, 0.12);
}

@media (max-width: 768px) {
  .yp-toolbar { flex-direction: column; align-items: stretch; }
  .yp-mode-tabs { width: 100%; }
  .yp-mode-tab { flex: 1; justify-content: center; }
}

.ep-student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-bottom: 20px;
}

.ep-student-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  cursor: pointer;
}

.ep-student-check:hover { background: var(--surface-hover); }

.ep-filter-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1.2fr;
  gap: 16px;
  margin-bottom: 20px;
}

.ep-search-wrap {
  display: flex;
  gap: 8px;
}

.ep-search-wrap input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
}

.ep-student-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ep-select-all { font-weight: 600; }

/* Exam halls — class mixing */
.eh-pool-banner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.eh-pool-stat {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  text-align: center;
}

.eh-pool-stat strong {
  display: block;
  font-size: 28px;
  line-height: 1.1;
  color: #0f172a;
  margin-top: 4px;
}

.eh-pool-stat-green { background: #f0fdf4; border-color: #bbf7d0; }
.eh-pool-stat-green strong { color: #15803d; }
.eh-pool-stat-amber { background: #fffbeb; border-color: #fde68a; }
.eh-pool-stat-amber strong { color: #b45309; }

.eh-pool-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.eh-remain-pill {
  display: inline-block;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #92400e;
  font-weight: 800;
  font-size: 12px;
  text-align: center;
}

.eh-class-picks {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 12px;
}

.eh-class-picks-head,
.eh-class-pick-row {
  display: grid;
  grid-template-columns: 1fr 72px 88px;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
}

.eh-class-picks-head {
  background: #f1f5f9;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: #64748b;
}

.eh-class-pick-row + .eh-class-pick-row {
  border-top: 1px solid #f1f5f9;
}

.eh-class-pick-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 14px;
}

.eh-count-input {
  width: 100%;
  text-align: center;
}

.eh-pool-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: #ecfeff;
  border: 1px solid #a5f3fc;
  border-radius: 8px;
  font-size: 13px;
  color: #0e7490;
}

.eh-pool-preview strong {
  color: #155e75;
}

.ep-print-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* A4 page — 3 passcards stacked (33.33% height each), full width */
.exam-passcard-page {
  width: 210mm;
  min-height: 297mm;
  height: 297mm;
  max-width: 100%;
  background: #fff;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.12);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  page-break-after: always;
  break-after: page;
}

.exam-passcard-cell {
  flex: 1 1 33.333%;
  height: 33.333%;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  padding: 3mm 4mm;
  border-bottom: 2px solid #0f172a;
}

.exam-passcard-cell:last-child {
  border-bottom: none;
}

.exam-passcard {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  font-family: Inter, system-ui, sans-serif;
  font-size: 11px;
  color: #0f172a;
  background: #fff;
  box-sizing: border-box;
  border: 2px solid #0f172a;
  outline: 1px solid #334155;
  outline-offset: -3px;
}

.epc-header {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 8px;
  background: linear-gradient(135deg, #006680 0%, #004d61 100%);
  color: #fff;
  flex-shrink: 0;
  border-bottom: 2px solid #0f172a;
  min-height: 64px;
}

.epc-school-lines {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
  width: 100%;
}

.epc-line-en,
.epc-line-ar,
.epc-line-so {
  margin: 0;
  width: 100%;
  max-width: 100%;
  font-weight: 800;
  line-height: 1.08;
  white-space: nowrap;
  overflow: hidden;
  text-align: center;
}

.epc-line-en {
  text-transform: uppercase;
  color: #fff;
}

.epc-line-ar {
  color: #fff;
  font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", "Traditional Arabic", sans-serif;
}

.epc-line-so {
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.95);
  letter-spacing: 0.02em;
}

.epc-logo {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #0f172a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  align-self: center;
  justify-self: center;
  font-weight: 800;
  color: #006680;
  font-size: 20px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.epc-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.epc-school-name {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
}

.epc-school-tagline {
  margin: 1px 0 0;
  font-size: 8px;
  opacity: 0.9;
}

.epc-school-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
  font-size: 7px;
  opacity: 0.85;
}

.epc-title-badge {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 8px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
}

.epc-year { text-align: right; font-size: 7px; }
.epc-year-label { margin: 0; opacity: 0.8; }
.epc-year-value { margin: 1px 0 0; font-size: 10px; font-weight: 800; }
.epc-year-term { margin: 1px 0 0; opacity: 0.9; font-size: 7px; }

.epc-banner {
  background: #004d61;
  color: #fff;
  text-align: center;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
  padding: 4px 8px;
  border-bottom: 1px solid #0f172a;
  flex-shrink: 0;
}

.epc-certify {
  margin: 0;
  text-align: center;
  font-size: 10px;
  font-weight: 700;
  padding: 5px 8px;
  border-bottom: 1px solid #cbd5e1;
  flex-shrink: 0;
}

.epc-body {
  display: grid;
  grid-template-columns: 1fr 112px;
  flex: 1;
  min-height: 0;
}

.epc-main {
  padding: 5px 7px 3px;
  border-right: 2px solid #0f172a;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.epc-info-frame {
  flex: 1;
  display: flex;
  flex-direction: column;
  border: 2px solid #0f172a;
  min-height: 0;
  background: #fff;
}

.epc-side {
  padding: 5px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  text-align: center;
  min-height: 0;
}

.epc-side-title {
  margin: 0;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  line-height: 1.2;
}

.epc-table-area {
  flex: 1.4;
  min-height: 0;
  display: flex;
}

.epc-data-table {
  width: 100%;
  height: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 11px;
}

.epc-data-table tbody {
  height: 100%;
}

.epc-data-table tr {
  height: 33.333%;
}

.epc-data-table td {
  border: 1px solid #0f172a;
  padding: 10px 8px;
  vertical-align: middle;
}

.epc-td-label {
  background: #f1f5f9;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  color: #475569;
  width: 13%;
}

.epc-td-value {
  font-size: 11px;
  font-weight: 700;
  color: #0f172a;
}

.epc-td-name {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.epc-subjects-row {
  border: 1px solid #0f172a;
  padding: 4px 6px;
  background: #fafafa;
}

.epc-subjects-row .epc-field-label {
  display: inline;
  margin-right: 4px;
}

.epc-subjects-row .epc-field-value {
  display: inline;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1.35;
}

.epc-field-label {
  font-size: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  font-weight: 700;
}

.epc-field-value {
  font-size: 8px;
  font-weight: 700;
  color: #0f172a;
}

.epc-validity {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-size: 11px;
  color: #334155;
  border-top: 1px dashed #64748b;
  padding: 12px 10px;
  text-align: center;
  line-height: 1.45;
}

.epc-validity strong {
  font-size: 12px;
}

.epc-warning {
  margin: 0;
  font-size: 8px;
  color: #b45309;
  font-weight: 600;
  line-height: 1.4;
  padding: 9px 10px;
  border-top: 1px solid #0f172a;
  flex-shrink: 0;
}

.epc-notes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 8px;
  color: #475569;
  background: #f8fafc;
  border-top: 1px solid #cbd5e1;
  padding: 9px 10px;
  flex-shrink: 0;
}

.epc-photo-box {
  width: 78px;
  height: 78px;
  border: 2px solid #0f172a;
  overflow: hidden;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.epc-photo-box img { width: 100%; height: 100%; object-fit: cover; }

.epc-photo-fallback {
  font-size: 34px;
  font-weight: 800;
  color: #006680;
}

.epc-side-date {
  margin: 0;
  font-size: 7px;
  font-weight: 600;
}

.epc-qr-wrap {
  padding: 2px;
  border: 1px solid #0f172a;
  background: #fff;
}

.epc-qr-wrap img { display: block; width: 62px; height: 62px; }

.epc-candidate-label { display: block; font-size: 7px; color: #64748b; }
.epc-candidate-id { display: block; font-size: 7px; font-weight: 700; word-break: break-all; }

.epc-status-title {
  margin: 0;
  font-size: 8px;
  font-weight: 800;
  color: #059669;
}

.epc-status-icon { margin-right: 2px; }

.epc-signature { width: 100%; margin-top: auto; }
.epc-signature-line {
  height: 1px;
  background: #0f172a;
  margin-bottom: 2px;
}
.epc-signature-title { margin: 0; font-size: 7px; font-weight: 700; }

.epc-footer {
  padding: 5px 10px;
  background: #f8fafc;
  flex-shrink: 0;
  border-top: 1px solid #cbd5e1;
}

.epc-credit {
  margin: 0;
  padding: 3px 8px 5px;
  text-align: center;
  font-size: 7px;
  font-weight: 600;
  color: #006680;
  letter-spacing: 0.02em;
  text-transform: lowercase;
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .ep-filter-row { grid-template-columns: 1fr; }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  body { background: #fff !important; }

  .no-print { display: none !important; }
  .print-only { display: block !important; }
  .app-sidebar, .app-topbar { display: none !important; }
  .app-shell { margin: 0 !important; }
  .app-main { padding: 0 !important; }
  .ep-page { max-width: none !important; padding: 0 !important; }

  .ep-print-wrap {
    gap: 0;
    align-items: stretch;
  }

  .exam-passcard-page {
    width: 210mm;
    height: 297mm;
    min-height: 297mm;
    max-width: none;
    box-shadow: none;
    margin: 0;
    page-break-after: always;
    break-after: page;
  }

  .exam-passcard-page:last-child {
    page-break-after: auto;
  }

  .exam-passcard-cell {
    height: 99mm;
    flex: 0 0 99mm;
  }

  .exam-passcard {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

@media (max-width: 1024px) {
  .reg-layout { grid-template-columns: 1fr; }
  .reg-aside { position: static; }
}

@media (max-width: 768px) {
  .reg-grid { grid-template-columns: 1fr; }
  .reg-grid-3 { grid-template-columns: repeat(3, minmax(150px, 1fr)); }

  .reg-section {
    padding: 16px;
    overflow-x: visible;
  }

  .reg-section-head {
    flex-wrap: wrap;
    gap: 10px;
  }

  .reg-page-header .app-btn-outline {
    width: 100%;
    justify-content: center;
  }

  .reg-hscroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    margin: 0 -4px;
    padding: 2px 4px 6px;
  }

  .reg-status-scroll .reg-grid-3 {
    min-width: 480px;
    width: max-content;
  }

  .reg-fee-cards-scroll .fee-cards {
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    min-width: min-content;
    margin-bottom: 0;
  }

  .reg-fee-cards-scroll .fee-card {
    flex: 0 0 168px;
    padding: 16px 12px;
  }

  .fee-section-v2 {
    padding: 14px;
    overflow-x: visible;
  }

  .reg-input-wrap input,
  .reg-input-wrap select,
  .reg-input-plain {
    font-size: 16px;
  }

  .reg-field[style*="max-width"] {
    max-width: 100% !important;
  }
}

@media (max-width: 900px) {
  .stu-stat-grid { grid-template-columns: 1fr; }
}

.app-chart { height: 300px; }

/* ========== Dark mode — all pages ========== */
html.dark .app-tab:hover,
html.dark .app-tab.active {
  color: #5eead4;
  border-bottom-color: #5eead4;
}

html.dark .app-btn-outline:hover {
  background: var(--surface-hover);
  color: var(--text);
}

html.dark .app-alert.success {
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.28);
}

html.dark .app-alert.error {
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.28);
}

html.dark .fin-table tbody tr:hover,
html.dark .rpt-table tbody tr:hover,
html.dark .usr-table tbody tr:hover {
  background: var(--table-row-hover);
}

html.dark .fin-btn:hover,
html.dark .rpt-btn:hover,
html.dark .usr-btn:hover {
  background: var(--surface-hover);
}

html.dark .tt-btn-outline,
html.dark .fee-btn-outline,
html.dark .sal-btn-outline,
html.dark .sc-btn-outline,
html.dark .yp-btn-outline {
  background: var(--card);
  color: var(--text);
  border-color: var(--border);
}

html.dark .tt-btn-outline:hover,
html.dark .fee-btn-outline:hover,
html.dark .sal-btn-outline:hover,
html.dark .sc-btn-outline:hover,
html.dark .yp-btn-outline:hover {
  background: var(--surface-hover);
}

html.dark .tt-btn-teal {
  background: rgba(45, 212, 191, 0.1);
  color: #5eead4;
  border-color: rgba(45, 212, 191, 0.35);
}

html.dark .tt-btn-teal:hover {
  background: rgba(45, 212, 191, 0.18);
}

html.dark .tt-modal h3,
html.dark .reg-page-header h1,
html.dark .reg-section-head h3,
html.dark .reg-card h2,
html.dark .fee-section-title,
html.dark .sal-page-header h1,
html.dark .sr-page-header h1 {
  color: var(--text);
}

html.dark .tt-modal-sub,
html.dark .reg-page-header p,
html.dark .reg-section-head p,
html.dark .reg-hint {
  color: var(--muted);
}

html.dark .reg-input-wrap input,
html.dark .reg-input-wrap select,
html.dark .fee-search input,
html.dark .fee-search-wrap input,
html.dark .fee-search select,
html.dark .fee-filter select,
html.dark .fee-filter-right select,
html.dark .sal-filter select,
html.dark .sr-filter select,
html.dark .yp-filter select,
html.dark .ep-filter select,
html.dark .sc-filter input,
html.dark .sc-filter select {
  background: var(--input-bg);
  color: var(--text);
  border-color: var(--border);
}

html.dark .stu-class-pill,
html.dark .tea-qual-pill {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.35);
  color: #93c5fd;
}

html.dark .app-nav-sublink:hover {
  background: rgba(0, 102, 128, 0.18);
  color: #7dd3fc;
}

html.dark .app-nav-sublink.active {
  background: rgba(0, 102, 128, 0.28);
  color: #7dd3fc;
}

html.dark .rpt-chip.gray {
  background: var(--surface-hover);
  color: var(--muted);
}

html.dark .fin-panel h3,
html.dark .fin-table-head h2,
html.dark .rpt-table-head h2,
html.dark .sr-chart-card h3,
html.dark .sr-table-card h3 {
  color: var(--text);
}

html.dark .tea-salary,
html.dark .tea-contact-line {
  color: var(--text);
}

html.dark .tea-login-box {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.12) 0%, rgba(15, 23, 42, 0.2) 100%);
  border-color: rgba(59, 130, 246, 0.3);
}

html.dark .fee-info-box {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

html.dark .fee-info-box.discount {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

html.dark .fee-card:hover {
  border-color: rgba(59, 130, 246, 0.45);
}

html.dark .fee-card.selected {
  border-color: #5eead4;
  background: rgba(45, 212, 191, 0.08);
}

html.dark .fee-stat {
  background: var(--card);
  border-color: var(--border);
}

html.dark .fee-title-icon { color: #5eead4; }

html.dark .fee-id-tag {
  color: #5eead4;
  background: rgba(45, 212, 191, 0.12);
}

html.dark .fee-table tbody tr.fee-row-debt {
  background: rgba(220, 38, 38, 0.08);
}

html.dark .fee-table tbody tr.fee-row-debt:hover {
  background: rgba(220, 38, 38, 0.12);
}

html.dark .fee-badge-blue { background: rgba(59, 130, 246, 0.18); color: #93c5fd; }
html.dark .fee-badge-amber { background: rgba(245, 158, 11, 0.15); color: #fcd34d; }
html.dark .fee-badge-purple { background: rgba(139, 92, 246, 0.18); color: #c4b5fd; }

html.dark .fee-action-months {
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.35);
  background: var(--card);
}

html.dark .fee-action-months:hover {
  background: rgba(59, 130, 246, 0.12);
}

html.dark .fee-action-history {
  color: var(--muted);
  background: var(--card);
}

html.dark .fee-action-pay {
  background: #006680;
  border-color: #006680;
  color: #fff;
}

html.dark .fee-action-pay:hover {
  background: #008099;
}

html.dark .fee-table-footer {
  background: var(--surface-muted);
}

html.dark .fee-pay-banner {
  background: rgba(59, 130, 246, 0.12);
  border-color: rgba(59, 130, 246, 0.3);
  color: #93c5fd;
}

html.dark .fee-pay-banner strong { color: #bfdbfe; }

html.dark .cls-expand-row {
  background: var(--surface-muted) !important;
}

html.dark .tt-grid-cell,
html.dark .tt-grid-head,
html.dark .sc-cal-day,
html.dark .cal-day-cell {
  border-color: var(--border);
  color: var(--text);
}

html.dark .tt-empty:hover {
  background: rgba(59, 130, 246, 0.12);
  color: var(--muted);
}

html.dark .tt-break-row {
  background: rgba(245, 158, 11, 0.1);
}

html.dark .cal-pill-other,
html.dark .cal-chip-other {
  background: var(--surface-hover);
  color: var(--muted);
}

html.dark .ep-passcard-subjects span {
  background: var(--surface-hover);
  color: var(--text);
}

html.dark .rc-search-input {
  background: var(--input-bg);
  color: var(--text);
  border-color: var(--border);
}

html.dark .idc-class-select {
  background: var(--input-bg);
  color: var(--text);
  border-color: var(--border);
}

html.dark .sr-tab-btn {
  color: var(--muted);
}

html.dark .sr-tab-btn.active {
  color: #5eead4;
  border-color: #5eead4;
}

html.dark .yp-month-card h3,
html.dark .yp-month-card p {
  color: var(--text);
}

html.dark .yp-task-item {
  border-color: var(--border);
}

html.dark .app-empty,
html.dark .rpt-empty,
html.dark .usr-empty {
  color: var(--muted);
}

html.dark .usr-code {
  color: #7dd3fc;
}

html.dark .stu-stat-icon.gray {
  background: var(--surface-hover);
  color: var(--muted);
}

html.dark .apexcharts-text,
html.dark .apexcharts-title-text,
html.dark .apexcharts-legend-text {
  fill: var(--text) !important;
  color: var(--text) !important;
}

html.dark .apexcharts-gridline,
html.dark .apexcharts-xaxis-tick,
html.dark .apexcharts-yaxis-tick {
  stroke: var(--border) !important;
}

/* Settings page */
.set-page {
  max-width: 960px;
  margin: 0 auto;
}

.set-header {
  margin-bottom: 24px;
}

.set-header h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
}

.set-header h1 i,
.set-header h1 svg {
  width: 28px;
  height: 28px;
  color: #3b82f6;
}

.set-header p {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
}

.set-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.set-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}

.set-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 120px;
  padding: 16px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.set-tab i,
.set-tab svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.set-tab:hover {
  color: var(--teal);
  background: var(--surface-hover);
}

.set-tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
  background: rgba(59, 130, 246, 0.08);
}

.set-body {
  padding: 28px 32px 32px;
}

.set-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 28px;
  align-items: start;
}

.set-fields {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.set-field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 8px;
}

.set-field input,
.set-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 14px;
  background: var(--input-bg);
  color: var(--text);
  outline: none;
}

.set-field input:focus,
.set-field select:focus {
  border-color: #006680;
  box-shadow: 0 0 0 2px rgba(0, 102, 128, 0.15);
}

.set-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.set-hint-center {
  text-align: center;
}

.set-logo-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 24px 16px;
  border: 2px dashed var(--border);
  border-radius: 16px;
  min-height: 280px;
}

.set-logo-preview {
  width: 128px;
  height: 128px;
  border-radius: 999px;
  object-fit: cover;
  background: var(--surface-muted);
}

.set-logo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(0, 102, 128, 0.12);
  color: #006680;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
}

.set-logo-btn:hover {
  background: rgba(0, 102, 128, 0.2);
}

.set-logo-btn i,
.set-logo-btn svg {
  width: 16px;
  height: 16px;
}

.set-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.set-save-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border: none;
  border-radius: 12px;
  background: #0891b2;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(8, 145, 178, 0.25);
  transition: background 0.15s;
}

.set-save-btn:hover {
  background: #0e7490;
}

.set-save-btn i,
.set-save-btn svg {
  width: 16px;
  height: 16px;
}

.set-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.set-section-title i,
.set-section-title svg {
  width: 18px;
  height: 18px;
  color: #059669;
}

.set-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

.set-year-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.set-year-pill {
  padding: 16px 18px;
  border-radius: 14px;
  border: 1px solid var(--border);
}

.set-year-pill-green {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.25);
}

.set-year-pill-blue {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.25);
}

.set-year-pill-label {
  display: block;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 4px;
}

.set-year-pill strong {
  font-size: 16px;
  color: var(--text);
}

.set-year-list h3 {
  margin: 0 0 12px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.set-year-item {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  background: var(--surface-muted);
}

.set-year-item.active {
  border-color: rgba(16, 185, 129, 0.4);
  background: rgba(16, 185, 129, 0.06);
}

.set-active-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #059669;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.set-term-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.set-term-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-hover);
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.set-term-chip.active {
  background: #059669;
  color: #fff;
}

.set-link {
  color: #0891b2;
  font-weight: 600;
  text-decoration: none;
}

.set-link:hover {
  text-decoration: underline;
}

.set-security-form,
.set-language-form {
  max-width: 520px;
}

.set-lang-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.set-lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--input-bg);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}

.set-lang-option input {
  accent-color: #0891b2;
}

.set-lang-option.selected,
.set-lang-option:has(input:checked) {
  border-color: #0891b2;
  background: rgba(8, 145, 178, 0.1);
}

html.dark .set-tab.active {
  color: #60a5fa;
  border-bottom-color: #60a5fa;
  background: rgba(59, 130, 246, 0.12);
}

html.dark .set-tab:hover {
  color: #5eead4;
}

html.dark .set-logo-btn {
  background: rgba(45, 212, 191, 0.12);
  color: #5eead4;
}

html.dark .set-logo-btn:hover {
  background: rgba(45, 212, 191, 0.2);
}

@media (max-width: 768px) {
  .set-body { padding: 20px 16px 24px; }
  .set-grid { grid-template-columns: 1fr; }
  .set-logo-box { min-height: auto; }
  .set-year-summary { grid-template-columns: 1fr; }
  .set-lang-grid { grid-template-columns: 1fr; }
  .set-tab { min-width: 100px; font-size: 13px; padding: 14px 8px; }
}

/* ── Mobile: horizontal scroll (all pages) ── */
@media (max-width: 768px) {
  body.app-body {
    overflow-x: hidden;
  }

  .app-shell,
  .app-main,
  .app-page {
    max-width: 100%;
    overflow-x: hidden;
  }

  .stu-table-wrap,
  .tt-grid-wrap,
  .yp-table-wrap,
  .fee-table-scroll,
  .fee-table-card,
  .sal-table-card,
  .sr-table-card,
  .reg-hscroll,
  .app-hscroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .usr-table-card,
  .fin-table-card,
  .rpt-table-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    padding: 12px;
  }

  .stu-table,
  .fee-table,
  .usr-table,
  .rpt-table,
  .fin-table,
  .sal-table,
  .yp-academic-table,
  .tt-grid-table,
  .rc-subjects,
  .cls-table {
    min-width: 720px;
  }

  .fee-table {
    min-width: 900px;
  }

  .app-tabs,
  .cls-tabs,
  .set-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 0;
  }

  .app-tab,
  .set-tab {
    flex-shrink: 0;
    white-space: nowrap;
  }

  .stu-toolbar,
  .fee-filter-bar,
  .rpt-filter-bar,
  .usr-filter-bar,
  .fin-filter-bar,
  .sal-filter-bar,
  .sr-filter-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .stu-header,
  .fee-page-header,
  .usr-page-header,
  .fin-page-header,
  .rpt-page-header,
  .sal-page-header,
  .sr-page-header,
  .reg-page-header,
  .set-header {
    flex-direction: column;
    align-items: stretch;
  }

  .stu-actions,
  .fee-page-header .fee-btn,
  .sal-page-header .sal-btn,
  .reg-page-header .app-btn-outline {
    width: 100%;
  }

  .fin-grid-2 {
    grid-template-columns: 1fr;
  }

  .app-chart {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
