/* pushed1 ==================== GLOBAL STYLES ==================== */

:root {
  --bg-base: #0f172a;
  --bg-panel: rgba(255, 255, 255, 0.92);
  --bg-panel-strong: rgba(255, 255, 255, 0.98);
  --border-subtle: rgba(255, 255, 255, 0.35);
  --shadow-soft: 0 10px 40px rgba(15, 23, 42, 0.18);
  --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.12);
  --text-strong: #0f172a;
  --text-muted: #475569;
  --primary: #6b8bff;
  --primary-strong: #4c6fff;
  --primary-soft: rgba(108, 139, 255, 0.16);
  --accent: #10b981;
}

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

body {
  font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(circle at 20% 20%, rgba(108, 139, 255, 0.22), transparent 28%),
              radial-gradient(circle at 80% 0%, rgba(16, 185, 129, 0.18), transparent 26%),
              linear-gradient(135deg, #0f172a 0%, #0b1020 55%, #0f172a 100%);
  color: #03111f;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button {
  border-radius: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #061831;
  padding: 10px 14px;
  min-height: 36px;
  line-height: 1.2;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.14);
  transition: all 0.2s ease;
}

button:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.28);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.18);
}

button:active {
  transform: translateY(1px) scale(0.995);
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}

html, body, #root {
  height: 100%;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  overscroll-behavior-x: none;
}

/* Safer desktop compacting without viewport-height side effects. */
@media (min-width: 1200px) {
  html {
    font-size: 92%;
  }
}

/* ==================== TYPOGRAPHY ==================== */

h1 {
  font-size: 32px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 12px;
}

h2 {
  font-size: 28px;
  font-weight: 700;
  color: #3a7dd5;
  margin-bottom: 10px;
}

h3 {
  font-size: 22px;
  font-weight: 600;
  color: #121e2e;
  margin-bottom: 8px;
}

h4 {
  font-size: 16px;
  font-weight: 600;
  color: #121e2e;
  margin-bottom: 6px;
}

p {
  font-size: 14px;
  color: #121e2e;
  margin-bottom: 8px;
}

/* ==================== CONTAINERS & LAYOUT ==================== */

.container {
  max-width: 100%;
  margin: 0;
  padding: 20px;
}

.card {
  background: var(--bg-panel);
  border-radius: 12px;
  padding: 18px;
  box-shadow: var(--shadow-card);
  transition: all 0.25s ease;
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(6px);
}

.card:hover {
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.16);
  transform: translateY(-1px);
}

.card-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.6);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-body {
  padding: 18px;
}

.card-footer {
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.7);
  border-top: 1px solid var(--border-subtle);
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==================== BUTTONS ==================== */

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.btn-primary {
  background: linear-gradient(135deg, #6b8bff 0%, #4c6fff 100%);
  color: white;
  border: 1px solid rgba(76, 111, 255, 0.8);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #5f7ff7 0%, #3f62f3 100%);
  box-shadow: 0 10px 20px rgba(91, 118, 255, 0.35);
  border-color: rgba(76, 111, 255, 0.95);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.99);
}

.btn-secondary {
  background: #e0e0e0;
  color: #0f172a;
}

.btn-secondary:hover {
  background: #d0d0d0;
}

.btn-success {
  background: #4CAF50;
  color: white;
}

.btn-success:hover {
  background: #45a049;
}

.btn-danger {
  background: #f44336;
  color: white;
}

.btn-danger:hover {
  background: #da190b;
}

.btn-warning {
  background: #FF9800;
  color: white;
}

.btn-warning:hover {
  background: #e68900;
}

.btn-info {
  background: #2196F3;
  color: white;
}

.btn-info:hover {
  background: #0b7dda;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 28px;
  font-size: 16px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ==================== FORM ELEMENTS ==================== */

.form-group {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

input, select, textarea {
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  color: var(--text-strong);
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft), 0 10px 24px rgba(15, 23, 42, 0.12);
}

textarea {
  resize: vertical;
  min-height: 120px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-panel);
  box-shadow: var(--shadow-soft);
  border-radius: 12px;
  overflow: hidden;
}

table th, table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 13px;
  color: var(--text-strong);
}

table thead th {
  background: rgba(108, 139, 255, 0.08);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  font-size: 12px;
}

table tbody tr:hover {
  background: rgba(108, 139, 255, 0.06);
}

.form-label {
  font-weight: 600;
  color: #121e2e;
  margin-bottom: 8px;
  font-size: 14px;
}

.form-control {
  padding: 10px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
  color: #64748b;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

select.form-control {
  cursor: pointer;
}

.form-control:disabled {
  background: #f5f5f5;
  color: #475569;
  cursor: not-allowed;
}

.form-control-inline {
  display: flex;
  gap: 10px;
  align-items: center;
}

.form-control-inline input,
.form-control-inline select {
  flex: 1;
}

/* ==================== INPUT VARIATIONS ==================== */

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
textarea,
select {
  width: 100%;
}

input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
  margin-right: 8px;
}

.checkbox-group,
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkbox-item,
.radio-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ==================== TABLES ==================== */

.table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.table th {
  background: #2c3e50;
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: 600;
  border-bottom: 2px solid #1a252f;
}

.table td {
  padding: 12px;
  border-bottom: 1px solid #e0e0e0;
}

.table tbody tr {
  transition: all 0.2s ease;
}

.table tbody tr:hover {
  background: #f9f9f9;
}

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

.table-striped tbody tr:nth-child(odd) {
  background: #f9f9f9;
}

.table-sm th,
.table-sm td {
  padding: 8px;
  font-size: 13px;
}

/* ==================== MODALS ==================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60000;
  padding: 20px;
}

/** Confirm/alert/prompt from AppDialogProvider — above page modals and Developer Control Center. */
.app-dialog-overlay {
  z-index: 2147483647;
}

/** Page-owned modals (below app-dialog-overlay at 70000). */
.app-page-modal-overlay,
.staff-attendance-settings-overlay {
  position: fixed;
  inset: 0;
  z-index: 16000;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.staff-mark-attendance-overlay {
  overflow-x: hidden;
}

.staff-ask-time-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin: 0;
  padding: 8px 12px;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  background: #eff6ff;
  color: #0f172a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
  white-space: nowrap;
}

.staff-ask-time-tick {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  flex: 0 0 auto;
  accent-color: #1d4ed8;
}

.staff-mark-attendance-overlay .ilm-modal-panel {
  width: calc(100vw - 48px);
  max-width: calc(100vw - 48px);
}

.staff-mark-attendance-overlay .staff-mark-attendance-modal {
  width: 100%;
  max-width: 100%;
}

.staff-mark-attendance-calendar-strip {
  width: 100%;
  max-width: 100%;
  scrollbar-gutter: stable;
}

.staff-mark-attendance-calendar-strip::-webkit-scrollbar {
  height: 6px;
}

.staff-mark-attendance-calendar-strip::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

/* Attendance history: date header scrolls horizontally with body, but never vertically. */
.staff-attendance-history-hscroll {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.staff-attendance-history-hscroll::-webkit-scrollbar {
  display: none;
  height: 0;
  width: 0;
}

/* Left frozen pane: hide scrollbar; vertical scroll syncs from the right pane. */
.staff-attendance-history-left-scroll {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.staff-attendance-history-left-scroll::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

/** Vehicle dashboard on Transportation — overlay only the main content pane (not the sidebar). */
.transport-vehicle-dashboard-backdrop {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 72px;
  z-index: 12000;
  background: rgba(15, 23, 42, 0.44);
}

.transport-vehicle-dashboard-shell {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 72px;
  z-index: 12001;
  padding: 34px 24px;
  overflow: hidden;
  display: block;
  box-sizing: border-box;
}

.transport-vehicle-dashboard-shell-scroll {
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
  padding-right: 6px;
  padding-bottom: 12px;
}

@media (max-width: 900px) {
  .transport-vehicle-dashboard-backdrop,
  .transport-vehicle-dashboard-shell {
    left: 66px;
  }
}

.modal {
  background: white;
  border-radius: 12px;
  max-width: 600px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal-header {
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.modal-header h2 {
  color: white;
  margin: 0;
}

.modal-close-btn {
  background: rgba(255, 255, 255, 0.25);
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.4);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  background: #f5f5f5;
  border-top: 1px solid #e0e0e0;
  border-bottom-left-radius: 12px;
  border-bottom-right-radius: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ==================== ALERTS & MESSAGES ==================== */

.alert {
  padding: 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeIn 0.3s ease;
}

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

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-warning {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.alert-info {
  background: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

.message {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

.message-success {
  background: #4CAF50;
  color: white;
}

.message-error {
  background: #f44336;
  color: white;
}

.message-warning {
  background: #FF9800;
  color: white;
}

.message-info {
  background: #2196F3;
  color: white;
}

/* ==================== BADGES & TAGS ==================== */

.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-primary {
  background: #667eea;
  color: white;
}

.badge-success {
  background: #4CAF50;
  color: white;
}

.badge-danger {
  background: #f44336;
  color: white;
}

.badge-warning {
  background: #FF9800;
  color: white;
}

.badge-info {
  background: #2196F3;
  color: white;
}

.badge-secondary {
  background: #e0e0e0;
  color: #0f172a;
}

.tag {
  display: inline-block;
  padding: 6px 12px;
  margin-right: 6px;
  margin-bottom: 6px;
  background: #f0f0f0;
  color: #0f172a;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid #e0e0e0;
}

.tag:hover {
  background: #e0e0e0;
}

/* ==================== TABS ==================== */

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: #f5f5f5;
  padding: 4px;
  border-radius: 8px;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 16px;
  background: transparent;
  color: #121e2e;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  text-transform: capitalize;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: rgba(102, 126, 234, 0.1);
}

.tab-btn.active {
  background: #667eea;
  color: white;
}

.tab-content {
  animation: fadeIn 0.3s ease;
}

/* ==================== GRID LAYOUTS ==================== */

.grid {
  display: grid;
  gap: 20px;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.flex {
  display: flex;
  gap: 10px;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

/* ==================== SPACING ==================== */

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mt-5 { margin-top: 32px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mb-5 { margin-bottom: 32px; }

.mx-1 { margin-left: 4px; margin-right: 4px; }
.mx-2 { margin-left: 8px; margin-right: 8px; }
.mx-3 { margin-left: 16px; margin-right: 16px; }
.mx-4 { margin-left: 24px; margin-right: 24px; }

.my-1 { margin-top: 4px; margin-bottom: 4px; }
.my-2 { margin-top: 8px; margin-bottom: 8px; }
.my-3 { margin-top: 16px; margin-bottom: 16px; }
.my-4 { margin-top: 24px; margin-bottom: 24px; }

.p-1 { padding: 4px; }
.p-2 { padding: 8px; }
.p-3 { padding: 16px; }
.p-4 { padding: 24px; }
.p-5 { padding: 32px; }

.px-1 { padding-left: 4px; padding-right: 4px; }
.px-2 { padding-left: 8px; padding-right: 8px; }
.px-3 { padding-left: 16px; padding-right: 16px; }
.px-4 { padding-left: 24px; padding-right: 24px; }

.py-1 { padding-top: 4px; padding-bottom: 4px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.py-3 { padding-top: 16px; padding-bottom: 16px; }
.py-4 { padding-top: 24px; padding-bottom: 24px; }

/* ==================== TEXT UTILITIES ==================== */

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

.text-primary { color: #667eea; }
.text-secondary { color: #64748b; }
.text-success { color: #4CAF50; }
.text-danger { color: #f44336; }
.text-warning { color: #FF9800; }
.text-info { color: #2196F3; }
.text-muted { color: #475569; }

.text-bold { font-weight: 700; }
.text-semi-bold { font-weight: 600; }
.text-normal { font-weight: 400; }
.text-light { font-weight: 300; }

.text-sm { font-size: 12px; }
.text-base { font-size: 14px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.text-2xl { font-size: 24px; }

.text-uppercase { text-transform: uppercase; }
.text-lowercase { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }

.text-nowrap { white-space: nowrap; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==================== BORDERS & SHADOWS ==================== */

.border {
  border: 1px solid #e0e0e0;
}

.border-top {
  border-top: 1px solid #e0e0e0;
}

.border-bottom {
  border-bottom: 1px solid #e0e0e0;
}

.border-left {
  border-left: 1px solid #e0e0e0;
}

.border-right {
  border-right: 1px solid #e0e0e0;
}

.rounded {
  border-radius: 6px;
}

.rounded-lg {
  border-radius: 10px;
}

.rounded-full {
  border-radius: 9999px;
}

.shadow-sm {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.shadow-md {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.shadow-lg {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ==================== DISPLAYS ==================== */

.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-scroll { overflow: scroll; }

/* ==================== RESPONSIVE ==================== */

@media (max-width: 768px) {
  .container {
    padding: 10px;
  }

  h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 20px;
  }

  h3 {
    font-size: 18px;
  }

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

  .grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  .table-sm {
    font-size: 12px;
  }

  .btn-sm {
    padding: 6px 10px;
    font-size: 11px;
  }

  .flex-column-mobile {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 20px;
  }

  h2 {
    font-size: 18px;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .btn {
    padding: 8px 16px;
    font-size: 13px;
  }

  .card {
    padding: 12px;
  }

  .tabs {
    flex-direction: column;
  }

  .tab-btn {
    width: 100%;
    text-align: left;
  }

  .modal {
    max-width: calc(100% - 20px);
  }
}

/* ==================== PRINT STYLES ==================== */

@media print {
  body {
    background: white;
  }

  .no-print {
    display: none;
  }

  .card {
    box-shadow: none;
    border: 1px solid #000;
    page-break-inside: avoid;
  }

  .btn,
  .modal-overlay,
  .tabs {
    display: none;
  }
}

/* ==================== ANIMATIONS ==================== */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.spin {
  animation: spin 1s linear infinite;
}

.pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.bounce {
  animation: bounce 1s infinite;
}

/* ==================== SCROLLBAR STYLING ==================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ==================== SELECTION STYLING ==================== */

::selection {
  background: #667eea;
  color: white;
}

::-moz-selection {
  background: #667eea;
  color: white;
}

/* ==================== PLACEHOLDER STYLING ==================== */

::placeholder {
  color: #64748b;
  opacity: 1;
}

::-moz-placeholder {
  color: #64748b;
  opacity: 1;
}

:-ms-input-placeholder {
  color: #64748b;
}

::-ms-input-placeholder {
  color: #64748b;
}

/* ==================== TASKS PAGE ==================== */

.tasks-page {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
  max-width: 100%;
  overflow: hidden;
  height: 100%;
}

.tasks-page.tasks-page--mobile {
  overflow: visible;
}

.tasks-page-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.tasks-page-header h1 {
  margin: 0;
  color: var(--text-strong);
}

.tasks-page-subtitle {
  color: #64748b;
  font-size: 13px;
  margin-top: 4px;
}

.tasks-btn-primary {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.tasks-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.tasks-filter-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
}

.tasks-filter-pill.active {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1d4ed8;
}

.tasks-toolbar select,
.tasks-toolbar input[type="search"],
.tasks-toolbar input[type="text"] {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  min-height: 36px;
}

.tasks-search {
  margin-left: auto;
  min-width: 220px;
}

.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 14px;
  align-items: start;
}

.tasks-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
  flex: 1;
  align-items: stretch;
}

.tasks-left-menu,
.tasks-center-panel,
.tasks-chat-panel {
  min-height: 0;
  max-height: calc(100vh - 210px);
}

.tasks-left-menu {
  grid-column: 1 / -1;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  overflow-x: auto;
  overflow-y: hidden;
  max-height: none;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.55) transparent;
  scroll-snap-type: x proximity;
}

.tasks-left-menu::-webkit-scrollbar {
  height: 8px;
}

.tasks-left-menu::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.45);
  border-radius: 999px;
}

.tasks-left-empty {
  padding: 12px;
  color: #64748b;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.tasks-left-items {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 10px;
  width: max-content;
  min-width: 100%;
  padding-bottom: 4px;
}

.tasks-left-item {
  flex: 0 0 240px;
  width: 240px;
  max-width: 240px;
  min-width: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  border-radius: 12px;
  padding: 12px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  box-shadow: none;
  overflow: hidden;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  scroll-snap-align: start;
}

.tasks-left-item:hover {
  border-color: rgba(37, 99, 235, 0.25);
  background: rgba(219, 234, 254, 0.45);
}

.tasks-left-item.is-active {
  border-color: #2563eb;
  background: #dbeafe;
}

.tasks-left-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.tasks-left-item-title {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 900;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: none;
}

.tasks-left-item-top .tasks-unread-badge {
  flex-shrink: 0;
}

.tasks-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 0;
  width: 100%;
  min-width: 0;
}

.tasks-item-meta-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tasks-item-meta-tag--calendar {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.tasks-item-meta-tag--management {
  border-color: #ddd6fe;
  background: #f5f3ff;
  color: #6d28d9;
}

.tasks-item-meta-tag--person {
  border-color: #e2e8f0;
  background: #f8fafc;
  color: #475569;
}

.tasks-item-meta-tag--due {
  border-color: #fde68a;
  background: #fffbeb;
  color: #b45309;
}

.tasks-item-meta-line,
.tasks-mobile-picker-item-sub,
.tasks-left-item-creator,
.tasks-left-item-due {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  color: #64748b;
  letter-spacing: 0.01em;
  text-transform: none;
}

.tasks-center-panel {
  min-width: 0;
  overflow: auto;
}

.tasks-chat-panel {
  display: flex;
  flex-direction: column;
  background: #e8eef5;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.tasks-chat-header {
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}

.tasks-chat-header-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.tasks-chat-header-text {
  min-width: 0;
  flex: 1;
}

.tasks-chat-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.tasks-chat-subtitle {
  margin-top: 2px;
  font-size: 12px;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tasks-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background:
    radial-gradient(circle at 12% 18%, rgba(148, 163, 184, 0.12), transparent 35%),
    radial-gradient(circle at 88% 70%, rgba(100, 116, 139, 0.1), transparent 40%),
    #e8eef5;
}

.tasks-chat-empty,
.tasks-chat-empty-thread {
  margin: auto;
  text-align: center;
  color: #64748b;
  font-size: 13px;
  font-weight: 650;
  padding: 18px;
}

.tasks-chat-bubble-row {
  display: flex;
  width: 100%;
}

.tasks-chat-bubble-row.is-mine {
  justify-content: flex-end;
}

.tasks-chat-bubble-row.is-theirs {
  justify-content: flex-start;
}

.tasks-chat-bubble {
  max-width: min(88%, 280px);
  padding: 8px 10px 6px;
  border-radius: 14px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.tasks-chat-bubble.is-mine {
  background: #dcf8c6;
  border-bottom-right-radius: 4px;
  color: #0f172a;
}

.tasks-chat-bubble.is-theirs {
  background: #fff;
  border-bottom-left-radius: 4px;
  color: #0f172a;
}

.tasks-chat-bubble-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.tasks-chat-author {
  font-size: 11px;
  font-weight: 800;
  color: #1d4ed8;
}

.tasks-chat-bubble.is-mine .tasks-chat-author {
  color: #166534;
}

.tasks-chat-msg-actions {
  position: relative;
  flex-shrink: 0;
}

.tasks-chat-msg-more {
  border: none !important;
  background: transparent !important;
  color: #64748b !important;
  min-height: 20px !important;
  min-width: 22px;
  padding: 0 4px !important;
  box-shadow: none !important;
  font-size: 16px;
  line-height: 1;
}

.tasks-chat-msg-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 5;
  min-width: 160px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  padding: 4px;
  display: grid;
}

.tasks-chat-msg-menu button {
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  text-align: left;
  justify-content: flex-start;
  padding: 8px 10px !important;
  min-height: 0 !important;
  border-radius: 8px !important;
  font-size: 12px;
  color: #0f172a;
}

.tasks-chat-msg-menu button:hover {
  background: #f1f5f9 !important;
}

.tasks-chat-msg-menu button.is-danger {
  color: #b91c1c;
}

.tasks-chat-bubble.is-deleted {
  opacity: 0.9;
  background: #f8fafc !important;
  font-style: italic;
}

.tasks-chat-deleted {
  font-size: 12px;
  color: #64748b;
  font-style: italic;
}

.tasks-chat-mention {
  display: inline;
  color: #1d4ed8;
  font-weight: 800;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 4px;
  padding: 0 3px;
}

.tasks-chat-edit-box {
  display: grid;
  gap: 6px;
}

.tasks-chat-edit-box input {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
}

.tasks-chat-edit-actions {
  display: flex;
  gap: 6px;
}

.tasks-chat-edit-actions button {
  min-height: 28px !important;
  padding: 4px 10px !important;
  border-radius: 8px !important;
  border: 1px solid #cbd5e1 !important;
  background: #fff !important;
  box-shadow: none !important;
  font-size: 12px;
}

.tasks-chat-mention-menu {
  max-height: 180px;
  overflow: auto;
  margin: 8px 10px 0;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.tasks-chat-mention-heading {
  padding: 8px 10px 4px;
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tasks-chat-mention-item {
  width: 100%;
  display: flex;
  gap: 8px;
  align-items: center;
  border: none !important;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 8px 10px !important;
  min-height: 0 !important;
  text-align: left;
  justify-content: flex-start;
  color: #0f172a;
  font-size: 13px;
}

.tasks-chat-mention-item.is-active,
.tasks-chat-mention-item:hover {
  background: #eff6ff !important;
}

.tasks-chat-mention-type {
  font-size: 10px;
  font-weight: 800;
  color: #1d4ed8;
  background: #dbeafe;
  border-radius: 999px;
  padding: 2px 6px;
  text-transform: uppercase;
}

.tasks-chat-text {
  font-size: 13px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.tasks-chat-time {
  margin-top: 4px;
  font-size: 10px;
  color: #64748b;
  text-align: right;
}

.tasks-chat-composer {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding: 10px;
  background: #fff;
  border-top: 1px solid #e2e8f0;
}

.tasks-chat-composer-wrap {
  background: #fff;
  border-top: 1px solid #e2e8f0;
}

.tasks-chat-composer input:not([type='file']),
.tasks-chat-composer .tasks-chat-composer-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border-radius: 16px;
  border: 1px solid #cbd5e1;
  padding: 10px 14px;
  background: #f8fafc;
  font-size: 13px;
  line-height: 1.4;
  resize: none;
  overflow-y: auto;
  min-height: 40px;
  max-height: 160px;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  field-sizing: content;
}

.tasks-chat-composer button {
  border-radius: 999px !important;
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  font-weight: 700;
  padding: 8px 14px;
  min-height: 36px;
  box-shadow: none;
  flex-shrink: 0;
}

.tasks-chat-composer button:disabled {
  opacity: 0.45;
}

.tasks-chat-attach-btn {
  border: 1px solid #cbd5e1 !important;
  background: #f8fafc !important;
  color: #334155 !important;
  min-width: 40px;
  padding: 8px 10px !important;
  font-size: 16px;
}

.tasks-chat-pending {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 10px 10px 0;
}

.tasks-chat-pending-item {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tasks-chat-pending-item img,
.tasks-chat-pending-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tasks-chat-pending-file {
  font-size: 10px;
  font-weight: 700;
  color: #334155;
  padding: 4px;
  text-align: center;
  word-break: break-word;
  max-height: 100%;
  overflow: hidden;
}

.tasks-chat-pending-item button {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  min-height: 20px;
  padding: 0;
  border-radius: 999px !important;
  border: none;
  background: rgba(15, 23, 42, 0.75);
  color: #fff;
  font-size: 12px;
  box-shadow: none;
}

.tasks-chat-error {
  padding: 6px 12px 0;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 650;
}

.tasks-chat-attachments {
  display: grid;
  gap: 6px;
  margin-bottom: 6px;
}

.tasks-chat-media {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  max-width: 100%;
}

.tasks-chat-media img,
.tasks-chat-media video {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  background: #0f172a;
}

.tasks-chat-media--video video {
  object-fit: contain;
  background: #000;
}

.tasks-chat-file {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.06);
  color: #1d4ed8;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}

.tasks-chat-file:hover {
  text-decoration: underline;
}

.tasks-chat-file-icon {
  font-size: 14px;
}

.tasks-chat-file-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tasks-chat-locked {
  padding: 10px 12px;
  font-size: 12px;
  color: #64748b;
  background: #fff;
  border-top: 1px solid #e2e8f0;
  text-align: center;
}

.tasks-detail-panel {
  width: 100%;
  max-width: 100%;
}

.tasks-detail-header--inline,
.tasks-detail-header--stacked {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 12px;
}

.tasks-detail-heading-block {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.tasks-detail-heading-wrap {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

.tasks-detail-heading {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tasks-detail-heading-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-width: 0;
}

.tasks-detail-heading-meta-line {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  color: #64748b;
  letter-spacing: 0.01em;
}

.tasks-detail-heading-meta-line.is-overdue {
  color: #b91c1c;
  font-weight: 700;
}

.tasks-detail-users-inline {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.tasks-detail-users-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.tasks-detail-users-inline .tasks-people-picker,
.tasks-detail-users-inline .tasks-card-people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tasks-detail-header-end {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}

.tasks-detail-roles-inline {
  font-size: 11px;
  font-weight: 500;
  color: #64748b;
  white-space: nowrap;
}

.tasks-detail-heading-wrap .tasks-modal-close {
  margin-left: auto;
  flex-shrink: 0;
}

.tasks-detail-meta-row {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(120px, 0.7fr) minmax(140px, 0.7fr);
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}

.tasks-field--row {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.tasks-field--row > span {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.tasks-field--row input,
.tasks-field--row select {
  width: 100%;
  min-height: 36px;
}

.tasks-card {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  display: grid;
  gap: 10px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.tasks-card-header {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.tasks-card-title {
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
  font-weight: 800;
  font-size: 16px;
  color: #0f172a;
  cursor: pointer;
  box-shadow: none;
  min-height: 0;
}

.tasks-card-title:hover {
  color: #1d4ed8;
  background: transparent;
  transform: none;
}

.tasks-card-more {
  border: 1px solid #dbeafe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  min-height: 0;
  border-radius: 999px;
  box-shadow: none;
}

.tasks-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.tasks-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.tasks-card-due {
  font-size: 12px;
  color: #64748b;
  margin-left: 2px;
}

.tasks-card-field,
.tasks-card-section {
  display: grid;
  gap: 6px;
}

.tasks-card-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.tasks-card-label {
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tasks-card-meta {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 700;
}

.tasks-card-textarea,
.tasks-field textarea,
.tasks-field input,
.tasks-field select,
.tasks-inline-form input {
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #dbeafe;
  background: #f8fafc;
  font-family: inherit;
  font-size: 13px;
  color: #0f172a;
}

.tasks-card-textarea:focus,
.tasks-field textarea:focus,
.tasks-field input:focus,
.tasks-field select:focus,
.tasks-inline-form input:focus {
  outline: none;
  border-color: #60a5fa;
  background: #fff;
}

.tasks-checklist {
  display: grid;
  gap: 14px;
  overflow: visible;
}

.tasks-checklist-partition {
  display: grid;
  gap: 8px;
}

.tasks-checklist-partition-title {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.02em;
  color: #334155;
  padding: 4px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.tasks-checklist-partition-items {
  display: grid;
  gap: 8px;
}

.tasks-checklist-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.tasks-checklist-section-head .tasks-card-label {
  margin-bottom: 0;
}

.tasks-checklist-count {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.tasks-checklist-head-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tasks-checklist-all-docs-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: none;
}

.tasks-checklist-all-docs-btn span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
}

.tasks-checklist-all-docs-btn:active {
  transform: scale(0.97);
}

.tasks-checklist-add-fab {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.28);
  flex-shrink: 0;
}

.tasks-checklist-add-fab:active {
  transform: scale(0.96);
}

.tasks-checklist-empty {
  padding: 16px 12px;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #64748b;
  font-size: 13px;
  text-align: center;
}

.tasks-more-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid #dbe3f0;
  background: #fff;
  color: #0f172a;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  box-shadow: none;
  transition: transform 0.12s ease, background 0.12s ease;
}

.tasks-more-btn:active {
  transform: scale(0.94);
  background: #f1f5f9;
}

.tasks-detail-heading-meta--tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tasks-info-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  font-family: inherit;
}

button.tasks-info-tag {
  cursor: pointer;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 0.12s ease, filter 0.12s ease;
}

button.tasks-info-tag:active {
  transform: scale(0.96);
  filter: brightness(0.97);
}

.tasks-info-tag-caret {
  font-size: 9px;
  opacity: 0.72;
  font-weight: 700;
}

.tasks-info-tag--due.is-overdue {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

.tasks-info-tag--due.is-empty {
  border-style: dashed;
  color: #94a3b8;
  font-weight: 700;
}

.tasks-info-tag--calendar {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.tasks-details-preview {
  width: 100%;
  text-align: left;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px;
  display: grid;
  gap: 6px;
  cursor: pointer;
  box-shadow: none;
}

.tasks-field-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.tasks-details-preview-text {
  font-size: 14px;
  font-weight: 650;
  color: #0f172a;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.tasks-details-preview-text.is-empty {
  color: #94a3b8;
  font-weight: 600;
}

.tasks-details-textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border-radius: 12px;
  border: 1px solid #dbe3f0;
  background: #f8fafc;
  padding: 12px;
  font-size: 16px;
  font-family: inherit;
  color: #0f172a;
}

.tasks-action-sheet-list {
  display: grid;
  gap: 8px;
}

.tasks-action-sheet-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  padding: 14px 14px;
  cursor: pointer;
  box-shadow: none;
  transition: transform 0.12s ease, background 0.12s ease;
}

.tasks-action-sheet-item:active {
  transform: scale(0.985);
  background: #f8fafc;
}

.tasks-action-sheet-item-main {
  display: grid;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.tasks-action-sheet-item strong {
  display: block;
  font-size: 14px;
  color: #0f172a;
}

.tasks-action-sheet-item em {
  display: block;
  font-size: 11px;
  font-style: normal;
  color: #94a3b8;
  font-weight: 600;
}

.tasks-action-sheet-item > span {
  display: block;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  text-align: right;
  max-width: 42%;
  flex-shrink: 0;
}

.tasks-action-sheet-item.is-active {
  border-color: #2563eb;
  background: #eff6ff;
}

.tasks-action-sheet-item.is-danger strong {
  color: #b91c1c;
}

.tasks-action-sheet-item.is-danger span {
  color: #f87171;
}

.tasks-action-sheet-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.tasks-action-sheet-empty {
  padding: 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 13px;
}

.tasks-detail-footer-hint {
  font-size: 11px;
  color: #94a3b8;
  font-weight: 600;
  max-width: 60%;
  line-height: 1.35;
}

.tasks-checklist-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 13050;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(15, 23, 42, 0.42);
}

.tasks-checklist-modal-sheet {
  width: min(520px, 100%);
  max-height: min(88vh, 640px);
  border-radius: 22px 22px 0 0;
  background: #fff;
  box-shadow: 0 -18px 40px rgba(15, 23, 42, 0.22);
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
  overflow: auto;
}

.tasks-checklist-modal-handle {
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: #cbd5e1;
  margin: 4px auto 12px;
}

.tasks-checklist-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.tasks-checklist-modal-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}

.tasks-checklist-modal-header h3 {
  margin: 2px 0 0;
  font-size: 1.2rem;
  color: #0f172a;
}

.tasks-checklist-modal-form {
  display: grid;
  gap: 12px;
}

.tasks-checklist-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

@media (min-width: 721px) {
  .tasks-checklist-modal-overlay {
    align-items: center;
    padding: 16px;
  }

  .tasks-checklist-modal-sheet {
    border-radius: 18px;
    padding: 18px;
  }

  .tasks-checklist-modal-handle {
    display: none;
  }
}

.tasks-checklist-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.tasks-checklist-add-form input[type='datetime-local'] {
  min-width: 0;
}

.tasks-checklist-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 0.85fr);
  gap: 10px;
  align-items: center;
  overflow: visible;
  position: relative;
  z-index: 1;
}

.tasks-checklist-row:has(.tasks-checklist-menu) {
  z-index: 5;
}

.tasks-checklist-main {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  overflow: visible;
}

.tasks-checklist-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 14px;
  font-weight: 650;
  color: #0f172a;
  line-height: 1.35;
  min-width: 0;
  flex: 1;
}

.tasks-checklist-item input[type='checkbox'] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #2563eb;
}

.tasks-checklist-tag-btn {
  border: 1px solid #bfdbfe !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  min-height: 26px !important;
  min-width: 28px;
  padding: 0 6px !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.tasks-checklist-tag-btn:hover {
  background: #dbeafe !important;
}

.tasks-checklist-actions {
  position: relative;
  flex-shrink: 0;
  align-self: flex-start;
  z-index: 2;
}

.tasks-checklist-pin {
  position: relative;
  flex-shrink: 0;
  align-self: flex-start;
  z-index: 3;
}

.tasks-checklist-pin-btn {
  position: relative;
  border: none !important;
  background: transparent !important;
  color: #64748b !important;
  min-height: 28px !important;
  min-width: 28px;
  padding: 0 4px !important;
  box-shadow: none !important;
  font-size: 14px;
  line-height: 1;
  border-radius: 8px !important;
  cursor: pointer;
}

.tasks-checklist-pin.has-files .tasks-checklist-pin-btn,
.tasks-checklist-pin-btn:hover {
  color: #b45309 !important;
  background: #fffbeb !important;
}

.tasks-checklist-pin-count {
  position: absolute;
  top: -4px;
  right: -2px;
  min-width: 14px;
  height: 14px;
  padding: 0 3px;
  border-radius: 999px;
  background: #ea580c;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 14px;
  text-align: center;
}

.tasks-checklist-pin-hover {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: 220px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  padding: 10px;
  cursor: pointer;
}

.tasks-checklist-pin-hover-title {
  font-size: 11px;
  font-weight: 900;
  color: #0f172a;
  margin-bottom: 8px;
}

.tasks-checklist-pin-hover-list {
  display: grid;
  gap: 6px;
}

.tasks-checklist-pin-hover-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.tasks-checklist-pin-hover-item img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

.tasks-checklist-pin-hover-item > span:first-child {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  background: #f1f5f9;
  border-radius: 6px;
  flex-shrink: 0;
  font-size: 12px;
}

.tasks-checklist-pin-hover-name {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tasks-checklist-pin-hover-more,
.tasks-checklist-pin-hover-hint {
  margin-top: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #94a3b8;
}

.tasks-checklist-pin-modal-card {
  width: min(420px, calc(100vw - 32px));
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
}

.tasks-checklist-pin-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.tasks-checklist-pin-modal-kicker {
  font-size: 11px;
  font-weight: 800;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tasks-checklist-pin-modal-title {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.3;
}

.tasks-checklist-pin-empty {
  padding: 18px 8px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
  font-weight: 650;
}

.tasks-checklist-pin-modal-list {
  display: grid;
  gap: 8px;
  max-height: min(360px, 50vh);
  overflow: auto;
  margin-bottom: 12px;
}

.tasks-checklist-pin-file {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  min-width: 0;
}

.tasks-checklist-pin-thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: #e2e8f0;
  flex-shrink: 0;
  text-decoration: none;
  color: #334155;
}

.tasks-checklist-pin-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tasks-checklist-pin-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.tasks-checklist-pin-name:hover {
  color: #2563eb;
  text-decoration: underline;
}

.tasks-checklist-pin-remove {
  border: none !important;
  background: transparent !important;
  color: #b91c1c !important;
  min-height: 28px !important;
  min-width: 28px;
  padding: 0 !important;
  box-shadow: none !important;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.tasks-checklist-pin-error {
  margin-bottom: 10px;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 700;
}

.tasks-docs-viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 14050;
  background: rgba(15, 23, 42, 0.72);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: env(safe-area-inset-top) 0 0;
}

.tasks-docs-viewer-shell {
  width: min(720px, 100%);
  height: 100%;
  background: #0b1220;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.35);
}

.tasks-docs-viewer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, #111827 0%, #0b1220 100%);
}

.tasks-docs-viewer-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #93c5fd;
}

.tasks-docs-viewer-header h2 {
  margin: 2px 0 4px;
  font-size: 22px;
  color: #fff;
}

.tasks-docs-viewer-header p {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
}

.tasks-docs-viewer-close {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
}

.tasks-docs-viewer-scroll {
  flex: 1;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 14px calc(24px + env(safe-area-inset-bottom));
  display: grid;
  gap: 16px;
}

.tasks-docs-viewer-empty {
  margin: 40px 12px;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
}

.tasks-docs-viewer-block {
  border-radius: 18px;
  overflow: hidden;
  background: #111827;
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.tasks-docs-viewer-block-head {
  padding: 12px 14px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.tasks-docs-viewer-block-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #60a5fa;
}

.tasks-docs-viewer-block-head h3 {
  margin: 4px 0 2px;
  font-size: 15px;
  color: #f8fafc;
  word-break: break-word;
}

.tasks-docs-viewer-block-head p {
  margin: 0;
  font-size: 12px;
  color: #94a3b8;
}

.tasks-docs-viewer-block-body {
  background: #020617;
  padding: 10px;
}

.tasks-docs-viewer-image,
.tasks-docs-viewer-video,
.tasks-docs-viewer-page img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  background: #000;
}

.tasks-docs-viewer-video {
  max-height: min(72vh, 640px);
}

.tasks-docs-viewer-pdf-pages {
  display: grid;
  gap: 12px;
}

.tasks-docs-viewer-page {
  margin: 0;
}

.tasks-docs-viewer-page figcaption {
  margin-top: 6px;
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  font-weight: 700;
}

.tasks-docs-viewer-loading,
.tasks-docs-viewer-fallback {
  padding: 18px 12px;
  text-align: center;
  color: #cbd5e1;
  font-size: 13px;
}

.tasks-docs-viewer-fallback a {
  color: #93c5fd;
  font-weight: 700;
}

.tasks-checklist-pin-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.tasks-checklist-more {
  border: none !important;
  background: transparent !important;
  color: #64748b !important;
  min-height: 28px !important;
  min-width: 28px;
  padding: 0 4px !important;
  box-shadow: none !important;
  font-size: 18px;
  line-height: 1;
  border-radius: 8px !important;
  cursor: pointer;
}

.tasks-checklist-more:hover,
.tasks-checklist-more[aria-expanded='true'] {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

.tasks-checklist-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  min-width: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.tasks-checklist-menu button,
.tasks-checklist-menu .tasks-checklist-delete-float,
.tasks-checklist-menu .tasks-checklist-edit-float {
  width: auto;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18) !important;
  text-align: center;
  justify-content: center;
  padding: 8px 14px !important;
  min-height: 0 !important;
  border-radius: 999px !important;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a !important;
  white-space: nowrap;
  cursor: pointer;
}

.tasks-checklist-menu button:hover,
.tasks-checklist-menu .tasks-checklist-delete-float:hover,
.tasks-checklist-menu .tasks-checklist-edit-float:hover {
  background: #f8fafc !important;
}

.tasks-checklist-menu button.is-danger,
.tasks-checklist-menu .tasks-checklist-delete-float {
  border-color: #fecaca !important;
  color: #b91c1c !important;
}

.tasks-checklist-menu .tasks-checklist-delete-float:hover {
  background: #fef2f2 !important;
}

.tasks-checklist-item-wrap {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.tasks-checklist-when {
  margin-left: 28px;
  width: fit-content;
  max-width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
  color: #94a3b8;
  line-height: 1.2;
  cursor: pointer;
  text-align: left;
  border-radius: 4px;
}

.tasks-checklist-when:hover:not(:disabled) {
  color: #2563eb;
  text-decoration: underline;
}

.tasks-checklist-when:disabled {
  cursor: default;
}

.tasks-checklist-when-input {
  margin-left: 24px;
  width: min(220px, 100%);
  border: 1px solid #93c5fd !important;
  background: #fff !important;
  border-radius: 8px !important;
  padding: 3px 8px !important;
  min-height: 28px !important;
  font-size: 12px;
  color: #0f172a;
  box-shadow: none !important;
}

.tasks-checklist-edit-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  border: 1px solid #93c5fd !important;
  background: #fff !important;
  border-radius: 8px !important;
  padding: 4px 8px !important;
  min-height: 28px !important;
  font-size: 13px;
  color: #0f172a;
  box-shadow: none !important;
}

.tasks-checklist-mark {
  width: 20px;
  text-align: center;
  flex-shrink: 0;
  font-size: 16px;
  line-height: 1.2;
  color: #64748b;
}

.tasks-checklist-comment {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.tasks-checklist-comment input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid #dbeafe;
  background: #f8fafc;
  font-size: 12px;
}

.tasks-checklist-comment .tasks-checklist-tag-btn {
  flex-shrink: 0;
}

@media (max-width: 900px) {
  .tasks-checklist-row {
    grid-template-columns: 1fr;
  }

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

.tasks-check-done {
  text-decoration: line-through;
  color: #94a3b8;
}

.tasks-inline-form {
  display: flex;
  gap: 8px;
}

.tasks-inline-form button {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 700;
  box-shadow: none;
}

.tasks-comments {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.tasks-comment {
  padding: 8px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.tasks-comment-meta {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 4px;
}

.tasks-comment-input {
  margin-top: 0;
}

.tasks-empty-hint {
  font-size: 12px;
  color: #94a3b8;
}

.tasks-empty-state {
  grid-column: 1 / -1;
  padding: 28px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  color: #64748b;
  text-align: center;
  background: rgba(255, 255, 255, 0.6);
}

/* Mobile task chrome — hidden on desktop */
.tasks-mobile-picker {
  display: none;
}

.tasks-mobile-open-chat,
.tasks-mobile-chat-back {
  display: none;
}

.tasks-heading-chat-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.tasks-unread-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}

.tasks-mobile-picker-badge {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  align-self: start;
}

.tasks-mobile-picker-item-top,
.tasks-left-item-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.tasks-chat-toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 14000;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(420px, calc(100vw - 24px));
  padding: 12px 14px;
  border: 1px solid rgba(37, 99, 235, 0.35);
  border-radius: 14px;
  background: #0f172a;
  color: #fff;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.35);
  cursor: pointer;
  text-align: left;
}

.tasks-chat-toast-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}

.tasks-chat-toast-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.tasks-chat-toast-copy strong {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tasks-chat-toast-copy span {
  font-size: 12px;
  color: #cbd5e1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tasks-chat-toast-action {
  font-size: 12px;
  font-weight: 800;
  color: #93c5fd;
  flex-shrink: 0;
}

.tasks-detail-modal {
  width: min(720px, 92vw);
  max-height: 90vh;
  overflow: auto;
  margin: 0;
}

.tasks-detail-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.tasks-detail-roles {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
}

.tasks-detail-people {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
}

.tasks-modal-close {
  border: none;
  background: #f1f5f9;
  color: #475569;
  width: 32px;
  height: 32px;
  min-height: 32px;
  border-radius: 8px;
  padding: 0;
  box-shadow: none;
}

.tasks-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tasks-field {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
}

.tasks-detail-section {
  margin-top: 16px;
  display: grid;
  gap: 8px;
}

.tasks-activity {
  display: grid;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  font-size: 12px;
}

.tasks-activity-row {
  color: #475569;
}

.tasks-activity-time {
  color: #94a3b8;
}

.tasks-detail-footer {
  margin-top: 18px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.tasks-btn-secondary {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  font-weight: 700;
  box-shadow: none;
}

.tasks-btn-danger {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid #fecaca;
  background: #fef2f2;
  color: #b91c1c;
  font-weight: 700;
  box-shadow: none;
}

.tasks-create-modal {
  width: min(560px, 92vw);
  margin: 0;
}

.tasks-quick-add {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.35);
}

.tasks-quick-title {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  font-size: 15px;
  font-weight: 600;
}

.tasks-quick-date {
  width: fit-content;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
}

.tasks-quick-people {
  display: grid;
  gap: 8px;
}

.tasks-quick-label {
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tasks-people-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tasks-person-chip {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  min-height: 0;
  box-shadow: none;
}

.tasks-person-chip.is-selected {
  border-color: #2563eb;
  background: #dbeafe;
  color: #1d4ed8;
}

.tasks-person-chip.is-me {
  box-shadow: inset 0 0 0 1px #1d4ed8;
}

.tasks-person-chip.is-locked {
  cursor: default;
  opacity: 0.95;
}

.tasks-chip-remove {
  margin-left: 6px;
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  min-height: 0;
  box-shadow: none;
}

.tasks-person-chip:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.tasks-btn-compact {
  padding: 7px 12px;
  min-height: 0;
  font-size: 12px;
}

.tasks-btn-secondary {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
}

.tasks-card-description {
  margin: 0;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
}

.tasks-card-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-start;
}

.tasks-card-people {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

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

.tasks-card.is-open {
  border-style: dashed;
  background: #fcfdff;
}

.tasks-card.is-done {
  opacity: 0.88;
}

.tasks-card-due.is-overdue {
  color: #b91c1c;
  font-weight: 700;
}

.tasks-open-hint {
  font-size: 12px;
  color: #64748b;
}

.tasks-comment-preview {
  font-size: 12px;
  color: #475569;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.tasks-join-banner {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  font-size: 13px;
}

@media (max-width: 900px) {
  .tasks-page--mobile {
    padding: 10px;
    gap: 12px;
    height: auto;
    min-height: 0;
    overflow: visible;
  }

  .tasks-page--mobile .tasks-page-header {
    gap: 8px;
    align-items: center;
    flex-shrink: 0;
  }

  .tasks-page--mobile .tasks-page-header h1 {
    font-size: 1.35rem;
  }

  .tasks-page--mobile .tasks-page-subtitle {
    display: none;
  }

  .tasks-page--mobile .tasks-btn-primary {
    padding: 8px 12px;
    font-size: 13px;
  }

  .tasks-page--mobile .tasks-toolbar {
    display: none;
  }

  .tasks-page--mobile .tasks-mobile-picker {
    display: none !important;
  }

  .tasks-page--mobile .tasks-left-menu {
    display: block !important;
    position: sticky;
    top: 8px;
    z-index: 40;
    margin: 0 0 10px;
    padding: 8px 10px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.1);
  }

  .tasks-page--mobile .tasks-left-items {
    gap: 8px;
  }

  .tasks-page--mobile .tasks-left-item {
    flex: 0 0 196px;
    width: 196px;
    max-width: 196px;
    padding: 10px;
    gap: 7px;
    -webkit-tap-highlight-color: transparent;
  }

  .tasks-page--mobile .tasks-left-item-title {
    max-width: none;
    font-size: 13px;
  }

  .tasks-page--mobile .tasks-item-meta {
    gap: 5px;
  }

  .tasks-page--mobile .tasks-item-meta-tag {
    font-size: 10px;
    padding: 3px 7px;
  }

  .tasks-mobile-picker-trigger {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 2px;
    align-items: center;
    text-align: left;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
    cursor: pointer;
    backdrop-filter: blur(10px);
  }

  .tasks-mobile-picker-trigger.is-open {
    border-color: #2563eb;
    box-shadow: 0 14px 32px rgba(37, 99, 235, 0.2);
  }

  .tasks-mobile-picker-label {
    grid-column: 1;
    grid-row: 1;
    font-weight: 800;
    color: #0f172a;
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .tasks-mobile-picker-meta {
    grid-column: 1;
    grid-row: 2;
    font-size: 12px;
    font-weight: 650;
    color: #64748b;
  }

  .tasks-mobile-picker-chevron {
    grid-column: 2;
    grid-row: 2;
    font-size: 16px;
    color: #475569;
    transition: transform 0.2s ease;
    justify-self: end;
  }

  .tasks-mobile-picker-trigger:has(.tasks-mobile-picker-badge) .tasks-mobile-picker-chevron {
    grid-row: 2;
  }

  .tasks-mobile-picker-trigger.is-open .tasks-mobile-picker-chevron {
    transform: rotate(180deg);
  }

  .tasks-mobile-picker-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 1202;
    max-height: min(58vh, 420px);
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: #fff;
    box-shadow: 0 22px 48px rgba(15, 23, 42, 0.22);
    overflow: hidden;
  }

  .tasks-mobile-picker-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1190;
    background: rgba(15, 23, 42, 0.28);
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
  }

  .tasks-mobile-picker-trigger {
    position: relative;
    z-index: 1201;
  }

  .tasks-mobile-picker-search {
    margin: 10px 10px 0;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font-size: 16px;
  }

  .tasks-mobile-picker-list {
    overflow: auto;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .tasks-mobile-picker-empty {
    padding: 16px 12px;
    color: #64748b;
    font-size: 13px;
    font-weight: 650;
    text-align: center;
  }

  .tasks-mobile-picker-item {
    width: 100%;
    text-align: left;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #f8fafc;
    padding: 12px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .tasks-mobile-picker-item:active {
    background: #e2e8f0;
  }

  .tasks-mobile-picker-item.is-active {
    border-color: #2563eb;
    background: #dbeafe;
  }

  .tasks-mobile-picker-item-title {
    font-weight: 800;
    color: #0f172a;
    font-size: 14px;
  }

  .tasks-mobile-picker-item-sub,
  .tasks-page--mobile .tasks-item-meta-line {
    margin-top: 0;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
  }

  .tasks-page--mobile .tasks-layout {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 55vh;
    overflow: visible;
    gap: 0;
  }

  .tasks-page--mobile .tasks-center-panel {
    position: relative;
    inset: auto;
    width: 100%;
    height: auto;
    max-height: none;
    min-height: 55vh;
    overflow: visible;
    transform: none !important;
    z-index: 1;
    padding-bottom: 16px;
  }

  .tasks-page--mobile .tasks-chat-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: var(--ilm-mobile-nav-h, calc(64px + env(safe-area-inset-bottom, 0px)));
    left: 0;
    width: 100%;
    height: auto;
    max-height: none;
    border-radius: 0;
    z-index: 1300;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: none;
  }

  .tasks-page--mobile.tasks-page--chat .tasks-chat-panel {
    transform: translateX(0);
    box-shadow: -12px 0 28px rgba(15, 23, 42, 0.18);
  }

  .tasks-page--mobile .tasks-detail-panel {
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
    background: rgba(255, 255, 255, 0.96);
    border-radius: 14px;
    padding: 12px;
    min-height: 0;
  }

  .tasks-page--mobile .tasks-detail-header--inline,
  .tasks-page--mobile .tasks-detail-header--stacked {
    gap: 10px;
    align-items: stretch;
  }

  .tasks-page--mobile .tasks-detail-heading {
    max-width: none;
    font-size: 1.15rem;
    line-height: 1.3;
    white-space: normal;
  }

  .tasks-page--mobile .tasks-detail-heading-wrap {
    width: 100%;
  }

  .tasks-page--mobile .tasks-detail-users-inline {
    width: 100%;
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
  }

  .tasks-page--mobile .tasks-detail-users-label {
    font-size: 11px;
  }

  .tasks-page--mobile .tasks-person-chip {
    min-height: 34px;
    padding: 6px 12px;
    font-size: 13px;
  }

  .tasks-page--mobile .tasks-mobile-open-chat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid #2563eb;
    background: #2563eb;
    color: #fff;
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
    flex-shrink: 0;
  }

  .tasks-page--mobile .tasks-mobile-open-chat.has-unread {
    border-color: #dc2626;
    background: #dc2626;
  }

  .tasks-page--mobile .tasks-mobile-open-chat .tasks-unread-badge {
    background: #fff;
    color: #dc2626;
  }

  .tasks-page--mobile .tasks-mobile-chat-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #0f172a;
    font-weight: 800;
    font-size: 12px;
    cursor: pointer;
  }

  .tasks-page--mobile .tasks-detail-meta-row,
  .tasks-page--mobile .tasks-detail-grid,
  .tasks-page--mobile .tasks-detail-meta-row--compact {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .tasks-page--mobile .tasks-detail-panel--compact {
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
    display: grid;
    gap: 12px;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-detail-header,
  .tasks-page--mobile .tasks-detail-panel--compact .tasks-detail-meta-row,
  .tasks-page--mobile .tasks-detail-panel--compact .tasks-checklist-section,
  .tasks-page--mobile .tasks-detail-panel--compact .tasks-detail-footer {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 16px;
    padding: 12px;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-detail-meta-row {
    margin-bottom: 0;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-field--row > span {
    font-size: 10px;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-field--row input,
  .tasks-page--mobile .tasks-detail-panel--compact .tasks-field--row select {
    min-height: 44px;
    border-radius: 12px;
    font-size: 16px;
    padding: 10px 12px;
    border: 1px solid #dbe3f0;
    background: #f8fafc;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-checklist-section-head {
    margin-bottom: 14px;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-checklist-section {
    padding: 14px;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-checklist-section .tasks-card-label {
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.01em;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-checklist-count {
    font-size: 12px;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-checklist-partition {
    gap: 10px;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-checklist-partition-title {
    font-size: 13px;
    padding: 6px 2px;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-checklist-partition-items {
    gap: 12px;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-checklist-row {
    border-radius: 18px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid #e2e8f0;
    padding: 14px 14px 12px;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
    gap: 12px;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-checklist-item {
    font-size: 16px;
    font-weight: 700;
    gap: 12px;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-checklist-item input[type='checkbox'] {
    width: 22px;
    height: 22px;
    margin-top: 1px;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-checklist-mark {
    width: 22px;
    font-size: 18px;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-checklist-when {
    margin-left: 34px;
    font-size: 12px;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-checklist-pin-btn {
    min-height: 34px !important;
    min-width: 34px;
    font-size: 16px;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-checklist-more {
    min-width: 34px;
    min-height: 34px;
    font-size: 18px;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-checklist-comment input {
    min-height: 40px;
    font-size: 14px;
    border-radius: 12px;
    padding: 10px 12px;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-checklist-all-docs-btn {
    min-height: 40px;
    padding: 0 14px;
    font-size: 13px;
  }

  .tasks-page--mobile .tasks-detail-panel--compact .tasks-checklist-add-form {
    display: none;
  }

  .tasks-page--mobile .tasks-detail-footer {
    position: sticky;
    bottom: 0;
    background: rgba(255, 255, 255, 0.96);
    padding-top: 10px;
    padding-bottom: 4px;
    margin-top: 0;
    border-top: 1px solid #e2e8f0;
    z-index: 3;
  }

  .tasks-page--mobile .tasks-chat-composer {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }

  .tasks-page--mobile .tasks-empty-state {
    min-height: 180px;
    margin: 0;
  }
}

@media (max-width: 720px) {
  .tasks-search {
    margin-left: 0;
    width: 100%;
  }

  .tasks-left-item {
    flex-basis: 200px;
    width: 200px;
    max-width: 200px;
  }

  .tasks-detail-grid {
    grid-template-columns: 1fr;
  }

  .tasks-detail-meta-row {
    grid-template-columns: 1fr;
  }

  .tasks-detail-heading {
    max-width: 100%;
  }
}

/* ==================== PAGE-SPECIFIC STYLES ==================== */

/* ==================== APP LAYOUT ==================== */

.app-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  position: relative;
}

.app-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  z-index: 100;
}

.app-header.floating {
  position: fixed;
  top: 16px;
  left: 16px;
  width: auto;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  padding: 12px 16px;
  flex: none;
  flex-shrink: 0;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0.9;
  transition: opacity 0.2s ease;
}

.app-header.floating:hover {
  opacity: 1;
}

.app-header.floating h1 {
  margin: 0;
  font-size: 20px;
  color: white;
  flex: none;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ==================== APP BODY ==================== */

.app-body {
  flex: 1;
  overflow: hidden;
}


/* ==================== PERMISSION EDITOR (app menu + flex row tiles) ==================== */

.perm-shell {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0;
  min-height: 280px;
  max-height: min(78vh, 900px);
  border-radius: 14px;
  overflow: hidden;
}

.perm-shell--dark {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98) 0%, rgba(2, 6, 23, 0.99) 100%);
  border: 1px solid rgba(51, 65, 85, 0.65);
  color: #f1f5f9;
}

.perm-shell--light {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  color: #0f172a;
}

.perm-shell__nav {
  flex: 0 0 min(248px, 100%);
  max-width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 10px 14px;
  max-height: inherit;
  overflow-y: auto;
  border-right: 1px solid rgba(51, 65, 85, 0.55);
}

.perm-shell--light .perm-shell__nav {
  background: linear-gradient(180deg, #f8fbff 0%, #f1f5f9 100%);
  border-right-color: #e2e8f0;
}

.perm-shell--dark .perm-shell__nav {
  background: rgba(15, 23, 42, 0.6);
}

.perm-shell__nav::-webkit-scrollbar {
  width: 5px;
}

.perm-shell__nav::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 8px;
}

.perm-shell--light .perm-shell__nav::-webkit-scrollbar-thumb {
  background: #cbd5e1;
}

.perm-shell__nav-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #64748b;
  margin: 4px 8px 10px;
}

.perm-shell__nav-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  margin: 12px 8px 6px;
  user-select: none;
}

.perm-shell__nav-head-icon {
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
}

.perm-shell__nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 9px 10px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: transparent;
  color: inherit;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.perm-shell--light .perm-shell__nav-item {
  color: #1e293b;
}

.perm-shell__nav-item:hover:not(:disabled) {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.25);
}

.perm-shell__nav-item--active {
  background: rgba(59, 130, 246, 0.22) !important;
  border-color: rgba(59, 130, 246, 0.55) !important;
  box-shadow: inset 3px 0 0 #3b82f6;
}

.perm-shell__nav-item:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.perm-shell__nav-icon {
  font-size: 17px;
  width: 26px;
  text-align: center;
  flex-shrink: 0;
}

.perm-shell__nav-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.perm-shell__main {
  flex: 1 1 280px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  max-height: inherit;
  overflow: hidden;
}

.perm-shell--dark .perm-shell__main {
  background: rgba(2, 6, 23, 0.35);
}

.perm-shell--light .perm-shell__main {
  background: #fafbfc;
}

.perm-shell__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(51, 65, 85, 0.45);
  flex-shrink: 0;
}

.perm-shell--light .perm-shell__toolbar {
  border-bottom-color: #e2e8f0;
  background: #fff;
}

.perm-shell__toolbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.perm-shell__toolbar-emoji {
  font-size: 22px;
  line-height: 1;
}

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

.perm-shell__toolbar-sep {
  width: 1px;
  height: 22px;
  background: rgba(148, 163, 184, 0.35);
  margin: 0 4px;
}

.perm-shell--light .perm-shell__toolbar-sep {
  background: #cbd5e1;
}

.perm-shell__row-wrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  align-content: flex-start;
}

.perm-shell__row-wrap-heading {
  flex: 1 1 100%;
  width: 100%;
  min-width: 100%;
}

.perm-shell__row-wrap-tile {
  flex: 1 1 180px;
  max-width: 100%;
  min-width: min(180px, 100%);
}

.perm-shell__hint {
  font-size: 13px;
  padding: 8px 4px;
}

.perm-shell__empty--panel.perm-shell__empty--light {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  color: #64748b;
}

.perm-shell__empty--panel:not(.perm-shell__empty--light) {
  background: rgba(15, 23, 42, 0.5);
  border: 1px dashed rgba(148, 163, 184, 0.35);
  color: #94a3b8;
}

/* ==================== MAIN CONTENT WRAPPER ==================== */

.main-content {
  position: absolute;
  top: 5px;
  left: 0;
  width: 100%;
  max-width: 100%;
  height: calc(100vh - 5px);
  height: calc(100dvh - 5px);
  padding-left: 72px;
  box-sizing: border-box;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  z-index: 1;
  background: transparent;
}

.page-shell,
.ilm-route-view {
  min-width: 0;
  max-width: 100%;
}

/* ==================== APP FOOTER ==================== */

.app-footer {
  display: none;
}

.page-container {
  min-height: 100%;
  padding: 24px;
  background: transparent;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.page-shell {
  max-width: 100%;
  /* max-height:100%; */
  width: 100%;
  /* height: 100%; */
  margin: 0;
  /* padding: 28px 32px 0 32px; */
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

/* Students page shell (scoped — do not import legacy.css globally; it overrides body/theme) */
.split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}

/* Academics tab bodies: toolbars wrap; wide tables scroll on phones */
.students-page-content .toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.students-page-content .toolbar input[type="search"],
.students-page-content .toolbar input[type="text"],
.students-page-content .toolbar select {
  flex: 1 1 160px;
  min-width: 0;
  max-width: 100%;
}

.students-page-content .toolbar .btn,
.students-page-content .toolbar button {
  flex: 0 0 auto;
}

.students-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.students-table-scroll > table {
  margin: 0;
}

.classroom-slider {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.yearly-portion-class-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.yearly-portion-class-row .classroom-slider {
  flex: 1 1 0;
  min-width: 0;
}

.yearly-portion-settings-btn {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-size: 20px;
  line-height: 1;
  font-weight: 800;
  cursor: pointer;
}

.yearly-portion-settings-btn.is-open {
  background: #f1f5f9;
}

.page-card,
.section-card {
  min-width: 0;
  max-width: 100%;
}

.classroom-slider-chip {
  flex: 0 0 auto;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

.classroom-slider-chip.is-selected {
  border-color: #0369a1;
  background: #e0f2fe;
  color: #0c4a6e;
  font-weight: 700;
}

.students-virtual-pad {
  pointer-events: none;
}

.students-virtual-spacer,
.students-virtual-spacer td {
  padding: 0 !important;
  border: 0 !important;
  line-height: 0;
}

.academics-stack-mobile {
  display: grid;
  gap: inherit;
}

.students-page-shell {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  box-sizing: border-box;
  overflow-x: clip;
}

.students-page-chrome {
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 8px 5px 12px;
  margin: 0;
  border-bottom: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.92);
  position: sticky;
  top: 0;
  z-index: 40;
  box-sizing: border-box;
  overflow-x: clip;
  overflow-y: visible;
}

.students-page-chrome .students-page-tabs .students-session-switcher {
  position: relative;
  z-index: 1;
  margin: 0;
}

.students-session-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: min(280px, 42vw);
}

.students-page-chrome .students-page-tabs .students-session-trigger {
  width: auto;
  max-width: none;
  min-height: 0 !important;
  height: clamp(20px, 2.35em, 34px);
  padding: 0 0.5em !important;
  gap: 4px !important;
  font-size: inherit;
  overflow: visible;
  border-width: 1.5px;
  border-radius: 12px;
  border: 1.5px solid #1d4ed8;
  background: #1d4ed8;
  color: #ffffff;
  cursor: pointer;
  text-align: center;
  justify-content: center !important;
  align-items: center !important;
  box-shadow: none !important;
  font-weight: 600;
  line-height: 1.1;
  position: relative;
  z-index: 1;
  transform-origin: center center;
  transition:
    transform 0.22s cubic-bezier(0.34, 1.35, 0.64, 1),
    box-shadow 0.22s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.students-page-chrome .students-page-tabs .students-session-trigger:hover {
  transform: scale(1.08);
  z-index: 4;
  box-shadow: 0 4px 14px rgba(29, 78, 216, 0.35);
}

.students-page-chrome .students-page-tabs .students-session-trigger:active {
  transform: scale(1.02);
}

.students-session-trigger:hover {
  border-color: #2563eb;
  background: #2563eb;
}

.students-session-trigger.is-open {
  border-color: #93c5fd;
  background: #1e40af;
}

.students-session-trigger-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.students-session-trigger-label {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.students-session-trigger-meta {
  font-size: 10px;
  opacity: 0.88;
  white-space: nowrap;
}

.students-session-trigger-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.students-session-trigger-chevron {
  flex: 0 0 auto;
  font-size: 14px;
  opacity: 0.9;
  transition: transform 0.15s ease;
}

.students-session-trigger.is-open .students-session-trigger-chevron {
  transform: rotate(180deg);
}

.students-session-trigger-menu {
  flex: 0 0 auto;
  margin-left: 2px;
  padding: 2px 6px;
  border-radius: 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.35);
  color: #ffffff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.students-session-trigger-menu:hover {
  background: rgba(255, 255, 255, 0.16);
}

.students-session-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  line-height: 1.2;
}

.students-session-badge-hidden {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.students-session-badge-frozen {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.students-session-badge-running {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.students-session-dropdown {
  position: fixed;
  z-index: 2000;
  max-width: min(360px, calc(100vw - 24px));
  max-height: min(440px, calc(100vh - 100px));
  overflow-y: auto;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
  padding: 8px;
  box-sizing: border-box;
}

.students-session-dropdown-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.students-session-dropdown-heading {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  padding: 4px 8px 6px;
}

.students-session-dropdown-row {
  display: flex;
  align-items: stretch;
  gap: 4px;
}

.students-session-dropdown-item {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 10px 12px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
}

.students-session-dropdown-item:hover {
  background: #f1f5f9;
}

.students-session-dropdown-item-label {
  font-size: 13px;
  font-weight: 700;
}

.students-session-dropdown-item-meta {
  font-size: 11px;
  color: #64748b;
}

.students-session-dropdown-item-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.students-session-dropdown-item-badges .students-session-badge-hidden {
  background: #fef3c7;
  color: #92400e;
}

.students-session-dropdown-item-badges .students-session-badge-frozen {
  background: #dbeafe;
  color: #1d4ed8;
}

.students-session-dropdown-item-badges .students-session-badge-running {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.students-session-row-menu-btn {
  flex: 0 0 auto;
  width: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 18px;
  cursor: pointer;
  align-self: center;
}

.students-session-row-menu-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.students-session-dropdown-empty {
  padding: 12px;
  font-size: 13px;
  color: #64748b;
  text-align: center;
}

.students-session-dropdown-toggle-hidden {
  width: 100%;
  margin-top: 6px;
  padding: 8px 10px;
  border: none;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.students-session-dropdown-toggle-hidden:hover {
  background: #f1f5f9;
}

.students-session-dropdown-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.students-session-dropdown-action {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
}

.students-session-dropdown-action:hover {
  background: #f8fafc;
}

.students-session-dropdown-action-primary {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.students-session-dropdown-action-primary:hover {
  background: #dbeafe;
}

.students-session-dropdown-action-title {
  font-size: 13px;
  font-weight: 700;
}

.students-session-dropdown-action-desc {
  font-size: 11px;
  opacity: 0.85;
}

.students-session-action-menu {
  position: fixed;
  z-index: 2100;
  min-width: 168px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.students-session-action-menu-item {
  width: 100%;
  padding: 9px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #0f172a;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.students-session-action-menu-item:hover:not(:disabled) {
  background: #f1f5f9;
}

.students-session-action-menu-item-danger {
  color: #b91c1c;
}

.students-session-action-menu-item-danger:hover:not(:disabled) {
  background: #fff1f2;
}

.students-session-action-menu-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.students-page-chrome .students-page-tabs {
  --students-tab-count: 10;
  --students-tab-gap: 2px;
  --students-tab-slot: calc(
    (100cqi - (var(--students-tab-count) - 1) * var(--students-tab-gap)) / var(--students-tab-count)
  );
  container-type: inline-size;
  display: flex;
  flex-wrap: nowrap;
  gap: var(--students-tab-gap);
  margin: 0;
  padding: 4px 0;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: visible;
  font-size: clamp(7px, calc(var(--students-tab-slot) * 0.36), 13px);
}

/* Session name — full width for label; tab pills share the rest */
.students-page-chrome .students-page-tabs .students-session-switcher {
  flex: 0 0 auto;
  width: auto;
  min-width: max-content;
  max-width: none;
}

.students-page-chrome .students-page-tabs .students-tab-pill {
  flex: 1 1 0;
  min-width: 0;
  max-width: none;
}

.students-page-chrome .students-page-tabs .students-session-trigger-meta {
  display: none;
}

.students-page-chrome .students-page-tabs .students-session-trigger-main {
  flex: 0 1 auto;
  min-width: 0;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.students-page-chrome .students-page-tabs .students-session-trigger-label {
  flex: 0 0 auto;
  min-width: max-content;
  font-size: 1em;
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
  text-align: center;
}

.students-page-chrome .students-page-tabs .students-session-trigger-chevron {
  font-size: 0.85em;
  flex-shrink: 0;
}

/* Tab pills — reset global button styles; label span handles center + ellipsis */
.students-page-chrome .students-page-tabs .students-tab-pill {
  min-height: 0 !important;
  height: clamp(20px, 2.35em, 34px);
  padding: 0 0.35em !important;
  gap: 0 !important;
  margin: 0;
  font-size: inherit !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  border-style: solid !important;
  border-width: 1.5px !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  z-index: 1;
  transform-origin: center center;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.22s ease,
    transform 0.22s cubic-bezier(0.34, 1.35, 0.64, 1);
}

.students-page-chrome .students-page-tabs .students-tab-pill:hover {
  transform: scale(1.1);
  z-index: 4;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18);
}

.students-page-chrome .students-page-tabs .students-tab-pill-label {
  display: block;
  width: 100%;
  height: 100%;
  font-size: 1em;
  line-height: clamp(18px, 2.2em, 32px);
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.students-page-chrome .students-page-tabs .students-tab-pill:active {
  transform: scale(1.03);
  transition-duration: 0.1s;
}

.students-page-chrome .students-page-tabs .students-session-trigger-badges {
  display: none;
}

/* Desktop: keep pills + session in one shared flex row */
.students-page-chrome .students-page-tabs-scroll {
  display: contents;
}

/* Mobile Academics chrome: session on its own row, swipeable section chips */
@media (max-width: 768px) {
  .students-page-shell {
    overflow-x: hidden;
  }

  .students-page-chrome {
    padding: 8px 10px 10px;
    overflow-x: hidden;
    overflow-y: visible;
  }

  .students-page-chrome .students-page-tabs {
    --students-tab-count: 1;
    --students-tab-slot: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 0;
    font-size: 13px;
    container-type: normal;
  }

  .students-page-chrome .students-page-tabs .students-session-switcher {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .students-page-chrome .students-page-tabs .students-session-trigger {
    width: 100%;
    max-width: 100%;
    height: 42px;
    min-height: 42px;
    padding: 0 12px !important;
    border-radius: 12px;
    justify-content: space-between !important;
    transform: none !important;
  }

  .students-page-chrome .students-page-tabs .students-session-trigger:hover,
  .students-page-chrome .students-page-tabs .students-session-trigger:active {
    transform: none !important;
    box-shadow: none !important;
  }

  .students-page-chrome .students-page-tabs .students-session-trigger-main {
    flex: 1 1 auto;
    justify-content: flex-start;
    min-width: 0;
  }

  .students-page-chrome .students-page-tabs .students-session-trigger-label {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    text-align: left;
  }

  .students-page-chrome .students-page-tabs-scroll {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding: 2px 2px 6px;
    margin: 0 -2px;
    scrollbar-width: none;
  }

  .students-page-chrome .students-page-tabs-scroll::-webkit-scrollbar {
    display: none;
  }

  .students-page-chrome .students-page-tabs .students-tab-pill {
    flex: 0 0 auto !important;
    width: auto !important;
    min-width: max-content !important;
    max-width: none !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 14px !important;
    border-radius: 999px !important;
    scroll-snap-align: start;
    transform: none !important;
  }

  .students-page-chrome .students-page-tabs .students-tab-pill:hover,
  .students-page-chrome .students-page-tabs .students-tab-pill:active {
    transform: none !important;
    box-shadow: none !important;
  }

  .students-page-chrome .students-page-tabs .students-tab-pill-label {
    width: auto;
    font-size: 13px;
    line-height: 36px;
    overflow: visible;
    text-overflow: clip;
  }

  .students-page-content {
    padding: 8px 8px 20px;
    overflow-x: hidden;
  }

  .students-page-content > .student-tab-content {
    padding: 12px 10px 16px;
    border-radius: 12px;
  }

  .students-page-content > .student-tab-content.student-tab-panel--exit {
    left: 8px;
    right: 8px;
    top: 8px;
  }

  .students-page-content > .student-tab-content.split,
  .students-page-content .split {
    grid-template-columns: 1fr;
  }

  .students-page-content .toolbar {
    gap: 6px;
  }

  .students-page-content .toolbar input[type="search"],
  .students-page-content .toolbar input[type="text"],
  .students-page-content .toolbar select {
    flex: 1 1 100%;
  }

  .academics-stack-mobile {
    grid-template-columns: 1fr !important;
  }

  .academics-stack-mobile--3 {
    grid-template-columns: 1fr !important;
  }

  .academics-prize-row {
    grid-template-columns: 1fr !important;
  }

  .students-page-content table.list th,
  .students-page-content table.list td {
    white-space: nowrap;
  }

  .students-page-content table.list td textarea {
    min-width: 120px !important;
  }

  .academics-tab-fallback {
    padding: 28px 12px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
    font-weight: 600;
  }

  .academics-toolbar {
    gap: 8px !important;
  }

  .academics-toolbar input[type="search"] {
    flex: 1 1 100% !important;
    min-height: 42px;
  }

  .academics-toolbar-primary {
    flex: 1 1 auto !important;
    min-height: 40px;
    font-weight: 700 !important;
  }

  .academics-toolbar-more-btn {
    min-height: 40px;
  }

  .academics-toolbar-more {
    display: none;
    flex: 1 1 100%;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
  }

  .academics-toolbar-more.is-open {
    display: flex;
  }

  .academics-toolbar-more button {
    flex: 1 1 calc(50% - 6px);
    min-height: 38px;
  }

  .academics-mobile-list {
    display: grid;
    gap: 10px;
  }

  .academics-mobile-empty {
    padding: 28px 14px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
  }

  .academics-mobile-card {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }

  .academics-mobile-card-main {
    appearance: none;
    border: 0;
    background: transparent;
    text-align: left;
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    cursor: pointer;
  }

  .academics-mobile-avatar {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #475569;
  }

  .academics-mobile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .academics-mobile-card-body {
    min-width: 0;
    flex: 1 1 auto;
  }

  .academics-mobile-card-title-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    margin-bottom: 4px;
  }

  .academics-mobile-card-title-row strong {
    font-size: 15px;
    color: #0f172a;
  }

  .academics-mobile-card-meta,
  .academics-mobile-card-sub {
    font-size: 12px;
    color: #64748b;
    line-height: 1.35;
  }

  .academics-mobile-card-sub {
    margin-top: 2px;
  }

  .academics-mobile-card-action {
    appearance: none;
    border: 0;
    border-left: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #0f766e;
    font-weight: 700;
    font-size: 12px;
    padding: 0 12px;
    min-width: 72px;
    cursor: pointer;
  }

  .academics-mobile-card-action:disabled {
    opacity: 0.45;
    cursor: not-allowed;
  }

  .academics-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.4;
  }

  .academics-chip--new {
    background: #dbeafe;
    color: #1d4ed8;
  }

  .academics-chip--promo {
    background: #dcfce7;
    color: #166534;
  }

  .academics-chip--danger {
    background: #fee2e2;
    color: #b91c1c;
  }

  .academics-chip--warn {
    background: #ffedd5;
    color: #c2410c;
  }
}

/* Desktop: keep More menu items inline in the toolbar row */
@media (min-width: 769px) {
  .academics-toolbar-more-btn {
    display: none !important;
  }

  .academics-toolbar-more {
    display: contents !important;
  }
}

.students-page-content {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 10px 16px 28px;
  box-sizing: border-box;
  position: relative;
  overflow-x: clip;
  overflow-y: visible;
}

/* Bordered surface for every Students tab body (below the tab row) */
.students-page-content > .student-tab-content {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin-top: 2px;
  padding: 18px 20px 24px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  border-radius: 14px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 6px 18px rgba(15, 23, 42, 0.05);
  overflow-x: auto;
}

.students-page-content > .student-tab-content.student-tab-content--narrow {
  max-width: 860px;
  margin-left: auto;
  margin-right: auto;
}

.students-page-content > .student-tab-content.student-tab-panel--exit {
  position: absolute;
  top: 10px;
  left: 16px;
  right: 16px;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.students-page-content > .student-tab-content.student-tab-panel--enter,
.students-page-content > .student-tab-content.student-tab-panel--idle {
  position: relative;
  z-index: 1;
}

/* Forward: new tab from right, old tab exits left */
.students-page-content > .student-tab-content.student-tab-panel--enter.student-tab-panel--slide-forward {
  animation: studentTabEnterFromRight var(--ilm-duration-medium, 0.42s) var(--ilm-ease-fluid, cubic-bezier(0.22, 1, 0.36, 1)) forwards;
}

.students-page-content > .student-tab-content.student-tab-panel--exit.student-tab-panel--slide-forward {
  animation: studentTabExitToLeft 0.28s var(--ilm-ease-tide, cubic-bezier(0.4, 0, 0.2, 1)) forwards;
}

/* Back: new tab from left, old tab exits right */
.students-page-content > .student-tab-content.student-tab-panel--enter.student-tab-panel--slide-back {
  animation: studentTabEnterFromLeft var(--ilm-duration-medium, 0.42s) var(--ilm-ease-fluid, cubic-bezier(0.22, 1, 0.36, 1)) forwards;
}

.students-page-content > .student-tab-content.student-tab-panel--exit.student-tab-panel--slide-back {
  animation: studentTabExitToRight 0.28s var(--ilm-ease-tide, cubic-bezier(0.4, 0, 0.2, 1)) forwards;
}

.students-page-content > .student-tab-content.student-tab-panel--enter,
.students-page-content > .student-tab-content.student-tab-panel--idle {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

@keyframes studentTabEnterFromRight {
  from {
    opacity: 0.4;
    transform: translate3d(64px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes studentTabExitToLeft {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  to {
    opacity: 0;
    transform: translate3d(-64px, 0, 0);
  }
}

@keyframes studentTabEnterFromLeft {
  from {
    opacity: 0.4;
    transform: translate3d(-64px, 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes studentTabExitToRight {
  from {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
  to {
    opacity: 0;
    transform: translate3d(64px, 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .students-page-content > .student-tab-content.student-tab-panel--enter,
  .students-page-content > .student-tab-content.student-tab-panel--exit {
    animation: none !important;
  }
}

.students-page-content .student-tab-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.students-page-content .student-tab-panel > section,
.students-page-content .student-tab-panel > .page-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  box-sizing: border-box;
}

.students-page-content .student-tab-panel .section-card:first-child {
  margin-top: 0;
}

.students-page-content .student-tab-panel h2:first-child,
.students-page-content .student-tab-panel h1:first-child {
  margin-top: 0;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  color: #f1f5f9;
  text-shadow: 0 1px 8px rgba(2, 6, 23, 0.4);
}

.page-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==================== SEARCH & FILTER BAR ==================== */

.search-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: center;
}

.search-input {
  flex: 1;
  min-width: 250px;
  padding: 10px 14px;
  border: 1.5px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  font-size: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  transition: all 0.22s ease;
  backdrop-filter: blur(4px);
}

.search-input::placeholder { color: rgba(148, 163, 184, 0.55); }

.search-input:focus {
  outline: none;
  border-color: rgba(99, 179, 237, 0.65);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

.filter-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.filter-label {
  font-weight: 600;
  color: rgba(148, 163, 184, 0.9);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-select {
  padding: 8px 12px;
  border: 1.5px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.07);
  color: #e2e8f0;
  cursor: pointer;
  transition: all 0.22s ease;
  backdrop-filter: blur(4px);
}

.filter-select option { background: #1e293b; color: #e2e8f0; }

.filter-select:focus {
  outline: none;
  border-color: rgba(99, 179, 237, 0.65);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

/* ==================== TABS ==================== */

.tabs-container {
  display: flex;
  gap: 4px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(148, 163, 184, 0.15);
  padding: 5px;
  border-radius: 12px;
  flex-wrap: wrap;
  backdrop-filter: blur(6px);
}

.tab-btn {
  padding: 9px 18px;
  background: transparent;
  color: rgba(148, 163, 184, 0.9);
  border: none;
  border-radius: 9px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-btn:hover {
  background: rgba(56, 189, 248, 0.1);
  color: #bae6fd;
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(6, 182, 212, 0.9));
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
}

/* Sub Tabs */
.sub-tabs-container {
  display: flex;
  gap: 3px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.12);
  padding: 4px;
  border-radius: 10px;
  flex-wrap: wrap;
  backdrop-filter: blur(4px);
}

.sub-tab-btn {
  padding: 7px 14px;
  background: transparent;
  color: rgba(148, 163, 184, 0.85);
  border: none;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s ease;
}

.sub-tab-btn:hover {
  background: rgba(56, 189, 248, 0.1);
  color: #bae6fd;
}

.sub-tab-btn.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.85), rgba(6, 182, 212, 0.85));
  color: white;
  box-shadow: 0 3px 9px rgba(37, 99, 235, 0.22);
}

/* Alternative Sub-tab Styles */
.sub-tabs-underline {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

.sub-tab-underline {
  padding: 10px 18px;
  background: transparent;
  color: rgba(148, 163, 184, 0.8);
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-weight: normal;
  font-size: 14px;
  transition: all 0.2s ease;
}

.sub-tab-underline:hover {
  background: rgba(56, 189, 248, 0.05);
  color: #bae6fd;
}

.sub-tab-underline.active {
  color: #7dd3fc;
  border-bottom-color: #38bdf8;
  font-weight: 600;
}

/* Nested Tabs (Level 3) */
.nested-tabs-container {
  display: flex;
  gap: 3px;
  margin-bottom: 12px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(148, 163, 184, 0.1);
  padding: 3px;
  border-radius: 8px;
  flex-wrap: wrap;
}

.nested-tab-btn {
  padding: 5px 12px;
  background: transparent;
  color: rgba(148, 163, 184, 0.8);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 12px;
  transition: all 0.2s ease;
}

.nested-tab-btn:hover {
  background: rgba(56, 189, 248, 0.1);
  color: #bae6fd;
}

.nested-tab-btn.active {
  background: rgba(37, 99, 235, 0.75);
  color: #e0f2fe;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

/* Pill Style Tabs */
.tabs-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tab-pill {
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(148, 163, 184, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s ease;
}

.tab-pill:hover {
  border-color: rgba(125, 211, 252, 0.5);
  color: #bae6fd;
  background: rgba(56, 189, 248, 0.1);
}

.tab-pill.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.88), rgba(6, 182, 212, 0.88));
  color: white;
  border-color: rgba(186, 230, 253, 0.7);
}

/* Vertical Tabs */
.tabs-vertical {
  display: flex;
  gap: 20px;
}

.tabs-vertical-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 180px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.15);
  padding: 8px;
  border-radius: 10px;
  backdrop-filter: blur(5px);
}

.tab-vertical-btn {
  padding: 10px 14px;
  background: transparent;
  color: rgba(148, 163, 184, 0.86);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  text-align: left;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.tab-vertical-btn:hover {
  background: rgba(56, 189, 248, 0.1);
  color: #bae6fd;
}

.tab-vertical-btn.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.88), rgba(6, 182, 212, 0.88));
  color: white;
  font-weight: 600;
}

.tabs-vertical-content {
  flex: 1;
}

/* Icon Tabs */
.tabs-with-icons {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.15);
  padding: 4px;
  border-radius: 10px;
  flex-wrap: wrap;
}

.tab-with-icon {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: transparent;
  color: rgba(148, 163, 184, 0.86);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}

.tab-with-icon:hover {
  background: rgba(56, 189, 248, 0.1);
  color: #bae6fd;
}

.tab-with-icon.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.88), rgba(6, 182, 212, 0.88));
  color: white;
}

.tab-icon {
  font-size: 18px;
}

/* Segmented Control Style */
.tabs-segmented {
  display: inline-flex;
  gap: 0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(148, 163, 184, 0.14);
  padding: 2px;
  border-radius: 10px;
  margin-bottom: 20px;
}

.tab-segment {
  padding: 8px 16px;
  background: transparent;
  color: rgba(148, 163, 184, 0.85);
  border: none;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tab-segment:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.tab-segment:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
}

.tab-segment:hover {
  background: rgba(56, 189, 248, 0.1);
  color: #bae6fd;
}

.tab-segment.active {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.88), rgba(6, 182, 212, 0.88));
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.22);
}

/* Tab Content */
.tab-content {
  animation: fadeIn 0.3s ease;
}

.sub-tab-content {
  animation: fadeIn 0.25s ease;
}

.nested-tab-content {
  animation: fadeIn 0.2s ease;
}

/* ==================== MODALS ==================== */

.modal-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
}

.modal-content {
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  max-width: 700px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.55);
  animation: slideIn 0.3s ease;
}

.modal-header {
  padding: 20px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.84) 0%, rgba(6, 182, 212, 0.84) 100%);
  color: #e0f2fe;
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2,
.modal-header h3 {
  color: white;
  margin: 0;
}

.modal-close {
  background: rgba(255, 255, 255, 0.16);
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.modal-body {
  padding: 24px;
  color: #e2e8f0;
}

.modal-footer {
  padding: 16px 24px;
  background: rgba(15, 23, 42, 0.68);
  border-top: 1px solid rgba(148, 163, 184, 0.2);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==================== FORMS ==================== */

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-weight: 600;
  color: rgba(186, 230, 253, 0.92);
  font-size: 14px;
}

.form-input,
.form-select,
.form-textarea {
  padding: 10px 12px;
  border: 1.5px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.06);
  color: #e2e8f0;
  backdrop-filter: blur(4px);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

.form-select option {
  background: #1e293b;
  color: #e2e8f0;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: rgba(99, 179, 237, 0.65);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.12);
}

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

.form-error {
  color: #f44336;
  font-size: 12px;
  margin-top: 4px;
}

.form-hint {
  color: rgba(148, 163, 184, 0.85);
  font-size: 12px;
  margin-top: 4px;
}

/* ==================== TABLES ==================== */

.table-container {
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.88));
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.38);
  margin-bottom: 20px;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background: rgba(15, 23, 42, 0.75);
  color: #e2e8f0;
}

.data-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  font-size: 14px;
  color: rgba(226, 232, 240, 0.9);
}

.data-table tbody tr {
  transition: all 0.2s ease;
}

.data-table tbody tr:hover {
  background: rgba(56, 189, 248, 0.08);
}

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

.data-table .row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Staff page contrast hardening */
.staff-page .staff-list-table thead {
  background: #1e293b;
  color: #f8fafc;
}

.staff-page .staff-list-table th {
  color: #f8fafc;
}

.staff-page .staff-list-table td {
  color: #0f172a;
  background: #ffffff;
}

.staff-page .staff-list-table tbody tr:nth-child(even) td {
  background: #f8fafc;
}

.staff-page .staff-list-table tbody tr:hover td {
  background: #e2e8f0;
}

.action-btn {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(125, 211, 252, 0.45);
  color: #bae6fd;
}

.action-btn-edit {
  color: #2196F3;
}

.action-btn-delete {
  color: #f44336;
}

.action-btn-view {
  color: #667eea;
}

/* ==================== LIST ITEMS ==================== */

.list-item {
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.86), rgba(30, 41, 59, 0.84));
  padding: 16px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.list-item:hover {
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.35);
  transform: translateY(-2px) scale(1.01);
}

.list-item-info {
  flex: 1;
}

.list-item-title {
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 4px;
}

.list-item-subtitle {
  font-size: 13px;
  color: rgba(148, 163, 184, 0.85);
}

.list-item-actions {
  display: flex;
  gap: 8px;
  margin-left: 16px;
}

/* ==================== CARDS GRID ==================== */

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.info-card {
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.86));
  border-radius: 14px;
  padding: 20px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  box-shadow: 0 14px 32px rgba(2, 6, 23, 0.35);
  transition: all 0.3s ease;
}

.info-card:hover {
  box-shadow: 0 20px 36px rgba(2, 6, 23, 0.42);
  transform: translateY(-4px) scale(1.01);
}

.info-card-label {
  font-size: 12px;
  color: rgba(125, 211, 252, 0.88);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 8px;
}

.info-card-value {
  font-size: 24px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 8px;
}

.info-card-subtitle {
  font-size: 13px;
  color: rgba(148, 163, 184, 0.84);
}

/* ==================== STATS & METRICS ==================== */

.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.86));
  padding: 18px;
  border-radius: 12px;
  border-left: 4px solid rgba(56, 189, 248, 0.85);
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  border-right: 1px solid rgba(148, 163, 184, 0.12);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.34);
  transition: all 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 18px 32px rgba(2, 6, 23, 0.4);
}

.stat-label {
  font-size: 12px;
  color: rgba(125, 211, 252, 0.88);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: #f1f5f9;
}

.stat-change {
  font-size: 12px;
  color: #4CAF50;
  margin-top: 8px;
  font-weight: 600;
}

/* ==================== BADGES & STATUS ==================== */

.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.status-active {
  background: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
}

.status-inactive {
  background: rgba(244, 63, 94, 0.18);
  color: #fda4af;
}

.status-pending {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.status-completed {
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
}

/* ==================== ALERTS ==================== */

.alert-box {
  padding: 14px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.alert-success {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(110, 231, 183, 0.45);
}

.alert-error {
  background: rgba(244, 63, 94, 0.18);
  color: #fda4af;
  border: 1px solid rgba(253, 164, 175, 0.45);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.18);
  color: #fde68a;
  border: 1px solid rgba(253, 230, 138, 0.45);
}

.alert-info {
  background: rgba(56, 189, 248, 0.18);
  color: #bae6fd;
  border: 1px solid rgba(186, 230, 253, 0.45);
}

.alert-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.alert-message {
  flex: 1;
  font-size: 14px;
}

/* ==================== EMPTY STATES ==================== */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: rgba(148, 163, 184, 0.9);
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.8), rgba(30, 41, 59, 0.76));
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 14px;
}

.empty-state-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state-title {
  font-size: 18px;
  font-weight: 600;
  color: #e2e8f0;
  margin-bottom: 8px;
}

.empty-state-text {
  font-size: 14px;
  color: rgba(148, 163, 184, 0.9);
  margin-bottom: 24px;
}

/* ==================== LOADING STATES ==================== */

.loading-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
  border-radius: 6px;
  height: 20px;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ==================== CONTENT SECTIONS ==================== */

.content-section {
  background: white;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.content-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #f0f0f0;
}

.content-section-title {
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
}

.content-section-subtitle {
  font-size: 14px;
  color: #475569;
  margin-top: 4px;
  margin-bottom: 0;
}

.content-section-body {
  padding: 12px 0;
}

.content-section-footer {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Content Grid Layouts */
.content-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.content-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.content-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

/* Info Display */
.info-group {
  margin-bottom: 20px;
}

.info-item {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

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

.info-label {
  font-weight: 600;
  color: #2c3e50;
  min-width: 150px;
  font-size: 14px;
}

.info-value {
  color: #555;
  font-size: 14px;
  flex: 1;
}

.info-value-editable {
  color: #555;
  font-size: 14px;
  flex: 1;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.info-value-editable:hover {
  background: #f5f5f5;
  color: #667eea;
}

/* Section with Icon */
.section-with-icon {
  display: flex;
  gap: 12px;
  align-items: start;
}

.section-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  border-radius: 8px;
  flex-shrink: 0;
}

.section-icon-content {
  flex: 1;
}

/* Collapsible Section */
.collapsible-section {
  margin-bottom: 16px;
}

.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f9f9f9;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.collapsible-header:hover {
  background: #f0f0f0;
}

.collapsible-header.active {
  background: #667eea;
  color: white;
}

.collapsible-content {
  padding: 16px;
  border: 1px solid #e0e0e0;
  border-top: none;
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

/* Data Display */
.data-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

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

.data-label {
  font-weight: 600;
  color: #2c3e50;
  font-size: 14px;
}

.data-value {
  color: #555;
  font-size: 14px;
  text-align: right;
}

/* Sidebar Layout */
.sidebar-layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 20px;
}

.sidebar {
  background: white;
  border-radius: 10px;
  padding: 16px;
  border: 1px solid #e0e0e0;
  height: fit-content;
  position: sticky;
  top: 90px;
}

.sidebar-item {
  padding: 10px 12px;
  margin-bottom: 6px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-item:hover {
  background: #f5f5f5;
}

.sidebar-item.active {
  background: #667eea;
  color: white;
  font-weight: 600;
}

/* Panel with Header */
.panel {
  background: white;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
  margin-bottom: 20px;
}

.panel-header {
  padding: 16px 20px;
  background: #f9f9f9;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
}

.panel-body {
  padding: 20px;
}

.panel-footer {
  padding: 16px 20px;
  background: #f9f9f9;
  border-top: 1px solid #e0e0e0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Highlight Box */
.highlight-box {
  background: #f0f8ff;
  border-left: 4px solid #2196F3;
  padding: 16px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.highlight-box-success {
  background: #f0f9f4;
  border-left-color: #4CAF50;
}

.highlight-box-warning {
  background: #fff8e1;
  border-left-color: #FF9800;
}

.highlight-box-danger {
  background: #ffebee;
  border-left-color: #f44336;
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e0e0e0;
}

.timeline-item {
  position: relative;
  margin-bottom: 24px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #667eea;
  border: 3px solid white;
  box-shadow: 0 0 0 2px #667eea;
}

.timeline-content {
  background: white;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
}

.timeline-date {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 8px;
}

.timeline-title {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 6px;
}

.timeline-description {
  font-size: 14px;
  color: #475569;
}

/* Card List */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-list-item {
  background: white;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  display: flex;
  gap: 16px;
  align-items: center;
  transition: all 0.2s ease;
  cursor: pointer;
}

.card-list-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateX(4px);
}

.card-list-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  border-radius: 8px;
  font-size: 24px;
  flex-shrink: 0;
}

.card-list-content {
  flex: 1;
}

.card-list-title {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 4px;
}

.card-list-subtitle {
  font-size: 13px;
  color: #64748b;
}

.card-list-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* Steppers */
.stepper {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  position: relative;
}

.stepper::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 0;
  right: 0;
  height: 2px;
  background: #e0e0e0;
  z-index: 0;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  flex: 1;
}

.step-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 3px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.step.active .step-circle {
  background: #667eea;
  border-color: #667eea;
  color: white;
}

.step.completed .step-circle {
  background: #4CAF50;
  border-color: #4CAF50;
  color: white;
}

.step-label {
  font-size: 13px;
  color: #475569;
  text-align: center;
  font-weight: 600;
}

.step.active .step-label {
  color: #667eea;
}

/* Dividers */
.divider-horizontal {
  height: 1px;
  background: #e0e0e0;
  margin: 20px 0;
}

.divider-vertical {
  width: 1px;
  background: #e0e0e0;
  margin: 0 20px;
  align-self: stretch;
}

.divider-text {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
  color: #64748b;
  font-size: 13px;
  font-weight: 600;
}

.divider-text::before,
.divider-text::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

.divider-text::before {
  margin-right: 16px;
}

.divider-text::after {
  margin-left: 16px;
}

/* Quick Actions */
.quick-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 120px;
}

.quick-action-btn:hover {
  border-color: #667eea;
  background: #f8f9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.quick-action-icon {
  font-size: 32px;
  color: #667eea;
}

.quick-action-label {
  font-size: 13px;
  font-weight: 600;
  color: #2c3e50;
  text-align: center;
}

/* Dropdown Menus */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropdown-toggle:hover {
  border-color: #667eea;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  right: 0;
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 180px;
  z-index: 1000;
  animation: slideDown 0.2s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #0f172a;
}

.dropdown-item:hover {
  background: #f5f5f5;
}

.dropdown-item:first-child {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
}

.dropdown-item:last-child {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
}

.dropdown-divider {
  height: 1px;
  background: #e0e0e0;
  margin: 4px 0;
}

/* Checkbox and Radio Styles */
.checkbox-wrapper,
.radio-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.checkbox-wrapper:hover,
.radio-wrapper:hover {
  background: #f5f5f5;
}

.checkbox-input,
.radio-input {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #667eea;
}

.checkbox-label,
.radio-label {
  cursor: pointer;
  font-size: 14px;
  color: #0f172a;
  user-select: none;
}

/* Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

.switch-input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 24px;
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
}

.switch-input:checked + .switch-slider {
  background-color: #667eea;
}

.switch-input:checked + .switch-slider:before {
  transform: translateX(24px);
}

/* File Upload */
.file-upload-wrapper {
  position: relative;
  display: inline-block;
}

.file-upload-input {
  position: absolute;
  width: 0.1px;
  height: 0.1px;
  opacity: 0;
  overflow: hidden;
  z-index: -1;
}

.file-upload-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: white;
  border: 2px dashed #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  color: #475569;
}

.file-upload-label:hover {
  border-color: #667eea;
  background: #f8f9ff;
  color: #667eea;
}

.file-upload-icon {
  font-size: 20px;
}

/* Image Preview */
.image-preview {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f9f9f9;
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-preview-large {
  width: 200px;
  height: 200px;
}

.image-preview-small {
  width: 50px;
  height: 50px;
}

/* Avatar */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e0e0e0;
  color: #475569;
  font-weight: 600;
  font-size: 16px;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

.avatar-lg {
  width: 64px;
  height: 64px;
  font-size: 24px;
}

.avatar-xl {
  width: 96px;
  height: 96px;
  font-size: 32px;
}

/* Chips/Tags */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: #f0f0f0;
  border-radius: 16px;
  font-size: 13px;
  color: #0f172a;
  margin-right: 6px;
  margin-bottom: 6px;
}

.chip-primary {
  background: #e8ebff;
  color: #667eea;
}

.chip-success {
  background: #e8f5e9;
  color: #4CAF50;
}

.chip-danger {
  background: #ffebee;
  color: #f44336;
}

.chip-warning {
  background: #fff3e0;
  color: #FF9800;
}

.chip-removable {
  cursor: pointer;
}

.chip-close {
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  margin-left: 4px;
}

/* Tooltip */
.tooltip-wrapper {
  position: relative;
  display: inline-block;
}

.tooltip-content {
  visibility: hidden;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #2c3e50;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.tooltip-content::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: #2c3e50;
}

.tooltip-wrapper:hover .tooltip-content {
  visibility: visible;
  opacity: 1;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}

.pagination-btn {
  padding: 8px 12px;
  border: 1px solid #e0e0e0;
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
  min-width: 36px;
  text-align: center;
}

.pagination-btn:hover {
  border-color: #667eea;
  color: #667eea;
}

.pagination-btn.active {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.pagination-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Breadcrumbs */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.breadcrumb-item {
  color: #475569;
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-item:hover {
  color: #667eea;
}

.breadcrumb-item.active {
  color: #2c3e50;
  font-weight: 600;
}

.breadcrumb-separator {
  color: #64748b;
}

/* Accordion */
.accordion {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  overflow: hidden;
}

.accordion-item {
  border-bottom: 1px solid #e0e0e0;
}

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

.accordion-header {
  padding: 16px;
  background: white;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
}

.accordion-header:hover {
  background: #f9f9f9;
}

.accordion-header.active {
  background: #f5f5f5;
}

.accordion-title {
  font-weight: 600;
  color: #2c3e50;
  font-size: 15px;
}

.accordion-icon {
  transition: transform 0.2s ease;
}

.accordion-header.active .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  padding: 16px;
  background: white;
  border-top: 1px solid #e0e0e0;
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner-large {
  width: 60px;
  height: 60px;
  border: 6px solid #f3f3f3;
  border-top: 6px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.loading-text {
  margin-top: 16px;
  color: #475569;
  font-size: 14px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10001;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.toast {
  background: white;
  padding: 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: start;
  gap: 12px;
  min-width: 300px;
  max-width: 400px;
  animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 4px;
}

.toast-message {
  font-size: 13px;
  color: #475569;
}

.toast-close {
  cursor: pointer;
  color: #64748b;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}

.toast-success {
  border-left: 4px solid #4CAF50;
}

.toast-error {
  border-left: 4px solid #f44336;
}

.toast-warning {
  border-left: 4px solid #FF9800;
}

.toast-info {
  border-left: 4px solid #2196F3;
}

/* Tabs with Content */
.tabs-wrapper {
  margin-bottom: 20px;
}

.tab-content-wrapper {
  background: white;
  border-radius: 10px;
  padding: 20px;
  border: 1px solid #e0e0e0;
}

/* Stat Cards Row */
.stat-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 12px;
}

.stat-card-icon-primary {
  background: #e8ebff;
  color: #667eea;
}

.stat-card-icon-success {
  background: #e8f5e9;
  color: #4CAF50;
}

.stat-card-icon-danger {
  background: #ffebee;
  color: #f44336;
}

.stat-card-icon-warning {
  background: #fff3e0;
  color: #FF9800;
}

/* Calendar Grid */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
}

.calendar-day:hover {
  background: #f5f5f5;
}

.calendar-day.today {
  background: #667eea;
  color: white;
  font-weight: 600;
}

.calendar-day.selected {
  background: #e8ebff;
  color: #667eea;
  font-weight: 600;
}

.calendar-day.other-month {
  color: #64748b;
}

.calendar-day-header {
  font-weight: 600;
  color: #475569;
  padding: 10px;
  text-align: center;
  font-size: 13px;
  text-transform: uppercase;
}

/* Table Enhancements */
.table-action-cell {
  white-space: nowrap;
}

.table-clickable-row {
  cursor: pointer;
}

.table-clickable-row:hover {
  background: #f8f9ff !important;
}

.table-header-sortable {
  cursor: pointer;
  user-select: none;
}

.table-header-sortable:hover {
  background: #1a252f;
}

.table-sort-icon {
  margin-left: 6px;
  font-size: 12px;
}

.table-no-data {
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
  font-size: 14px;
}

/* Responsive Table */
.table-mobile-card {
  display: none;
}

@media (max-width: 768px) {
  .table-responsive .data-table {
    display: none;
  }
  
  .table-mobile-card {
    display: block;
  }
  
  .mobile-card-item {
    background: white;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-bottom: 12px;
  }
  
  .mobile-card-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
  }
  
  .mobile-card-row:last-child {
    border-bottom: none;
  }
  
  .mobile-card-label {
    font-weight: 600;
    color: #475569;
    font-size: 13px;
  }
  
  .mobile-card-value {
    color: #0f172a;
    font-size: 13px;
    text-align: right;
  }
}

/* Print Styles */
.print-header {
  display: none;
}

.print-footer {
  display: none;
}

@media print {
  .no-print {
    display: none !important;
  }
  
  .print-header {
    display: block;
    text-align: center;
    margin-bottom: 20px;
  }
  
  .print-footer {
    display: block;
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: #475569;
  }
  
  .page-container {
    padding: 0;
  }
  
  .card,
  .content-section,
  .panel {
    box-shadow: none;
    page-break-inside: avoid;
  }
  
  .data-table {
    page-break-inside: auto;
  }
  
  .data-table tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }
}

/* Filter Panel */
.filter-panel {
  background: white;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  margin-bottom: 20px;
}

.filter-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.filter-panel-title {
  font-weight: 600;
  color: #2c3e50;
  font-size: 15px;
}

.filter-panel-toggle {
  cursor: pointer;
  color: #667eea;
  font-size: 13px;
  font-weight: 600;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}

.filter-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 16px;
}

/* Export Options */
.export-menu {
  background: white;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 8px 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.export-option {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.2s ease;
  font-size: 14px;
}

.export-option:hover {
  background: #f5f5f5;
}

.export-icon {
  font-size: 18px;
  color: #667eea;
}

/* Summary Cards */
.summary-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
}

.summary-row:last-child {
  border-bottom: none;
  padding-top: 16px;
  margin-top: 16px;
  border-top: 2px solid #e0e0e0;
  font-weight: 700;
}

.summary-label {
  color: #475569;
  font-size: 14px;
}

.summary-value {
  color: #2c3e50;
  font-size: 14px;
  font-weight: 600;
}

/* Payment/Transaction Cards */
.transaction-card {
  background: white;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.transaction-info {
  flex: 1;
}

.transaction-title {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 4px;
}

.transaction-details {
  font-size: 13px;
  color: #475569;
}

.transaction-amount {
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
}

.transaction-amount-positive {
  color: #4CAF50;
}

.transaction-amount-negative {
  color: #f44336;
}

/* Student/Staff Cards */
.profile-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  border: 1px solid #e0e0e0;
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-size: 20px;
  font-weight: 700;
  color: #2c3e50;
  margin-bottom: 4px;
}

.profile-subtitle {
  font-size: 14px;
  color: #475569;
  margin-bottom: 12px;
}

.profile-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #475569;
}

.profile-meta-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Search Results Highlight */
.search-highlight {
  background: #fff3cd;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 600;
}

/* No Results Message */
.no-results {
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
}

.no-results-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.no-results-title {
  font-size: 18px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
}

.no-results-text {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 24px;
}

/* Status Indicators */
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-dot-success {
  background: #4CAF50;
}

.status-dot-danger {
  background: #f44336;
}

.status-dot-warning {
  background: #FF9800;
}

.status-dot-info {
  background: #2196F3;
}

.status-dot-inactive {
  background: #999;
}

/* Remark Boxes */
.remark-box {
  background: #f9f9f9;
  border-left: 3px solid #667eea;
  padding: 12px;
  border-radius: 6px;
  margin-bottom: 12px;
}

.remark-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.remark-author {
  font-weight: 600;
  color: #2c3e50;
  font-size: 13px;
}

.remark-date {
  font-size: 12px;
  color: #64748b;
}

.remark-content {
  font-size: 14px;
  color: #555;
  line-height: 1.5;
}

/* Contact Info Display */
.contact-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.contact-info-item {
  display: flex;
  align-items: start;
  gap: 12px;
  padding: 12px;
  background: #f9f9f9;
  border-radius: 8px;
}

.contact-info-icon {
  font-size: 20px;
  color: #667eea;
  flex-shrink: 0;
}

.contact-info-content {
  flex: 1;
}

.contact-info-label {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}

.contact-info-value {
  font-size: 14px;
  color: #2c3e50;
  font-weight: 600;
}

/* Editable Fields */
.editable-field {
  position: relative;
  padding: 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.editable-field:hover {
  background: #f5f5f5;
}

.editable-field-edit-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.2s ease;
  cursor: pointer;
  color: #667eea;
  font-size: 16px;
}

.editable-field:hover .editable-field-edit-btn {
  opacity: 1;
}

/* Date Range Picker */
.date-range-inputs {
  display: flex;
  gap: 12px;
  align-items: center;
}

.date-range-separator {
  color: #64748b;
  font-weight: 600;
}

/* Multi-Select Display */
.multi-select-display {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

/* Action Bar */
.action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: #f9f9f9;
  border-radius: 8px;
  margin-bottom: 16px;
}

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

.action-bar-right {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Bulk Select */
.bulk-select-bar {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #2c3e50;
  color: white;
  padding: 16px 24px;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  display: flex;
  gap: 16px;
  align-items: center;
  z-index: 1000;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from {
    transform: translateX(-50%) translateY(100px);
    opacity: 0;
  }
  to {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
  }
}

.bulk-select-count {
  font-weight: 600;
}

.bulk-select-actions {
  display: flex;
  gap: 10px;
}

/* Staff dashboard — freestyle masonry: cards pack into shortest column(s), 5px spacing */
.dashboard-masonry {
  position: relative;
  width: 100%;
  padding: 5px;
  box-sizing: border-box;
}

.dashboard-masonry-brick {
  position: absolute;
  top: 0;
  left: 0;
  box-sizing: border-box;
  transition: opacity 0.12s ease;
}

.dashboard-brick-card,
.dashboard-brick-shell {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.dashboard-brick-card {
  background: #f8f9fa;
  color: #0f172a;
  padding: 10px;
}

.dashboard-brick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
}

.dashboard-brick-title {
  margin: 0;
  font-size: 13px;
  color: #1e293b;
  font-weight: 600;
  min-width: 0;
}

.dashboard-brick-action-hint {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  color: #0f766e;
  background: #ccfbf1;
  border: 1px solid #99f6e4;
  border-radius: 999px;
  padding: 2px 8px;
}

.dashboard-brick-body {
  min-width: 0;
}

.dashboard-brick-card.is-actionable:hover {
  background: #f1f5f9;
}

/* Dashboard timetable — many period columns need horizontal scroll inside the brick */
.dashboard-timetable-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  margin: 0 -2px;
  padding-bottom: 2px;
}

.dashboard-timetable-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  table-layout: auto;
}

.dashboard-timetable-table th,
.dashboard-timetable-table td {
  box-sizing: border-box;
}

.dashboard-brick-shell .notice-dashboard-brick {
  height: auto;
  min-height: 400px;
  max-height: none;
}

.dashboard-brick-shell:has(.notice-dashboard-brick.is-composing) {
  overflow: visible;
  z-index: 20;
}

@media (max-width: 720px) {
  .dashboard-brick-shell:has(.notice-dashboard-brick.is-composing) {
    position: static;
    z-index: auto;
  }
}

.dashboard-brick-shell {
  background: #fff;
}

.dashboard-school-bell-top {
  padding: 0 12px 8px;
}

.dashboard-school-bell-top .dashboard-brick-card {
  width: 100%;
}

.dashboard-priority-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 0 12px 8px;
  align-items: stretch;
}

.dashboard-priority-cell {
  min-width: 0;
  display: flex;
}

.dashboard-priority-cell > * {
  flex: 1;
  min-width: 0;
  width: 100%;
}

@media (max-width: 960px) {
  .dashboard-priority-row {
    grid-template-columns: 1fr;
  }
}

.dashboard-insight-band {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.dashboard-insight-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  padding: 8px 10px;
  width: fit-content;
  max-width: 100%;
  box-sizing: border-box;
  flex: 0 1 auto;
}

.dashboard-insight-panel--reports {
  max-width: min(100%, 560px);
}

.dashboard-insight-panel--agenda {
  max-width: min(100%, 420px);
  flex: 0 1 auto;
  width: fit-content;
}

.dashboard-insight-panel--cwhw {
  max-width: min(100%, 360px);
}

.dashboard-cwhw-progress-hero {
  width: 100%;
  box-sizing: border-box;
  border: none;
  background: transparent;
  padding: 0 0 8px;
  margin: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.dashboard-cwhw-progress-hero-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.dashboard-cwhw-progress-pct {
  font-size: 22px;
  font-weight: 800;
  color: #0e7490;
  line-height: 1;
}

.dashboard-cwhw-progress-meta {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
}

.dashboard-cwhw-progress-track {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.dashboard-cwhw-progress-track--sm {
  height: 5px;
}

.dashboard-cwhw-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0891b2, #14b8a6);
  transition: width 0.2s ease;
}

.dashboard-cwhw-progress-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  max-height: 220px;
  overflow: auto;
}

.dashboard-cwhw-progress-row {
  width: 100%;
  box-sizing: border-box;
  border: none;
  background: transparent;
  padding: 4px 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.dashboard-cwhw-progress-row-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
}

.dashboard-cwhw-progress-class {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.dashboard-cwhw-progress-count {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  white-space: nowrap;
}

.dashboard-cwhw-subject-entry-mark {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid transparent;
  font-weight: 700;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.dashboard-cwhw-subject-entry-mark.is-entered {
  color: #047857;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.dashboard-cwhw-subject-entry-mark.is-missing {
  color: #b45309;
  background: #fffbeb;
  border-color: #fde68a;
}

.dashboard-cwhw-subject-name-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.dashboard-cwhw-field-grid--detail {
  grid-template-columns: 1fr;
}

.dashboard-cwhw-field-grid--detail .dashboard-cwhw-field {
  min-height: 0;
}

.dashboard-cwhw-field-grid--detail .value {
  white-space: pre-wrap;
  word-break: break-word;
}

.dashboard-insight-panel--workdone {
  width: min(100%, 360px);
  min-width: min(100%, 300px);
  max-width: min(100%, 420px);
  flex: 0 1 360px;
}

.dashboard-workdone-summary-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
  min-width: 0;
  max-height: 320px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.dashboard-workdone-summary-row,
button.dashboard-workdone-summary-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0;
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 7px 8px;
  background: #fff;
  font: inherit;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  min-height: 0;
  height: auto;
  box-shadow: none;
}

button.dashboard-workdone-summary-row:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: none;
  transform: none;
}

.dashboard-workdone-summary-row.is-done {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.dashboard-workdone-summary-row.is-partial {
  border-color: #fde68a;
  background: #fffbeb;
}

.dashboard-workdone-summary-row.is-empty {
  border-color: #e2e8f0;
  background: #f8fafc;
}

button.dashboard-workdone-summary-row.is-done:hover {
  background: #f0fdf4;
  border-color: #bbf7d0;
}

button.dashboard-workdone-summary-row.is-partial:hover {
  background: #fffbeb;
  border-color: #fde68a;
}

button.dashboard-workdone-summary-row.is-empty:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.dashboard-workdone-summary-main {
  min-width: 0;
  width: 100%;
}

.dashboard-workdone-summary-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.dashboard-workdone-summary-class {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 800;
  font-size: 12px;
  color: #0f172a;
  line-height: 1.25;
  white-space: normal;
  overflow: visible;
  overflow-wrap: anywhere;
}

.dashboard-workdone-summary-top .dashboard-chip {
  flex-shrink: 0;
}

.dashboard-workdone-summary-meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
}

.dashboard-workdone-bar {
  margin-top: 5px;
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.dashboard-workdone-bar--lg {
  height: 10px;
  margin-top: 0;
  flex: 1;
}

.dashboard-workdone-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  transition: width 0.2s ease;
}

.dashboard-workdone-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.dashboard-workdone-overall {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
}

.dashboard-workdone-overall-label {
  font-size: 12px;
  font-weight: 800;
  color: #166534;
  white-space: nowrap;
}

.dashboard-workdone-overall-meta {
  font-size: 13px;
  font-weight: 800;
  color: #166534;
  white-space: nowrap;
}

.dashboard-workdone-class-grid {
  display: grid;
  gap: 14px;
}

.dashboard-workdone-class-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 48%);
}

.dashboard-workdone-class-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.dashboard-workdone-class-title {
  font-weight: 800;
  font-size: 15px;
  color: #0f172a;
}

.dashboard-workdone-class-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.dashboard-workdone-subject-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.dashboard-workdone-subject-row {
  display: grid;
  grid-template-columns: minmax(90px, 140px) 1fr;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.dashboard-workdone-subject-name {
  font-weight: 700;
  font-size: 12px;
  color: #0f172a;
}

.dashboard-workdone-subject-track {
  min-width: 0;
}

.dashboard-workdone-subject-meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 3px;
}

@media (max-width: 720px) {
  .dashboard-workdone-subject-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

.dashboard-cwhw-summary-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: max-content;
  max-width: 100%;
}

.dashboard-cwhw-summary-row {
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #fff;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.dashboard-cwhw-summary-row.is-filled {
  border-color: #a5f3fc;
  background: #ecfeff;
}

.dashboard-cwhw-summary-row.is-partial {
  border-color: #fde68a;
  background: #fffbeb;
}

.dashboard-cwhw-summary-row.is-empty {
  border-color: #e2e8f0;
  background: #f8fafc;
}

.dashboard-cwhw-summary-main {
  min-width: 0;
}

.dashboard-cwhw-summary-class {
  font-weight: 800;
  font-size: 12px;
  color: #0f172a;
  line-height: 1.25;
}

.dashboard-cwhw-summary-meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
}

.dashboard-cwhw-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.dashboard-cwhw-class-grid {
  display: grid;
  gap: 14px;
}

.dashboard-cwhw-class-card {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 48%);
}

.dashboard-cwhw-class-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.dashboard-cwhw-class-title {
  font-weight: 800;
  font-size: 15px;
  color: #0f172a;
}

.dashboard-cwhw-class-meta {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

.dashboard-cwhw-subject-list {
  display: grid;
  gap: 8px;
}

.dashboard-cwhw-subject-card {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.dashboard-cwhw-subject-card.is-pending {
  background: #f8fafc;
}

.dashboard-cwhw-subject-name {
  font-weight: 800;
  font-size: 13px;
  color: #0f172a;
  margin-bottom: 8px;
}

.dashboard-cwhw-field-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.dashboard-cwhw-field {
  border-radius: 10px;
  padding: 8px 10px;
  border: 1px solid transparent;
  min-height: 58px;
}

.dashboard-cwhw-field .label {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}

.dashboard-cwhw-field .value {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #0f172a;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.dashboard-cwhw-field--cw {
  background: #ecfeff;
  border-color: #a5f3fc;
}

.dashboard-cwhw-field--cw .label {
  color: #0e7490;
}

.dashboard-cwhw-field--hw {
  background: #fff7ed;
  border-color: #fdba74;
}

.dashboard-cwhw-field--hw .label {
  color: #c2410c;
}

.dashboard-cwhw-field--activity {
  background: #fdf2f8;
  border-color: #f9a8d4;
}

.dashboard-cwhw-field--activity .label {
  color: #be185d;
}

.dashboard-insight-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.dashboard-insight-panel-head h3 {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.dashboard-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}

.dashboard-chip-muted {
  color: #475569;
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.dashboard-chip-ok {
  color: #047857;
  background: #d1fae5;
  border-color: #6ee7b7;
}

.dashboard-chip-warn {
  color: #b45309;
  background: #fef3c7;
  border-color: #fcd34d;
}

.dashboard-chip-info {
  color: #1d4ed8;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.dashboard-report-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: max-content;
  max-width: 100%;
}

.dashboard-report-row {
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  background: #fff;
  font: inherit;
  color: inherit;
}

button.dashboard-report-row {
  font: inherit;
}

.dashboard-reports-modal-section {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px;
  background: #f8fafc;
}

.dashboard-reports-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.dashboard-reports-modal-rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dashboard-report-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
  background: #fff;
}

.dashboard-report-info-cell {
  min-width: 120px;
  flex: 1 1 140px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dashboard-report-info-cell .label {
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.dashboard-report-info-cell .value {
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  word-break: break-word;
}

@media (max-width: 720px) {
  .dashboard-report-info-cell {
    min-width: calc(50% - 8px);
    flex: 1 1 calc(50% - 8px);
  }
}

.dashboard-report-row.is-filled {
  border-color: #bbf7d0;
  background: #ecfdf5;
}

.dashboard-report-row.is-pending {
  border-color: #fde68a;
  background: #fffbeb;
}

.dashboard-report-row-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.dashboard-report-meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 1px;
}

.dashboard-progress-track {
  display: none;
}

.dashboard-progress-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 180ms ease;
}

.dashboard-agenda-scroller {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: max-content;
  max-width: 100%;
  max-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.dashboard-agenda-card {
  min-width: 0;
  width: 100%;
  max-width: 320px;
  flex: 0 0 auto;
  text-align: left;
  border: 1px solid #dbeafe;
  background: #f8fbff;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  box-shadow: none;
}

.dashboard-agenda-card:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.dashboard-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-stat-tile {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  min-width: 0;
}

.dashboard-stat-tile .label {
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
  margin-bottom: 4px;
}

.dashboard-stat-tile .value {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
  word-break: break-word;
}

.dashboard-stat-tile .hint {
  font-size: 10px;
  color: #94a3b8;
  margin-top: 3px;
}

.school-bell-card .dashboard-brick-body {
  display: grid;
  gap: 4px;
}

.school-bell-audience {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
  margin: 8px 0 6px;
}

.school-bell-list + .school-bell-list {
  margin-top: 4px;
}

.school-bell-row {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  margin-bottom: 6px;
}

.school-bell-name-btn {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
  cursor: pointer;
}

.school-bell-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-top: 6px;
}

.school-bell-time-btn {
  display: grid;
  gap: 2px;
  text-align: left;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
}

.school-bell-time-btn .lbl {
  font-size: 9px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
}

.school-bell-time-btn .val {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.school-bell-period-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.school-bell-period-chips span {
  font-size: 10px;
  font-weight: 700;
  color: #0f766e;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 999px;
  padding: 2px 7px;
}

.school-bell-modal {
  padding: 16px 18px 20px;
  min-width: min(720px, 100%);
  max-height: min(86vh, 860px);
  overflow: auto;
}

.school-bell-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.school-bell-modal-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0f766e;
}

.school-bell-modal-head h3 {
  margin: 4px 0 0;
  font-size: 18px;
  color: #0f172a;
}

.school-bell-mode-toggle {
  display: inline-flex;
  background: #f1f5f9;
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 12px;
}

.school-bell-mode-toggle button {
  border: none;
  background: transparent;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
}

.school-bell-mode-toggle button.is-active {
  background: #fff;
  color: #0f766e;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.school-bell-default-layout {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.school-bell-group-nav {
  display: grid;
  gap: 6px;
}

.school-bell-group-nav button {
  display: grid;
  gap: 2px;
  text-align: left;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.school-bell-group-nav button.is-active {
  border-color: #99f6e4;
  background: #f0fdfa;
}

.school-bell-group-nav button strong {
  font-size: 13px;
  color: #0f172a;
}

.school-bell-group-nav button span {
  font-size: 11px;
  color: #64748b;
}

.school-bell-group-nav .school-bell-field {
  margin-top: 8px;
  font-weight: 600;
}

.school-bell-group-edit,
.school-bell-editor {
  display: grid;
  gap: 10px;
}

.school-bell-field,
.school-bell-time-grid label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.school-bell-field input,
.school-bell-time-grid input,
.school-bell-period-row input {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  background: #fff;
}

.school-bell-time-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.school-bell-period-list {
  display: grid;
  gap: 8px;
}

.school-bell-weekday {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  padding: 10px;
  display: grid;
  gap: 8px;
}

.school-bell-editor > .school-bell-weekday {
  grid-template-columns: minmax(92px, 120px) minmax(0, 1fr);
  align-items: center;
}

.school-bell-weekday-name {
  font-size: 12px;
  font-weight: 800;
  color: #0f766e;
}

.school-bell-period-row {
  display: grid;
  grid-template-columns: minmax(70px, 0.7fr) 1fr 1fr auto;
  gap: 6px;
  align-items: center;
}

.school-bell-members {
  display: grid;
  gap: 6px;
}

.school-bell-members-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.school-bell-members-list {
  max-height: 180px;
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  padding: 6px;
}

.school-bell-members-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  font-size: 12px;
  color: #1e293b;
}

.school-bell-members-list .school-bell-late-flag {
  padding: 0;
  gap: 0;
}

.school-bell-staff-radius-row,
.school-bell-staff-flag-legend {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 56px 78px;
  align-items: center;
  column-gap: 6px;
  width: 100%;
}

.school-bell-staff-assign {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.school-bell-staff-assign span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.school-bell-staff-radius-row input[type='number'] {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px 6px;
  font-size: 12px;
  font-weight: 700;
}

.school-bell-staff-flag-legend {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  padding: 2px 6px 6px;
  margin: -6px -6px 2px;
  border-bottom: 1px solid #e2e8f0;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.school-bell-staff-flag-legend span:nth-child(n + 2) {
  text-align: center;
}

.school-bell-late-flag {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

.school-bell-members-list .school-bell-staff-assign {
  padding: 0;
}

.school-bell-members-list .school-bell-staff-radius-row {
  padding: 4px 6px;
}

.school-bell-note {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

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

.school-bell-primary-btn,
.school-bell-ghost-btn,
.school-bell-danger-btn {
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.school-bell-primary-btn {
  background: #0f766e;
  color: #fff;
  border: none;
}

.school-bell-ghost-btn {
  background: #fff;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.school-bell-danger-btn {
  background: #fff;
  color: #b91c1c;
  border: 1px solid #fecaca;
  justify-self: start;
}

@media (max-width: 720px) {
  .school-bell-default-layout,
  .school-bell-period-row,
  .school-bell-times,
  .school-bell-editor > .school-bell-weekday {
    grid-template-columns: 1fr;
  }
}

.dashboard-info-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.dashboard-info-item {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 10px;
  padding: 8px 10px;
}

.dashboard-info-item .title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-info-item .meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dashboard-section-note {
  font-size: 11px;
  color: #64748b;
  margin-top: 8px;
}

.dashboard-accounts-statement {
  margin-top: 10px;
  max-height: 220px;
  overflow-y: auto;
  display: grid;
  gap: 6px;
  padding-right: 2px;
  -webkit-overflow-scrolling: touch;
}

.dashboard-accounts-statement-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  border-radius: 10px;
  padding: 8px 10px;
}

.dashboard-accounts-statement-row .title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dashboard-accounts-statement-row .meta {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

.dashboard-directory-scroll {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 8px;
  -webkit-overflow-scrolling: touch;
}

.dashboard-directory-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 8px;
  padding: 6px 8px;
}

.dashboard-directory-row .title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.25;
}

.dashboard-directory-row .meta {
  font-size: 10px;
  color: #64748b;
  margin-top: 2px;
}

.dashboard-geo-brick {
  margin-top: 4px;
}

.dashboard-geo-brick-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.dashboard-geo-brick-counts {
  display: flex;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #475569;
}

.dashboard-geo-brick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dashboard-geo-brick-map {
  height: 260px;
  width: 100%;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

/* Poke hub layout */
.staff-poked-hub-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: 14px;
  min-height: 0;
  flex: 1;
}

.staff-poked-hub-staff {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid #e2e8f0;
  padding-right: 12px;
}

.staff-poked-hub-staff-toggle {
  display: none;
}

.staff-poked-hub-staff-dropdown {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
}

.staff-poked-hub-staff-scroll,
.staff-poked-hub-detail-scroll {
  overflow-y: auto;
  display: grid;
  gap: 6px;
  flex: 1;
  min-height: 0;
}

.staff-poked-hub-detail {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.staff-poked-hub-detail-scroll {
  gap: 8px;
}

@media (max-width: 720px) {
  .app-page-modal-overlay:has(.staff-poked-hub) {
    align-items: flex-start;
    overflow: visible;
  }

  .app-page-modal-overlay:has(.staff-poked-hub) .ilm-modal-panel {
    overflow: visible;
    width: 100%;
    max-width: 100%;
  }

  .staff-poked-hub {
    width: min(96vw, 760px) !important;
    max-height: 92vh !important;
    overflow: visible !important;
    position: relative;
    z-index: 1;
  }

  .staff-poked-hub:hover {
    transform: none;
  }

  .staff-poked-hub-layout {
    grid-template-columns: 1fr;
    gap: 10px;
    overflow: visible;
  }

  .staff-poked-hub-staff {
    position: relative;
    z-index: 40;
    border-right: none;
    padding-right: 0;
    border: none;
    border-radius: 0;
    padding: 0;
    background: transparent;
    max-height: none;
    overflow: visible;
  }

  .staff-poked-hub-staff-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 10px;
    padding: 10px 12px;
    cursor: pointer;
    text-align: left;
    margin-bottom: 0;
    position: relative;
    z-index: 41;
  }

  .staff-poked-hub-staff-toggle-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  .staff-poked-hub-staff-toggle-main strong {
    font-size: 14px;
    color: #0f172a;
  }

  .staff-poked-hub-staff-toggle-meta {
    font-size: 11px;
    color: #64748b;
  }

  .staff-poked-hub-staff-chevron {
    flex-shrink: 0;
    font-size: 14px;
    color: #475569;
  }

  /* Floating staff dropdown on top of the poke modal body */
  .staff-poked-hub-staff-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 50;
    display: flex;
    flex-direction: column;
    max-height: min(55vh, 360px);
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.28);
    overflow: hidden;
  }

  .staff-poked-hub-staff-scroll {
    max-height: none;
    flex: 1 1 auto;
  }

  .staff-poked-hub-detail {
    min-height: 240px;
    position: relative;
    z-index: 1;
  }
}

/* Staff dashboard — mobile / narrow viewports */
.dash-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dash-tab-row {
  gap: 8px;
}

@media (max-width: 720px) {
  .dashboard-page {
    padding-bottom: 24px;
    max-width: 100vw;
    overflow-x: hidden;
  }

  .dashboard-page h1 {
    font-size: 18px !important;
  }

  .dashboard-insight-band {
    flex-direction: column;
  }

  .dashboard-insight-panel {
    width: 100%;
    min-width: 0;
    flex: 1 1 auto;
    max-width: 100%;
  }

  .dashboard-insight-panel--reports,
  .dashboard-insight-panel--cwhw,
  .dashboard-insight-panel--workdone,
  .dashboard-insight-panel--agenda {
    max-width: 100%;
    width: 100%;
  }

  .dashboard-cwhw-summary-list,
  .dashboard-cwhw-summary-row,
  .dashboard-cwhw-progress-list,
  .dashboard-cwhw-progress-row,
  .dashboard-workdone-summary-list,
  .dashboard-workdone-summary-row {
    width: 100%;
  }

  .dashboard-agenda-scroller {
    display: flex;
    flex-direction: column;
    overflow-x: visible;
    max-height: none;
  }

  .dashboard-agenda-card {
    min-width: 0;
    width: 100%;
  }

  .dashboard-geo-brick-map {
    height: 220px;
  }

  .dashboard-stat-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  .dash-modal-overlay {
    padding: 10px !important;
    padding-top: 10px !important;
    align-items: flex-start !important;
    justify-content: center !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
  }

  .dash-modal-panel {
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: calc(100dvh - 20px) !important;
    margin: 0 auto !important;
    border-radius: 12px !important;
    box-sizing: border-box;
  }

  .dash-modal-panel--padded {
    padding: 16px !important;
  }

  .dash-detail-grid,
  .dash-detail-grid--3,
  .dash-card-grid,
  .dash-card-grid--3 {
    grid-template-columns: 1fr !important;
  }

  .dash-tab-row {
    gap: 6px !important;
    padding: 10px 12px !important;
  }

  .dash-tab-row button {
    padding: 6px 10px !important;
    font-size: 12px !important;
  }

  .dash-table-scroll {
    margin: 0 -4px;
    padding-bottom: 4px;
  }

  .dash-table-scroll table {
    min-width: 480px;
  }

  /* —— Mobile dashboard: bento tiles + bottom sheet —— */
  .dashboard-page {
    --dash-ink: #0b1220;
    --dash-sea: #0f766e;
    background: linear-gradient(180deg, #f3f6fb 0%, #e8eef6 100%);
  }

  .dashboard-insight-band--desktop,
  .dashboard-school-bell-top,
  .dashboard-priority-row {
    display: none !important;
  }

  .dashboard-page > div:first-child {
    padding: 12px 14px 0 !important;
    margin-bottom: 6px !important;
    align-items: center !important;
  }

  .dashboard-page h1 {
    font-family: "Space Grotesk", "Sora", "Segoe UI", sans-serif !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    letter-spacing: -0.04em;
    color: var(--dash-ink) !important;
    line-height: 1.05;
  }

  .dashboard-masonry.is-mobile {
    position: relative;
    display: block;
    height: auto !important;
    padding: 4px 14px 28px;
    overflow: visible;
  }

  .dashboard-mobile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .dashboard-mobile-tile {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-height: 108px;
    padding: 14px 12px 12px;
    border: 1px solid rgba(11, 18, 32, 0.07);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 20px rgba(11, 18, 32, 0.06);
    text-align: left;
    color: var(--dash-ink);
    cursor: pointer;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    animation: dash-tile-in 420ms cubic-bezier(0.22, 1, 0.36, 1) both;
    animation-delay: calc(var(--dash-brick-i, 0) * 24ms);
    transition: transform 140ms ease;
  }

  .dashboard-mobile-tile.is-featured {
    min-height: 118px;
    background:
      linear-gradient(145deg, #ffffff 0%, color-mix(in srgb, var(--dash-tile-accent, #0f766e) 8%, #fff) 100%);
    border-color: color-mix(in srgb, var(--dash-tile-accent, #0f766e) 22%, transparent);
  }

  .dashboard-mobile-tile:active {
    transform: scale(0.975);
  }

  .dashboard-mobile-tile-glow {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--dash-tile-accent, #0f766e);
  }

  .dashboard-mobile-tile-icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    font-size: 18px;
    background: color-mix(in srgb, var(--dash-tile-accent, #0f766e) 12%, #fff);
  }

  .dashboard-mobile-tile-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    width: 100%;
    padding-right: 22px;
  }

  .dashboard-mobile-tile-title {
    font-family: "Space Grotesk", "Sora", "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.15;
    color: var(--dash-ink);
  }

  .dashboard-mobile-tile-teaser {
    font-family: "Sora", "Segoe UI", sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .dashboard-mobile-tile-arrow {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    color: #fff;
    background: var(--dash-tile-accent, #0f766e);
  }

  @keyframes dash-tile-in {
    from {
      opacity: 0;
      transform: translateY(12px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .dashboard-mobile-sheet-root {
    position: fixed;
    inset: 0;
    z-index: 12000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    animation: dash-sheet-backdrop-in 200ms ease both;
  }

  .dashboard-mobile-sheet-backdrop {
    position: absolute;
    inset: 0;
    border: none;
    padding: 0;
    margin: 0;
    background: rgba(11, 18, 32, 0.45);
    backdrop-filter: blur(5px);
    cursor: pointer;
  }

  .dashboard-mobile-sheet {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: min(86dvh, 900px);
    border-radius: 24px 24px 0 0;
    background: #f8fafc;
    box-shadow: 0 -16px 40px rgba(11, 18, 32, 0.22);
    --dash-sheet-y: 0px;
    transform: translateY(var(--dash-sheet-y));
    animation: dash-sheet-up 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
    overflow: hidden;
    will-change: transform;
  }

  .dashboard-mobile-sheet.is-dragging {
    animation: none;
    transition: none;
  }

  .dashboard-mobile-sheet-grab {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    padding: 10px 0 2px;
    cursor: grab;
    touch-action: none;
  }

  .dashboard-mobile-sheet-handle {
    width: 40px;
    height: 4px;
    border-radius: 6px;
    background: #cbd5e1;
  }

  .dashboard-mobile-sheet-head {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 4px 16px 12px;
    border-bottom: 1px solid rgba(11, 18, 32, 0.06);
  }

  .dashboard-mobile-sheet-head-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }

  .dashboard-mobile-sheet-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 20px;
    background: color-mix(in srgb, var(--dash-sheet-accent, #0f766e) 14%, #fff);
  }

  .dashboard-mobile-sheet-head h2 {
    margin: 0;
    font-family: "Space Grotesk", "Sora", "Segoe UI", sans-serif;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.04em;
    color: var(--dash-ink);
    line-height: 1.1;
  }

  .dashboard-mobile-sheet-head p {
    margin: 3px 0 0;
    font-family: "Sora", "Segoe UI", sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
  }

  .dashboard-mobile-sheet-close {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(11, 18, 32, 0.1);
    border-radius: 10px;
    background: #fff;
    color: #334155;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
  }

  .dashboard-mobile-sheet-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .dashboard-mobile-sheet-body .dashboard-brick-card,
  .dashboard-mobile-sheet-body .dashboard-brick-shell {
    border: none;
    box-shadow: none;
    background: transparent;
    border-radius: 0;
    padding: 0;
  }

  .dashboard-mobile-sheet-body .dashboard-brick-head {
    display: none;
  }

  .dashboard-mobile-sheet-body .dashboard-stat-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
  }

  .dashboard-mobile-sheet-body .dashboard-brick-shell .notice-dashboard-brick {
    min-height: 240px;
  }

  .dashboard-mobile-sheet-body .dashboard-report-list,
  .dashboard-mobile-sheet-body .dashboard-cwhw-progress-list,
  .dashboard-mobile-sheet-body .dashboard-cwhw-summary-list,
  .dashboard-mobile-sheet-body .dashboard-workdone-summary-list,
  .dashboard-mobile-sheet-body .dashboard-agenda-scroller {
    width: 100%;
    max-width: 100%;
  }

  .dashboard-mobile-sheet-body .dashboard-cwhw-summary-row,
  .dashboard-mobile-sheet-body .dashboard-workdone-summary-row {
    width: 100%;
  }

  .dashboard-mobile-sheet-body .dashboard-report-row,
  .dashboard-mobile-sheet-body .dashboard-agenda-card {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .dashboard-mobile-sheet-body .dashboard-agenda-scroller {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow: visible;
    max-height: none;
  }

  .dashboard-insight-more {
    margin-top: 12px;
    width: 100%;
    border: 1px solid rgba(11, 18, 32, 0.1);
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font-family: "Sora", "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 10px 12px;
    cursor: pointer;
  }

  @keyframes dash-sheet-up {
    from {
      transform: translateY(24%);
      opacity: 0.7;
    }
    to {
      transform: translateY(var(--dash-sheet-y, 0px));
      opacity: 1;
    }
  }

  @keyframes dash-sheet-backdrop-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

.dashboard-insight-band--desktop .dashboard-insight-more {
  display: none;
}

/* Desktop: no mobile sheet chrome leftovers */
.dashboard-masonry:not(.is-mobile) .dashboard-mobile-tile,
.dashboard-masonry:not(.is-mobile) .dashboard-mobile-kicker,
.dashboard-masonry:not(.is-mobile) .dashboard-mobile-orbit {
  display: none;
}

/* Parent/Staff Dashboard Specific */
.dashboard-container {
  min-height: 100vh;
  background: #f5f5f5;
  padding-top: 15px;
}

.dashboard-header {
  background: #2c3e50;
  color: white;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.dashboard-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: bold;
  color: white;
}

.logout-btn {
  background: #e74c3c;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
}

.user-welcome {
  background: white;
  border-bottom: 1px solid #e0e0e0;
  padding: 20px;
}

.user-welcome-label {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-welcome-name {
  margin: 0 0 5px 0;
  font-size: 22px;
  font-weight: bold;
  color: #2c3e50;
}

.user-welcome-role {
  margin: 0;
  font-size: 12px;
  color: #475569;
}

/* Student Selection Cards */
.student-select-title {
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: bold;
  color: #2c3e50;
}

.student-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.student-select-card {
  padding: 16px;
  background: white;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.student-select-card:hover {
  border-color: #667eea;
  background: #f8f9ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.student-select-info {
  flex: 1;
}

.student-select-name {
  margin: 0 0 6px 0;
  font-size: 15px;
  font-weight: 600;
  color: #2c3e50;
}

.student-select-details {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #475569;
}

.student-select-details p {
  margin: 0;
}

.student-select-details span {
  font-weight: 500;
  color: #2c3e50;
}

.student-select-icon {
  font-size: 32px;
}

/* Student Dashboard Header */
.student-dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e0e0e0;
}

.student-dashboard-info h2 {
  margin: 0 0 6px 0;
  font-size: 22px;
  font-weight: bold;
  color: #2c3e50;
}

.student-dashboard-info p {
  margin: 0;
  font-size: 13px;
  color: #64748b;
}

.back-to-selection-btn {
  padding: 10px 16px;
  background: #e0e0e0;
  color: #0f172a;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

/* Dashboard Tabs */
.dashboard-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 25px;
  border-bottom: 2px solid #e0e0e0;
}

.dashboard-tab {
  padding: 12px 24px;
  background: transparent;
  color: #475569;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  font-weight: normal;
  font-size: 14px;
  transition: all 0.2s ease;
}

.dashboard-tab:hover {
  background: rgba(102, 126, 234, 0.05);
}

.dashboard-tab.active {
  background: #667eea;
  color: white;
  border-bottom-color: #667eea;
  font-weight: bold;
}

/* Attendance Status Card */
.attendance-status-card {
  margin-bottom: 25px;
  padding: 20px;
  border-radius: 10px;
  border: 2px solid;
}

.attendance-status-header {
  display: flex;
  align-items: center;
  gap: 15px;
}

.attendance-status-icon {
  font-size: 40px;
  font-weight: bold;
}

.attendance-status-label {
  margin: 0 0 4px 0;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.attendance-status-title {
  margin: 0;
  font-size: 20px;
  font-weight: bold;
}

.attendance-remarks {
  margin: 6px 0 0 0;
  font-size: 12px;
  color: #475569;
}

.attendance-timestamp {
  margin: 4px 0 0 0;
  font-size: 11px;
  color: #64748b;
}

/* Personal Info Section */
.personal-info-section {
  margin-bottom: 25px;
  padding: 20px;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
}

.personal-info-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.personal-info-title {
  margin: 0;
  font-size: 16px;
  font-weight: bold;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 8px;
}

.edit-toggle-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}

.photo-upload-section {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  gap: 20px;
  align-items: center;
}

.photo-upload-section > div:first-child {
  flex: 1;
}

.photo-upload-label {
  margin: 0 0 10px 0;
  font-size: 12px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
}

.photo-upload-controls {
  display: flex;
  gap: 10px;
  align-items: center;
}

.photo-upload-input {
  flex: 1;
}

.photo-preview {
  width: 100px;
  height: 100px;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
  overflow: hidden;
}

.photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.save-success-msg {
  color: #4CAF50;
  font-size: 13px;
  font-weight: 600;
}

/* Info Grid */
.info-display-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.info-display-item {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

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

.info-display-label {
  font-weight: 600;
  color: #475569;
  font-size: 13px;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.info-display-value {
  color: #2c3e50;
  font-size: 15px;
  font-weight: 500;
}

.info-display-full-width {
  grid-column: 1 / -1;
}

/* Marks/Grades Display */
.marks-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.marks-section-title {
  font-size: 18px;
  font-weight: 700;
  color: #2c3e50;
}

.exam-selector {
  padding: 8px 12px;
  border: 2px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  background: white;
}

.marks-table-wrapper {
  overflow-x: auto;
  margin-bottom: 20px;
}

.marks-summary {
  background: #f9f9f9;
  padding: 16px;
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.marks-summary-item {
  text-align: center;
}

.marks-summary-label {
  font-size: 12px;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 6px;
}

.marks-summary-value {
  font-size: 24px;
  font-weight: 700;
  color: #2c3e50;
}

/* Attendance Stats */
.attendance-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.attendance-stat-box {
  text-align: center;
  padding: 10px;
  color: white;
  border-radius: 6px;
}

.attendance-stat-box.present {
  background: #28a745;
}

.attendance-stat-box.absent {
  background: #dc3545;
}

.attendance-stat-box.late {
  background: #ffc107;
}

.attendance-stat-box.half-day {
  background: #17a2b8;
}

.attendance-stat-box.percentage {
  background: #6c757d;
}

.attendance-stat-value {
  font-size: 24px;
  font-weight: bold;
}

.attendance-stat-label {
  font-size: 14px;
}

/* Bulk Actions */
.bulk-action-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.bulk-action-buttons {
  display: flex;
  gap: 10px;
}

/* Status Buttons */
.status-btn {
  padding: 6px 12px;
  border: 1px solid;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s ease;
}

.status-btn-present {
  background: white;
  color: #28a745;
  border-color: #28a745;
}

.status-btn-present.active {
  background: #28a745;
  color: white;
}

.status-btn-absent {
  background: white;
  color: #dc3545;
  border-color: #dc3545;
}

.status-btn-absent.active {
  background: #dc3545;
  color: white;
}

.status-btn-late {
  background: white;
  color: #ffc107;
  border-color: #ffc107;
}

.status-btn-late.active {
  background: #ffc107;
  color: white;
}

.status-btn-half {
  background: white;
  color: #17a2b8;
  border-color: #17a2b8;
}

.status-btn-half.active {
  background: #17a2b8;
  color: white;
}

/* History Cards */
.history-card {
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 20px;
}

.history-card-header {
  background: #f8f9fa;
  padding: 12px 15px;
  border-bottom: 1px solid #ddd;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-card-header h4 {
  margin: 0;
}

.history-stats {
  display: flex;
  gap: 15px;
  font-size: 14px;
}

.history-card-body {
  padding: 15px;
}

/* Not Found State */
.not-found-state {
  margin-top: 30px;
  padding: 30px;
  background: #ffebee;
  border-radius: 10px;
  text-align: center;
}

.not-found-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.not-found-title {
  color: #c62828;
  margin-bottom: 10px;
}

.not-found-message {
  color: #475569;
  font-size: 14px;
}

/* Deleted Row */
.row-deleted {
  text-decoration: line-through;
  opacity: 0.5;
}

/* RESPONSIVE ==================== */

@media (max-width: 768px) {
  .app-header {
    padding: 12px 16px;
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .app-header h1 {
    font-size: 24px;
  }

  .app-header nav {
    width: 100%;
  }

  .page-container {
    padding: 16px;
  }

  .page-shell {
    padding: 16px 14px 32px 14px;
  }

  .page-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .search-bar {
    flex-direction: column;
  }

  .search-input {
    width: 100%;
  }

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

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

  .data-table {
    font-size: 12px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
  }

  .list-item {
    flex-direction: column;
    gap: 12px;
  }

  .list-item-actions {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .content-grid-2,
  .content-grid-3,
  .content-grid-4 {
    grid-template-columns: 1fr;
  }

  .info-item {
    flex-direction: column;
    gap: 6px;
  }

  .info-label {
    min-width: auto;
  }

  .sub-tabs-container {
    flex-direction: column;
  }

  .sub-tab-btn {
    width: 100%;
    text-align: left;
  }

  .dashboard-tabs {
    flex-wrap: wrap;
  }

  .dashboard-tab {
    flex: 1;
    min-width: 100px;
  }

  .info-display-grid {
    grid-template-columns: 1fr;
  }

  .student-dashboard-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

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

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

  .photo-upload-section {
    flex-direction: column;
  }

  .sidebar-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    top: 0;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 22px;
  }

  .modal-content {
    max-width: calc(100% - 20px);
  }

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

  .row-actions {
    flex-direction: column;
    width: 100%;
  }

  .action-btn {
    width: 100%;
  }

  .dashboard-header {
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }

  .marks-summary {
    grid-template-columns: 1fr;
  }

  .attendance-stats-grid {
    grid-template-columns: 1fr;
  }

  .history-stats {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }

  .bulk-action-bar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }

  .bulk-action-buttons {
    flex-direction: column;
  }

  .page-container {
    padding: 12px;
  }

  .page-shell {
    padding: 12px 10px 24px 10px;
  }
}

@media (max-width: 480px) {
  .page-title {
    font-size: 22px;
  }

  .modal-content {
    max-width: calc(100% - 20px);
  }

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

  .row-actions {
    flex-direction: column;
    width: 100%;
  }

  .action-btn {
    width: 100%;
  }
}

/* ============================================
   RECEPTION PAGE - UNIQUE LAYOUTS
   ============================================ */

/* Reception page gradient header */
.reception-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 24px;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  margin-bottom: 0;
}

.reception-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.reception-header-title h2 {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 700;
}

.reception-header-title p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
}

.reception-header-actions {
  display: flex;
  gap: 12px;
}

/* Reception glass buttons */
.reception-glass-btn {
  background: rgba(255,255,255,0.2);
  color: white;
  border: 2px solid rgba(255,255,255,0.4);
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s;
  backdrop-filter: blur(10px);
}

.reception-glass-btn:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

/* Reception tabs with badges */
.reception-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
  border-bottom: 2px solid #E0E7FF;
  padding-bottom: 12px;
}

.reception-tab-btn {
  padding: 10px 20px;
  border-radius: 8px 8px 0 0;
  font-size: 15px;
  font-weight: 500;
  border: none;
  background: transparent;
  color: #475569;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.reception-tab-btn.active {
  font-weight: 700;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

.reception-tab-badge {
  background: #FF6B6B;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 12px;
  color: white;
}

.reception-tab-badge.info {
  background: #4ECDC4;
}

/* Reception stat cards - animated gradient */
.reception-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.reception-stat-card {
  padding: 24px;
  border-radius: 12px;
  color: white;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
  transition: all 0.3s;
}

.reception-stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.reception-stat-card.primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.reception-stat-card.pink {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  box-shadow: 0 4px 15px rgba(245, 87, 108, 0.4);
}

.reception-stat-card.blue {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  box-shadow: 0 4px 15px rgba(79, 172, 254, 0.4);
}

.reception-stat-content {
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.reception-stat-info p {
  margin: 0 0 8px 0;
  font-size: 13px;
  opacity: 0.9;
  font-weight: 600;
}

.reception-stat-number {
  font-size: 42px;
  font-weight: 800;
  margin: 0;
}

.reception-stat-label {
  font-size: 12px;
  opacity: 0.85;
}

.reception-stat-icon {
  font-size: 32px;
}

/* Reception visitor cards */
.reception-visitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.reception-visitor-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  border-left: 4px solid #667eea;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: all 0.3s;
}

.reception-visitor-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

.reception-visitor-card.status-in {
  border-left-color: #4CAF50;
}

.reception-visitor-card.status-out {
  border-left-color: #64748b;
}

.reception-visitor-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
}

.reception-visitor-name {
  font-weight: 700;
  font-size: 16px;
  color: #2c3e50;
  margin: 0 0 4px 0;
}

.reception-visitor-status {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.reception-visitor-status.in {
  background: #E8F5E9;
  color: #2E7D32;
}

.reception-visitor-status.out {
  background: #F5F5F5;
  color: #757575;
}

.reception-visitor-details {
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
}

.reception-visitor-details p {
  margin: 4px 0;
}

.reception-visitor-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f0f0f0;
}

/* Reception modal enhancements */
.reception-modal-content {
  background: white;
  border-radius: 16px;
  padding: 30px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.reception-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.reception-form-group {
  margin-bottom: 16px;
}

.reception-page {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 20px;
  padding-bottom: 32px;
}

.reception-page__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.reception-page__header-copy {
  min-width: 0;
  flex: 1 1 220px;
}

.reception-page__header-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.reception-status-banner {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e3a8a;
  font-size: 14px;
}

.reception-status-banner.is-error {
  background: #fef2f2;
  color: #991b1b;
}

.reception-tabs-scroll {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid #ddd;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  flex-wrap: nowrap;
  max-width: 100%;
  scrollbar-width: thin;
  padding-bottom: 4px;
  touch-action: pan-x pan-y;
}

.reception-tabs-scroll > button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.reception-tab-panel {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.reception-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* ============================================
   COMPETITIONS PAGE - UNIQUE LAYOUTS
   ============================================ */

/* Competition tabs with emoji */
.competition-tabs {
  display: flex;
  gap: 10px;
  border-bottom: 2px solid #e0e0e0;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.competition-tab-btn {
  padding: 10px 20px;
  background: #e0e0e0;
  color: #0f172a;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 6px;
}

.competition-tab-btn.active {
  background: #2c3e50;
  color: white;
}

.competition-tab-btn:hover:not(.active) {
  background: #d0d0d0;
}

/* Competition cards grid */
.competition-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.competition-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.3s;
}

.competition-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transform: translateY(-4px);
}

.competition-card-title {
  margin: 0 0 10px 0;
  color: #2c3e50;
  font-size: 18px;
  font-weight: 700;
}

.competition-card-description {
  margin: 5px 0;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
}

.competition-card-meta {
  margin: 5px 0;
  font-size: 12px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 6px;
}

.competition-card-meta.capitalize {
  text-transform: capitalize;
}

/* Competition winners section */
.competition-winners-section {
  margin: 15px 0;
  padding: 10px;
  background: #f5f5f5;
  border-radius: 4px;
}

.competition-winners-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.competition-winners-list {
  margin: 8px 0 0 0;
  padding: 0 0 0 20px;
  font-size: 12px;
  list-style: none;
}

.competition-winners-list li {
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.competition-winners-empty {
  margin: 8px 0 0 0;
  font-size: 12px;
  color: #64748b;
  font-style: italic;
}

/* Competition prizes section */
.competition-prizes-section {
  margin: 15px 0;
  padding: 10px;
  background: #f0f7ff;
  border-radius: 4px;
  border-left: 3px solid #2196F3;
}

.competition-prizes-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #2196F3;
}

.competition-prizes-list {
  margin: 8px 0 0 0;
  padding: 0 0 0 20px;
  font-size: 12px;
}

.competition-prizes-list li {
  margin-bottom: 4px;
}

/* Competition form container */
.competition-form-container {
  max-width: 600px;
  margin: 0 auto;
}

.competition-form-card {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 25px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.competition-form-title {
  margin: 0 0 20px 0;
  font-size: 24px;
  font-weight: 700;
  color: #2c3e50;
}

/* Competition class checkbox grid */
.competition-checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

.competition-checkbox-label {
  display: flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
  border-radius: 4px;
  transition: background 0.2s;
}

.competition-checkbox-label:hover {
  background: #f5f5f5;
}

/* Competition prize builder */
.competition-prize-builder {
  margin: 20px 0;
  padding: 15px;
  background: #f9f9f9;
  border-radius: 8px;
  border: 2px dashed #ddd;
}

.competition-prize-row {
  display: grid;
  grid-template-columns: 80px 1fr 120px auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 10px;
}

.competition-prize-item {
  padding: 10px;
  background: white;
  border-radius: 4px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #e0e0e0;
}

.competition-prize-details {
  flex: 1;
}

.competition-prize-remove {
  background: #f44336;
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s;
}

.competition-prize-remove:hover {
  background: #d32f2f;
}

/* Competition winner selector */
.competition-winner-selector {
  margin-top: 20px;
}

.competition-winner-search {
  position: relative;
}

.competition-winner-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 300px;
  overflow-y: auto;
  background: white;
  color: #475569 !important;
  opacity: 1 !important;
}

.competition-empty-state-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.competition-empty-state-text {
  font-size: 16px;
  color: #475569;
}

/* Responsive adjustments for Reception & Competition */
@media (max-width: 768px) {
  .reception-page {
    padding: 12px 10px 28px;
  }

  .reception-page__header {
    flex-direction: column;
    align-items: stretch;
  }

  .reception-page__header-actions {
    width: 100%;
  }

  .reception-page__header-actions button {
    width: 100%;
    justify-content: center;
  }

  .reception-stats-grid {
    grid-template-columns: 1fr;
  }
  
  .reception-visitor-grid {
    grid-template-columns: 1fr;
  }
  
  .reception-form-row {
    grid-template-columns: 1fr;
  }
  
  .reception-header-content {
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
  }
  
  .reception-header-actions {
    width: 100%;
  }
  
  .reception-glass-btn {
    flex: 1;
    font-size: 12px;
    padding: 8px 12px;
  }
  
  .competition-cards-grid {
    grid-template-columns: 1fr;
  }
  
  .competition-prize-row {
    grid-template-columns: 1fr;
  }
  
  .competition-checkbox-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.exam-intel-eval {
  margin-top: 12px;
  background: #fff;
  border: 1px solid #dbe3ee;
  border-radius: 12px;
  padding: 12px;
}

.exam-intel-eval-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.exam-intel-eval-head strong {
  color: #0f172a;
}

.exam-intel-eval-head span {
  color: #475569;
  font-size: 12px;
}

.exam-intel-eval-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
}

.exam-intel-eval section {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
  display: grid;
  gap: 8px;
}

.exam-intel-eval h4 {
  margin: 0;
  font-size: 13px;
  color: #0f172a;
}

.exam-intel-eval p {
  margin: 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.exam-intel-eval-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.exam-intel-eval-chips button,
.exam-intel-eval-head button {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: normal;
  overflow: visible;
  height: auto;
  min-height: 30px;
}

.exam-intel-eval-chips button.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.exam-intel-eval-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.exam-intel-eval label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #334155;
}

.exam-intel-eval label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 6px;
}

.exam-intel-setup-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fff;
  padding-bottom: 4px;
}

.exam-intel-setup-tab {
  border: 1px solid #cbd5e1 !important;
  background: #fff !important;
  color: #334155 !important;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.exam-intel-setup-tab.is-active {
  border-color: #2563eb !important;
  background: #2563eb !important;
  color: #fff !important;
}

.exam-intel-easy-note {
  font-size: 12px;
  color: #475569;
  line-height: 1.45;
  background: #f8fafc;
  border-radius: 8px;
  padding: 8px 10px;
}

.exam-intel-print-overlay {
  position: fixed;
  inset: 0;
  z-index: 2400;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: stretch;
  justify-content: center;
  padding: 8px;
}

.exam-intel-print-modal {
  background: #fff;
  border-radius: 12px;
  width: min(1240px, 100%);
  height: calc(100dvh - 16px);
  max-height: calc(100dvh - 16px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(2, 6, 23, 0.32);
}

.exam-intel-print-modal button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  min-height: 30px;
  height: auto;
  min-width: 0;
  padding: 4px 10px;
  border-radius: 8px !important;
}

.exam-intel-print-head {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.exam-intel-print-head h3 {
  margin: 0;
  color: #0f172a;
  font-size: 16px;
}

.exam-intel-print-head p {
  margin: 4px 0 0;
  color: #475569;
  font-size: 12px;
}

.exam-intel-print-body {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(260px, 1.08fr);
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.exam-intel-print-options {
  overflow: auto;
  padding: 10px 12px;
  display: grid;
  gap: 8px;
  align-content: start;
  border-right: 1px solid #e2e8f0;
  min-width: 0;
}

.exam-intel-section {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px 10px;
  display: grid;
  gap: 6px;
}

.exam-intel-section-title {
  font-weight: 800;
  color: #0f172a;
  font-size: 13px;
}

.exam-intel-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.exam-intel-chip-row > span,
.exam-intel-chip-row > label,
.exam-intel-section label {
  font-size: 12px;
  color: #334155;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.exam-intel-chip {
  border: 1px solid #cbd5e1 !important;
  background: #fff !important;
  color: #334155 !important;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.exam-intel-chip.is-active {
  border-color: #2563eb !important;
  background: #eff6ff !important;
  color: #1d4ed8 !important;
}

.exam-intel-field {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #334155;
}

.exam-intel-field input,
.exam-intel-sig-row input,
.exam-intel-chip-row input[type="number"] {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.exam-intel-chip-row input[type="number"] {
  width: 72px;
}

.exam-intel-field-inline {
  grid-template-columns: auto 80px;
  align-items: center;
}

.exam-intel-size-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.exam-intel-size-row label {
  display: grid;
  gap: 3px;
  font-size: 11px;
  color: #475569;
}

.exam-intel-size-row input {
  width: 100%;
  min-width: 0;
}

.exam-intel-column-block {
  display: grid;
  gap: 4px;
  padding-bottom: 6px;
  border-bottom: 1px solid #eef2f7;
}

.exam-intel-column-spec {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.exam-intel-column-spec input[type="number"] {
  width: 64px;
}

@media (max-width: 980px) {
  .exam-intel-size-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.exam-intel-column-list {
  display: grid;
  gap: 4px;
}

.exam-intel-column-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.exam-intel-sig-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
}

.exam-intel-help {
  font-size: 12px;
  color: #64748b;
}

.exam-intel-error {
  color: #b91c1c;
  font-size: 13px;
}

.exam-intel-print-preview {
  background: #d7dee8;
  padding: 10px 12px 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 0;
}

.exam-intel-print-preview-label {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.exam-intel-print-preview-hint {
  font-size: 12px;
  color: #475569;
  line-height: 1.35;
}

.exam-intel-print-paper-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
  overflow: hidden;
}

.exam-intel-print-paper {
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  position: relative;
  flex: 0 0 auto;
}

.exam-intel-print-paper iframe {
  border: 0;
  background: #fff;
  display: block;
  transform-origin: top left;
  position: absolute;
  top: 0;
  left: 0;
}

.exam-intel-fit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.exam-intel-fit-card {
  display: block !important;
  width: 100%;
  min-width: 0;
  height: auto !important;
  min-height: 0 !important;
  text-align: left;
  white-space: normal !important;
  overflow: visible !important;
  align-items: flex-start !important;
  border: 1px solid #cbd5e1 !important;
  background: #fff !important;
  color: #0f172a !important;
  border-radius: 9px !important;
  padding: 7px 8px !important;
  cursor: pointer;
}

.exam-intel-fit-card.is-active {
  border-color: #2563eb !important;
  background: #eff6ff !important;
  box-shadow: 0 0 0 1px #2563eb inset;
}

.exam-intel-fit-card strong {
  display: block;
  font-size: 12px;
  margin-bottom: 2px;
}

.exam-intel-fit-card span {
  display: block;
  font-size: 11px;
  color: #64748b;
  line-height: 1.3;
  font-weight: 500;
  white-space: normal;
}

.exam-intel-fit-grid > .exam-intel-fit-card:nth-child(5) {
  grid-column: 1 / -1;
}

.exam-intel-print-foot {
  flex: 0 0 auto;
  border-top: 1px solid #e2e8f0;
  padding: 8px 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: #fff;
}

.exam-intel-print-go {
  border: none !important;
  background: #2563eb !important;
  color: #fff !important;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 14px !important;
}

@media (max-width: 980px) {
  .exam-intel-print-body {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 0.52fr) minmax(180px, 0.48fr);
  }

  .exam-intel-print-options {
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
  }

  .exam-intel-fit-grid {
    grid-template-columns: 1fr 1fr;
  }

  .exam-intel-sig-row {
    grid-template-columns: auto 1fr auto;
  }

  .exam-intel-sig-row input[placeholder="Designation / position"] {
    grid-column: 2 / 3;
  }
}

.marks-entry-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

.marks-entry-legend-label {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}

.marks-entry-legend-item,
.marks-class-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.marks-class-chip {
  cursor: pointer;
}

.marks-class-chip .marks-class-chip-count {
  font-weight: 600;
  opacity: 0.88;
  font-size: 11px;
}

.marks-entry-kind-full {
  background: #dcfce7;
  color: #166534;
  border: 1px solid #86efac;
}

.marks-entry-kind-partial {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.marks-entry-kind-none {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.marks-entry-kind-empty {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

button.marks-class-chip {
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
}

button.marks-class-chip:hover {
  filter: brightness(0.97);
}

@media (max-width: 640px) {
  .exam-intel-print-overlay {
    padding: 0;
  }

  .exam-intel-print-modal {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-radius: 0;
  }

  .exam-intel-fit-grid {
    grid-template-columns: 1fr;
  }
}

/* REPORT MAKER FRIENDLY UI */
.report-maker-page {
  max-width: 980px;
  margin: 0 auto;
  padding: 20px 16px 40px;
  color: #0f172a;
}
.report-maker-page * { box-sizing: border-box; }
.rm-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.rm-header h1 {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}
.rm-header p {
  margin: 0;
  font-size: 14px;
  color: #64748b;
  max-width: 520px;
  line-height: 1.45;
}
.rm-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.rm-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.rm-btn-primary { background: #2563eb; color: #fff; }
.rm-btn-primary:hover:not(:disabled) { background: #1d4ed8; }
.rm-btn-secondary { background: #fff; color: #334155; border: 1px solid #cbd5e1; }
.rm-btn-secondary:hover:not(:disabled) { background: #f8fafc; }
.rm-btn-success { background: #059669; color: #fff; }
.rm-btn-danger { background: #dc2626; color: #fff; }
.rm-btn-ghost { background: transparent; color: #475569; border: 1px solid transparent; }
.rm-btn-sm { padding: 7px 12px; font-size: 12px; border-radius: 8px; }

.rm-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 18px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 12px;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}
.rm-tab {
  border: none;
  background: transparent;
  color: #475569;
  padding: 9px 14px;
  border-radius: 9px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}
.rm-tab.is-active {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.rm-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 14px;
}
.rm-card-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}
.rm-card-help {
  margin: 0 0 14px;
  font-size: 13px;
  color: #64748b;
  line-height: 1.45;
}
.rm-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}
.rm-input, .rm-select, .rm-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
  color: #0f172a;
  font-family: inherit;
}
.rm-textarea { min-height: 84px; resize: vertical; }
.rm-grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.rm-pill-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.rm-pill {
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.rm-pill.is-active {
  border-color: #2563eb;
  background: #eff6ff;
  color: #1d4ed8;
}

.rm-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.rm-step {
  flex: 1 1 140px;
  min-width: 120px;
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}
.rm-step.is-active {
  border-color: #2563eb;
  background: #eff6ff;
}
.rm-step.is-done { border-color: #86efac; background: #f0fdf4; }
.rm-step-num {
  font-size: 11px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.rm-step.is-active .rm-step-num { color: #1d4ed8; }
.rm-step-label {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}

.rm-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
  padding-top: 4px;
}
.rm-footer-right { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }

.rm-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.rm-list-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 180px;
}
.rm-list-card h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
}
.rm-chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}
.rm-meta {
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  flex: 1;
}
.rm-meta strong { color: #0f172a; font-weight: 700; }
.rm-list-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.rm-empty {
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: 14px;
  padding: 48px 24px;
  text-align: center;
  color: #64748b;
}
.rm-empty strong {
  display: block;
  color: #0f172a;
  font-size: 16px;
  margin-bottom: 6px;
}

.rm-view-panels {
  display: flex;
  gap: 6px;
  margin: 14px 0 16px;
  padding: 4px;
  background: #f1f5f9;
  border-radius: 12px;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}
.rm-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  cursor: pointer;
}
.rm-check span { font-weight: 500; color: #64748b; display: block; margin-top: 2px; }
.rm-banner {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e3a8a;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 14px;
}
.rm-entry {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #f8fafc;
  padding: 14px;
}
@media (max-width: 720px) {
  .report-maker-page { padding: 12px 10px 28px; }
  .rm-header h1 { font-size: 22px; }
  .rm-list-actions { grid-template-columns: 1fr; }
}

/* REPORT FILL SHEET */
.rm-fill-sheet {
  display: grid;
  gap: 16px;
}
.rm-fill-sheet.is-sheet {
  font-family: "Sora", "Segoe UI", sans-serif;
}
.rm-fill-empty {
  padding: 28px;
  text-align: center;
  color: #64748b;
  font-size: 14px;
}
.rm-fill-progress {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #0f766e 140%);
  color: #fff;
}
.rm-fill-progress-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-family: "Space Grotesk", "Sora", sans-serif;
}
.rm-fill-progress-meta strong {
  font-size: 28px;
  letter-spacing: -0.03em;
  font-weight: 700;
}
.rm-fill-progress-meta span {
  font-size: 13px;
  opacity: 0.78;
  font-weight: 600;
}
.rm-fill-progress-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255,255,255,0.18);
  overflow: hidden;
}
.rm-fill-progress-bar {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #5eead4, #34d399);
  transition: width 280ms ease;
}
.rm-fill-questions {
  display: grid;
  gap: 18px;
}

.rm-q-card {
  position: relative;
  border: 1px solid #dbe4f0;
  border-radius: 22px;
  background:
    radial-gradient(1200px 180px at 0% 0%, rgba(14, 165, 233, 0.08), transparent 55%),
    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 22px 22px 20px;
  overflow: hidden;
  animation: rmQIn 420ms ease both;
  transition: border-color 180ms ease, transform 180ms ease, background 180ms ease;
}
.rm-q-card:hover {
  border-color: #94a3b8;
}
.rm-q-card.is-answered {
  border-color: #6ee7b7;
  background:
    radial-gradient(900px 160px at 100% 0%, rgba(16, 185, 129, 0.10), transparent 50%),
    linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}
.rm-q-card.is-view {
  animation: none;
}
@keyframes rmQIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.rm-q-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: start;
  margin-bottom: 16px;
}
.rm-q-index {
  width: 64px;
  min-height: 64px;
  border-radius: 18px;
  background: #0f172a;
  color: #fff;
  display: grid;
  place-content: center;
  text-align: center;
  font-family: "Space Grotesk", "Sora", sans-serif;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
}
.rm-q-index span {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}
.rm-q-index small {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  opacity: 0.65;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.rm-q-title {
  margin: 0;
  font-family: "Space Grotesk", "Sora", sans-serif;
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 700;
  color: #0f172a;
}
.rm-q-help {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: #64748b;
  font-weight: 500;
}
.rm-required { color: #dc2626; }
.rm-q-status {
  align-self: start;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #e2e8f0;
  color: #475569;
}
.rm-q-status.is-on {
  background: #d1fae5;
  color: #047857;
}
.rm-q-answer { margin-top: 4px; }

.rm-answer-display {
  font-family: "Space Grotesk", "Sora", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
  padding: 14px 16px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e2e8f0;
}
.rm-answer-display.is-small { font-size: 16px; padding: 10px 12px; }

.rm-control {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid #cbd5e1;
  border-radius: 14px;
  background: #fff;
  color: #0f172a;
  font-size: 16px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.rm-control:focus {
  outline: none;
  border-color: #0f766e;
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.15);
}
.rm-control-hero {
  padding: 18px 18px;
  border-radius: 18px;
  font-size: 18px;
  font-weight: 600;
  min-height: 64px;
  background: #fff;
  border-color: #94a3b8;
}
.rm-control-hero:focus {
  border-color: #0f766e;
  transform: translateY(-1px);
}
.rm-control-area {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}
.rm-control-hero.rm-control-area {
  min-height: 150px;
  font-size: 17px;
  font-weight: 500;
}

.rm-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
}
.rm-choice {
  min-height: 64px;
  border-radius: 16px;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  color: #0f172a;
  font-size: 16px;
  font-weight: 700;
  font-family: "Space Grotesk", "Sora", sans-serif;
  cursor: pointer;
  padding: 12px 14px;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.rm-choice:hover {
  border-color: #0f766e;
  transform: translateY(-1px);
}
.rm-choice.is-active {
  border-color: #0f766e;
  background: #ecfdf5;
  color: #065f46;
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.12);
}

.rm-yn {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 6px;
  border-radius: 18px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}
.rm-yn.is-hero {
  gap: 12px;
  padding: 8px;
  border-radius: 22px;
}
.rm-yn-btn {
  min-height: 72px;
  border-radius: 16px;
  border: 2px solid #94a3b8;
  background: #fff;
  color: #334155;
  display: grid;
  place-items: center;
  gap: 4px;
  cursor: pointer;
  font-family: "Space Grotesk", "Sora", sans-serif;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, color 140ms ease;
}
.rm-yn-btn.is-hero {
  min-height: 108px;
  border-radius: 18px;
  padding: 14px 10px;
}
.rm-yn-btn:hover:not(:disabled) { transform: translateY(-1px); }
.rm-yn-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.rm-yn-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 900;
  background: #e2e8f0;
  color: #64748b;
}
.rm-yn-btn.is-hero .rm-yn-icon {
  width: 44px;
  height: 44px;
  font-size: 22px;
}
.rm-yn-label {
  font-size: 18px;
  font-weight: 800;
}
.rm-yn-btn.is-hero .rm-yn-label { font-size: 24px; letter-spacing: -0.03em; }
.rm-yn-hint {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.7;
}
.rm-yn-btn.is-yes.is-active {
  border-color: #059669;
  background: #ecfdf5;
  color: #047857;
}
.rm-yn-btn.is-yes.is-active .rm-yn-icon {
  background: #10b981;
  color: #fff;
}
.rm-yn-btn.is-no.is-active {
  border-color: #dc2626;
  background: #fef2f2;
  color: #b91c1c;
}
.rm-yn-btn.is-no.is-active .rm-yn-icon {
  background: #ef4444;
  color: #fff;
}

.rm-followups {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}
.rm-followups-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #0f766e;
}
.rm-followup {
  padding: 14px;
  border-radius: 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.rm-followup.is-answered {
  border-color: #6ee7b7;
  background: #ecfdf5;
}
.rm-followup-title {
  font-size: 16px;
  font-weight: 800;
  color: #065f46;
  margin-bottom: 8px;
  font-family: "Space Grotesk", "Sora", sans-serif;
}
.rm-q-children {
  margin-top: 14px;
  display: grid;
  gap: 12px;
}
.rm-q-nested {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: rgba(255,255,255,0.82);
}
.rm-q-nested.is-answered {
  border-color: #a7f3d0;
  background: #f0fdf4;
}
.rm-q-nested-title {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
  font-family: "Space Grotesk", "Sora", sans-serif;
}

.rm-fill-hero {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: 22px 22px 18px;
  margin-bottom: 16px;
  color: #fff;
  background:
    radial-gradient(700px 220px at 100% -10%, rgba(45, 212, 191, 0.35), transparent 55%),
    linear-gradient(135deg, #0f172a 0%, #134e4a 55%, #0f766e 100%);
}
.rm-fill-hero h2 {
  margin: 0 0 6px;
  font-family: "Space Grotesk", "Sora", sans-serif;
  font-size: clamp(26px, 4vw, 34px);
  letter-spacing: -0.04em;
  font-weight: 700;
}
.rm-fill-hero p {
  margin: 0;
  max-width: 52ch;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.88;
}
.rm-submit-dock {
  position: sticky;
  bottom: 10px;
  z-index: 4;
  margin-top: 18px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255,255,255,0.92);
  border: 1px solid #dbe4f0;
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.rm-btn-submit {
  min-width: 180px;
  min-height: 52px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(180deg, #14b8a6 0%, #0f766e 100%);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  font-family: "Space Grotesk", "Sora", sans-serif;
  cursor: pointer;
  padding: 0 22px;
  transition: transform 140ms ease, filter 140ms ease;
}
.rm-btn-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.05);
}
.rm-btn-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .rm-q-top {
    grid-template-columns: auto 1fr;
  }
  .rm-q-status {
    grid-column: 2;
    justify-self: start;
  }
  .rm-q-index {
    width: 56px;
    min-height: 56px;
  }
  .rm-q-title {
    font-size: 22px;
  }
  .rm-yn {
    grid-template-columns: 1fr;
  }
  .rm-submit-dock {
    position: static;
  }
}
/* ==================== SIDEBAR NAVIGATION ==================== */

.sidebar {
  --sidebar-collapsed: 64px;
  --sidebar-expanded: 240px;
  --sidebar-bg: #0f172a;
  --sidebar-bg-elevated: #1e293b;
  --sidebar-border: rgba(148, 163, 184, 0.14);
  --sidebar-text: #cbd5e1;
  --sidebar-text-muted: #94a3b8;
  --sidebar-accent: #3b82f6;
  --sidebar-accent-soft: rgba(59, 130, 246, 0.18);

  position: fixed;
  left: 0;
  top: 0;
  width: var(--sidebar-collapsed);
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, #111827 100%);
  border-right: 1px solid var(--sidebar-border);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.22);
  overflow: hidden;
  z-index: 1000;
  transition: width 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s ease;
}

.sidebar:hover,
.sidebar.icon-mode:hover {
  width: var(--sidebar-expanded);
  box-shadow: 8px 0 32px rgba(0, 0, 0, 0.28);
}

.sidebar.icon-mode {
  width: var(--sidebar-collapsed);
}

/* Brand header */
.sidebar-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 12px 10px;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.sidebar-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  flex-shrink: 0;
}

.sidebar-brand-label {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: 0.02em;
}

.sidebar:not(:hover) .sidebar-brand-label {
  display: none !important;
}

/* Scrollable nav */
.sidebar-nav-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 8px 6px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

.sidebar-nav-scroll::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav-scroll::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}

.sidebar-footer {
  flex: 0 0 auto;
  padding: 8px;
  border-top: 1px solid var(--sidebar-border);
}

.nav-separator {
  border: none;
  border-top: 1px solid var(--sidebar-border);
  margin: 8px 4px;
}

/* Links */
.sidebar .tab-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 8px 10px;
  margin: 0;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--sidebar-text) !important;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s cubic-bezier(0.34, 1.35, 0.64, 1),
    box-shadow 0.2s ease;
}

.sidebar .tab-link::after {
  display: none;
}

.sidebar:not(:hover) .tab-link:not(.submenu-link):not(.menu-header) {
  justify-content: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0 auto 4px;
}

.sidebar:hover .tab-link:not(.submenu-link):not(.menu-header) {
  justify-content: flex-start;
  width: auto;
  min-height: 40px;
  padding: 8px 10px;
  margin: 0 0 2px;
}

.sidebar:not(:hover) .menu-text {
  display: none !important;
}

.sidebar:hover .menu-text {
  display: inline !important;
}

.sidebar .menu-icon {
  position: relative;
  width: 22px;
  font-size: 17px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.tasks-nav-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px rgba(15, 23, 42, 0.85);
}

.sidebar .tab-link:not(.submenu-link):not(.menu-header):hover {
  color: #fff !important;
  background: var(--sidebar-accent-soft) !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
  transform: translateX(2px) scale(1.02);
  box-shadow: none !important;
}

.sidebar .tab-link.active:not(.submenu-link) {
  color: #fff !important;
  background: linear-gradient(135deg, #2563eb, #0ea5e9) !important;
  border-color: rgba(147, 197, 253, 0.45) !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
  transform: none;
}

.sidebar .tab-link.active:not(.submenu-link)::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 58%;
  border-radius: 0 4px 4px 0;
  background: #93c5fd;
}

/* Section labels */
.sidebar .sidebar-group-label,
.sidebar .menu-header {
  margin-top: 6px !important;
  margin-bottom: 2px !important;
  min-height: 32px !important;
  padding: 6px 10px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em !important;
  text-transform: uppercase;
  color: var(--sidebar-text-muted) !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  pointer-events: none;
  transform: none !important;
}

.sidebar:not(:hover) .sidebar-group-label,
.sidebar:not(:hover) .menu-header {
  justify-content: center;
  width: 44px;
  padding: 6px 0 !important;
  margin: 4px auto 2px !important;
}

.sidebar:not(:hover) .sidebar-group-label .menu-text,
.sidebar:not(:hover) .menu-header .menu-text {
  display: none !important;
}

/* Menu groups — inline submenus when sidebar expanded */
.sidebar-menu-group,
.finance-menu-group,
.students-menu-group,
.academics-menu-group,
.staff-menu-group,
.operations-menu-group,
.tools-menu-group,
.resources-menu-group {
  position: relative;
  margin-bottom: 2px;
}

.submenu-container {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: max-height 0.28s ease, opacity 0.2s ease, margin 0.2s ease;
}

.sidebar:not(:hover) .submenu-container {
  display: none !important;
}

.sidebar:hover .sidebar-menu-group:hover .submenu-container,
.sidebar:hover .finance-menu-group:hover .submenu-container,
.sidebar:hover .students-menu-group:hover .submenu-container,
.sidebar:hover .students-menu-group:has(.submenu-link.active) .submenu-container,
.sidebar:hover .academics-menu-group:hover .submenu-container,
.sidebar:hover .staff-menu-group:hover .submenu-container,
.sidebar:hover .operations-menu-group:hover .submenu-container,
.sidebar:hover .tools-menu-group:hover .submenu-container,
.sidebar:hover .resources-menu-group:hover .submenu-container {
  position: static;
  width: 100%;
  max-height: 480px;
  opacity: 1;
  pointer-events: auto;
  margin: 2px 0 6px;
  padding: 4px 0 4px 6px;
  border-left: 2px solid rgba(59, 130, 246, 0.45);
  background: rgba(15, 23, 42, 0.45);
  border-radius: 0 8px 8px 0;
  box-shadow: none;
  transform: none;
}

.sidebar:hover .students-menu-group:hover .submenu-container,
.sidebar:hover .students-menu-group:has(.submenu-link.active) .submenu-container {
  max-height: min(720px, calc(100vh - 160px));
  overflow-y: auto;
}

.sidebar:hover .sidebar-menu-group:hover .sidebar-group-label,
.sidebar:hover .finance-menu-group:hover .sidebar-group-label,
.sidebar:hover .students-menu-group:hover .sidebar-group-label,
.sidebar:hover .academics-menu-group:hover .sidebar-group-label,
.sidebar:hover .staff-menu-group:hover .sidebar-group-label,
.sidebar:hover .operations-menu-group:hover .sidebar-group-label,
.sidebar:hover .tools-menu-group:hover .sidebar-group-label,
.sidebar:hover .resources-menu-group:hover .sidebar-group-label,
.sidebar:hover .sidebar-menu-group:hover .menu-header,
.sidebar:hover .finance-menu-group:hover .menu-header,
.sidebar:hover .students-menu-group:hover .menu-header,
.sidebar:hover .academics-menu-group:hover .menu-header,
.sidebar:hover .staff-menu-group:hover .menu-header,
.sidebar:hover .operations-menu-group:hover .menu-header,
.sidebar:hover .tools-menu-group:hover .menu-header,
.sidebar:hover .resources-menu-group:hover .menu-header {
  color: #e2e8f0 !important;
  background: rgba(59, 130, 246, 0.12) !important;
}

.sidebar .submenu-link {
  min-height: 36px !important;
  padding: 6px 10px 6px 12px !important;
  margin: 0 0 2px !important;
  font-size: 12px !important;
  font-weight: 550 !important;
  opacity: 1 !important;
  color: var(--sidebar-text) !important;
}

.sidebar .submenu-link:hover {
  color: #fff !important;
  background: var(--sidebar-accent-soft) !important;
  transform: translateX(2px);
}

.sidebar .submenu-link.active {
  color: #fff !important;
  background: rgba(59, 130, 246, 0.35) !important;
}

/* Logout */
.sidebar .logout-btn {
  width: 100%;
  min-height: 40px;
  margin: 0;
  color: #fecaca !important;
  background: rgba(127, 29, 29, 0.35) !important;
  border: 1px solid rgba(248, 113, 113, 0.28) !important;
  box-shadow: none !important;
}

.sidebar:not(:hover) .logout-btn {
  justify-content: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  margin: 0 auto;
}

.sidebar .logout-btn:hover {
  color: #fff !important;
  background: rgba(185, 28, 28, 0.75) !important;
  border-color: rgba(252, 165, 165, 0.5) !important;
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(127, 29, 29, 0.35) !important;
}

/* Main content offset */
.main-content {
  padding-left: calc(var(--sidebar-collapsed, 64px) + 8px);
}

/* Mobile hamburger — hidden on desktop */
.mobile-nav-toggle,
.mobile-nav-backdrop {
  display: none;
}

.sidebar-mobile-chevron {
  display: none;
}

.sidebar-mobile-close {
  display: none;
}

.sidebar-mobile-group-toggle {
  appearance: none;
  -webkit-appearance: none;
}

@media (max-width: 900px) {
  /* Hide hamburger and old slide-out sidebar entirely on mobile */
  .mobile-nav-toggle,
  .mobile-nav-backdrop {
    display: none !important;
  }

  .sidebar,
  .sidebar.icon-mode {
    display: none !important;
  }

  .main-content {
    padding-left: 0 !important;
    padding-top: 0 !important;
  }

  /*
   * Bottom nav is IN FLOW (not fixed overlay).
   * Main content flexes above it — nothing can render underneath the strip.
   */
  .app-layout--mobile-bottom-nav {
    height: 100dvh !important;
    max-height: 100dvh !important;
  }

  .app-layout--mobile-bottom-nav .app-body {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    overflow: hidden !important;
  }

  .app-layout--mobile-bottom-nav .main-content {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    order: 1;
    flex: 1 1 auto !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    padding-bottom: 20px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    /* Keep page stacking under the strip; open payments sheets raise themselves via padding */
    z-index: 1;
  }

  /* Accounts Statements: lock page scroll so only the entry list scrolls */
  .app-layout--mobile-bottom-nav .main-content:has(.expense-page--statements-mobile) {
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    padding-bottom: 8px !important;
  }
  .app-layout--mobile-bottom-nav .main-content:has(.expense-page--statements-mobile) > .page-shell,
  .app-layout--mobile-bottom-nav .main-content:has(.expense-page--statements-mobile) > .page-shell > .ilm-route-view {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    max-height: 100% !important;
  }
  .app-layout--mobile-bottom-nav .main-content .expense-page--statements-mobile {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: 100% !important;
  }

  /* While a Payments/Accounts sheet is open, cover/hide the bottom menu so it cannot sit on the sheet */
  .app-layout--mobile-bottom-nav:has(.payments-page--layer-open) .main-content,
  .app-layout--mobile-bottom-nav:has(.expense-page--layer-open) .main-content,
  .app-layout--mobile-bottom-nav:has(.tt-maker-page--sheet-open) .main-content,
  .app-layout--mobile-bottom-nav:has(.tt-page--sheet-open) .main-content {
    z-index: 40;
  }
  .app-layout--mobile-bottom-nav:has(.payments-page--layer-open) .mobile-bottom-nav,
  .app-layout--mobile-bottom-nav:has(.expense-page--layer-open) .mobile-bottom-nav,
  .app-layout--mobile-bottom-nav:has(.tt-maker-page--sheet-open) .mobile-bottom-nav,
  .app-layout--mobile-bottom-nav:has(.tt-page--sheet-open) .mobile-bottom-nav {
    visibility: hidden;
    pointer-events: none;
  }

}

/* ==================== MOBILE BOTTOM NAV BAR ==================== */

.mobile-bottom-nav {
  display: none;
}

@media (max-width: 900px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1100;
    height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #0f172a;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.32);
    align-items: stretch;
    justify-content: stretch;
  }

  /* When the shell has the mobile bottom-nav class, keep the strip in document flow */
  .app-layout--mobile-bottom-nav .mobile-bottom-nav {
    position: relative !important;
    inset: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    order: 2;
    flex: 0 0 auto !important;
    width: 100% !important;
    z-index: 30;
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.28);
  }

  .mobile-bottom-nav__item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 8px 4px 6px;
    border: none;
    background: transparent;
    color: #64748b;
    text-decoration: none;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease;
    border-radius: 0;
    min-width: 0;
    position: relative;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-bottom-nav__item:active {
    background: rgba(59, 130, 246, 0.12);
  }

  .mobile-bottom-nav__item.active,
  .mobile-bottom-nav__item[aria-current="page"] {
    color: #60a5fa;
  }

  .mobile-bottom-nav__item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    border-radius: 0 0 3px 3px;
    background: #3b82f6;
  }

  .mobile-bottom-nav__icon {
    font-size: 22px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }

  .mobile-bottom-nav__label {
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* More overlay — stop above the in-flow bottom nav */
  .mobile-more-overlay {
    position: fixed;
    inset: 0;
    bottom: var(--ilm-mobile-nav-h, calc(64px + env(safe-area-inset-bottom, 0px)));
    z-index: 1099;
    background: rgba(2, 6, 23, 0.6);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: mobileMoreIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }

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

  .mobile-more-sheet {
    background: #0f172a;
    border-radius: 20px 20px 0 0;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
    max-height: 80vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .mobile-more-sheet__handle {
    width: 36px;
    height: 4px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.35);
    margin: 10px auto 0;
  }

  .mobile-more-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px 8px;
  }

  .mobile-more-sheet__title {
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.07em;
  }

  .mobile-more-sheet__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    background: rgba(30, 41, 59, 0.7);
    color: #cbd5e1;
    font-size: 15px;
    cursor: pointer;
    line-height: 1;
  }

  .mobile-more-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    padding: 4px 8px 12px;
  }

  .mobile-more-grid__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 5px;
    padding: 12px 8px 10px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: #cbd5e1;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-more-grid__item:active,
  .mobile-more-grid__item:hover {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
  }

  .mobile-more-grid__item.active {
    color: #60a5fa;
    background: rgba(59, 130, 246, 0.12);
  }

  .mobile-more-grid__icon {
    font-size: 26px;
    line-height: 1;
  }

  .mobile-more-grid__label {
    line-height: 1.2;
    word-break: break-word;
  }

  /* Section headers inside "More" sheet */
  .mobile-more-section-title {
    padding: 10px 16px 2px;
    font-size: 11px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.07em;
  }

  .mobile-more-sheet__footer {
    padding: 8px 12px 16px;
    border-top: 1px solid rgba(148, 163, 184, 0.12);
  }

  .mobile-more-logout {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 13px 14px;
    border-radius: 12px;
    border: 1px solid rgba(248, 113, 113, 0.25);
    background: rgba(127, 29, 29, 0.25);
    color: #fca5a5;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
  }

  .mobile-more-logout:active {
    background: rgba(185, 28, 28, 0.5);
  }
}
/* ==================== ADDITIONAL UTILITY CLASSES ==================== */

/* Display Utilities */
.d-none { display: none; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

/* Position Utilities */
.position-relative { position: relative; }
.position-absolute { position: absolute; }
.position-fixed { position: fixed; }
.position-sticky { position: sticky; }

/* Width Utilities */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-50 { width: 50%; }
.min-w-full { min-width: 100%; }
.max-w-full { max-width: 100%; }

/* Height Utilities */
.h-full { height: 100%; }
.h-auto { height: auto; }

/* Gap Utilities */
.gap-0 { gap: 0; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }

/* Justify Content */
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }

/* Align Items */
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-center { align-items: center; }
.items-baseline { align-items: baseline; }
.items-stretch { align-items: stretch; }

/* Flex Direction */
.flex-row { flex-direction: row; }
.flex-col { flex-direction: column; }
.flex-row-reverse { flex-direction: row-reverse; }
.flex-col-reverse { flex-direction: column-reverse; }

/* Flex Wrap */
.flex-no-wrap { flex-wrap: nowrap; }
.flex-wrap { flex-wrap: wrap; }
.flex-wrap-reverse { flex-wrap: wrap-reverse; }

/* Flex Grow/Shrink */
.flex-grow { flex-grow: 1; }
.flex-shrink { flex-shrink: 1; }
.flex-grow-0 { flex-grow: 0; }
.flex-shrink-0 { flex-shrink: 0; }

/* Opacity */
.opacity-0 { opacity: 0; }
.opacity-25 { opacity: 0.25; }
.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }
.opacity-100 { opacity: 1; }

/* Cursor */
.cursor-auto { cursor: auto; }
.cursor-default { cursor: default; }
.cursor-pointer { cursor: pointer; }
.cursor-wait { cursor: wait; }
.cursor-text { cursor: text; }
.cursor-not-allowed { cursor: not-allowed; }

/* Pointer Events */
.pointer-events-none { pointer-events: none; }
.pointer-events-auto { pointer-events: auto; }

/* User Select */
.select-none { user-select: none; }
.select-text { user-select: text; }
.select-all { user-select: all; }
.select-auto { user-select: auto; }

/* Visibility */
.visible { visibility: visible; }
.invisible { visibility: hidden; }

/* Transform Utilities */
.translate-x-1 { transform: translateX(4px); }
.translate-x-2 { transform: translateX(8px); }
.translate-x-3 { transform: translateX(12px); }
.translate-x-4 { transform: translateX(16px); }

.translate-y-1 { transform: translateY(4px); }
.translate-y-2 { transform: translateY(8px); }
.translate-y-3 { transform: translateY(12px); }
.translate-y-4 { transform: translateY(16px); }

.translate-y-n1 { transform: translateY(-4px); }
.translate-y-n2 { transform: translateY(-8px); }
.translate-y-n3 { transform: translateY(-12px); }
.translate-y-n4 { transform: translateY(-16px); }

.scale-75 { transform: scale(0.75); }
.scale-90 { transform: scale(0.9); }
.scale-95 { transform: scale(0.95); }
.scale-100 { transform: scale(1); }
.scale-105 { transform: scale(1.05); }
.scale-110 { transform: scale(1.1); }

.rotate-0 { transform: rotate(0deg); }
.rotate-45 { transform: rotate(45deg); }
.rotate-90 { transform: rotate(90deg); }
.rotate-180 { transform: rotate(180deg); }

/* Transition */
.transition-none { transition: none; }
.transition-all { transition: all 0.2s ease; }
.transition-colors { transition: background-color, border-color, color 0.2s ease; }
.transition-transform { transition: transform 0.2s ease; }
.transition-opacity { transition: opacity 0.2s ease; }

/* Z-Index */
.z-0 { z-index: 0; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-auto { z-index: auto; }

/* Line Clamp */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Background Colors */
.bg-white { background-color: white; }
.bg-gray-50 { background-color: #f9f9f9; }
.bg-gray-100 { background-color: #f5f5f5; }
.bg-gray-200 { background-color: #e0e0e0; }
.bg-primary { background-color: #667eea; }
.bg-success { background-color: #4CAF50; }
.bg-danger { background-color: #f44336; }
.bg-warning { background-color: #FF9800; }
.bg-info { background-color: #2196F3; }

/* Border Colors */
.border-gray { border-color: #e0e0e0; }
.border-primary { border-color: #667eea; }
.border-success { border-color: #4CAF50; }
.border-danger { border-color: #f44336; }
.border-warning { border-color: #FF9800; }

/* Code/Monospace */
.font-mono {
  font-family: 'Courier New', Courier, monospace;
}

.code-block {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 12px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 13px;
  overflow-x: auto;
}

/* Print Utilities */
@media print {
  .no-print { display: none !important; }
  .print-only { display: block !important; }
}

/* Responsive Visibility */
@media (max-width: 768px) {
  .hide-on-mobile { display: none; }
  .show-on-mobile { display: block; }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .hide-on-tablet { display: none; }
  .show-on-tablet { display: block; }
}

@media (min-width: 1025px) {
  .hide-on-desktop { display: none; }
  .show-on-desktop { display: block; }
}

/* Clearfix */
.clearfix::after {
  content: '';
  display: table;
  clear: both;
}

/* Truncate */
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.truncate-multiline {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Float */
.float-left { float: left; }
.float-right { float: right; }
.float-none { float: none; }

/* List Styles */
.list-none { list-style: none; }
.list-disc { list-style: disc; }
.list-decimal { list-style: decimal; }

/* Link Styles */
.link-underline {
  text-decoration: underline;
}

.link-no-underline {
  text-decoration: none;
}

a.link {
  color: #667eea;
  text-decoration: none;
  transition: all 0.2s ease;
}

a.link:hover {
  text-decoration: underline;
  color: #764ba2;
}

/* Divider */
.divider {
  height: 1px;
  background: #e0e0e0;
  margin: 16px 0;
}

.divider-vertical {
  width: 1px;
  background: #e0e0e0;
  margin: 0 16px;
}

/* Progress Bar */
.progress {
  height: 8px;
  background: #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background: #667eea;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-bar-success {
  background: #4CAF50;
}

.progress-bar-warning {
  background: #FF9800;
}

.progress-bar-danger {
  background: #f44336;
}

/* Aspect Ratio */
.aspect-square {
  aspect-ratio: 1;
}

.aspect-video {
  aspect-ratio: 16/9;
}

/* Group Hover Effect */
.group:hover .group-hover\:opacity-100 {
  opacity: 1;
}

.group:hover .group-hover\:visible {
  visibility: visible;
}

.group:hover .group-hover\:text-primary {
  color: #667eea;
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
  .dark\:bg-gray-900 {
    background-color: #1a1a1a;
  }

  .dark\:text-gray-100 {
    color: #f5f5f5;
  }

  .dark\:border-gray-700 {
    border-color: #333;
  }
}
/* ==================== ILMTOUCH MOTION (performance-tuned) ==================== */

:root {
  --ilm-ease-fluid: cubic-bezier(0.22, 1, 0.36, 1);
  --ilm-ease-soft: cubic-bezier(0.25, 0.8, 0.25, 1);
  --ilm-ease-bounce: cubic-bezier(0.34, 1.35, 0.64, 1);
  --ilm-duration-fast: 0.18s;
  --ilm-duration-medium: 0.28s;
  --ilm-duration-modal: 0.38s;
}

/* No smooth-scroll globally — it makes large tables feel sluggish */
html.ilm-motion .main-content {
  z-index: 1;
}

html.ilm-motion .page-shell,
html.ilm-motion .ilm-route-view {
  position: relative;
  z-index: 1;
}

/* Route enter — opacity only (no transform on route wrapper) */
@keyframes ilmPageFadeIn {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

html.ilm-motion .ilm-route-view {
  animation: ilmPageFadeIn var(--ilm-duration-medium) var(--ilm-ease-soft) forwards;
}

@keyframes ilmProgressFlow {
  0% { transform: translateX(-120%) scaleX(0.35); opacity: 0; }
  20% { opacity: 1; }
  100% { transform: translateX(120%) scaleX(1); opacity: 0; }
}

html.ilm-motion .ilm-route-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 42%;
  height: 3px;
  z-index: 20000;
  pointer-events: none;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.95), rgba(45, 212, 191, 0.95), transparent);
  animation: ilmProgressFlow 0.45s var(--ilm-ease-soft) forwards;
}

/* ——— Modals: center pop + light bounce (GPU: transform + opacity only) ——— */
@keyframes ilmOverlayFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ilmModalBounceIn {
  0% {
    opacity: 0;
    transform: scale(0.88);
  }
  65% {
    opacity: 1;
    transform: scale(1.03);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

html.ilm-motion .modal-overlay,
html.ilm-motion .modal-wrapper,
html.ilm-motion .ilm-modal-overlay {
  animation: ilmOverlayFade var(--ilm-duration-fast) var(--ilm-ease-soft) forwards;
}

html.ilm-motion .ilm-modal-panel,
html.ilm-motion .modal,
html.ilm-motion .ilm-modal-ready > .ilm-modal-panel,
html.ilm-motion .ilm-modal-ready > .modal,
html.ilm-motion .ilm-modal-ready > .card,
html.ilm-motion .ilm-modal-ready > :first-child:not(.ilm-modal-panel):not(style):not(script) {
  animation: ilmModalBounceIn var(--ilm-duration-modal) var(--ilm-ease-bounce) forwards;
  transform-origin: center center;
}

html.ilm-motion .ilm-modal-panel {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  max-width: 100%;
  max-height: 100%;
}

html.ilm-motion .ilm-modal-panel > .card,
html.ilm-motion .ilm-modal-ready .ilm-modal-panel .card,
html.ilm-motion .modal-overlay .modal .card {
  animation: none;
}

/* Override global.css slideIn on modals — single bounce only */
html.ilm-motion .modal-overlay .modal {
  animation: ilmModalBounceIn var(--ilm-duration-modal) var(--ilm-ease-bounce) forwards;
}

/* ——— Dropdowns: single fade (no per-item stagger) ——— */
@keyframes ilmDropdownIn {
  from {
    opacity: 0;
    transform: translate3d(0, -6px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

html.ilm-motion .dropdown-menu,
html.ilm-motion .students-session-dropdown,
html.ilm-motion .filter-dropdown-panel {
  animation: ilmDropdownIn var(--ilm-duration-fast) var(--ilm-ease-soft) forwards;
  transform-origin: top center;
}

/* ——— Light interactions (no transform on table rows / cards) ——— */
html.ilm-motion button,
html.ilm-motion .btn,
html.ilm-motion .tab-btn {
  transition:
    background var(--ilm-duration-fast) ease,
    border-color var(--ilm-duration-fast) ease,
    box-shadow var(--ilm-duration-fast) ease,
    color var(--ilm-duration-fast) ease;
}

html.ilm-motion .card {
  transition:
    box-shadow var(--ilm-duration-fast) ease,
    border-color var(--ilm-duration-fast) ease;
}

html.ilm-motion .card:hover {
  box-shadow: 0 8px 24px rgba(14, 116, 144, 0.1);
}

html.ilm-motion input:not([type='checkbox']):not([type='radio']),
html.ilm-motion select,
html.ilm-motion textarea,
html.ilm-motion .filter-select,
html.ilm-motion .form-select {
  transition:
    border-color var(--ilm-duration-fast) ease,
    box-shadow var(--ilm-duration-fast) ease;
}

html.ilm-motion input:not([type='checkbox']):not([type='radio']):focus,
html.ilm-motion select:focus,
html.ilm-motion textarea:focus {
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

html.ilm-motion input[type='checkbox'],
html.ilm-motion input[type='radio'] {
  accent-color: #0ea5e9;
  transition: transform 0.15s var(--ilm-ease-bounce);
}

html.ilm-motion input[type='checkbox']:checked,
html.ilm-motion input[type='radio']:checked {
  transform: scale(1.08);
}

html.ilm-motion .tab-link {
  transition:
    background var(--ilm-duration-fast) ease,
    color var(--ilm-duration-fast) ease;
}

html.ilm-motion .list tbody tr,
html.ilm-motion .data-table tbody tr {
  transition: background var(--ilm-duration-fast) ease;
}

html.ilm-motion .list tbody tr:hover,
html.ilm-motion .data-table tbody tr:hover {
  background: rgba(224, 242, 254, 0.4);
}

/* Tab panels — quick fade only */
@keyframes ilmTabFade {
  from { opacity: 0.7; }
  to { opacity: 1; }
}

html.ilm-motion .tab-content,
html.ilm-motion .sub-tab-content,
html.ilm-motion .nested-tab-content {
  animation: ilmTabFade var(--ilm-duration-medium) var(--ilm-ease-soft) forwards;
}

@media (prefers-reduced-motion: reduce) {
  html.ilm-motion .ilm-route-view,
  html.ilm-motion .ilm-route-progress,
  html.ilm-motion .modal-overlay,
  html.ilm-motion .modal-wrapper,
  html.ilm-motion .ilm-modal-overlay,
  html.ilm-motion .ilm-modal-panel,
  html.ilm-motion .modal,
  html.ilm-motion .tab-content,
  html.ilm-motion .dropdown-menu,
  html.ilm-motion .students-session-dropdown {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
/* Finance & expense entry / collection forms — modal shells and fields */

.finance-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(4px);
}

.finance-modal-panel {
  display: flex;
  justify-content: center;
  align-items: center;
  width: fit-content;
  max-width: min(920px, 96vw);
  margin: 0 auto;
  flex: 0 1 auto;
  animation: financeModalIn 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes financeModalIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.finance-modal-shell {
  width: min(760px, 92vw);
  max-height: min(88vh, 920px);
  overflow: auto;
  margin: 0 auto;
  padding: 0;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  box-shadow:
    0 24px 48px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.finance-modal-shell--wide {
  width: min(1000px, 96vw);
}

.finance-modal-shell--narrow {
  width: min(440px, 92vw);
}

.finance-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 55%, #ffffff 100%);
  border-radius: 16px 16px 0 0;
  position: sticky;
  top: 0;
  z-index: 2;
}

.finance-modal-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  line-height: 1.3;
}

.finance-modal-subtitle {
  margin: 6px 0 0;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
  font-weight: 500;
}

.finance-modal-close {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #fff;
  color: #64748b;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.finance-modal-close:hover {
  background: #fef2f2;
  border-color: #fecaca;
  color: #b91c1c;
}

.finance-modal-body {
  padding: 18px 20px 20px;
}

/* Legacy shells without header wrapper */
.finance-modal-shell > h3:first-child {
  margin: 0;
  padding: 18px 20px 12px;
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 100%);
}

.finance-modal-shell > h3:first-child + p,
.finance-modal-shell > h3:first-child + div {
  margin-left: 20px;
  margin-right: 20px;
}

.finance-modal-shell > form,
.finance-modal-shell > .finance-form,
.finance-modal-body > form,
.finance-modal-body > .finance-form {
  padding: 0 20px 20px;
}

.finance-modal-shell > form:first-of-type,
.finance-modal-shell > .grid-2:first-of-type {
  padding: 16px 20px 20px;
}

.finance-form {
  display: grid;
  gap: 14px;
}

.finance-form-grid,
.finance-modal-shell form.grid-2,
.finance-modal-shell .grid-2.finance-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

@media (max-width: 900px) {
  .finance-form-grid,
  .finance-modal-shell form.grid-2,
  .finance-modal-shell .grid-2.finance-form {
    grid-template-columns: 1fr;
  }

  .finance-modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .finance-modal-panel,
  .finance-modal-shell,
  .finance-modal-shell--wide,
  .finance-modal-shell--narrow,
  .finance-modal-overlay > .finance-modal-shell {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 20px 20px 0 0;
    max-height: min(90dvh, calc(100dvh - 56px));
  }

  .finance-pill-track {
    width: 100%;
    border-radius: 14px;
  }

  .finance-pill-btn {
    flex: 1 1 auto;
    text-align: center;
  }
}

@media (max-width: 640px) {
  .finance-form-grid,
  .finance-modal-shell form.grid-2,
  .finance-modal-shell .grid-2.finance-form {
    grid-template-columns: 1fr;
  }
}

.finance-form label,
.finance-modal-shell form label,
.finance-modal-shell .grid-2 label {
  display: grid;
  gap: 6px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  letter-spacing: 0.02em;
  text-transform: none;
}

.finance-form input:not([type='checkbox']):not([type='radio']):not([type='hidden']),
.finance-form select,
.finance-form textarea,
.finance-modal-shell form input:not([type='checkbox']):not([type='radio']):not([type='hidden']),
.finance-modal-shell form select,
.finance-modal-shell form textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.finance-form textarea,
.finance-modal-shell form textarea {
  min-height: 84px;
  resize: vertical;
  line-height: 1.45;
}

.finance-form input:focus,
.finance-form select:focus,
.finance-form textarea:focus,
.finance-modal-shell form input:focus,
.finance-modal-shell form select:focus,
.finance-modal-shell form textarea:focus {
  outline: none;
  border-color: #38bdf8;
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.finance-form input:read-only,
.finance-form select:disabled,
.finance-modal-shell form input:read-only {
  background: #f1f5f9;
  color: #475569;
  cursor: default;
}

.finance-form-section {
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #f0f9ff 100%);
}

.finance-form-section .finance-form-grid,
.finance-form-section > div[style*='grid'] {
  gap: 12px;
}

.finance-callout {
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.5;
  font-weight: 500;
}

.finance-callout--info {
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.finance-callout--warn {
  color: #9a3412;
  background: #fff7ed;
  border: 1px solid #fdba74;
}

.finance-callout--danger {
  color: #9f1239;
  background: #fdf2f8;
  border: 1px solid #fbcfe8;
}

.finance-callout--success {
  color: #166534;
  background: #f0fdf4;
  border: 1px solid #86efac;
}

.finance-form-actions,
.finance-modal-shell .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  align-items: center;
  margin-top: 4px;
  padding-top: 14px;
  border-top: 1px solid #e2e8f0;
}

.finance-form-actions button,
.finance-modal-shell .form-actions button {
  min-height: 40px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.finance-form-actions button[type='submit'],
.finance-modal-shell .form-actions button[type='submit'] {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(2, 132, 199, 0.35);
}

.finance-form-actions button[type='submit']:hover,
.finance-modal-shell .form-actions button[type='submit']:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(2, 132, 199, 0.4);
}

.finance-form-actions button[type='button'],
.finance-modal-shell .form-actions button[type='button']:not([style*='background']) {
  background: #fff;
  border-color: #cbd5e1;
  color: #334155;
}

.finance-form-actions button[type='button']:hover,
.finance-modal-shell .form-actions button[type='button']:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.finance-pill-track {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: #e2e8f0;
}

.finance-pill-btn {
  padding: 9px 16px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  background: transparent;
  color: #334155;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.finance-pill-btn.is-active,
.finance-pill-btn[data-active='true'] {
  background: #fff;
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.finance-pill-btn--success.is-active {
  background: #16a34a;
  color: #fff;
}

.finance-pill-btn--warning.is-active {
  background: #ea580c;
  color: #fff;
}

.finance-field-hint {
  font-size: 11px;
  color: #64748b;
  margin-top: 4px;
  line-height: 1.4;
  font-weight: 500;
}

.finance-modal-shell [style*='gridColumn: \'1/-1\''],
.finance-modal-shell [style*='grid-column: 1 / -1'] {
  grid-column: 1 / -1;
}

/* Expense page modals using finance classes on overlay */
.finance-modal-overlay .finance-modal-shell {
  margin: 16px auto;
}

/* Shell rendered directly in overlay (no panel wrapper) */
.finance-modal-overlay > .finance-modal-shell {
  margin: auto;
}
/**
 * Global mobile polish for the staff web shell (≤900px matches bottom-nav breakpoint).
 * Makes pages, tabs, tables, and modals feel like a clean phone UI without rewriting every page.
 */

:root {
  --ilm-mobile-nav-h: calc(64px + env(safe-area-inset-bottom, 0px));
  /* Edge-to-edge mobile pages; use --ilm-mobile-inset for inner text breathing room */
  --ilm-mobile-gutter: 0px;
  --ilm-mobile-inset: 10px;
  --ilm-mobile-ink: #0b1220;
  --ilm-mobile-panel: #f8fafc;
  --ilm-mobile-accent: #0f766e;
}

@media (max-width: 900px) {
  /* —— App chrome —— */
  .main-content {
    overflow-x: hidden;
    max-width: 100vw;
  }

  .main-content > * {
    max-width: 100%;
  }

  /*
   * Page shells must size to the main pane (above the in-flow nav),
   * never to the full phone viewport (100vh), or they paint under the strip.
   */
  .app-layout--mobile-bottom-nav .main-content .page-shell,
  .app-layout--mobile-bottom-nav .main-content .ilm-route-view {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0 !important;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
  }

  .app-layout--mobile-bottom-nav .main-content {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .app-layout--mobile-bottom-nav .main-content > .page-shell,
  .app-layout--mobile-bottom-nav .main-content > .page-shell > .ilm-route-view {
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Any routed page root: edge-to-edge width on phone */
  .app-layout--mobile-bottom-nav .main-content .ilm-route-view > *,
  .app-layout--mobile-bottom-nav .main-content .page-shell > *:not(.ilm-route-view) {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }

  .app-layout--mobile-bottom-nav .main-content .page-container,
  .app-layout--mobile-bottom-nav .main-content .app-page,
  .app-layout--mobile-bottom-nav .main-content .tasks-page,
  .app-layout--mobile-bottom-nav .main-content .students-page,
  .app-layout--mobile-bottom-nav .main-content .fees-page,
  .app-layout--mobile-bottom-nav .main-content .expense-page,
  .app-layout--mobile-bottom-nav .main-content .staff-page,
  .app-layout--mobile-bottom-nav .main-content .dashboard-page,
  .app-layout--mobile-bottom-nav .main-content .calendar-page,
  .app-layout--mobile-bottom-nav .main-content .reception-page,
  .app-layout--mobile-bottom-nav .main-content .infrastructure-page,
  .app-layout--mobile-bottom-nav .main-content .payments-page,
  .app-layout--mobile-bottom-nav .main-content .timetable-page,
  .app-layout--mobile-bottom-nav .main-content .attendance-page,
  .app-layout--mobile-bottom-nav .main-content .marks-sheet-page,
  .app-layout--mobile-bottom-nav .main-content .transportation-page,
  .app-layout--mobile-bottom-nav .main-content .enquiry-page,
  .app-layout--mobile-bottom-nav .main-content .competitions-page,
  .app-layout--mobile-bottom-nav .main-content .settings-page,
  .app-layout--mobile-bottom-nav .main-content .documents-page,
  .app-layout--mobile-bottom-nav .main-content .ledger-page,
  .app-layout--mobile-bottom-nav .main-content .meetings-page,
  .app-layout--mobile-bottom-nav .main-content .collections-page,
  .app-layout--mobile-bottom-nav .main-content .report-maker-page,
  .app-layout--mobile-bottom-nav .main-content .map-page,
  .app-layout--mobile-bottom-nav .main-content .elections-page,
  .app-layout--mobile-bottom-nav .main-content .messages-page,
  .app-layout--mobile-bottom-nav .main-content .cwhw-page,
  .app-layout--mobile-bottom-nav .main-content .staff-ledger-page {
    min-height: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .app-layout--mobile-bottom-nav .main-content .timetable-page {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  /* Fixed page chrome that pinned to the phone bottom must clear the strip */
  .app-layout--mobile-bottom-nav .main-content .page-sticky-footer,
  .app-layout--mobile-bottom-nav .main-content .sticky-footer,
  .app-layout--mobile-bottom-nav .main-content .mobile-sticky-actions,
  .app-layout--mobile-bottom-nav .main-content .fab-bottom,
  .app-layout--mobile-bottom-nav .main-content .floating-action-bar {
    bottom: 8px !important;
  }

  /* —— Page shells: full phone width (no side gutters) —— */
  .page-container,
  .page-shell,
  .app-page,
  .students-page,
  .fees-page,
  .expense-page,
  .staff-page,
  .attendance-page,
  .marks-sheet-page,
  .timetable-page,
  .transportation-page,
  .reception-page,
  .enquiry-page,
  .competitions-page,
  .settings-page,
  .documents-page,
  .ledger-page,
  .calendar-page,
  .meetings-page,
  .collections-page,
  .infrastructure-page,
  .report-maker-page,
  .map-page,
  .elections-page,
  .dashboard-page,
  .tasks-page,
  .payments-page,
  .messages-page,
  .cwhw-page,
  .staff-ledger-page,
  .physical-info-page,
  .institution-page,
  .follow-ups-page,
  .hiring-desk-page {
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
  }

  /* Keep titles/toolbars readable without eating grid/table width */
  .page-header,
  .app-header,
  .students-page-header,
  .page-title,
  .main-content > h1,
  .main-content h1.page-title {
    padding-left: var(--ilm-mobile-inset) !important;
    padding-right: var(--ilm-mobile-inset) !important;
    box-sizing: border-box;
  }

  .page-header,
  .app-header,
  .students-page-header,
  .fees-toolbar,
  .staff-toolbar,
  .marks-toolbar,
  .attendance-toolbar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .page-title,
  .page-header h1,
  .app-header h1,
  .main-content h1 {
    font-family: "Space Grotesk", "Sora", "Segoe UI", sans-serif;
    font-size: 22px !important;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin: 0 !important;
  }

  .page-actions,
  .header-actions,
  .toolbar-actions {
    width: 100%;
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }

  .page-actions > .btn,
  .header-actions > .btn,
  .toolbar-actions > .btn,
  .page-actions > button,
  .header-actions > button {
    flex: 1 1 auto;
    min-height: 40px;
  }

  /* —— Tabs: horizontal chip scroller —— */
  .tabs,
  .sub-tabs,
  .sub-tabs-container,
  .dashboard-tabs,
  .student-tabs,
  .fees-tabs,
  .staff-tabs,
  .reception-tabs,
  .settings-tabs,
  .marks-tabs,
  .attendance-tabs,
  .enquiry-tabs,
  .competition-tabs,
  .transport-tabs,
  .ledger-tabs,
  [role="tablist"] {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 2px 10px !important;
    margin-bottom: 8px !important;
  }

  .tabs::-webkit-scrollbar,
  .sub-tabs::-webkit-scrollbar,
  .sub-tabs-container::-webkit-scrollbar,
  .dashboard-tabs::-webkit-scrollbar,
  .student-tabs::-webkit-scrollbar,
  [role="tablist"]::-webkit-scrollbar {
    display: none;
  }

  .tab-btn,
  .sub-tab-btn,
  .dashboard-tab,
  .student-tab,
  .fees-tab,
  [role="tab"] {
    flex: 0 0 auto !important;
    width: auto !important;
    white-space: nowrap !important;
    border-radius: 12px !important;
    padding: 8px 14px !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    min-height: 36px;
  }

  /* —— Cards / grids —— */
  .grid-2,
  .grid-3,
  .grid-4,
  .cards-grid,
  .content-grid-2,
  .content-grid-3,
  .content-grid-4,
  .info-display-grid,
  .form-row,
  .form-grid,
  .stats-grid,
  .metric-grid,
  .finance-form-grid,
  .finance-form-grid--2,
  .finance-form-grid--3,
  .finance-form-grid--4 {
    grid-template-columns: 1fr !important;
  }

  .card,
  .page-card,
  .panel,
  .section-card {
    border-radius: 16px !important;
    max-width: 100%;
  }

  /* —— Search / filters —— */
  .search-bar,
  .filter-bar,
  .toolbar,
  .filters-row,
  .list-controls {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 8px !important;
  }

  .search-input,
  .search-bar input,
  .filter-bar input,
  .filter-bar select,
  input[type="search"],
  .main-content input[type="text"],
  .main-content input[type="number"],
  .main-content input[type="date"],
  .main-content input[type="email"],
  .main-content input[type="tel"],
  .main-content select,
  .main-content textarea {
    max-width: 100% !important;
    width: 100%;
    box-sizing: border-box;
    font-size: 16px !important; /* prevents iOS zoom */
  }

  /* —— Tables: always swipeable —— */
  .table-responsive,
  .dash-table-scroll,
  .table-scroll,
  .data-table-wrap,
  .timetable-scroll,
  .marks-table-scroll,
  .attendance-table-scroll,
  .fees-table-scroll,
  .staff-table-scroll,
  .dashboard-timetable-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    margin: 0 -2px;
    padding-bottom: 4px;
  }

  .main-content .card:has(> table),
  .main-content .panel:has(> table),
  .page-card:has(> table),
  .section-card:has(> table),
  .ilm-modal-panel:has(table),
  .finance-modal-shell:has(table),
  .dash-modal-panel:has(table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Catch wide tables that sit in plain wrappers */
  .main-content div:has(> table),
  .page-container div:has(> table),
  .page-shell div:has(> table) {
    max-width: 100%;
  }

  table.data-table,
  table.simple-table,
  .data-table {
    font-size: 12px !important;
  }

  table th,
  table td {
    padding: 8px 10px !important;
  }

  /* —— Buttons —— */
  .btn,
  button.btn,
  .main-content button:not(.tab-btn):not(.sub-tab-btn):not([role="tab"]):not(.mobile-bottom-nav__item) {
    min-height: 40px;
    border-radius: 10px;
  }

  /* —— Modals: sheets sit above the bottom nav, never under it —— */
  .modal-overlay,
  .app-page-modal-overlay,
  .ilm-modal-overlay,
  .finance-modal-overlay,
  .staff-attendance-settings-overlay,
  .dash-modal-overlay,
  .transport-simple-modal-overlay,
  .app-dialog-overlay,
  .payments-layer-overlay {
    align-items: flex-end !important;
    justify-content: stretch !important;
    padding: 0 !important;
    padding-bottom: var(--ilm-mobile-nav-h) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .ilm-modal-panel,
  .finance-modal-panel,
  .finance-modal-shell,
  .finance-modal-shell--wide,
  .finance-modal-shell--narrow,
  .dash-modal-panel,
  .modal,
  .modal-content,
  .staff-mark-attendance-overlay .ilm-modal-panel {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: min(90dvh, calc(100dvh - var(--ilm-mobile-nav-h) - 8px)) !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    animation: ilmMobileSheetUp 320ms cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .finance-modal-header,
  .modal-header,
  .dash-modal-panel > div:first-child {
    position: sticky;
    top: 0;
    z-index: 3;
  }

  .finance-modal-footer,
  .modal-footer,
  .modal-actions {
    position: sticky;
    bottom: 0;
    z-index: 3;
    background: #fff;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  }

  /* Transport vehicle dashboard: full bleed when sidebar is gone */
  .transport-vehicle-dashboard-backdrop {
    left: 0 !important;
  }

  .transport-vehicle-dashboard-panel,
  .transport-vehicle-dashboard {
    left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 0 !important;
  }

  /* —— Lists —— */
  .list-item {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .list-item-actions {
    width: 100%;
    margin-left: 0 !important;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  /* —— Common two-pane layouts —— */
  .split-layout,
  .two-pane,
  .master-detail,
  .sidebar-content-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
  }

  .split-layout > *,
  .two-pane > *,
  .master-detail > * {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}

@keyframes ilmMobileSheetUp {
  from {
    transform: translateY(18%);
    opacity: 0.75;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Extra-small phones */
@media (max-width: 480px) {
  :root {
    --ilm-mobile-gutter: 0px;
    --ilm-mobile-inset: 8px;
  }

  .main-content h1,
  .page-title {
    font-size: 20px !important;
  }

  .marks-summary,
  .attendance-stats-grid {
    grid-template-columns: 1fr 1fr !important;
  }
}

/* —— Page-specific two-pane / wide layout collapse —— */
@media (max-width: 900px) {
  .expense-page [style*="minmax(280px"],
  .expense-page [style*="minmax(320px"],
  .expense-page [style*="minmax(360px"],
  .expense-page [style*="300px 1fr"],
  .expense-page [style*="1.25fr .95fr"],
  .fees-page [style*="minmax(360px"],
  .fees-page [style*="minmax(420px"],
  .staff-page [style*="minmax(280px"],
  .staff-page [style*="minmax(320px"],
  .page-container [style*="300px 1fr"],
  .page-container [style*="320px 1fr"] {
    grid-template-columns: 1fr !important;
  }

  .expense-page [style*="repeat(4, minmax"],
  .expense-page [style*="repeat(4,minmax"] {
    grid-template-columns: 1fr 1fr !important;
  }

  .expense-page-tabs,
  .students-page-tabs,
  .students-page-tabs-scroll,
  .transport-page-header__tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 8px !important;
  }

  .expense-page-tabs::-webkit-scrollbar,
  .students-page-tabs::-webkit-scrollbar,
  .students-page-tabs-scroll::-webkit-scrollbar,
  .transport-page-header__tabs::-webkit-scrollbar {
    display: none;
  }

  .students-page-chrome,
  .transport-page-header,
  .transport-page-header__row {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .staff-page .page-header,
  .transportation-page .page-header {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  /* Keep search rows from forcing 600px+ */
  .staff-page [style*="minWidth: '600px'"],
  .staff-page [style*="minWidth: \"600px\""],
  .staff-page [style*="min-width: 600px"],
  .staff-page [style*="minWidth:600"] {
    min-width: 0 !important;
    width: 100% !important;
    flex-wrap: wrap !important;
  }

  /* Wide tables inside known pages */
  .marks-sheet-page,
  .attendance-page,
  .timetable-page,
  .staff-page,
  .fees-page,
  .expense-page,
  .transportation-page,
  .students-page-shell,
  .students-page-content {
    overflow-x: clip;
  }

  .marks-sheet-page table,
  .attendance-page table,
  .timetable-page table,
  .staff-page table,
  .fees-page table,
  .expense-page table,
  .transportation-page table,
  .students-page-content table {
    max-width: none;
  }

  /* Soften dashboard search on mobile — full width */
  .dashboard-page > div[style*="linear-gradient(135deg, #f8fafc"] {
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 12px var(--ilm-mobile-inset) !important;
    border-radius: 0 !important;
  }

  .dashboard-page > div[style*="linear-gradient(135deg, #f8fafc"] input {
    font-size: 16px !important;
  }

  /* Reception / enquiry / competitions / settings / documents / ledger / calendar / meetings */
  /* Academics embedded stacks (timetable / meetings embeds) */
  .academics-stack-mobile,
  .academics-stack-mobile--3 {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  /* Class Timetable Maker: keep the full grid on-screen (no page scroll) */
  .tt-maker-page--mobile .academics-stack-mobile.tt-maker-stack {
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    box-sizing: border-box !important;
  }

  .timetable-page.tt-maker-page--mobile,
  .timetable-page.tt-maker-page {
    padding-left: 0 !important;
    padding-right: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .tt-maker-page--mobile .tt-maker-board,
  .tt-maker-page--mobile .tt-subjects-panel,
  .tt-maker-page--mobile .tt-maker-chrome,
  .tt-maker-page--mobile .tt-maker-main {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .tt-maker-page--mobile .tt-maker-board {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }

  .tt-maker-page--mobile .tt-subjects-panel {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }

  .competitions-page .academics-prize-row,
  .competitions-page [style*="280px 1fr 320px"] {
    grid-template-columns: 1fr !important;
  }

  /* Staff ledger two-pane + fixed inset modals */
  .staff-ledger-page [style*="300px 1fr"] {
    grid-template-columns: 1fr !important;
    min-height: 0 !important;
  }

  .staff-ledger-page .app-page-modal-overlay .card[style*="inset"],
  .staff-ledger-page .card[style*="inset:"] {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: min(90dvh, calc(100dvh - 56px)) !important;
  }

  .settings-page [style*="gridTemplateColumns: '180px 1fr auto'"],
  .settings-page [style*="180px 1fr auto"] {
    grid-template-columns: 1fr !important;
  }

  .map-page > div:first-child {
    padding: 12px 14px !important;
  }

  .map-page input[type="search"] {
    min-width: 0 !important;
    width: 100% !important;
    flex: 1 1 100% !important;
  }

  .meetings-page {
    padding: 12px !important;
    max-width: 100% !important;
  }

  .meetings-page > div:first-child {
    padding: 16px !important;
  }

  .meetings-page h1 {
    font-size: 22px !important;
  }

  .report-maker-page {
    padding: 12px !important;
  }

  .report-maker-page > div:first-child {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .infra-page .infra-header {
    flex-direction: column !important;
    align-items: stretch !important;
  }

  /* —— Timetable page shared mobile chrome (all planner tabs) —— */
  .tt-shared-page--mobile {
    background: #f1f5f9 !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    box-sizing: border-box !important;
  }

  .tt-shared-page--mobile .tt-shared-chrome {
    flex: 0 0 auto;
    display: grid;
    gap: 6px;
    padding: 6px 4px 4px;
    background: #f1f5f9;
  }

  .tt-shared-page--mobile .tt-shared-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 5px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 2px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
  }

  .tt-shared-page--mobile .tt-shared-tabs::-webkit-scrollbar { display: none; }

  .tt-shared-page--mobile .tt-shared-tabs > button {
    flex: 0 0 auto;
    white-space: nowrap;
    min-height: 32px !important;
    padding: 4px 10px !important;
    border-radius: 8px !important;
    font-size: 11px !important;
  }

  .tt-shared-page--mobile .tt-shared-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .tt-shared-page--mobile .tt-shared-actions button {
    min-height: 38px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
  }

  .tt-shared-page--mobile .tt-shared-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 8px;
  }

  .tt-shared-page--mobile .tt-mobile-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }

  .tt-shared-page--mobile .tt-mobile-sheet {
    background: #fff;
    border-radius: 18px 18px 0 0;
    max-height: min(88dvh, 920px);
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.2);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .tt-shared-page--mobile .tt-mobile-sheet__handle {
    width: 40px;
    height: 4px;
    border-radius: 999px;
    background: #cbd5e1;
    margin: 10px auto 0;
  }

  .tt-shared-page--mobile .tt-mobile-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px 8px;
  }

  .tt-shared-page--mobile .tt-mobile-sheet__title {
    margin: 0;
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
  }

  .tt-shared-page--mobile .tt-mobile-sheet__close {
    min-width: 36px;
    min-height: 36px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: #334155;
    font-weight: 800;
    cursor: pointer;
  }

  .tt-shared-page--mobile .tt-mobile-sheet__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .tt-shared-page--mobile .tt-mobile-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .tt-shared-page--mobile .tt-mobile-actions button {
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #0f172a;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
  }

  .tt-shared-page--mobile .tt-mobile-actions button.is-on {
    border-color: #7c3aed;
    background: #ede9fe;
    color: #5b21b6;
  }

  .tt-shared-page--mobile .tt-mobile-actions button.is-save {
    border-color: #16a34a;
    background: #dcfce7;
    color: #166534;
  }

  .tt-class-teacher-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 12px;
    display: grid;
    gap: 10px;
    margin: 0 4px 10px;
  }

  .tt-class-teacher-card__title {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
  }

  .tt-class-teacher-card label {
    display: grid;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
  }

  .tt-class-teacher-card select,
  .tt-class-teacher-card input {
    min-height: 42px;
    border-radius: 12px;
    border: 1px solid #cbd5e1;
    padding: 8px 12px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
  }

  .tt-sub-page--mobile .academics-stack-mobile {
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 0 !important;
    gap: 6px !important;
  }

  .tt-sub-page--mobile .tt-sub-grid-wrap {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
  }

  .tt-sub-page--mobile .tt-sub-grid-wrap table {
    font-size: 11px !important;
  }

  .tt-sub-page--mobile .tt-sub-grid-wrap th,
  .tt-sub-page--mobile .tt-sub-grid-wrap td {
    min-width: 56px !important;
  }

  .tt-sub-page--mobile .tt-sub-grid-wrap th:first-child,
  .tt-sub-page--mobile .tt-sub-grid-wrap td:first-child {
    min-width: 72px !important;
    position: sticky;
    left: 0;
    z-index: 2;
  }

  .tt-sub-page--mobile .tt-sub-desktop-teachers {
    display: none !important;
  }

  .tt-weekly-page--mobile {
    padding: 0 !important;
  }

  .tt-weekly-page--mobile .weekly-tt-frame {
    border-radius: 0 !important;
    border-left: none !important;
    border-right: none !important;
  }

  .tt-weekly-page--mobile .tt-weekly-help {
    display: none !important;
  }

  .tt-teachers-page--mobile .tt-teachers-grid {
    font-size: 11px !important;
  }

  .tt-teachers-page--mobile .tt-teachers-grid__period,
  .tt-teachers-page--mobile .tt-teachers-grid__cell {
    min-width: 72px !important;
  }

  .tt-teachers-page--mobile .tt-teachers-grid__day {
    min-width: 72px !important;
  }

  .tt-teachers-page--mobile .tt-teachers-grid__count,
  .tt-teachers-page--mobile .tt-teachers-grid__week {
    min-width: 44px !important;
    width: 44px !important;
    padding: 6px 4px !important;
  }
}
/**
 * Force EVERY modal / dialog / overlay into a mobile bottom-sheet.
 * Works with named classes AND classless fixed overlays (via .ilm-fs-* tags from MotionEnhancer).
 */

@media (max-width: 900px) {
  /* —— Overlay shells —— */
  .modal-overlay,
  .modal-wrapper,
  .app-page-modal-overlay,
  .ilm-modal-overlay,
  .ilm-fs-overlay,
  .finance-modal-overlay,
  .staff-attendance-settings-overlay,
  .dash-modal-overlay,
  .transport-simple-modal-overlay,
  .app-dialog-overlay,
  .pa-modal-overlay,
  .qpm-modal-backdrop,
  .qpm-diagram-backdrop,
  .cert-paint-overlay,
  .ilm-modal-overlay--sheet,
  .payments-layer-overlay {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-end !important;
    padding: 0 !important;
    /* Keep sheets above the fixed mobile bottom nav */
    padding-bottom: var(--ilm-mobile-nav-h, calc(64px + env(safe-area-inset-bottom, 0px))) !important;
    margin: 0 !important;
    inset: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
    height: 100% !important;
    max-height: 100dvh !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box !important;
  }

  /* —— Panels / sheets —— */
  .ilm-modal-panel,
  .ilm-fs-panel,
  .ilm-modal-panel--sheet,
  .finance-modal-panel,
  .finance-modal-shell,
  .finance-modal-shell--wide,
  .finance-modal-shell--narrow,
  .dash-modal-panel,
  .dash-modal-panel--padded,
  .modal,
  .modal-content,
  .modal-dialog,
  .pa-modal-card,
  .glass-modal,
  .qpm-modal,
  .cert-paint-dialog,
  .staff-mark-attendance-overlay .ilm-modal-panel,
  .modal-overlay > .card,
  .app-page-modal-overlay > .card,
  .ilm-fs-overlay > .card,
  .ilm-modal-overlay > .card,
  .dash-modal-overlay > .card,
  .finance-modal-overlay > .finance-modal-shell,
  .finance-modal-overlay > .finance-modal-panel,
  .payments-layer-overlay > .payments-layer-panel,
  .payments-layer-overlay > .card {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    inset: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: min(92dvh, calc(100dvh - var(--ilm-mobile-nav-h, 64px) - 8px)) !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box !important;
    transform: none !important;
    flex: 0 1 auto !important;
  }

  /* Direct panel children already tagged .ilm-fs-panel / .ilm-modal-panel above */

  /* Kill fixed inset panels (Fees detail, Staff ledger, etc.) */
  .app-page-modal-overlay [style*="inset"],
  .ilm-fs-overlay [style*="inset"],
  .modal-overlay [style*="inset"],
  .ilm-modal-overlay [style*="inset"],
  [style*="inset: 4%"],
  [style*="inset:4%"],
  [style*="inset: 5%"],
  [style*="inset:5%"],
  [style*="inset: 8%"],
  [style*="inset:8%"],
  [style*="inset: 10%"],
  [style*="inset:10%"],
  [style*="inset: 12%"],
  [style*="inset:12%"],
  [style*="inset: 15%"],
  [style*="inset:15%"],
  [style*="inset: 20%"],
  [style*="inset:20%"] {
    position: relative !important;
    inset: auto !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 20px 20px 0 0 !important;
    max-height: min(92dvh, calc(100dvh - 8px)) !important;
  }

  /* Inline maxWidth / width on panels inside overlays */
  .modal-overlay [style*="maxWidth"],
  .modal-overlay [style*="max-width"],
  .app-page-modal-overlay [style*="maxWidth"],
  .app-page-modal-overlay [style*="max-width"],
  .dash-modal-overlay [style*="maxWidth"],
  .dash-modal-overlay [style*="max-width"],
  .ilm-fs-overlay [style*="maxWidth"],
  .ilm-fs-overlay [style*="max-width"],
  .ilm-modal-overlay [style*="maxWidth"],
  .ilm-modal-overlay [style*="max-width"],
  .ilm-fs-panel[style*="width"],
  .ilm-modal-panel[style*="width"],
  .dash-modal-panel[style*="width"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  /* Sticky chrome inside sheets */
  .finance-modal-header,
  .modal-header,
  .pa-modal-header,
  .dash-modal-panel > div:first-child,
  .ilm-fs-panel > div:first-child,
  .ilm-modal-panel > div:first-child {
    position: sticky;
    top: 0;
    z-index: 4;
  }

  .finance-modal-footer,
  .modal-footer,
  .modal-actions,
  .form-actions {
    position: sticky;
    bottom: 0;
    z-index: 4;
    background: #fff;
    padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
  }

  /* Forms / grids inside any sheet */
  .ilm-fs-panel .grid-2,
  .ilm-fs-panel .grid-3,
  .ilm-fs-panel .grid-4,
  .ilm-modal-panel .grid-2,
  .ilm-modal-panel .grid-3,
  .dash-modal-panel .grid-2,
  .finance-modal-shell .grid-2,
  .finance-form-grid {
    grid-template-columns: 1fr !important;
  }

  .ilm-fs-panel input,
  .ilm-fs-panel select,
  .ilm-fs-panel textarea,
  .ilm-modal-panel input,
  .ilm-modal-panel select,
  .ilm-modal-panel textarea,
  .dash-modal-panel input,
  .dash-modal-panel select,
  .dash-modal-panel textarea {
    max-width: 100% !important;
    font-size: 16px !important;
  }

  .ilm-fs-panel table,
  .ilm-modal-panel table,
  .dash-modal-panel table,
  .finance-modal-shell table {
    width: max-content;
    min-width: 100%;
    max-width: none;
  }

  .ilm-fs-panel:has(> table),
  .ilm-modal-panel:has(> table),
  .dash-modal-panel:has(table),
  .finance-modal-shell:has(table),
  .ilm-fs-panel div:has(> table),
  .ilm-modal-panel div:has(> table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  /* Photo lightboxes stay centered full-screen, not sheets */
  [style*="rgba(0,0,0,0.9)"],
  [style*="rgba(0, 0, 0, 0.9)"],
  [data-ilm-no-mobile-sheet] {
    align-items: center !important;
    justify-content: center !important;
  }

  [style*="rgba(0,0,0,0.9)"] > *,
  [style*="rgba(0, 0, 0, 0.9)"] > * {
    border-radius: 12px !important;
    max-height: 85dvh !important;
    width: auto !important;
    max-width: 96vw !important;
  }
}
/**
 * Beginner-friendly mobile UX — filters, tables, stacks, and cramped inline layouts.
 * Loaded after mobile-app.css / mobile-modals.css.
 */

:root {
  --ilm-touch: 44px;
}

/* Utility classes — use in JSX or auto-applied by MobileLayoutFixer */
.ilm-mobile-filters {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
  gap: 8px !important;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.ilm-mobile-filters > * {
  min-width: 0 !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.ilm-mobile-filters > input,
.ilm-mobile-filters > select,
.ilm-mobile-filters > textarea,
.ilm-mobile-filters > label,
.ilm-mobile-filters > .search-input {
  flex: 1 1 160px !important;
}

.ilm-mobile-filters > button,
.ilm-mobile-filters > .btn {
  flex: 1 1 auto !important;
  min-height: var(--ilm-touch);
}

.ilm-table-scroll {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  overflow-y: visible;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  margin: 0;
  padding-bottom: 2px;
  box-sizing: border-box;
}

.ilm-table-scroll > table {
  width: max-content;
  min-width: 100%;
  max-width: none;
}

.ilm-stack {
  display: grid !important;
  grid-template-columns: 1fr !important;
  gap: inherit;
}

@media (max-width: 900px) {
  /* —— Beginner readability —— */
  .main-content,
  .ilm-fs-panel,
  .ilm-modal-panel,
  .dash-modal-panel,
  .finance-modal-shell {
    font-size: 14px;
    line-height: 1.4;
  }

  .main-content label,
  .ilm-fs-panel label,
  .ilm-modal-panel label {
    font-size: 12px !important;
    font-weight: 700 !important;
    color: #334155 !important;
  }

  /* —— Every filter / toolbar row wraps —— */
  .toolbar,
  .filter-bar,
  .filters-row,
  .filters-section,
  .list-controls,
  .search-bar,
  .page-actions,
  .header-actions,
  .toolbar-actions,
  .transport-toolbar,
  .expense-page-tabs,
  .ilm-mobile-filters {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  /* Horizontal flex rows in pages (not column stacks) */
  .main-content [style*="display: flex"]:not([style*="flex-direction: column"]):not([style*="flex-direction:column"]):not([style*="flex-direction: column"]),
  .main-content [style*="display:flex"]:not([style*="flex-direction: column"]):not([style*="flex-direction:column"]),
  .ilm-fs-panel [style*="display: flex"]:not([style*="flex-direction: column"]):not([style*="flex-direction:column"]),
  .ilm-modal-panel [style*="display: flex"]:not([style*="flex-direction: column"]):not([style*="flex-direction:column"]),
  .dash-modal-panel [style*="display: flex"]:not([style*="flex-direction: column"]):not([style*="flex-direction:column"]),
  .finance-modal-shell [style*="display: flex"]:not([style*="flex-direction: column"]):not([style*="flex-direction:column"]),
  .app-page-modal-overlay [style*="display: flex"]:not([style*="flex-direction: column"]):not([style*="flex-direction:column"]),
  .modal-overlay [style*="display: flex"]:not([style*="flex-direction: column"]):not([style*="flex-direction:column"]) {
    flex-wrap: wrap !important;
    max-width: 100% !important;
  }

  /* Kill huge min-widths that blow out the phone */
  [style*="min-width: 600px"],
  [style*="min-width:600px"],
  [style*="min-width: 640px"],
  [style*="min-width:640px"],
  [style*="min-width: 700px"],
  [style*="min-width:700px"],
  [style*="min-width: 720px"],
  [style*="min-width:720px"],
  [style*="min-width: 760px"],
  [style*="min-width:760px"],
  [style*="min-width: 800px"],
  [style*="min-width:800px"],
  [style*="min-width: 860px"],
  [style*="min-width:860px"],
  [style*="min-width: 900px"],
  [style*="min-width:900px"],
  [style*="min-width: 960px"],
  [style*="min-width:960px"],
  [style*="min-width: 1000px"],
  [style*="min-width:1000px"],
  [style*="min-width: 1100px"],
  [style*="min-width:1100px"],
  [style*="min-width: 1200px"],
  [style*="min-width:1200px"],
  [style*="minWidth: '600"],
  [style*="minWidth: \"600"] {
    min-width: 0 !important;
  }

  /* —— Tables always swipe —— */
  .ilm-table-scroll,
  .students-table-scroll,
  .reception-table-scroll,
  .dash-table-scroll,
  .table-responsive,
  .entries-table-wrap,
  .fees-table-scroll,
  .staff-table-scroll,
  .marks-table-scroll,
  .attendance-table-scroll,
  .timetable-scroll,
  .dashboard-timetable-scroll {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  /* Any direct table parent becomes a scroller */
  .main-content *:has(> table),
  .ilm-fs-panel *:has(> table),
  .ilm-modal-panel *:has(> table),
  .dash-modal-panel *:has(> table),
  .finance-modal-shell *:has(> table),
  .modal-overlay *:has(> table),
  .app-page-modal-overlay *:has(> table),
  .card:has(> table),
  .page-card:has(> table) {
    overflow-x: auto !important;
    max-width: 100% !important;
    -webkit-overflow-scrolling: touch;
  }

  .main-content table,
  .ilm-fs-panel table,
  .ilm-modal-panel table,
  .dash-modal-panel table,
  .finance-modal-shell table,
  .modal-overlay table,
  .app-page-modal-overlay table {
    width: max-content;
    min-width: 100%;
    max-width: none;
  }

  /* —— Collapse multi-column grids inside modals / sheets —— */
  .ilm-fs-panel [style*="grid-template-columns"],
  .ilm-modal-panel [style*="grid-template-columns"],
  .dash-modal-panel [style*="grid-template-columns"],
  .finance-modal-shell [style*="grid-template-columns"],
  .finance-modal-panel [style*="grid-template-columns"],
  .modal-overlay [style*="grid-template-columns"],
  .app-page-modal-overlay [style*="grid-template-columns"],
  .pa-modal-card [style*="grid-template-columns"],
  .ilm-stack,
  .ilm-fs-panel .grid-2,
  .ilm-fs-panel .grid-3,
  .ilm-fs-panel .grid-4,
  .ilm-modal-panel .grid-2,
  .ilm-modal-panel .grid-3,
  .dash-modal-panel .grid-2,
  .dash-modal-panel .grid-3,
  .dash-detail-grid,
  .dash-detail-grid--3,
  .dash-card-grid,
  .dash-card-grid--3 {
    grid-template-columns: 1fr !important;
  }

  /* Page-level wide two-pane grids */
  .main-content [style*="grid-template-columns: 300px"],
  .main-content [style*="grid-template-columns:300px"],
  .main-content [style*="grid-template-columns: 320px"],
  .main-content [style*="grid-template-columns: 280px"],
  .main-content [style*="grid-template-columns: minmax(280"],
  .main-content [style*="grid-template-columns: minmax(320"],
  .main-content [style*="grid-template-columns: minmax(360"],
  .main-content [style*="grid-template-columns: minmax(420"],
  .main-content [style*="grid-template-columns: 1.25fr"],
  .main-content [style*="grid-template-columns: 1.2fr"],
  .main-content [style*="grid-template-columns: 1fr 1fr"],
  .main-content [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Keep compact 2-col stat tiles readable */
  .dashboard-stat-grid,
  .marks-summary,
  .attendance-stats-grid {
    grid-template-columns: 1fr 1fr !important;
  }

  /* —— Touch-friendly controls —— */
  .main-content button:not(.tab-btn):not(.sub-tab-btn):not([role="tab"]):not(.mobile-bottom-nav__item),
  .ilm-fs-panel button,
  .ilm-modal-panel button,
  .dash-modal-panel button,
  .finance-modal-shell button {
    min-height: 40px;
  }

  .main-content input,
  .main-content select,
  .main-content textarea,
  .ilm-fs-panel input,
  .ilm-fs-panel select,
  .ilm-fs-panel textarea,
  .ilm-modal-panel input,
  .ilm-modal-panel select,
  .ilm-modal-panel textarea {
    min-height: 40px;
    font-size: 16px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  /* Helpful empty / note text */
  .dashboard-section-note,
  .empty-state,
  .section-note {
    font-size: 13px !important;
    line-height: 1.45 !important;
    color: #475569 !important;
  }

  /* Nested second modal sits as another sheet on top */
  .ilm-fs-overlay .ilm-fs-overlay,
  .modal-overlay .modal-overlay,
  .app-page-modal-overlay .app-page-modal-overlay,
  body > .ilm-fs-overlay ~ .ilm-fs-overlay {
    z-index: 13000 !important;
  }
}

@media (max-width: 900px) {
  .student-action-overlay {
    align-items: flex-end !important;
    justify-content: flex-end !important;
    padding: 0 !important;
  }
  .student-action-sheet {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92dvh !important;
    margin: 0 !important;
    border-radius: 18px 18px 0 0 !important;
    padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    box-sizing: border-box !important;
  }
  .student-action-sheet h3 {
    font-size: 18px !important;
    line-height: 1.35 !important;
  }
  .student-action-sheet textarea,
  .student-action-sheet select,
  .student-action-sheet input {
    font-size: 16px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  .student-action-buttons {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .student-action-buttons button {
    width: 100% !important;
    min-height: 48px !important;
    white-space: normal !important;
    justify-content: center !important;
  }
}

/* Staff portal physical info: class chips + compact student sheet */
.portal-physical-classes {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  margin: 0 -2px;
  -webkit-overflow-scrolling: touch;
}
.portal-physical-chip {
  flex: 0 0 auto;
  min-height: 36px !important;
  padding: 6px 12px !important;
  border-radius: 999px !important;
  border: 1px solid #99f6e4 !important;
  background: #f0fdfa !important;
  color: #115e59 !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  box-shadow: none !important;
  white-space: nowrap;
}
.portal-physical-chip.is-on {
  background: #0f766e !important;
  border-color: #0f766e !important;
  color: #fff !important;
}
.portal-physical-sheet {
  display: grid;
  gap: 8px;
}
.portal-physical-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.portal-physical-row.is-dirty {
  border-color: #5eead4;
  background: #f0fdfa;
}
.portal-physical-row.is-saved {
  border-color: #bbf7d0;
}
.portal-physical-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}
.portal-physical-name {
  min-width: 0;
  font-weight: 800;
  font-size: 15px;
  color: #0b1f3f;
  line-height: 1.25;
  word-break: break-word;
}
.portal-physical-meta {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 650;
  color: #64748b;
  line-height: 1.3;
}
.portal-physical-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 3px 7px;
}
.portal-physical-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr 72px;
  gap: 6px;
  align-items: end;
}
.portal-physical-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  align-items: end;
}
.portal-physical-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.portal-physical-choice {
  min-height: 32px !important;
  padding: 4px 10px !important;
  border-radius: 999px !important;
  border: 1px solid #cbd5e1 !important;
  background: #fff !important;
  color: #334155 !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  box-shadow: none !important;
}
.portal-physical-choice.is-on {
  background: #0f766e !important;
  border-color: #0f766e !important;
  color: #fff !important;
}
.portal-physical-sheet input,
.portal-physical-sheet select,
.portal-physical-sheet textarea {
  min-height: 36px !important;
  height: 36px;
  padding: 6px 8px !important;
  font-size: 16px !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  border: 1px solid #cbd5e1 !important;
  background: #fff !important;
  width: 100%;
  box-sizing: border-box;
}
.portal-physical-sheet textarea {
  height: auto;
  min-height: 36px !important;
  resize: none;
}
.portal-physical-label {
  display: grid;
  gap: 3px;
  font-size: 10px;
  font-weight: 800;
  color: #64748b;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.portal-physical-bmi {
  min-height: 36px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  display: grid;
  place-items: center;
  font-weight: 800;
  color: #0f766e;
  font-size: 14px;
}
.portal-physical-save {
  position: sticky;
  bottom: 8px;
  z-index: 2;
}
.portal-inventory {
  display: grid;
  gap: 10px;
}
.portal-inventory-title {
  font-weight: 800;
  font-size: 16px;
  color: #0b1f3f;
}
.portal-inventory-meta {
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}
.portal-inventory-empty {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}
.portal-inventory-status {
  font-size: 12px;
  font-weight: 700;
  color: #0f766e;
  background: #f0fdfa;
  border: 1px solid #99f6e4;
  border-radius: 10px;
  padding: 8px 10px;
}
.portal-inventory-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.portal-inventory-metrics > div {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px;
  display: grid;
  gap: 2px;
}
.portal-inventory-metrics span {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #64748b;
}
.portal-inventory-metrics strong {
  font-size: 16px;
  color: #0b1f3f;
}
.portal-inventory-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.portal-inventory-chip,
.portal-inventory-action,
.portal-inventory-save,
.portal-inventory-person {
  min-height: 36px !important;
  border-radius: 999px !important;
  border: 1px solid #cbd5e1 !important;
  background: #fff !important;
  color: #334155 !important;
  box-shadow: none !important;
  padding: 6px 12px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  white-space: nowrap;
}
.portal-inventory-chip.is-on,
.portal-inventory-person.is-on {
  background: #0f766e !important;
  border-color: #0f766e !important;
  color: #fff !important;
}
.portal-inventory-save {
  background: #0f766e !important;
  border-color: #0f766e !important;
  color: #fff !important;
  width: 100%;
}
.portal-inventory-action {
  width: 100%;
}
.portal-inventory-stack {
  display: grid;
  gap: 8px;
}
.portal-inventory-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
}
.portal-inventory-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}
.portal-inventory-name {
  font-weight: 800;
  font-size: 15px;
  color: #0b1f3f;
  line-height: 1.25;
  word-break: break-word;
}
.portal-inventory-stock {
  min-width: 52px;
  border-radius: 12px;
  background: #ecfdf5;
  color: #166534;
  text-align: center;
  padding: 4px 6px;
  font-weight: 800;
  line-height: 1.1;
}
.portal-inventory-stock span {
  display: block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.portal-inventory-stock.is-out {
  background: #fef2f2;
  color: #b91c1c;
}
.portal-inventory-label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
}
.portal-inventory input,
.portal-inventory select,
.portal-inventory textarea {
  width: 100%;
  min-height: 40px !important;
  font-size: 16px !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 10px !important;
  padding: 8px 10px !important;
  background: #fff !important;
  color: #0f172a !important;
  box-shadow: none !important;
}
.portal-inventory-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: end;
}
.portal-inventory-people {
  display: grid;
  gap: 4px;
  max-height: 180px;
  overflow-y: auto;
}
.portal-inventory-person {
  width: 100%;
  text-align: left;
  border-radius: 10px !important;
}
.portal-inventory-tag {
  font-size: 10px;
  font-weight: 800;
  border-radius: 999px;
  padding: 3px 8px;
  background: #e2e8f0;
  color: #334155;
}
.portal-inventory-tag.is-out {
  background: #ffedd5;
  color: #9a3412;
}
.portal-inventory-tag.is-back {
  background: #dcfce7;
  color: #166534;
}

/* Staff portal workdone: nested book → chapter → topic → subtopic */
.portal-workdone-tree {
  display: grid;
  gap: 12px;
}
.portal-workdone-subject {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  padding: 2px 2px 0;
}
.portal-workdone-node {
  display: grid;
  gap: 8px;
  padding: 8px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  border-left-width: 3px;
}
.portal-workdone-node.is-book {
  border-left-color: #0f766e;
  background: #f8fffd;
}
.portal-workdone-node.is-chapter {
  border-left-color: #0369a1;
  background: #f8fbff;
}
.portal-workdone-node.is-topic {
  border-left-color: #b45309;
  background: #fffdf8;
}
.portal-workdone-node.is-subtopic {
  border-left-color: #be123c;
  background: #fffafb;
}
.portal-workdone-head {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
  border: none;
  background: transparent;
  padding: 6px 2px;
  text-align: left;
  cursor: pointer;
  min-height: 44px;
  color: inherit;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}
.portal-workdone-head:disabled {
  cursor: default;
}
.portal-workdone-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}
.portal-workdone-copy {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.portal-workdone-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.portal-workdone-title {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  word-break: break-word;
  line-height: 1.3;
  white-space: normal;
}
.portal-workdone-when {
  font-size: 12px;
  color: #64748b;
  font-weight: 500;
}
.portal-workdone-chevron {
  flex-shrink: 0;
  color: #64748b;
  font-size: 14px;
  padding-top: 4px;
}
.portal-workdone-extra {
  display: grid;
  gap: 8px;
  padding: 0 2px 2px;
}
.portal-workdone-kids {
  display: grid;
  gap: 8px;
  margin-left: 8px;
  padding-left: 8px;
  border-left: 2px dashed #cbd5e1;
}
@media (max-width: 420px) {
  .portal-workdone-kids {
    margin-left: 4px;
    padding-left: 6px;
  }
  .portal-workdone-node {
    padding: 8px 8px 8px 6px;
  }
}
