/* ==========================================================================
   Aarambh Early Years - Reusable Component Library
   Pre-Primary School Management UI Foundation
   ========================================================================== */

/* ==========================================================================
   1. BUTTONS
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-family-base);
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
  line-height: 1;
  text-decoration: none;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--duration-fast) var(--ease-smooth);
  user-select: none;
  position: relative;
  outline: none;
  min-height: var(--touch-target-md);
  padding: 0 var(--space-4);
  touch-action: manipulation;
}

.btn:focus-visible {
  box-shadow: var(--shadow-focus);
}

.btn:active:not(:disabled) {
  transform: scale(0.97);
}

/* Button Variants */
.btn-primary {
  background-color: var(--color-primary-500);
  color: var(--color-text-inverse);
  box-shadow: 0 3px 10px rgba(231, 111, 81, 0.28);
}
.btn-primary:hover:not(:disabled) {
  background-color: var(--color-primary-600);
  box-shadow: 0 5px 14px rgba(231, 111, 81, 0.35);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--color-surface);
  color: var(--color-text-primary);
  border-color: var(--color-border);
  box-shadow: var(--shadow-xs);
}
.btn-secondary:hover:not(:disabled) {
  background-color: var(--color-canvas);
  border-color: var(--color-border-hover);
  color: var(--color-primary-600);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-primary-600);
  border-color: var(--color-primary-500);
}
.btn-outline:hover:not(:disabled) {
  background-color: var(--color-primary-50);
  color: var(--color-primary-700);
}

.btn-soft {
  background-color: var(--color-primary-50);
  color: var(--color-primary-600);
  border-color: transparent;
}
.btn-soft:hover:not(:disabled) {
  background-color: var(--color-primary-100);
  color: var(--color-primary-700);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
}
.btn-ghost:hover:not(:disabled) {
  background-color: rgba(30, 41, 59, 0.05);
  color: var(--color-text-primary);
}

.btn-destructive {
  background-color: var(--color-pastel-rose-bg);
  color: var(--color-pastel-rose-text);
  border-color: var(--color-pastel-rose-border);
}
.btn-destructive:hover:not(:disabled) {
  background-color: #FECDD3;
  color: #881337;
}

/* Button Sizes */
.btn-sm {
  min-height: var(--touch-target-sm);
  padding: 0 var(--space-3);
  font-size: var(--font-size-xs);
  border-radius: var(--radius-sm);
}

.btn-lg {
  min-height: var(--touch-target-lg);
  padding: 0 var(--space-6);
  font-size: var(--font-size-base);
  border-radius: var(--radius-lg);
}

.btn-icon-only {
  width: var(--touch-target-md);
  height: var(--touch-target-md);
  padding: 0;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.btn-icon-only.btn-sm {
  width: var(--touch-target-sm);
  height: var(--touch-target-sm);
  border-radius: var(--radius-sm);
}

.btn:disabled,
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none !important;
  transform: none !important;
}

/* Loading button spinner */
.btn.is-loading {
  color: transparent !important;
  pointer-events: none;
}
.btn.is-loading::after {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border: 2.5px solid currentColor;
  border-radius: 50%;
  border-right-color: transparent;
  animation: spin 0.75s linear infinite;
  color: var(--color-text-inverse);
}
.btn-secondary.is-loading::after,
.btn-outline.is-loading::after,
.btn-soft.is-loading::after {
  color: var(--color-primary-500);
}

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


/* ==========================================================================
   2. FORM CONTROLS & INPUTS
   ========================================================================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
  width: 100%;
  text-align: left;
}

.form-label {
  font-family: var(--font-family-base);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label-optional {
  font-size: var(--font-size-xs);
  color: var(--color-text-subtle);
  font-weight: var(--font-weight-regular);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-prefix-icon,
.input-suffix-icon {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  pointer-events: none;
  width: 20px;
  height: 20px;
}

.input-prefix-icon {
  left: var(--space-3);
}

.input-suffix-icon {
  right: var(--space-3);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-height: var(--touch-target-md);
  padding: 0 var(--space-3);
  font-family: var(--font-family-base);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  background-color: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  outline: none;
  transition: all var(--duration-fast) var(--ease-smooth);
  box-shadow: var(--shadow-xs);
  box-sizing: border-box;
}

.input-with-prefix {
  padding-left: calc(var(--space-3) + 24px);
}
.input-with-suffix {
  padding-right: calc(var(--space-3) + 24px);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-subtle);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--color-primary-500);
  box-shadow: var(--shadow-focus);
  background-color: var(--color-surface);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background-color: var(--color-canvas-subtle);
  color: var(--color-text-subtle);
  cursor: not-allowed;
  border-color: var(--color-border-subtle);
}

.form-textarea {
  min-height: 90px;
  padding: var(--space-3);
  resize: vertical;
  line-height: var(--line-height-normal);
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-8);
  cursor: pointer;
}

/* Form Helper & Validation Messages */
.form-helper {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  line-height: var(--line-height-snug);
}

.form-error {
  font-size: var(--font-size-xs);
  color: var(--color-danger);
  font-weight: var(--font-weight-semibold);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.form-input.is-error,
.form-select.is-error {
  border-color: var(--color-danger);
  background-color: #FFF5F5;
}
.form-input.is-error:focus,
.form-select.is-error:focus {
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Checkbox & Radio Controls */
.form-check-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-family-base);
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  user-select: none;
  min-height: var(--touch-target-sm);
}

.form-check-input {
  appearance: none;
  width: 22px;
  height: 22px;
  border: 1.8px solid var(--color-border);
  border-radius: var(--radius-xs);
  background-color: var(--color-surface);
  cursor: pointer;
  display: grid;
  place-content: center;
  transition: all var(--duration-fast) var(--ease-smooth);
  margin: 0;
  flex-shrink: 0;
}

.form-check-input[type="radio"] {
  border-radius: var(--radius-full);
}

.form-check-input:checked {
  background-color: var(--color-primary-500);
  border-color: var(--color-primary-500);
}

.form-check-input[type="checkbox"]:checked::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid var(--color-text-inverse);
  border-width: 0 2.2px 2.2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

.form-check-input[type="radio"]:checked::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background-color: var(--color-text-inverse);
}

/* Switch Toggle (Preschool friendly pill switch) */
.form-switch-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
  min-height: var(--touch-target-sm);
}

.form-switch {
  position: relative;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.form-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #CBD5E1;
  border-radius: var(--radius-full);
  transition: background-color var(--duration-fast) var(--ease-smooth);
}

.switch-slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
  transition: transform var(--duration-fast) var(--ease-smooth);
}

.form-switch input:checked + .switch-slider {
  background-color: var(--color-primary-500);
}

.form-switch input:checked + .switch-slider::before {
  transform: translateX(22px);
}


/* ==========================================================================
   3. CARDS & SURFACES
   ========================================================================== */
.card {
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  transition: transform var(--duration-fast) var(--ease-smooth),
              box-shadow var(--duration-fast) var(--ease-smooth),
              border-color var(--duration-fast) var(--ease-smooth);
  position: relative;
  box-sizing: border-box;
}

.card-hoverable:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(231, 111, 81, 0.3);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  gap: var(--space-3);
}

.card-title {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.card-subtitle {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Metric / Stat Card */
.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 120px;
}

.stat-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

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

.stat-card-title {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0;
}

.stat-card-value {
  font-family: var(--font-family-display);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
  margin: var(--space-1) 0;
}

.stat-card-footer {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
}

.trend-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-weight: var(--font-weight-bold);
  border-radius: var(--radius-full);
  padding: 1px 6px;
  font-size: 11px;
}
.trend-up {
  background-color: var(--color-pastel-emerald-bg);
  color: var(--color-pastel-emerald-text);
}
.trend-down {
  background-color: var(--color-pastel-rose-bg);
  color: var(--color-pastel-rose-text);
}


/* ==========================================================================
   4. BADGES, CHIPS & TAGS
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-family: var(--font-family-base);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  line-height: 1.3;
  border: 1px solid transparent;
  white-space: nowrap;
}

/* Soft Pastel Preschool Badges */
.badge-pastel-amber {
  background-color: var(--color-pastel-amber-bg);
  color: var(--color-pastel-amber-text);
  border-color: var(--color-pastel-amber-border);
}

.badge-pastel-emerald {
  background-color: var(--color-pastel-emerald-bg);
  color: var(--color-pastel-emerald-text);
  border-color: var(--color-pastel-emerald-border);
}

.badge-pastel-sky {
  background-color: var(--color-pastel-sky-bg);
  color: var(--color-pastel-sky-text);
  border-color: var(--color-pastel-sky-border);
}

.badge-pastel-purple {
  background-color: var(--color-pastel-purple-bg);
  color: var(--color-pastel-purple-text);
  border-color: var(--color-pastel-purple-border);
}

.badge-pastel-rose {
  background-color: var(--color-pastel-rose-bg);
  color: var(--color-pastel-rose-text);
  border-color: var(--color-pastel-rose-border);
}

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

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: var(--radius-full);
  display: inline-block;
}

/* Interactive Filter Chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-family: var(--font-family-base);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-secondary);
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  user-select: none;
  min-height: var(--touch-target-sm);
}

.chip:hover {
  background-color: var(--color-primary-50);
  border-color: var(--color-primary-300);
  color: var(--color-primary-700);
}

.chip.is-active {
  background-color: var(--color-primary-500);
  color: var(--color-text-inverse);
  border-color: var(--color-primary-500);
  box-shadow: 0 2px 8px rgba(231, 111, 81, 0.3);
}


/* ==========================================================================
   5. RESPONSIVE TABLES
   ========================================================================== */
.table-card {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.table-school {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  text-align: left;
  font-family: var(--font-family-base);
}

.table-school th {
  background-color: #FAF9F6;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
}

.table-school td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  border-bottom: 1px solid var(--color-border-subtle);
  vertical-align: middle;
  transition: background-color var(--duration-fast);
}

.table-school tbody tr:hover td {
  background-color: #FFF9F7;
}

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

/* Student Avatar Cell */
.student-avatar-cell {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-xs);
  flex-shrink: 0;
}


/* ==========================================================================
   6. MODALS & DIALOGS
   ========================================================================== */
.modal-dialog {
  border: none;
  background: transparent;
  padding: 0;
  margin: auto;
  max-width: 520px;
  width: calc(100% - 32px);
  position: fixed;
  inset: 0;
  overflow: visible;
  z-index: var(--z-modal);
}

.modal-dialog::backdrop {
  background-color: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: modalFadeIn var(--duration-normal) var(--ease-smooth);
}

.modal-content {
  background-color: var(--color-surface);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  border: 1px solid var(--color-border);
  animation: modalScaleUp var(--duration-normal) var(--ease-spring);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.modal-content > form {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-height: 85vh;
  flex: 1;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalScaleUp {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Mobile Bottom Sheet optimization */
@media (max-width: 640px) {
  .modal-dialog {
    width: 100%;
    max-width: 100%;
    margin-bottom: 0;
    bottom: 0;
    top: auto;
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
  }
  
  .modal-content {
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    max-height: 90vh;
    animation: bottomSheetSlideUp var(--duration-normal) var(--ease-spring);
  }

  @keyframes bottomSheetSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
}

.modal-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}

.modal-title {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin: 0;
}

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  background-color: #FCFBF9;
}


/* ==========================================================================
   7. TOAST & NOTIFICATION MESSAGES
   ========================================================================== */
.toast-container {
  position: fixed;
  top: var(--space-5);
  right: var(--space-5);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  pointer-events: none;
  max-width: 380px;
  width: calc(100% - 32px);
}

@media (max-width: 640px) {
  .toast-container {
    top: var(--space-4);
    right: 50%;
    transform: translateX(50%);
  }
}

.toast {
  pointer-events: auto;
  background-color: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  animation: toastSlideIn var(--duration-normal) var(--ease-spring);
  transition: all var(--duration-fast);
}

.toast.is-hiding {
  opacity: 0;
  transform: translateY(-8px) scale(0.95);
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateY(-16px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

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

.toast-success .toast-icon {
  background-color: var(--color-pastel-emerald-bg);
  color: var(--color-pastel-emerald-text);
}

.toast-error .toast-icon {
  background-color: var(--color-pastel-rose-bg);
  color: var(--color-pastel-rose-text);
}

.toast-warning .toast-icon {
  background-color: var(--color-pastel-amber-bg);
  color: var(--color-pastel-amber-text);
}

.toast-info .toast-icon {
  background-color: var(--color-pastel-sky-bg);
  color: var(--color-pastel-sky-text);
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin: 0;
  line-height: var(--line-height-snug);
}

.toast-message {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin: 2px 0 0 0;
}

.toast-close {
  background: transparent;
  border: none;
  color: var(--color-text-subtle);
  cursor: pointer;
  padding: var(--space-1);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.toast-close:hover {
  color: var(--color-text-primary);
  background-color: var(--color-canvas);
}

/* Inline Alert Banners */
.alert-banner {
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  border: 1px solid transparent;
  margin-bottom: var(--space-4);
}

.alert-banner-info {
  background-color: var(--color-pastel-sky-bg);
  color: var(--color-pastel-sky-text);
  border-color: var(--color-pastel-sky-border);
}

.alert-banner-warning {
  background-color: var(--color-pastel-amber-bg);
  color: var(--color-pastel-amber-text);
  border-color: var(--color-pastel-amber-border);
}

.alert-banner-success {
  background-color: var(--color-pastel-emerald-bg);
  color: var(--color-pastel-emerald-text);
  border-color: var(--color-pastel-emerald-border);
}


/* ==========================================================================
   8. EMPTY STATES
   ========================================================================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-12) var(--space-6);
  background-color: var(--color-surface);
  border-radius: var(--radius-2xl);
  border: 1.5px dashed var(--color-border);
}

.empty-state-icon-bubble {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  background-color: var(--color-primary-50);
  color: var(--color-primary-500);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
  box-shadow: 0 4px 14px rgba(231, 111, 81, 0.12);
}

.empty-state-title {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  margin: 0 0 var(--space-2) 0;
}

.empty-state-description {
  font-size: var(--font-size-sm);
  color: var(--color-text-muted);
  max-width: 380px;
  line-height: var(--line-height-relaxed);
  margin: 0 0 var(--space-6) 0;
}


/* ==========================================================================
   9. LOADING SKELETONS
   ========================================================================== */
.skeleton {
  background: linear-gradient(
    90deg,
    #F1F5F9 0%,
    #E2E8F0 50%,
    #F1F5F9 100%
  );
  background-size: 200% 100%;
  animation: skeletonPulse 1.6s ease-in-out infinite;
  border-radius: var(--radius-sm);
  display: block;
}

@keyframes skeletonPulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 14px;
  margin-bottom: var(--space-2);
}
.skeleton-text-lg {
  height: 24px;
  margin-bottom: var(--space-3);
}
.skeleton-circle {
  border-radius: var(--radius-full);
}
.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
}

/* ==========================================================================
   10. LOGIN SCREEN & ROLE SELECTOR STYLES
   ========================================================================== */
.login-overlay-container {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: radial-gradient(circle at top right, #FFF5F2 0%, #FAF9F6 60%);
}

.login-card {
  width: 100%;
  max-width: 460px;
  background-color: var(--color-surface);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xl);
  padding: var(--space-8);
  animation: modalScaleUp var(--duration-normal) var(--ease-spring);
}

@media (max-width: 480px) {
  .login-card {
    padding: var(--space-5);
    border-radius: var(--radius-xl);
  }
}

.login-header {
  text-align: center;
  margin-bottom: var(--space-6);
}

.login-logo {
  margin: 0 auto var(--space-3);
}

.login-title {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-xl);
  font-weight: 800;
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
}

.login-subtitle {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* 1-Click Demo Login Selector */
.demo-accounts-box {
  background-color: var(--color-canvas);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin-bottom: var(--space-6);
}

.demo-accounts-title {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.demo-role-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-2);
}

.demo-role-btn {
  background-color: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 8px 6px;
  text-align: center;
  cursor: pointer;
  transition: all var(--duration-fast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.demo-role-btn:hover {
  border-color: var(--color-primary-500);
  background-color: var(--color-primary-50);
  transform: translateY(-2px);
}

.demo-role-btn.is-active {
  border-color: var(--color-primary-500);
  background-color: var(--color-primary-50);
  box-shadow: 0 2px 8px rgba(231, 111, 81, 0.2);
}

.demo-role-name {
  font-size: 11px;
  font-weight: 800;
  color: var(--color-text-primary);
}

.demo-role-desc {
  font-size: 10px;
  color: var(--color-text-muted);
}

/* Password Toggle Icon Button */
.password-toggle-btn {
  position: absolute;
  right: var(--space-3);
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-1);
}
.password-toggle-btn:hover {
  color: var(--color-text-primary);
}

/* ==========================================================================
   11. ADMIN DASHBOARD SPECIFIC COMPONENTS
   ========================================================================== */
.admin-greeting-card {
  background: linear-gradient(135deg, #FFF8F6 0%, #FFFFFF 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.greeting-text-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.greeting-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #FF8A65 0%, #E76F51 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(231, 111, 81, 0.3);
  flex-shrink: 0;
}

.greeting-title {
  font-family: var(--font-family-heading);
  font-size: var(--font-size-xl);
  font-weight: 800;
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
}

.greeting-subtitle {
  font-size: var(--font-size-xs);
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* 4 Quick Actions Bar */
.quick-actions-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

@media (max-width: 900px) {
  .quick-actions-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .quick-actions-bar {
    grid-template-columns: 1fr;
  }
}

.quick-action-pill {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  color: var(--color-text-primary);
  text-decoration: none;
  font-family: var(--font-family-base);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: all var(--duration-fast) var(--ease-smooth);
  min-height: 52px;
}

.quick-action-pill:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(231, 111, 81, 0.4);
  background-color: #FFF9F7;
  color: var(--color-primary-600);
}

.quick-action-pill:active {
  transform: scale(0.98);
}

.quick-action-pill-primary {
  background-color: var(--color-primary-500);
  color: white;
  border-color: var(--color-primary-500);
  box-shadow: 0 4px 14px rgba(231, 111, 81, 0.28);
}
.quick-action-pill-primary:hover {
  background-color: var(--color-primary-600);
  border-color: var(--color-primary-600);
  color: white;
}

.quick-action-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* 6 Summary Cards Grid */
.stats-grid-6 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

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

.stat-card-clickable {
  cursor: pointer;
  user-select: none;
}
.stat-card-clickable:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(231, 111, 81, 0.35);
}

/* Attendance Progress Bar */
.attendance-progress-track {
  width: 100%;
  height: 8px;
  background-color: #F1F5F9;
  border-radius: var(--radius-full);
  overflow: hidden;
  margin-top: 8px;
}

.attendance-progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  transition: width 0.8s ease-in-out;
}

/* ==========================================================================
   12. TEACHER DASHBOARD SPECIFIC STYLES
   ========================================================================== */
.teacher-greeting-card {
  background: linear-gradient(135deg, #F0FDF4 0%, #FFFFFF 100%);
  border: 1px solid rgba(46, 125, 50, 0.2);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  margin-bottom: var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.teacher-avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #34D399 0%, #059669 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.3);
  flex-shrink: 0;
}

/* 4 Summary Cards Grid for Teacher */
.stats-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

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

/* 1-Tap Attendance Status Pills */
.one-tap-att-group {
  display: flex;
  gap: 4px;
  background-color: #F8FAFC;
  padding: 3px;
  border-radius: var(--radius-full);
  border: 1px solid var(--color-border-subtle);
}

.one-tap-att-btn {
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--color-text-secondary);
  transition: all var(--duration-fast) var(--ease-smooth);
  min-height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.one-tap-att-btn:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.one-tap-att-btn.is-active-present {
  background-color: var(--color-pastel-emerald-text);
  color: white;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.one-tap-att-btn.is-active-late {
  background-color: var(--color-pastel-amber-text);
  color: white;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
}

.one-tap-att-btn.is-active-absent {
  background-color: var(--color-pastel-rose-text);
  color: white;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

/* Reminder Checklist Item */
.reminder-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background-color: var(--color-canvas);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  transition: all var(--duration-fast) var(--ease-smooth);
}

.reminder-item:hover {
  border-color: var(--color-border);
  background-color: #FFFFFF;
}

.reminder-item.is-completed {
  opacity: 0.6;
  background-color: #F8FAFC;
}

.reminder-item.is-completed .reminder-title {
  text-decoration: line-through;
  color: var(--color-text-muted);
}

.reminder-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--color-primary-500);
  margin-top: 2px;
  cursor: pointer;
}

/* Preset Category Chips in Modal */
.category-preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-4);
}

.category-chip-btn {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: var(--color-text-secondary);
  transition: all var(--duration-fast) var(--ease-smooth);
  min-height: 38px;
}

.category-chip-btn:hover,
.category-chip-btn.is-active {
  border-color: var(--color-primary-500);
  background: var(--color-primary-50);
  color: var(--color-primary-600);
}

/* ==========================================================================
   PARENT DASHBOARD COMPONENT STYLES (Falcon Academy - Aarav Sharma)
   ========================================================================== */
.parent-dashboard-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  max-width: 100%;
  box-sizing: border-box;
}

.parent-greeting-card {
  background: linear-gradient(135deg, #FFF9F6 0%, #FFFFFF 100%);
  border: 1.5px solid #FFE4DB;
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
  box-shadow: 0 4px 16px rgba(231, 111, 81, 0.08);
  position: relative;
  overflow: hidden;
  max-width: 100%;
  box-sizing: border-box;
}

@media (max-width: 767px) {
  .parent-greeting-card {
    padding: var(--space-4);
    gap: var(--space-3);
  }
}

.parent-greeting-card::before {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(231, 111, 81, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.parent-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFE8E0 0%, #FFD6C9 100%);
  color: var(--color-primary-700);
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 4px 12px rgba(231, 111, 81, 0.16);
  flex-shrink: 0;
}

.child-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.child-detail-item {
  padding: var(--space-3) var(--space-4);
  background: var(--color-canvas);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  transition: all var(--duration-fast) var(--ease-smooth);
}

.child-detail-item:hover {
  background: #FFFFFF;
  border-color: var(--color-border);
  box-shadow: var(--shadow-xs);
}

.child-detail-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: block;
  margin-bottom: 2px;
}

.child-detail-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.4;
  display: block;
}

.activity-photo-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
  margin-top: var(--space-3);
}

@media (max-width: 640px) {
  .activity-photo-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

.activity-photo-thumbnail {
  height: 74px;
  border-radius: var(--radius-md);
  background: #FFF8F5;
  border: 1px solid #FFE4DB;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--color-primary-600);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  padding: 6px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
}

.activity-photo-thumbnail:hover {
  transform: translateY(-2px);
  background: #FFF1EC;
  border-color: var(--color-primary-400);
  box-shadow: 0 4px 10px rgba(231, 111, 81, 0.15);
}

.fee-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-4);
  background: var(--color-canvas);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border-subtle);
  transition: all var(--duration-fast) var(--ease-smooth);
}

.fee-item-row:hover {
  background: #FFFFFF;
  border-color: var(--color-border);
}

/* Official Falcon Academy Digital Receipt Layout */
.receipt-paper {
  background: #FFFFFF;
  border: 2px solid #E2E8F0;
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  position: relative;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.receipt-stamp {
  width: 90px;
  height: 90px;
  border: 2.5px dashed var(--color-primary-500);
  border-radius: 50%;
  color: var(--color-primary-600);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transform: rotate(-10deg);
  opacity: 0.85;
}

/* ==========================================================================
   14. STUDENT MANAGEMENT MODULE STYLES
   ========================================================================== */
.student-filter-toolbar {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  box-shadow: var(--shadow-sm);
}

.student-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.student-search-box {
  position: relative;
  flex: 1;
  min-width: 240px;
}

.student-search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-muted);
  pointer-events: none;
}

.student-search-input {
  width: 100%;
  padding: 10px 14px 10px 40px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  background: var(--color-canvas);
  font-family: var(--font-family-body);
  font-size: 13.5px;
  color: var(--color-text-primary);
  transition: all var(--duration-fast) var(--ease-smooth);
}

.student-search-input:focus {
  outline: none;
  border-color: var(--color-primary-500);
  background: #FFFFFF;
  box-shadow: 0 0 0 3px rgba(231, 111, 81, 0.15);
}

.student-filter-selects {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}

.student-filter-selects select {
  padding: 8px 14px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-secondary);
  cursor: pointer;
  outline: none;
}

.student-filter-selects select:focus {
  border-color: var(--color-primary-500);
}

.student-status-tabs {
  display: flex;
  gap: var(--space-2);
  border-bottom: 2px solid var(--color-border-subtle);
  padding-bottom: 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.student-status-tab {
  padding: 8px 16px;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.student-status-tab.is-active {
  color: var(--color-primary-600);
  background: #FFF1EC;
  border-bottom: 2.5px solid var(--color-primary-600);
}

.student-action-buttons {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 280px;
  justify-content: flex-end;
  flex-wrap: nowrap;
}

.btn-action-icon {
  padding: 5px 8px;
  font-size: 12px;
  border-radius: var(--radius-md);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

/* Mobile cards */
.student-mobile-card-list {
  display: none;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-3);
}

.student-mobile-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.student-mobile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.student-mobile-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-canvas);
  border-radius: var(--radius-lg);
  font-size: 12px;
}

.student-mobile-card-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-2);
  border-top: 1px solid var(--color-border-subtle);
  padding-top: var(--space-3);
}

@media (max-width: 768px) {
  .student-desktop-table {
    display: none !important;
  }
  .student-mobile-card-list {
    display: flex !important;
  }
}

/* Student Profile Modal Styles */
.student-profile-hero {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-5);
  background: linear-gradient(135deg, #FFF9F5 0%, #FFFFFF 100%);
  border-radius: var(--radius-xl);
  border: 1px solid rgba(231, 111, 81, 0.15);
  margin-bottom: var(--space-5);
}

.student-profile-avatar-large {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-2xl);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.student-profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}

@media (max-width: 600px) {
  .student-profile-stats-grid {
    grid-template-columns: 1fr;
  }
  .student-profile-hero {
    flex-direction: column;
    text-align: center;
  }
}

.profile-stat-box {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-canvas);
  border: 1px solid var(--color-border);
}

.profile-stat-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-text-primary);
}

.profile-stat-lbl {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.student-info-section {
  margin-bottom: var(--space-5);
}

.student-info-section-title {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  gap: 8px;
}

.student-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3);
}

@media (max-width: 500px) {
  .student-info-grid {
    grid-template-columns: 1fr;
  }
}

.student-info-item {
  background: var(--color-canvas);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border-subtle);
}

.student-info-item-label {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.student-info-item-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
  word-break: break-word;
}

/* Archive safety modal box */
.archive-safety-box {
  background: #FFF5F5;
  border: 1.5px solid #FEB2B2;
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  margin-bottom: var(--space-4);
}

.archive-safety-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  color: #C53030;
  margin-bottom: 4px;
}

/* Empty Search Results State */
.student-empty-state {
  text-align: center;
  padding: var(--space-8) var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  border: 1.5px dashed var(--color-border);
}

.student-empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #FFF1EC;
  color: var(--color-primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-3);
}

/* ==========================================================================
   15. ATTENDANCE ROLL CALL & FAST MARKING MODULE
   ========================================================================== */

.attendance-header-card {
  margin-bottom: var(--space-4);
}

.attendance-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  background: var(--color-canvas);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border-subtle);
  margin-top: var(--space-3);
}

.attendance-filter-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.attendance-date-picker-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #FFFFFF;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 4px 10px;
}

.attendance-date-input {
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-primary);
  background: transparent;
  outline: none;
  cursor: pointer;
}

/* Real-Time Summary Ribbon */
.attendance-summary-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--color-border);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
  margin-bottom: var(--space-4);
  transition: all var(--duration-fast) var(--ease-smooth);
}

.attendance-stats-pill-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.att-stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-secondary);
}

.att-stat-item strong {
  font-family: var(--font-family-display);
  font-size: 16px;
  color: var(--color-text-primary);
}

.att-stat-item .stat-badge {
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 800;
}

.stat-badge-present {
  background: var(--color-pastel-emerald-bg);
  color: var(--color-pastel-emerald-text);
}

.stat-badge-absent {
  background: var(--color-pastel-rose-bg);
  color: var(--color-pastel-rose-text);
}

.stat-badge-late {
  background: var(--color-pastel-amber-bg);
  color: var(--color-pastel-amber-text);
}

/* Roster Cards List */
.attendance-cards-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}

.attendance-student-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  border: 1.5px solid var(--color-border-subtle);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
  transition: all var(--duration-fast) var(--ease-smooth);
}

.attendance-student-card:hover {
  border-color: var(--color-border);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.attendance-student-card.is-absent-card {
  background: #FFFBFB;
  border-color: #FED7D7;
}

.attendance-student-meta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 220px;
}

.attendance-student-info h4 {
  font-size: 15px;
  font-weight: 800;
  color: var(--color-text-primary);
  margin: 0 0 2px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.attendance-student-info p {
  font-size: 12px;
  color: var(--color-text-muted);
  margin: 0;
}

.attendance-care-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  background: #FEF3C7;
  color: #92400E;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-top: 4px;
}

/* High-Contrast Segmented Toggle Buttons */
.attendance-segmented-control {
  display: flex;
  align-items: center;
  background: var(--color-canvas);
  padding: 4px;
  border-radius: var(--radius-lg);
  border: 1.5px solid var(--color-border);
  gap: 4px;
}

.btn-toggle-att {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 100px;
  padding: 8px 16px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 800;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  background: transparent;
  color: var(--color-text-muted);
  transition: all var(--duration-fast) var(--ease-bounce);
  -webkit-tap-highlight-color: transparent;
}

.btn-toggle-att:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--color-text-primary);
}

.btn-toggle-att.is-active-present {
  background: #10B981 !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}

.btn-toggle-att.is-active-absent {
  background: #EF4444 !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.btn-toggle-att.is-active-late {
  background: #F59E0B !important;
  color: #FFFFFF !important;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

/* Mobile Sticky Bottom Bar */
.attendance-sticky-mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #FFFFFF;
  border-top: 1.5px solid var(--color-border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.1);
  padding: 10px 16px;
  z-index: 900;
  align-items: center;
  justify-content: space-between;
}

@media (max-width: 768px) {
  .attendance-sticky-mobile-bar {
    display: flex;
  }
  .attendance-student-card {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-3);
  }
  .attendance-segmented-control {
    width: 100%;
  }
  .btn-toggle-att {
    flex: 1;
    min-height: 48px; /* High-touch requirement */
  }
  /* Leave space at bottom so sticky bar does not cover last card */
  .attendance-cards-list {
    margin-bottom: 90px;
  }
}

/* ==========================================================================
   16. ACTIVITIES & HOMEWORK MODULE STYLES (Feed UI)
   ========================================================================== */
.activity-feed-container {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 880px;
  margin: 0 auto;
}

.activity-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  background: var(--color-surface);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-xl);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-4);
}

.activity-filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.activity-chip {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
  border: 1.5px solid var(--color-border);
  background: var(--color-canvas);
  color: var(--color-text-secondary);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-bounce);
  user-select: none;
}

.activity-chip:hover {
  border-color: var(--color-primary-400);
  color: var(--color-primary-600);
  background: var(--color-surface);
}

.activity-chip.is-active {
  background: var(--color-primary-500);
  border-color: var(--color-primary-500);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(231, 111, 81, 0.35);
}

.activity-card {
  background: var(--color-surface);
  border-radius: var(--radius-2xl);
  border: 1.5px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  transition: transform var(--duration-fast), box-shadow var(--duration-fast);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  position: relative;
  overflow: hidden;
}

.activity-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: rgba(231, 111, 81, 0.3);
}

.activity-card.is-homework {
  border-left: 5px solid #8B5CF6;
  background: linear-gradient(180deg, #FAF5FF 0%, #FFFFFF 60px);
}

.activity-card.is-archived-card {
  opacity: 0.75;
  background: #F8FAFC;
  border-style: dashed;
}

.activity-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.activity-meta-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.activity-card-title {
  font-family: var(--font-family-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-text-primary);
  margin: 0;
  line-height: 1.3;
}

.activity-card-desc {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.55;
  margin: 0;
}

.activity-homework-banner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 12px;
  background: #F3E8FF;
  border-radius: var(--radius-lg);
  border: 1px solid #E9D5FF;
  font-size: 12px;
  color: #6B21A8;
  font-weight: 700;
}

.activity-photo-wrap {
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 1.5px solid var(--color-border);
  background: #F8FAFC;
  position: relative;
}

.activity-feed-photo {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  display: block;
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

.activity-feed-photo:hover {
  transform: scale(1.015);
}

.activity-photo-caption {
  padding: 8px 14px;
  font-size: 12px;
  color: var(--color-text-muted);
  background: #FFFFFF;
  border-top: 1px solid var(--color-border-subtle);
  display: flex;
  align-items: center;
  gap: 6px;
}

.photo-approval-bar {
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
}

.photo-approval-bar.is-pending {
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
}

.photo-approval-bar.is-approved {
  background: #ECFDF5;
  border: 1px solid #A7F3D0;
  color: #065F46;
}

.photo-approval-bar.is-rejected {
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: #991B1B;
}

.btn-whatsapp {
  background: #25D366;
  color: #FFFFFF !important;
  border: none;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35);
  transition: all var(--duration-fast) var(--ease-bounce);
}

.btn-whatsapp:hover {
  background: #20BA5A;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.45);
}

.activity-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px dashed var(--color-border-subtle);
}

.activity-educator-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--color-text-muted);
}

.activity-action-btns {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   FEE INSTALLMENTS & RECEIPT SYSTEM STYLES
   ========================================================================== */

/* Segmented Installment Mode Selector */
.installment-mode-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: var(--space-3);
}

.installment-mode-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 8px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-smooth);
  text-align: center;
}

.installment-mode-option:hover {
  border-color: var(--color-primary-400);
  background: var(--color-canvas);
}

.installment-mode-option.is-selected {
  border-color: var(--color-primary-600);
  background: #FFF5F2;
  box-shadow: 0 0 0 2px rgba(231, 111, 81, 0.15);
}

.installment-mode-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--color-text-primary);
}

.installment-mode-option.is-selected .installment-mode-title {
  color: var(--color-primary-700);
}

.installment-mode-sub {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Receipt On-Screen Modal Preview */
.receipt-preview-card {
  background: #FFFFFF;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: #1F2937;
}

.receipt-screen-header {
  border-bottom: 2px solid #E76F51;
  padding-bottom: 14px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.receipt-screen-school-name {
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0.5px;
  color: #E76F51;
  margin: 0 0 2px 0;
  text-transform: uppercase;
}

.receipt-screen-school-tagline {
  font-size: 12px;
  font-weight: 700;
  color: #4B5563;
  margin-bottom: 4px;
}

.receipt-screen-school-details {
  font-size: 11px;
  color: #6B7280;
  line-height: 1.4;
}

.receipt-badge-wrap {
  text-align: right;
  flex-shrink: 0;
}

.receipt-screen-badge {
  display: inline-block;
  background: #E76F51;
  color: white;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.receipt-screen-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  background: #F9FAFB;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
}

.receipt-meta-cell-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: #6B7280;
}

.receipt-meta-cell-value {
  font-size: 13px;
  font-weight: 800;
  color: #111827;
}

.receipt-screen-details-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 12px;
}

.receipt-screen-details-table td {
  padding: 6px 10px;
  border: 1px solid #E5E7EB;
}

.receipt-screen-details-table td strong {
  color: #374151;
}

.receipt-screen-items-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 14px;
  font-size: 12px;
}

.receipt-screen-items-table th {
  background: #F3F4F6;
  border: 1px solid #D1D5DB;
  padding: 8px 10px;
  text-align: left;
  font-weight: 800;
  color: #374151;
  font-size: 11px;
  text-transform: uppercase;
}

.receipt-screen-items-table td {
  border: 1px solid #E5E7EB;
  padding: 8px 10px;
}

.receipt-words-box {
  background: #FFFBF5;
  border: 1px solid #FED7AA;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  margin-bottom: 18px;
  color: #9A3412;
}

.receipt-screen-signatures {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 24px;
  padding-top: 10px;
}

.receipt-signature-line {
  border-top: 1px dashed #9CA3AF;
  width: 160px;
  padding-top: 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #4B5563;
}

.receipt-seal-circle {
  width: 72px;
  height: 72px;
  border: 2px dashed #E76F51;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 9px;
  font-weight: 800;
  color: #E76F51;
  line-height: 1.1;
  text-transform: uppercase;
  transform: rotate(-10deg);
  opacity: 0.85;
}

/* ==========================================================================
   A4 PRINT STYLES - 2 COPIES ON 1 SHEET (School Copy + Student's Copy)
   ========================================================================== */
#print-receipt-container {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 6mm 8mm;
  }

  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
    color: #000000 !important;
    font-size: 10pt;
  }

  /* Hide everything on screen except print container */
  body > *:not(#print-receipt-container),
  .viewport-simulator-bar,
  .app-layout,
  .app-sidebar,
  .app-header,
  .app-main,
  .app-bottom-nav,
  .toast-container {
    display: none !important;
    visibility: hidden !important;
  }

  /* Force hide all modals, dialogs, and overlays in print */
  dialog, .modal-dialog, dialog::backdrop {
    display: none !important;
    visibility: hidden !important;
  }

  #print-receipt-container {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    background: #FFFFFF !important;
    margin: 0 !important;
    padding: 0 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .a4-page-layout {
    width: 100%;
    max-height: 284mm;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
  }

  /* Each Copy (Top and Bottom) */
  .a4-receipt-unit {
    border: 1.5px solid #222222;
    border-radius: 4px;
    padding: 8px 12px;
    box-sizing: border-box;
    background: #FFFFFF;
    position: relative;
    max-height: 133mm;
  }

  .a4-receipt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1.5px solid #222222;
    padding-bottom: 4px;
    margin-bottom: 6px;
  }

  .a4-school-brand h1 {
    font-size: 15pt;
    font-weight: 900;
    margin: 0;
    line-height: 1.1;
    color: #000000;
    letter-spacing: 0.5px;
  }

  .a4-school-tagline {
    font-size: 8pt;
    font-weight: 700;
    color: #444444;
    margin: 1px 0;
  }

  .a4-school-contact {
    font-size: 7.5pt;
    color: #333333;
    line-height: 1.25;
    margin: 0;
  }

  .a4-copy-tag {
    border: 1.5px solid #000000;
    padding: 3px 8px;
    font-size: 8.5pt;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #F3F4F6;
    display: inline-block;
    border-radius: 2px;
  }

  .a4-copy-tag.student {
    background: #FFFFFF;
  }

  .a4-rec-title-banner {
    background: #000000;
    color: #FFFFFF;
    text-align: center;
    font-weight: 900;
    font-size: 9pt;
    letter-spacing: 1px;
    padding: 2px 0;
    margin: 4px 0 6px 0;
    text-transform: uppercase;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .a4-grid-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    border: 1px solid #333333;
    margin-bottom: 5px;
    font-size: 8pt;
  }

  .a4-meta-item {
    padding: 2px 6px;
    border-right: 1px solid #333333;
  }

  .a4-meta-item:last-child {
    border-right: none;
  }

  .a4-meta-lbl {
    font-size: 6.5pt;
    color: #555555;
    text-transform: uppercase;
    font-weight: 700;
  }

  .a4-meta-val {
    font-weight: 800;
    color: #000000;
  }

  .a4-student-table,
  .a4-fee-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 5px;
    font-size: 7.5pt;
  }

  .a4-student-table td {
    border: 1px solid #888888;
    padding: 2px 5px;
  }

  .a4-fee-table th {
    border: 1px solid #222222;
    background: #E5E7EB;
    font-weight: 800;
    padding: 3px 6px;
    text-align: left;
    font-size: 7.5pt;
    text-transform: uppercase;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .a4-fee-table td {
    border: 1px solid #888888;
    padding: 3px 6px;
  }

  .a4-words-row {
    font-size: 7.5pt;
    padding: 2px 5px;
    border: 1px solid #888888;
    background: #F9FAFB;
    margin-bottom: 6px;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .a4-signatures-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-top: 8px;
    padding-top: 2px;
  }

  .a4-sig-box {
    text-align: center;
    width: 140px;
  }

  .a4-sig-line {
    border-top: 1px solid #000000;
    margin-bottom: 2px;
  }

  .a4-sig-label {
    font-size: 7pt;
    font-weight: 700;
    color: #000000;
  }

  .a4-seal-box {
    border: 1.5px dashed #222222;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 6pt;
    font-weight: 800;
    text-align: center;
    line-height: 1.1;
  }

  /* Perforation / Scissors Divider */
  .a4-cut-divider {
    text-align: center;
    padding: 5px 0;
    font-size: 8pt;
    color: #333333;
    font-family: monospace;
    letter-spacing: 1px;
    user-select: none;
  }
}
