/* AppUI-inspired theme (pixelcave demo) */
:root {
  --appui-dark: #454e59;
  --appui-dark-hover: #3a4149;
  --appui-accent: #1bbae1;
  --appui-accent-dark: #1593b3;
  --appui-content: #eaedf1;
  --appui-surface: #ffffff;
  --appui-text: #454e59;
  --appui-muted: #87919a;
  --appui-border: #dbe1e8;
  --appui-success: #7db831;
  --appui-warning: #f39c12;
  --appui-danger: #e74c3c;
  --appui-info: #5ccdde;
  --sidebar-width: 220px;
}

* { box-sizing: border-box; }

button:not(:disabled),
a[href],
select,
summary,
[role="button"],
.link-btn,
.nav-btn,
.view-btn,
.btn,
.icon-btn,
.teacher-card-link,
[data-teacher-profile],
[data-edit-course],
[data-del-course],
[data-edit-student],
[data-del-student],
[data-edit-teacher],
[data-edit-workshop],
[data-del-workshop],
[data-del-payment],
[data-add-student-course],
[data-del-student-enrollment],
.sidebar-brand,
.sidebar-toggle,
.teacher-appui-tab,
input[type="checkbox"],
input[type="radio"],
input[type="file"],
label:has(input[type="checkbox"]),
label:has(input[type="radio"]) {
  cursor: pointer;
}

button:disabled,
[disabled],
[aria-disabled="true"] {
  cursor: not-allowed;
}

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  color: var(--appui-text);
  background: var(--appui-dark);
  cursor: default;
}

#page-wrapper, #page-container {
  min-height: 100vh;
}

#page-container {
  display: flex;
  background: var(--appui-dark);
}

/* Sidebar */
#sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--appui-dark);
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1000;
  overflow-y: auto;
  transition: transform .25s ease;
}

.sidebar-header {
  padding: 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
}

.brand-icon {
  width: 34px;
  height: 34px;
  border-radius: 4px;
  background: var(--appui-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.sidebar-nav {
  list-style: none;
  margin: 0;
  padding: 10px 0 20px;
}

.sidebar-nav li { margin: 0; }

.nav-sep {
  height: 1px;
  margin: 8px 16px;
  border-bottom: 1px dotted rgba(255,255,255,.15);
}

.nav-btn {
  width: 100%;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,.75);
  text-align: left;
  padding: 11px 18px;
  cursor: pointer;
  font: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background .15s, color .15s;
}

.nav-btn i {
  width: 18px;
  text-align: center;
  font-size: 15px;
}

.nav-btn:hover {
  background: rgba(255,255,255,.06);
  color: #fff;
}

.nav-btn.active {
  background: #fff;
  color: var(--appui-text);
  font-weight: 600;
}

/* Main area */
#main-container {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.top-header {
  height: 50px;
  background: var(--appui-accent);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
  position: sticky;
  top: 0;
  z-index: 900;
  box-shadow: 0 2px 4px rgba(0,0,0,.08);
}

.sidebar-toggle {
  display: none;
  border: 0;
  background: rgba(255,255,255,.15);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 3px;
  cursor: pointer;
}

.header-brand {
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
}

.header-search {
  flex: 1;
  max-width: 280px;
  position: relative;
}

.header-search i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: .7;
  font-size: 13px;
}

.header-search input {
  width: 100%;
  border: 0;
  border-radius: 20px;
  padding: 8px 14px 8px 34px;
  background: rgba(255,255,255,.2);
  color: #fff;
  font: inherit;
}

.header-search input::placeholder { color: rgba(255,255,255,.75); }
.header-search input:focus {
  outline: none;
  background: rgba(255,255,255,.3);
}

.header-user {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.welcome {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#page-content {
  flex: 1;
  background: var(--appui-content);
  padding: 20px;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.content-header h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 300;
  color: var(--appui-text);
}

.screen { display: none; }
.screen.active { display: block; }

/* Stat widgets (AppUI style) */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.stat-widget {
  background: var(--appui-surface);
  border: 1px solid var(--appui-border);
  border-radius: 3px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 78px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
  flex-shrink: 0;
}

.stat-icon.blue { background: var(--appui-info); }
.stat-icon.green { background: var(--appui-success); }
.stat-icon.orange { background: var(--appui-warning); }
.stat-icon.red { background: var(--appui-danger); }
.stat-icon.cyan { background: var(--appui-accent); }

.stat-body strong {
  display: block;
  font-size: 26px;
  font-weight: 300;
  line-height: 1.1;
}

.stat-body span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--appui-muted);
  margin-top: 4px;
}

.stat-body strong.blue { color: var(--appui-info); }
.stat-body strong.green { color: var(--appui-success); }
.stat-body strong.orange { color: var(--appui-warning); }
.stat-body strong.red { color: var(--appui-danger); }
.stat-body strong.cyan { color: var(--appui-accent); }

/* Widget blocks */
.widget {
  background: var(--appui-surface);
  border: 1px solid var(--appui-border);
  border-radius: 3px;
  margin-bottom: 18px;
}

.widget-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--appui-border);
  background: #f9fafb;
}

.widget-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--appui-text);
}

.widget-content { padding: 0; }
.widget-content .table-wrap { padding: 0; }

.toolbar {
  display: flex;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid var(--appui-border);
  background: var(--appui-surface);
  color: var(--appui-text);
  padding: 8px 14px;
  border-radius: 3px;
  cursor: pointer;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn:hover { background: #f5f7fa; }

.btn-primary, .btn.btn-primary {
  background: var(--appui-accent);
  border-color: var(--appui-accent-dark);
  color: #fff;
}

.btn-primary:hover { background: var(--appui-accent-dark); }

table {
  width: 100%;
  border-collapse: collapse;
}

th, td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--appui-border);
  font-size: 13px;
}

th {
  background: #f5f7fa;
  color: var(--appui-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .04em;
}

tbody tr:hover { background: #fafbfc; }

.table-wrap { overflow-x: auto; }

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge.aktif { background: #e8f6df; color: #4a7c16; }
.badge.pasif { background: #fdecea; color: #b03a2e; }

.row-actions { display: flex; gap: 8px; }

.link-btn {
  border: 0;
  background: transparent;
  color: var(--appui-accent);
  cursor: pointer;
  padding: 0;
  font-size: 13px;
}

.link-btn.danger { color: var(--appui-danger); }

.filter label,
.attendance-toolbar label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--appui-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.filter select,
.attendance-toolbar select {
  min-width: 150px;
  text-transform: none;
  color: #2c3e50;
  background-color: #fff;
}

.filter select option,
.attendance-toolbar select option {
  color: #2c3e50;
  background-color: #fff;
}

.check-filter {
  flex-direction: row !important;
  align-items: center;
  gap: 8px !important;
  text-transform: none !important;
  font-weight: 400 !important;
}

input, select, textarea {
  border: 1px solid var(--appui-border);
  border-radius: 3px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
  color: var(--appui-text);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--appui-accent);
  box-shadow: 0 0 0 2px rgba(27,186,225,.15);
}

textarea { min-height: 80px; resize: vertical; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-grid .full { grid-column: 1 / -1; }

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--appui-muted);
  text-transform: uppercase;
}

.modal {
  border: 0;
  border-radius: 3px;
  padding: 0;
  width: min(560px, 96vw);
  max-width: 96vw;
  max-height: 94vh;
  overflow: hidden;
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
}

.modal::backdrop { background: rgba(69,78,89,.55); }

#modal-form {
  display: flex;
  flex-direction: column;
  max-height: 94vh;
  overflow: hidden;
  margin: 0;
}

.modal-header,
.modal-footer {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-bottom: 1px solid var(--appui-border);
  background: #f9fafb;
}

.modal-footer {
  border-bottom: 0;
  border-top: 1px solid var(--appui-border);
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.modal-status {
  flex: 1 1 100%;
  margin: 0;
  font-size: 13px;
  color: var(--appui-muted);
}

.modal-status.error {
  color: #b03a2e;
}

.modal-status.hidden {
  display: none;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.modal-body {
  padding: 10px 14px;
  background: #fff;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.modal .form-grid {
  gap: 8px 10px;
}

.modal .form-field {
  gap: 4px;
  font-size: 11px;
}

.modal input,
.modal select,
.modal textarea {
  padding: 5px 8px;
  font-size: 13px;
}

.modal textarea {
  min-height: 0;
  resize: none;
}

.modal .hint {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
}

.icon-btn {
  border: 0;
  background: transparent;
  font-size: 18px;
  cursor: pointer;
  color: var(--appui-muted);
}

.attendance-row {
  display: grid;
  grid-template-columns: 1fr 160px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--appui-border);
}

.attendance-row:last-child { border-bottom: 0; }

.empty {
  color: var(--appui-muted);
  padding: 28px 16px;
  text-align: center;
}

.toast {
  position: fixed;
  top: 62px;
  right: 18px;
  z-index: 2000;
  max-width: min(360px, 92vw);
  padding: 8px 14px;
  border-radius: 3px;
  font-size: 13px;
  line-height: 1.45;
  background: #e8f6df;
  color: #4a7c16;
  border: 1px solid #c8e6b5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.toast strong {
  font-weight: 700;
}

.toast.error {
  background: #fdecea;
  color: #b03a2e;
  border-color: #f5c6cb;
}

.toast.hidden { display: none; }

.modal-wide {
  width: min(920px, 98vw);
}

.teacher-form-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.teacher-form-grid .span-2 {
  grid-column: span 2;
}

.teacher-form-grid .span-3 {
  grid-column: span 3;
}

.teacher-form-grid .full,
.teacher-form-grid .span-4 {
  grid-column: 1 / -1;
}

.teacher-form-bio textarea {
  min-height: 220px;
  resize: vertical;
  line-height: 1.5;
}

.modal .checks-inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.modal .checks-inline label {
  white-space: nowrap;
}

.modal .teacher-form-media {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  grid-column: 1 / -1;
}

.modal .teacher-form-media .form-field {
  margin: 0;
}

.modal .photo-preview {
  width: 64px;
  height: 64px;
}

.modal .works-preview {
  margin-top: 4px;
  max-height: 72px;
  overflow: hidden;
}

.modal .works-preview-thumb,
.modal .works-preview-fallback {
  width: 40px;
  height: 40px;
  font-size: 9px;
}

.modal .sessions-list {
  gap: 6px;
  max-height: 132px;
  overflow: hidden;
}

.modal .session-row {
  padding: 6px 8px;
  gap: 6px;
}

.modal .enrollments-panel {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--appui-border);
}

.modal .enrollments-panel h4 {
  margin: 0 0 6px;
  font-size: 12px;
}

.modal .enrollment-mini {
  padding: 4px 0;
  font-size: 12px;
}

.modal .check-row .check-filter {
  margin: 0;
}

.modal .sessions-panel .hint {
  display: none;
}

.enrollments-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--appui-border);
}

.enrollments-panel h4 {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--appui-muted);
}

.enrollment-mini {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--appui-border);
  font-size: 13px;
}

.sessions-panel {
  margin-top: 4px;
}

.sessions-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.sessions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.session-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  background: #f8f9fa;
  border: 1px solid var(--appui-border);
  border-radius: 4px;
}

.session-row .form-field { margin: 0; }

.course-card-sessions span:last-child {
  text-align: right;
  line-height: 1.45;
}

.hint {
  display: block;
  margin-top: 8px;
  color: var(--appui-muted);
  font-size: 12px;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.enrollment-mini:last-child { border-bottom: 0; }

.add-course-row {
  display: flex;
  gap: 8px;
  align-items: end;
  margin-top: 10px;
  flex-wrap: wrap;
}

.add-course-row select { flex: 1; min-width: 140px; }

.checks {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 4px;
  text-transform: none;
  font-weight: 400;
}

.view-toggle {
  display: inline-flex;
  margin-left: auto;
  border: 1px solid var(--appui-border);
  border-radius: 3px;
  overflow: hidden;
  background: var(--appui-surface);
}

.view-btn {
  border: 0;
  background: transparent;
  color: var(--appui-muted);
  width: 38px;
  height: 34px;
  cursor: pointer;
  font-size: 15px;
}

.view-btn:hover { background: #f5f7fa; color: var(--appui-text); }

.view-btn.active {
  background: var(--appui-accent);
  color: #fff;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

#courses-cards .empty {
  grid-column: 1 / -1;
}

.courses-grid.hidden,
.students-list-widget.hidden,
.courses-list-widget.hidden {
  display: none;
}

.students-toolbar {
  flex-wrap: wrap;
  gap: 10px;
}

.students-grid {
  margin-bottom: 16px;
}

.payments-toolbar {
  flex-wrap: wrap;
  gap: 10px;
}

.payments-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 16px;
  background: var(--appui-surface);
  border: 1px solid var(--appui-border);
  border-radius: 3px;
  font-size: 14px;
}

.payments-summary .payments-total strong {
  color: var(--appui-success);
  font-size: 18px;
}

.payments-matrix-wrap {
  overflow-x: auto;
  background: var(--appui-surface);
  border: 1px solid var(--appui-border);
  border-radius: 3px;
}

.payments-matrix {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  table-layout: fixed;
}

.payments-matrix th,
.payments-matrix td {
  border-bottom: 1px solid var(--appui-border);
  border-right: 1px solid var(--appui-border);
  vertical-align: middle;
}

.payments-matrix th:last-child,
.payments-matrix td:last-child {
  border-right: none;
}

.payments-matrix tbody tr:last-child td {
  border-bottom: none;
}

.payments-matrix th.student-col,
.payments-matrix td.student-cell {
  width: 220px;
  min-width: 220px;
  text-align: left;
  padding: 10px 14px;
}

.payments-matrix td.student-cell {
  position: sticky;
  left: 0;
  background: var(--appui-surface);
  z-index: 1;
}

.payments-matrix th.student-col {
  position: sticky;
  left: 0;
  z-index: 2;
}

.payments-matrix .student-cell strong {
  display: block;
  font-size: 14px;
}

.payments-matrix .student-cell small {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--appui-muted);
  line-height: 1.35;
}

.payments-matrix th.month-col {
  width: 48px;
  text-align: center;
  padding: 10px 4px;
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
}

.payments-matrix td.month-cell {
  text-align: center;
  padding: 10px 4px;
  color: var(--appui-muted);
}

.payments-matrix td.month-cell.paid {
  background: #e8f8ee;
  color: var(--appui-success);
  font-weight: 700;
  font-size: 15px;
}

.payments-matrix-amounts td.month-cell.paid {
  background: #fff8e8;
  color: #b8860b;
}

.payments-matrix-amounts .month-amt {
  display: block;
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
}

.kasa-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kasa-stat {
  background: var(--appui-card, #fff);
  border: 1px solid var(--appui-border, #e5e7eb);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kasa-stat-label {
  font-size: 12px;
  color: var(--appui-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kasa-stat strong {
  font-size: 20px;
  font-weight: 700;
}

.kasa-stat-in strong { color: var(--appui-success, #16a34a); }
.kasa-stat-out strong { color: #dc2626; }
.kasa-stat-net strong { color: var(--appui-primary, #2563eb); }

.kasa-toolbar {
  flex-wrap: wrap;
  gap: 10px;
}

.payments-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.overdue-widget {
  margin-top: 22px;
}

.overdue-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.overdue-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.overdue-table-wrap {
  overflow-x: auto;
}

.overdue-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.overdue-table th,
.overdue-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--appui-border);
  text-align: left;
  vertical-align: middle;
}

.overdue-table th {
  background: var(--appui-bg);
  font-weight: 700;
  white-space: nowrap;
}

.overdue-table tr.no-email td {
  opacity: 0.65;
}

.overdue-table .badge-overdue {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  background: #fdecea;
  color: #c0392b;
  font-size: 12px;
  font-weight: 600;
}

.notify-form-section {
  margin-bottom: 18px;
}

.notify-form-section h4 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--appui-heading);
}

.notify-placeholders {
  font-size: 12px;
  color: var(--appui-muted);
  line-height: 1.5;
}

.notify-preview-box {
  margin-top: 10px;
  padding: 12px;
  background: var(--appui-bg);
  border: 1px solid var(--appui-border);
  border-radius: 3px;
  font-size: 13px;
  white-space: pre-wrap;
  display: none;
}

.notify-preview-box.is-visible {
  display: block;
}

.notify-test-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 8px;
}

.notify-test-row input {
  flex: 1;
  min-width: 180px;
}

.org-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.org-term-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-bottom: 12px;
}

.org-term-badge {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.org-term-badge.active {
  background: rgba(64, 140, 189, 0.15);
  color: #2a6a94;
}

.org-term-badge.ending {
  background: rgba(243, 156, 18, 0.15);
  color: #b8750a;
}

.org-term-badge.ended {
  background: rgba(231, 76, 60, 0.12);
  color: #c0392b;
}

.org-term-badge.pending {
  background: #eef1f4;
  color: var(--appui-muted);
}

.term-context-banner {
  margin: 0 0 12px;
  padding: 0;
  font-size: 13px;
}

.term-context-banner.hidden {
  display: none;
}

.term-context-info {
  margin: 0;
  color: #31708f;
  background: #d9edf7;
  border: 1px solid #bce8f1;
  padding: 10px 14px;
  border-radius: 4px;
}

.term-context-warn {
  margin: 0;
  color: #856404;
  background: #fff3cd;
  border: 1px solid #ffeeba;
  padding: 10px 14px;
  border-radius: 4px;
}

.term-context-info i,
.term-context-warn i {
  margin-right: 6px;
}

.org-term-range {
  font-size: 14px;
  color: var(--appui-text);
}

.org-term-hint {
  margin: 0 0 14px;
}

.org-term-grid {
  margin-bottom: 14px;
}

.org-term-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.org-term-extras {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
}

.org-term-extra {
  font-size: 12px;
  color: var(--appui-muted);
  background: #f3f5f7;
  padding: 4px 10px;
  border-radius: 999px;
}

.term-plan-intro {
  margin: 0 0 14px;
}

.term-plan-grid {
  margin-bottom: 18px;
}

.term-plan-holidays-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.term-plan-holidays-header h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
}

.term-holiday-row {
  display: grid;
  grid-template-columns: 1fr 1fr 2fr auto;
  gap: 10px;
  align-items: end;
  padding: 10px 0;
  border-top: 1px solid var(--appui-border);
}

.term-holiday-row:first-child {
  border-top: 0;
}

@media (max-width: 720px) {
  .term-holiday-row {
    grid-template-columns: 1fr 1fr;
  }

  .term-holiday-row .span-2 {
    grid-column: 1 / -1;
  }

  .term-holiday-row .term-holiday-remove {
    grid-column: 1 / -1;
    justify-self: start;
  }
}

.org-section .widget-content {
  padding: 16px 18px 18px;
}

.org-logo-row {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.org-logo-preview {
  width: 88px;
  height: 88px;
  border-radius: 8px;
  border: 1px solid var(--appui-border);
  background: var(--appui-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--appui-muted);
  font-size: 28px;
}

.org-logo-preview img,
.sidebar-brand-logo,
.header-brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.sidebar-brand-logo {
  width: 28px;
  height: 28px;
  border-radius: 4px;
}

.header-brand-logo {
  width: 22px;
  height: 22px;
  vertical-align: middle;
  margin-right: 6px;
  border-radius: 3px;
}

.org-form-actions {
  display: flex;
  justify-content: flex-end;
}

.org-form .form-grid .span-2 {
  grid-column: 1 / -1;
}

@media (min-width: 720px) {
  .org-form .form-grid .span-2 {
    grid-column: span 2;
  }
}

.payments-month-group {
  background: var(--appui-surface);
  border: 1px solid var(--appui-border);
  border-radius: 3px;
  overflow: hidden;
}

.payments-month-title {
  margin: 0;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--appui-muted);
  background: #f5f6f7;
  border-bottom: 1px solid var(--appui-border);
}

.payments-cards {
  display: flex;
  flex-direction: column;
}

.payment-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--appui-border);
}

.payment-card:last-child {
  border-bottom: none;
}

.payment-card-main {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  min-width: 0;
  flex: 1;
}

.payment-card-amount {
  flex-shrink: 0;
  min-width: 88px;
  font-size: 17px;
  font-weight: 700;
  color: var(--appui-success);
}

.payment-card-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.payment-card-info strong {
  font-size: 15px;
}

.payment-card-info span {
  font-size: 13px;
  color: var(--appui-text);
}

.payment-card-info small {
  font-size: 12px;
  color: var(--appui-muted);
}

.payment-card-desc {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--appui-muted);
}

.photo-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-transform: none;
  font-weight: 400;
}

.photo-preview {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--appui-border);
}

.photo-preview.hidden {
  display: none;
}

.course-card {
  background: var(--appui-surface);
  border: 1px solid var(--appui-border);
  border-radius: 3px;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: box-shadow .15s ease, transform .15s ease;
}

.course-card:hover {
  box-shadow: 0 4px 16px rgba(69, 78, 89, .12);
  transform: translateY(-1px);
}

.course-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--appui-border);
  background: #f9fafb;
}

.course-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  flex-shrink: 0;
}

.course-card-icon.cyan { background: var(--appui-accent); }
.course-card-icon.blue { background: var(--appui-info); }
.course-card-icon.green { background: var(--appui-success); }
.course-card-icon.orange { background: var(--appui-warning); }
.course-card-icon.red { background: var(--appui-danger); }

.student-card-photo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #fff;
  box-shadow: 0 1px 5px rgba(69, 78, 89, .16);
}

.student-photo-preview {
  border-radius: 50%;
}

.course-card-title {
  flex: 1;
  min-width: 0;
}

.course-card-title strong {
  display: block;
  font-size: 17px;
  font-weight: 600;
  color: var(--appui-text);
  line-height: 1.2;
}

.course-card-title small {
  display: block;
  margin-top: 4px;
  color: var(--appui-muted);
  font-size: 12px;
}

.course-card-body {
  padding: 14px 16px;
  display: grid;
  gap: 10px;
  flex: 1;
}

.course-card-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
}

.course-card-row span:first-child {
  color: var(--appui-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .03em;
}

.course-card-row span:last-child {
  text-align: right;
  color: var(--appui-text);
}

.course-card-fee strong {
  color: var(--appui-accent);
  font-size: 18px;
  font-weight: 300;
}

.course-card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--appui-border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  background: #fafbfc;
}

.works-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.works-preview-thumb {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid var(--appui-border);
}

.works-preview-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f3f4f6;
  color: var(--appui-muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.teachers-grid {
  display: grid;
  grid-template-columns: repeat(var(--teacher-cols, 1), minmax(0, 1fr));
  gap: 16px;
  width: 100%;
  margin-bottom: 18px;
}

.teachers-grid .empty {
  grid-column: 1 / -1;
}

@media (max-width: 900px) {
  .teachers-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }
}

.dashboard-courses-widget {
  background: transparent;
  border: none;
  margin-bottom: 22px;
}

.dashboard-courses-widget-header {
  padding: 0 0 12px;
  border: none;
  background: transparent;
}

.dashboard-courses-widget-header h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--appui-muted);
}

.dashboard-courses-grid {
  display: grid;
  grid-template-columns: repeat(var(--dashboard-course-cols, 1), minmax(0, 1fr));
  gap: 16px;
  width: 100%;
}

.dashboard-courses-grid .empty {
  grid-column: 1 / -1;
}

.dashboard-course-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 320px;
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 3px 16px rgba(69, 78, 89, .12);
  transition: transform .2s ease, box-shadow .2s ease;
}

.dashboard-course-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 26px rgba(69, 78, 89, .18);
}

.dashboard-course-card.is-passive {
  opacity: .82;
  filter: saturate(.8);
}

.dashboard-course-card-hero {
  position: relative;
  flex: 1 1 auto;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px 16px 26px;
  text-align: center;
  overflow: hidden;
  background: linear-gradient(145deg, #4a5560 0%, #2f3640 100%);
  --px-x: 0px;
  --px-y: 0px;
  --scroll-y: 0px;
}

.dashboard-course-card-hero-bg {
  position: absolute;
  left: -8%;
  top: -12%;
  width: 116%;
  height: 124%;
  object-fit: cover;
  will-change: transform;
  transform: translate3d(var(--px-x), calc(var(--scroll-y) + var(--px-y)), 0) scale(1.06);
  transition: transform .18s ease-out;
}

.dashboard-course-card-hero:hover .dashboard-course-card-hero-bg {
  transition: transform .07s ease-out;
}

.dashboard-course-card-hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(35, 42, 50, .62);
}

.dashboard-course-card-hero-body {
  position: relative;
  z-index: 1;
  width: 100%;
}

.dashboard-course-card-avatar {
  width: 72px;
  height: 72px;
  margin: 0 auto;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .88);
  overflow: hidden;
  background: rgba(255, 255, 255, .12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
  --px-x: 0px;
  --px-y: 0px;
  transform: translate3d(var(--px-x), var(--px-y), 0);
  transition: transform .18s ease-out;
}

.dashboard-course-card-hero:hover .dashboard-course-card-avatar {
  transition: transform .07s ease-out;
}

.dashboard-course-card-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.dashboard-course-card-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .75);
  font-size: 28px;
}

.dashboard-course-card-name {
  margin: 0 0 18px;
  padding: 0 8px;
  font-size: clamp(28px, 3.4vw, 42px);
  font-weight: 800;
  color: #fff;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.55), 0 1px 3px rgba(0, 0, 0, 0.35);
  word-break: break-word;
}

.dashboard-course-card-role {
  margin: 7px 0 0;
  font-size: 13px;
  font-style: italic;
  color: rgba(255, 255, 255, .78);
  line-height: 1.35;
}

.dashboard-course-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
  border-top: 1px solid #eef1f4;
}

.dashboard-course-card-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 10px;
  text-align: center;
  font-size: 12px;
  color: var(--appui-muted);
  line-height: 1.35;
}

.dashboard-course-card-stat + .dashboard-course-card-stat {
  border-left: 1px solid #eef1f4;
}

.dashboard-course-card-stat i {
  font-size: 18px;
}

.dashboard-course-card-stat:first-child i {
  color: var(--appui-warning);
}

.dashboard-course-card-stat:last-child i {
  color: var(--appui-info);
}

.dashboard-course-card-stat strong {
  color: var(--appui-text);
  font-weight: 700;
}

.dashboard-course-card-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 10px 12px;
  background: #fafbfc;
  border-top: 1px solid #eef1f4;
}

@media (prefers-reduced-motion: reduce) {
  .dashboard-course-card-hero-bg,
  .dashboard-course-card-avatar {
    transform: none !important;
    transition: none !important;
  }
}

@media (max-width: 820px) {
  .dashboard-courses-grid {
    gap: 12px;
  }

  .dashboard-course-card {
    min-height: 300px;
  }

  .dashboard-course-card-hero {
    min-height: 200px;
    padding: 24px 12px 20px;
  }

  .dashboard-course-card-avatar {
    width: 64px;
    height: 64px;
  }

  .dashboard-course-card-name {
    font-size: clamp(24px, 7vw, 34px);
    margin-bottom: 14px;
  }
}

.teacher-card {
  background: #fff;
  border: 1px solid var(--appui-border);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px rgba(69, 78, 89, .08);
  transition: box-shadow .15s ease, transform .15s ease;
}

.teacher-card:hover {
  box-shadow: 0 6px 20px rgba(69, 78, 89, .14);
  transform: translateY(-2px);
}

.teacher-card-visual {
  position: relative;
  min-height: 252px;
  overflow: hidden;
  isolation: isolate;
}

.teacher-card-bg-masonry {
  position: absolute;
  inset: 0;
  columns: 3;
  column-gap: 0;
  overflow: hidden;
  line-height: 0;
  transform: scale(1.04);
  filter: saturate(1.08);
}

.teacher-card-bg-masonry.teacher-card-bg-empty {
  background: linear-gradient(145deg, #dce8f0 0%, #c5d4e0 45%, #b8cad8 100%);
  transform: none;
  filter: none;
}

.teacher-card-bg-tile {
  break-inside: avoid;
  width: 100%;
  overflow: hidden;
  margin: 0;
  padding: 0;
}

.teacher-card-bg-tile.h-short { height: 78px; }
.teacher-card-bg-tile.h-med { height: 102px; }
.teacher-card-bg-tile.h-tall { height: 126px; }

.teacher-card-bg-img {
  width: 100%;
  height: 100%;
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  object-fit: cover;
  border-radius: 0;
}

.teacher-card-bg-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse 120% 90% at 50% 0%, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.55) 52%, rgba(255, 255, 255, 0.92) 100%),
    linear-gradient(180deg, rgba(64, 140, 189, 0.12) 0%, rgba(255, 255, 255, 0.45) 38%, rgba(248, 251, 253, 0.96) 100%);
  pointer-events: none;
}

.teacher-card-hero-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 22px 18px 18px;
  padding: 22px 16px 18px;
  text-align: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow:
    0 10px 28px rgba(15, 35, 55, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.teacher-card-avatar-wrap {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  padding: 4px;
  background-size: cover;
  background-position: center;
  background-color: #eef4f8;
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.98),
    0 8px 22px rgba(15, 35, 55, 0.18);
}

.teacher-card-avatar-ring {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #fff;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.teacher-card-photo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.teacher-card-photo-fallback {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: linear-gradient(145deg, #eef4f8, #dce8f0);
  color: var(--appui-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}

.teacher-card-name {
  margin: 16px 0 0;
  padding: 0 6px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1a2b3c;
  line-height: 1.25;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

.teacher-card-role {
  padding: 10px 14px;
  text-align: center;
  background: #f3f5f7;
  border-top: 1px solid var(--appui-border);
  border-bottom: 1px solid var(--appui-border);
  font-size: 13px;
  font-weight: 600;
  color: #6b7785;
}

.teacher-card-contact {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #fff;
  border-top: 1px solid var(--appui-border);
}

.teacher-card-contact-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  font-size: 13px;
  line-height: 1.35;
}

.teacher-card-contact-row + .teacher-card-contact-row {
  border-top: 1px solid #eef1f4;
}

.teacher-card-contact-row i {
  width: 18px;
  margin-top: 2px;
  text-align: center;
  color: var(--appui-accent);
  flex-shrink: 0;
}

.teacher-card-contact-text {
  min-width: 0;
  flex: 1;
}

.teacher-card-contact-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--appui-muted);
  margin-bottom: 2px;
}

.teacher-card-contact-text a {
  color: var(--appui-text);
  text-decoration: none;
  word-break: break-word;
}

.teacher-card-contact-text a:hover {
  color: var(--appui-accent);
}

.teacher-card-contact-empty {
  color: var(--appui-muted);
}

.teacher-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: #fff;
}

.teacher-card-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 10px;
  font-size: 13px;
  color: var(--appui-muted);
}

.teacher-card-stat + .teacher-card-stat {
  border-left: 1px solid var(--appui-border);
}

.teacher-card-stat i {
  font-size: 22px;
}

.teacher-card-stat .stat-green { color: var(--appui-success); }
.teacher-card-stat .stat-blue { color: var(--appui-info); }

.teacher-card-stat strong {
  color: var(--appui-text);
  font-weight: 600;
}

.teacher-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--appui-border);
  background: #fafbfc;
}

.teacher-card-link {
  cursor: pointer;
}

.teacher-card-link:focus {
  outline: 2px solid var(--appui-accent);
  outline-offset: -2px;
}

.teacher-detail-toolbar {
  margin-bottom: 14px;
}

.teacher-profile .teacher-appui {
  border: 1px solid var(--appui-border);
  border-radius: 4px;
  overflow: hidden;
  min-height: 480px;
}

.teachers-toolbar {
  margin-bottom: 14px;
}

.teachers-toolbar .filter {
  margin-left: auto;
}

.teachers-page {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 0;
  min-height: 520px;
  background: #fff;
  border: 1px solid var(--appui-border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 18px;
}

.teachers-roster {
  border-right: 1px solid var(--appui-border);
  background: #f8f9fa;
  overflow-y: auto;
  max-height: 72vh;
}

.teachers-roster-empty,
.teachers-profile-empty {
  padding: 28px 18px;
  color: var(--appui-muted);
  text-align: center;
  font-size: 14px;
}

.teachers-roster-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--appui-border);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .12s ease;
}

.teachers-roster-item:hover,
.teachers-roster-item.active {
  background: #fff;
}

.teachers-roster-item.active {
  box-shadow: inset 3px 0 0 var(--appui-accent);
}

.teachers-roster-thumb {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}

.teachers-roster-thumb-fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e8eef3;
  color: var(--appui-muted);
}

.teachers-roster-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.teachers-roster-text strong {
  font-size: 14px;
  color: var(--appui-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teachers-roster-text small {
  font-size: 11px;
  color: var(--appui-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teachers-profile-pane {
  min-height: 520px;
  background: #fff;
}

.teachers-payments-widget {
  margin-top: 0;
}

.teacher-appui {
  display: grid;
  grid-template-columns: minmax(260px, 32%) minmax(0, 1fr);
  min-height: 520px;
}

.teacher-appui-side {
  border-right: 1px solid var(--appui-border);
  background: #fff;
}

.teacher-appui-cover {
  position: relative;
  min-height: 200px;
  padding: 58px 18px 18px;
  text-align: center;
  background: linear-gradient(135deg, #4a5f6f 0%, #2c3e50 100%);
  background-size: cover;
  background-position: center;
  color: #fff;
}

.teacher-appui-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.2) 0%, rgba(0,0,0,.45) 55%, rgba(0,0,0,.78) 100%);
}

.teacher-appui-avatar {
  position: relative;
  z-index: 1;
  width: 108px;
  height: 108px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid #fff;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  margin: 0 auto 12px;
  display: block;
}

.teacher-appui-avatar-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  margin-right: auto;
  background: #5d6d7e;
  font-size: 40px;
}

.teacher-appui-cover .teacher-appui-name {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 26px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,.9), 0 2px 14px rgba(0,0,0,.65);
}

.teacher-appui-role {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 13px;
  opacity: .92;
}

.teacher-appui-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--appui-border);
}

.teacher-appui-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 10px;
  font-size: 12px;
  color: var(--appui-muted);
}

.teacher-appui-stat + .teacher-appui-stat {
  border-left: 1px solid var(--appui-border);
}

.teacher-appui-stat i {
  font-size: 20px;
}

.teacher-appui-stat strong {
  color: var(--appui-text);
  font-weight: 600;
}

.teacher-appui-stat-label {
  color: var(--appui-text);
  font-weight: 600;
  font-size: 13px;
  text-align: center;
  line-height: 1.3;
}

.teacher-appui-block {
  padding: 16px 18px;
  border-bottom: 1px solid var(--appui-border);
}

.teacher-appui-block h3 {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--appui-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
}

.teacher-appui-block p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--appui-text);
}

.teacher-appui-social {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.teacher-social-link {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 3px;
  background: #f3f5f7;
  color: var(--appui-muted);
  text-decoration: none;
  border: 1px solid var(--appui-border);
}

.teacher-appui-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.teacher-appui-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--appui-border);
  background: #f9fafb;
  padding: 0 12px;
}

.teacher-appui-tab {
  border: 0;
  background: transparent;
  padding: 14px 18px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--appui-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.teacher-appui-tab.active {
  color: var(--appui-accent);
  border-bottom-color: var(--appui-accent);
  background: #fff;
}

.teacher-appui-panels {
  flex: 1;
  padding: 18px;
  overflow-y: auto;
  max-height: calc(72vh - 48px);
}

.teacher-appui-panel {
  display: none;
}

.teacher-appui-panel.active {
  display: block;
}

.teacher-appui-block-inset {
  margin-top: 18px;
  padding: 16px;
  background: #f9fafb;
  border: 1px solid var(--appui-border);
  border-radius: 4px;
}

.teacher-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.teacher-timeline-item {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid #eef1f4;
}

.teacher-timeline-item:last-child {
  border-bottom: 0;
}

.teacher-timeline-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
}

.teacher-timeline-icon.tl-green { background: var(--appui-success); }
.teacher-timeline-icon.tl-blue { background: var(--appui-info); }
.teacher-timeline-icon.tl-orange { background: var(--appui-warning); }
.teacher-timeline-icon.tl-teal { background: var(--appui-accent); }
.teacher-timeline-icon.tl-purple { background: #8e44ad; }

.teacher-timeline-body h4 {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: var(--appui-text);
}

.teacher-timeline-content {
  font-size: 13px;
  color: var(--appui-muted);
  line-height: 1.5;
}

.teacher-profile-tag {
  display: inline-block;
  padding: 3px 8px;
  margin: 0 4px 4px 0;
  font-size: 11px;
  background: #edf7fb;
  color: var(--appui-accent);
  border-radius: 3px;
}

.teacher-photos-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.teacher-photos-item {
  display: block;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--appui-border);
  aspect-ratio: 4 / 3;
}

.teacher-photos-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.teacher-profile-bio {
  font-size: 14px;
  line-height: 1.65;
  color: var(--appui-text);
}

.teacher-profile-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.teacher-profile-info-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 10px;
  font-size: 13px;
  padding: 8px 0;
  border-bottom: 1px solid #eef1f4;
}

.teacher-profile-info-row .label {
  color: var(--appui-muted);
  font-weight: 600;
}

.teacher-profile-info-row .value {
  color: var(--appui-text);
  word-break: break-word;
}

.empty-inline {
  margin: 0;
  color: var(--appui-muted);
  font-size: 13px;
}

.muted {
  color: var(--appui-muted);
}

@media (max-width: 991px) {
  #sidebar {
    transform: translateX(-100%);
  }

  #sidebar.open {
    transform: translateX(0);
  }

  #main-container { margin-left: 0; }

  .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .header-brand { display: none; }

  .header-search { max-width: none; }

  .form-grid { grid-template-columns: 1fr; }

  .teacher-form-grid { grid-template-columns: 1fr 1fr; }

  .teacher-form-grid .span-2,
  .teacher-form-grid .span-3,
  .teacher-form-grid .span-4,
  .teacher-form-grid .full {
    grid-column: 1 / -1;
  }

  .modal .teacher-form-media { grid-template-columns: 1fr; }

  .modal-wide { width: min(96vw, 560px); }

  .attendance-row { grid-template-columns: 1fr; }

  .teachers-page { grid-template-columns: 1fr; }

  .teachers-roster {
    max-height: 220px;
    border-right: 0;
    border-bottom: 1px solid var(--appui-border);
  }

  .teacher-appui { grid-template-columns: 1fr; }

  .teacher-appui-side { border-right: 0; border-bottom: 1px solid var(--appui-border); }

  .teacher-photos-grid { grid-template-columns: 1fr; }

  .teacher-profile-info-row { grid-template-columns: 1fr; gap: 2px; }
}

.student-lookup-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 4px 0 8px;
  max-height: 180px;
  overflow-y: auto;
}

.student-lookup-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border: 1px solid var(--appui-border);
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
}

.student-lookup-item:hover {
  border-color: var(--appui-primary, #408CBD);
  background: #f5f9fc;
}

.student-lookup-item small {
  display: block;
  color: var(--appui-muted, #73879c);
  margin-top: 2px;
}

.student-lookup-hint {
  margin: 0 0 8px;
  color: var(--appui-primary, #408CBD);
}
