/* ==================== RESET & BASE ==================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --brand-red: #cf1e20;
  --brand-red-hover: #ae1719;
  --brand-navy: #23336b;
  --brand-navy-dark: #18234b;
  --brand-navy-light: #eef2fa;
  --bg-app: #edf0f7;
  --toolbar-bg: linear-gradient(135deg, #18234b 0%, #23336b 100%);
  --toolbar-border: #cf1e20;
  --accent: #cf1e20;
  --accent-hover: #ae1719;
  --ink: #111827;
  --line: #23336b;
  --muted: #64748b;
  --paper: #ffffff;
  --font-ui: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-sheet: "Segoe UI", Arial, Helvetica, sans-serif;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: var(--font-ui);
  background: var(--bg-app);
  color: var(--ink);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ==================== TOOLBAR (SCREEN ONLY) ==================== */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 11px 24px;
  background: var(--toolbar-bg);
  color: #f9fafb;
  border-bottom: 3px solid var(--toolbar-border);
  box-shadow: 0 4px 18px rgba(24, 35, 75, 0.24);
}

.toolbar-brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.toolbar-logo-pill {
  background: #ffffff;
  padding: 5px 10px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  flex-shrink: 0;
}

.toolbar-logo-img {
  height: 30px;
  width: auto;
  display: block;
}

.toolbar h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.toolbar-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: #cbd5e1;
}

.toolbar-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.view-tabs {
  display: inline-flex;
  background: rgba(15, 23, 52, 0.55);
  padding: 3px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.tab-btn {
  border: 0;
  background: transparent;
  color: #dbe3f4;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.tab-btn:hover {
  color: #fff;
}

.tab-btn.active {
  background: var(--brand-red);
  color: #fff;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.print-group {
  display: inline-flex;
  gap: 6px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.btn {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 7px 13px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: var(--brand-red);
  color: #fff;
}

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

.btn-dark {
  background: #ffffff;
  color: var(--brand-navy-dark);
  border-color: #ffffff;
}

.btn-dark:hover {
  background: #e8edf7;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
}

.btn-ghost {
  background: transparent;
  color: #e2e8f0;
  border-color: rgba(255, 255, 255, 0.22);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.file-label {
  cursor: pointer;
}

/* ==================== WORKSPACE & A4 PAPER ==================== */
.workspace {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  padding: 28px 16px 56px;
}

.workspace[data-active-view="front"] #page-back {
  display: none;
}

.workspace[data-active-view="back"] #page-front {
  display: none;
}

.a4-sheet {
  width: 210mm;
  min-height: 297mm;
  background: var(--paper);
  padding: 11mm 12mm;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.14), 0 2px 6px rgba(15, 23, 42, 0.08);
  border-radius: 3px;
  font-family: var(--font-sheet);
  color: #111;
}

.sheet-frame {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.back-frame {
  gap: 8px;
}

/* ==================== FRONT PAGE HEADER ==================== */
.header-box {
  border: 1.25px solid var(--line);
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 116px;
}

.brand-block {
  justify-self: start;
  display: inline-flex;
  align-items: center;
}

.sheet-brand-logo {
  max-width: 185px;
  max-height: 82px;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

.header-title-wrap {
  justify-self: center;
}

.data-sheet-badge {
  background: var(--brand-navy);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  padding: 6px 22px;
  border-radius: 3px;
  border-bottom: 3px solid var(--brand-red);
  letter-spacing: 0.4px;
}

/* ==================== PHOTO UPLOAD BOX ==================== */
.photo-box-wrap {
  justify-self: end;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.photo-box {
  width: 96px;
  height: 104px;
  border: 1.25px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: #fafafa;
  transition: border-color 0.15s, background 0.15s;
}

.photo-box:hover,
.photo-box.drag-over {
  border-color: var(--brand-red);
  background: #fef2f2;
}

.photo-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #6b7280;
  text-align: center;
  padding: 6px;
  user-select: none;
}

.photo-placeholder span {
  font-size: 11px;
  font-weight: 700;
  color: #374151;
}

.photo-placeholder small {
  font-size: 9.5px;
  color: #6b7280;
}

.photo-actions {
  display: none;
  gap: 4px;
}

.photo-actions.visible {
  display: flex;
}

.mini-btn {
  border: 1px solid #d1d5db;
  background: #f9fafb;
  color: #111827;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  cursor: pointer;
}

.mini-btn:hover {
  background: #e5e7eb;
}

.mini-btn-danger {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.mini-btn-danger:hover {
  background: #fee2e2;
}

/* ==================== SHEET TABLES & LIVE INPUTS ==================== */
.sheet-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.sheet-table th,
.sheet-table td {
  border: 1.15px solid var(--line);
  padding: 0;
  vertical-align: middle;
  font-size: 12px;
  color: #111;
}

.basic-info-table td {
  height: 30px;
  padding: 0 8px;
}

.inline-field {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  height: 100%;
}

.inline-field label {
  font-weight: 600;
  white-space: nowrap;
  font-size: 12px;
  color: var(--brand-navy-dark);
  flex-shrink: 0;
}

.inline-field input,
.cell-input {
  width: 100%;
  min-width: 0;
  height: 26px;
  border: 0;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  color: #0f172a;
  padding: 2px 4px;
}

.inline-field input:focus,
.cell-input:focus {
  background: rgba(207, 30, 32, 0.06);
  box-shadow: inset 0 -1.5px 0 var(--brand-red);
}

.cell-input {
  height: 28px;
  padding: 2px 6px;
}

.center {
  text-align: center;
}

.left-align {
  text-align: left;
}

/* Split Education & Installment Table */
.split-details-table th,
.split-details-table td {
  height: 28px;
}

.section-label-cell {
  padding: 4px 8px !important;
  font-weight: 700;
  font-size: 12px;
  background: var(--brand-navy-light);
  color: var(--brand-navy-dark) !important;
}

.subhead {
  padding: 3px 6px !important;
  font-weight: 600;
  text-align: left;
  background: #f8fafe;
  color: var(--brand-navy-dark) !important;
}

.subhead.center {
  text-align: center;
}

.label-cell {
  padding: 0 8px !important;
  font-weight: 600;
  color: var(--brand-navy-dark) !important;
}

/* Status & Break Tables */
.status-table th,
.break-table th {
  height: 27px;
  padding: 2px 6px !important;
  font-weight: 600;
  text-align: center;
  background: var(--brand-navy-light);
  color: var(--brand-navy-dark) !important;
}

.status-table th.tab-header,
.break-table th.tab-header {
  text-align: center;
  font-weight: 700;
  background: var(--brand-navy);
  color: #ffffff !important;
}

.status-table th.tab-spacer,
.break-table th.tab-spacer {
  background: #ffffff;
}

.status-table td,
.break-table td {
  height: 31px;
}

/* Student Declaration & Terms Box */
.terms-box {
  border: 1.15px solid var(--line);
  margin-top: 2px;
}

.terms-header {
  background: var(--brand-navy-light);
  color: var(--brand-navy-dark);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 8px;
  border-bottom: 1.15px solid var(--line);
}

.terms-body {
  padding: 7px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.terms-item {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.4;
  color: #1e293b;
}

.terms-item strong {
  color: var(--brand-navy-dark);
}

.terms-sign-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: end;
  gap: 18px;
  margin-top: 14px;
  padding-top: 2px;
}

.terms-date-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
}

.terms-date-wrap label {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand-navy-dark);
}

.terms-date-wrap input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  color: #0f172a;
  padding: 1px 3px;
}

.terms-date-wrap input:focus {
  background: rgba(207, 30, 32, 0.06);
}

.terms-sign-line {
  border-top: 1px solid var(--line);
  padding-top: 3px;
  text-align: center;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--brand-navy-dark);
}

/* ==================== PAGE 2 (TOPICS & PROJECTS) ==================== */
.back-header-table td {
  height: 29px;
  padding: 0 8px;
}

.topics-table th {
  height: 28px;
  padding: 2px 6px !important;
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  background: var(--brand-navy);
  color: #ffffff !important;
}

.topics-table td {
  height: 27.5px;
}

.topics-table td .cell-input {
  height: 26px;
  font-size: 12px;
  padding: 2px 6px;
}

.topics-table .sno-cell,
.project-table .sno-cell {
  text-align: center;
  font-weight: 600;
  font-size: 12px;
}

.project-table th {
  height: 30px;
  padding: 2px 5px !important;
  font-weight: 700;
  font-size: 11.5px;
  text-align: center;
  line-height: 1.2;
  background: var(--brand-navy-light);
  color: var(--brand-navy-dark) !important;
}

.project-table td {
  height: 29px;
}

.project-table td .cell-input {
  height: 27px;
  font-size: 12px;
}

/* ==================== TOAST & MODAL ==================== */
.toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 60;
  background: var(--brand-navy-dark);
  border-left: 4px solid var(--brand-red);
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(24, 35, 75, 0.28);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 680px;
  max-height: 84vh;
  background: #fff;
  border-radius: 12px;
  border-top: 4px solid var(--brand-red);
  box-shadow: 0 24px 48px rgba(24, 35, 75, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--brand-navy-light);
  border-bottom: 1px solid #d9e1f2;
}

.modal-header h2 {
  margin: 0;
  font-size: 17px;
  color: var(--brand-navy-dark);
}

.modal-sub {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}

.icon-close {
  border: 0;
  background: transparent;
  font-size: 24px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
}

.modal-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 20px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
}

.modal-tools input[type="search"] {
  flex: 1 1 240px;
  padding: 8px 12px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 13px;
  outline: none;
}

.modal-tools input[type="search"]:focus {
  border-color: var(--accent);
}

.modal-io {
  display: flex;
  gap: 8px;
}

.modal-io .btn-secondary {
  background: #fff;
  color: #111827;
  border-color: #d1d5db;
}

.modal-io .btn-secondary:hover {
  background: #f3f4f6;
}

.records-list {
  padding: 14px 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.record-item {
  border: 1px solid #e5e7eb;
  border-radius: 9px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.record-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.record-thumb {
  width: 42px;
  height: 46px;
  border-radius: 5px;
  border: 1px solid #d1d5db;
  object-fit: cover;
  background: #f3f4f6;
  flex-shrink: 0;
}

.record-thumb-empty {
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: #9ca3af;
}

.record-title {
  font-size: 14px;
  font-weight: 700;
  color: #111827;
}

.record-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.record-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.record-actions .btn {
  padding: 5px 10px;
  font-size: 12px;
}

.btn-danger-outline {
  background: #fff;
  color: #b91c1c;
  border-color: #fecaca;
}

.btn-danger-outline:hover {
  background: #fef2f2;
}

.empty-state {
  text-align: center;
  padding: 28px 12px;
  color: var(--muted);
  font-size: 13.5px;
}

/* ==================== ADMIN NAV, LOGIN & DASHBOARD ==================== */
.toolbar-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.role-badge {
  background: var(--brand-red);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.portal-mode-tabs {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.14);
  padding: 3px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.mode-btn {
  border: 0;
  background: transparent;
  color: #e2e8f0;
  font-size: 12.5px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.mode-btn:hover {
  color: #ffffff;
}

.mode-btn.active {
  background: #ffffff;
  color: var(--brand-navy-dark);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}

.admin-nav-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}

/* Full-screen Login Gate */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(circle at 18% 20%, rgba(207, 30, 32, 0.16), transparent 45%),
    radial-gradient(circle at 82% 80%, rgba(255, 255, 255, 0.08), transparent 45%),
    linear-gradient(135deg, #121b3d 0%, #23336b 60%, #18234b 100%);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: 14px;
  border-top: 5px solid var(--brand-red);
  box-shadow: 0 28px 60px rgba(10, 16, 40, 0.45);
  overflow: hidden;
}

.login-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 10px;
  background: var(--brand-navy-light);
  border-bottom: 1px solid #d9e1f2;
}

.login-header-center {
  justify-content: center;
  padding: 20px 20px 16px;
}

.login-logo-wrap {
  background: #ffffff;
  padding: 8px 16px;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(24, 35, 75, 0.12);
}

.login-logo-img {
  height: 44px;
  width: auto;
  display: block;
}

.login-dest-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.dest-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-navy-dark);
  background: #f8fafc;
  transition: border-color 0.15s, background 0.15s;
}

.dest-pill input[type="radio"] {
  width: auto;
  margin: 0;
  accent-color: var(--brand-red);
}

.dest-pill:has(input:checked) {
  border-color: var(--brand-navy);
  background: var(--brand-navy-light);
}

.login-body {
  padding: 18px 22px 22px;
}

.login-role-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: var(--brand-navy-light);
  border-radius: 10px;
  margin-bottom: 16px;
}

.role-tab-btn {
  border: 0;
  background: transparent;
  color: var(--brand-navy-dark);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.role-tab-btn:hover {
  background: rgba(255, 255, 255, 0.55);
}

.role-tab-btn.active {
  background: var(--brand-navy);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(24, 35, 75, 0.2);
}

.role-tab-btn[data-login-role="team"].active {
  background: var(--brand-red);
  box-shadow: 0 2px 8px rgba(207, 30, 32, 0.24);
}

.login-body h2 {
  margin: 0;
  font-size: 19px;
  color: var(--brand-navy-dark);
}

.login-sub {
  margin: 6px 0 16px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

.login-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 12.5px;
  font-weight: 600;
  padding: 9px 12px;
  border-radius: 8px;
  margin-bottom: 14px;
}

.login-form,
.settings-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-row label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-navy-dark);
}

.form-row input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.form-row input:focus {
  border-color: var(--brand-navy);
  box-shadow: 0 0 0 3px rgba(35, 51, 107, 0.12);
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.password-wrap input {
  padding-right: 60px;
}

.pw-toggle {
  position: absolute;
  right: 8px;
  border: 0;
  background: transparent;
  color: var(--brand-navy);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 6px;
}

.login-submit {
  width: 100%;
  justify-content: center;
  padding: 10px 14px;
  font-size: 13.5px;
  margin-top: 2px;
}

.default-creds-hint {
  margin-top: 14px;
  padding: 9px 12px;
  background: var(--brand-navy-light);
  border-radius: 8px;
  font-size: 12px;
  color: var(--brand-navy-dark);
  text-align: center;
}

/* Dashboard Shell */
.dashboard-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 26px 20px 56px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
}

.dashboard-eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--brand-red);
  margin-bottom: 4px;
}

.dashboard-top h2 {
  margin: 0;
  font-size: 24px;
  color: var(--brand-navy-dark);
}

.dashboard-sub {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.dashboard-top-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-dash-navy {
  background: var(--brand-navy);
  color: #ffffff;
}

.btn-dash-navy:hover {
  background: var(--brand-navy-dark);
}

.btn-dash-outline {
  background: #ffffff;
  color: var(--brand-navy-dark);
  border-color: #cbd5e1;
}

.btn-dash-outline:hover {
  background: #f1f5f9;
  border-color: var(--brand-navy);
}

/* KPI Grid */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kpi-card {
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 18px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 14px rgba(24, 35, 75, 0.06);
  display: flex;
  flex-direction: column;
  gap: 5px;
  border-top: 4px solid var(--brand-navy);
}

.kpi-card.kpi-red {
  border-top-color: var(--brand-red);
}

.kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--brand-navy-dark);
  line-height: 1.15;
}

.kpi-card.kpi-red .kpi-value {
  color: var(--brand-red);
}

.kpi-foot {
  font-size: 12px;
  color: var(--muted);
}

/* Dashboard Cards & Controls */
.dash-card {
  background: #ffffff;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 4px 16px rgba(24, 35, 75, 0.06);
  padding: 18px;
}

.dash-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dash-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  flex: 1 1 420px;
}

.dash-filters input[type="search"],
.dash-filters select {
  padding: 8px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #ffffff;
  color: #111827;
  outline: none;
}

.dash-filters input[type="search"] {
  flex: 1 1 240px;
}

.dash-filters input[type="search"]:focus,
.dash-filters select:focus {
  border-color: var(--brand-navy);
}

.dash-exports {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dash-table-wrap {
  overflow-x: auto;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
}

.dash-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 820px;
}

.dash-table th {
  background: var(--brand-navy);
  color: #ffffff;
  text-align: left;
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.dash-table th.right-align,
.dash-table td.right-align {
  text-align: right;
}

.dash-table td {
  padding: 10px 12px;
  border-top: 1px solid #e2e8f0;
  vertical-align: middle;
  color: #1e293b;
}

.dash-table tbody tr:hover {
  background: #f8fafe;
}

.dash-student-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dash-avatar {
  width: 38px;
  height: 42px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  object-fit: cover;
  background: #f1f5f9;
  flex-shrink: 0;
}

.dash-avatar-empty {
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-navy);
  background: var(--brand-navy-light);
}

.dash-main-text {
  font-weight: 700;
  color: var(--brand-navy-dark);
}

.dash-sub-text {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.dash-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--brand-navy-light);
  color: var(--brand-navy-dark);
}

.dash-fee-amount {
  font-weight: 700;
  color: #0f766e;
}

.dash-row-actions {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
}

.dash-row-actions .btn {
  padding: 5px 9px;
  font-size: 11.5px;
}

.dash-bottom-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}

.dash-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.dash-card-head h3 {
  margin: 0;
  font-size: 16px;
  color: var(--brand-navy-dark);
}

.dash-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--brand-navy-light);
  color: var(--brand-navy-dark);
}

.dash-pill-red {
  background: #fef2f2;
  color: var(--brand-red);
}

.software-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sw-bar-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sw-bar-label {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  color: #1e293b;
}

.sw-bar-track {
  height: 9px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.sw-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-navy), var(--brand-red));
}

.settings-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.settings-note {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted);
}

.settings-divider {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 18px 0 14px;
}

.settings-subhead {
  margin-bottom: 12px;
}

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

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-navy-dark);
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--brand-red);
}

.team-users-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-user-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
}

.team-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.team-user-id {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand-navy-dark);
}

.status-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
}

.status-pill.disabled {
  background: #fee2e2;
  color: #991b1b;
}

.team-user-actions {
  display: flex;
  gap: 6px;
}

.team-user-actions .btn {
  padding: 4px 8px;
  font-size: 11px;
}

/* ==================== RESPONSIVE SCREEN VIEW ==================== */
@media (max-width: 960px) {
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-bottom-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .workspace {
    align-items: flex-start;
    overflow-x: auto;
  }
}

@media (max-width: 560px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ==================== PRINT STYLES (EXACT A4) ==================== */
@page {
  size: A4 portrait;
  margin: 8mm;
}

@media print {

  html,
  body {
    background: #fff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .no-print {
    display: none !important;
  }

  .workspace {
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    display: block !important;
  }

  /* Control which pages print based on body[data-print-mode] */
  body[data-print-mode="front"] #page-back {
    display: none !important;
  }

  body[data-print-mode="back"] #page-front {
    display: none !important;
  }

  body[data-print-mode="front"] #page-front,
  body[data-print-mode="back"] #page-back,
  body[data-print-mode="both"] .a4-sheet {
    display: block !important;
  }

  .a4-sheet {
    width: 100% !important;
    min-height: auto !important;
    padding: 2mm 3mm !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    page-break-after: always;
    break-after: page;
  }

  .a4-sheet:last-of-type {
    page-break-after: auto;
    break-after: auto;
  }

  body[data-print-mode="front"] #page-front,
  body[data-print-mode="back"] #page-back {
    page-break-after: auto;
    break-after: auto;
  }

  .photo-box {
    background: #fff !important;
    border-color: var(--line) !important;
  }

  .inline-field input:focus,
  .cell-input:focus,
  .terms-date-wrap input:focus {
    background: transparent !important;
    box-shadow: none !important;
  }
}