/* Nicolas Robinson School HRMS - Enterprise Stylesheet */
:root {
  --primary-900: #0f172a;
  --primary-800: #1e293b;
  --primary-700: #334155;
  --nrs-blue: #1e3a8a;
  --nrs-blue-light: #2563eb;
  --nrs-blue-hover: #1d4ed8;
  --nrs-gold: #d97706;
  --nrs-gold-light: #f59e0b;
  --nrs-gold-bg: #fef3c7;
  --nrs-emerald: #059669;
  --nrs-emerald-light: #10b981;
  --nrs-emerald-bg: #d1fae5;
  --nrs-red: #dc2626;
  --nrs-red-bg: #fee2e2;
  --nrs-purple: #7c3aed;
  --nrs-purple-bg: #ede9fe;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --radius: 10px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* App Header */
.app-header {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  color: #ffffff;
  padding: 1rem 1.75rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

/* School Logo Wrapper (Feature #4) */
.school-logo-wrap {
  position: relative;
  flex-shrink: 0;
}

.school-logo-img {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: contain;
  background: white;
  padding: 3px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  border: 2px solid rgba(255,255,255,0.35);
  display: block;
}

.school-crest {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--nrs-gold-light), var(--nrs-gold));
  color: #1e293b;
  font-weight: 800;
  font-size: 1.25rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.brand-text h1 {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 0.15rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.brand-badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.15);
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.brand-text p {
  font-size: 0.8rem;
  color: #cbd5e1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Language Toggle */
.lang-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 0.45rem 0.85rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

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

/* Primary Action Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.55rem 1.15rem;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease-in-out;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

.btn-gold {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
  box-shadow: 0 2px 4px rgba(217, 119, 6, 0.25);
}

.btn-gold:hover {
  background: linear-gradient(135deg, #d97706, #b45309);
  transform: translateY(-1px);
}

.btn-outline {
  background: white;
  color: var(--text-main);
  border-color: var(--border-color);
}

.btn-outline:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.775rem;
  border-radius: 6px;
}

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

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

/* Navigation Tabs */
.app-nav {
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: 0 1.75rem;
}

.nav-container {
  max-width: 1600px;
  margin: 0 auto;
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-container::-webkit-scrollbar {
  display: none;
}

.nav-tab {
  padding: 0.85rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 3px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.15s ease;
}

.nav-tab:hover {
  color: var(--nrs-blue);
  background: #f8fafc;
}

.nav-tab.active {
  color: var(--nrs-blue);
  border-bottom-color: var(--nrs-blue);
}

.nav-badge {
  background: #f1f5f9;
  color: var(--text-muted);
  font-size: 0.725rem;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  font-weight: 700;
}

.nav-tab.active .nav-badge {
  background: #dbeafe;
  color: var(--nrs-blue);
}

/* Main Layout */
.main-content {
  flex: 1;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.75rem 3rem 1.75rem;
}

/* Dashboard Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

.metric-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  overflow: hidden;
}

.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.metric-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--card-color, #3b82f6);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.metric-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--icon-bg, #eff6ff);
  color: var(--icon-color, #2563eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.metric-value {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.metric-sub {
  font-size: 0.775rem;
  color: var(--text-muted);
}

/* Filter Toolbar */
.toolbar-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.25rem;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
}

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}

.search-box {
  flex: 1 1 320px;
  position: relative;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
}

.search-input {
  width: 100%;
  padding: 0.65rem 1rem 0.65rem 2.6rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.875rem;
  outline: none;
  background: #f8fafc;
  transition: all 0.2s ease;
}

.search-input:focus {
  background: #ffffff;
  border-color: var(--nrs-blue-light);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.select-filter {
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 0.85rem;
  background: #f8fafc;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  min-width: 140px;
}

.select-filter:focus {
  border-color: var(--nrs-blue-light);
  background: white;
}

.view-toggle {
  display: flex;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  background: #f1f5f9;
}

.view-toggle-btn {
  border: none;
  background: transparent;
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.view-toggle-btn.active {
  background: white;
  color: var(--nrs-blue);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}

/* Quick Filter Pills */
.quick-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid #f1f5f9;
}

.pill {
  font-size: 0.775rem;
  padding: 0.3rem 0.75rem;
  border-radius: 9999px;
  background: #f1f5f9;
  color: var(--text-muted);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}

.pill:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.pill.active {
  background: #dbeafe;
  color: var(--nrs-blue);
  border-color: #bfdbfe;
  font-weight: 600;
}

/* Table Card */
.table-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.table-header-info {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
}

.table-title {
  font-size: 1rem;
  font-weight: 700;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.nrs-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.85rem;
}

.nrs-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.725rem;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.nrs-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.nrs-table tbody tr:hover {
  background-color: #f8fafc;
}

/* Employee Row Components */
.emp-name-cell {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.emp-avatar {
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  background: #e2e8f0;
  color: #334155;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.emp-details-text .name-primary {
  font-weight: 600;
  color: var(--text-main);
  display: block;
}

.emp-details-text .id-secondary {
  font-size: 0.725rem;
  color: var(--text-muted);
  font-family: monospace;
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.725rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-active { background: #dcfce7; color: #15803d; }
.badge-leave { background: #fee2e2; color: #b91c1c; }
.badge-permanent { background: #e0e7ff; color: #4338ca; }
.badge-temp { background: #fef3c7; color: #b45309; }
.badge-part { background: #f3e8ff; color: #6b21a8; }

.badge-location {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #e2e8f0;
}

.badge-wing {
  background: #e0f2fe;
  color: #0369a1;
}

/* Action Icon Buttons */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-icon {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: #f1f5f9;
  color: var(--text-main);
  border-color: #cbd5e1;
}

.btn-icon-danger:hover {
  background: #fee2e2;
  color: #dc2626;
  border-color: #fca5a5;
}

.btn-icon-primary:hover {
  background: #eff6ff;
  color: #2563eb;
  border-color: #bfdbfe;
}

/* Card Grid View */
.staff-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.25rem;
}

.staff-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: all 0.15s ease;
}

.staff-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.staff-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1rem;
}

.staff-card-avatar {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  background: #e0f2fe;
  color: #0369a1;
  font-weight: 700;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.staff-card-body {
  flex: 1;
  font-size: 0.825rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 0.85rem;
}

.staff-card-row {
  display: flex;
  justify-content: space-between;
}

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

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow-y: auto;
}

.modal-overlay.active {
  display: flex;
}

.modal-container {
  background: white;
  border-radius: 14px;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  animation: modalEnter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalEnter {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  border-radius: 6px;
}

.modal-close:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: #f8fafc;
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* Forms */
.form-section {
  background: #f8fafc;
  border-radius: 8px;
  padding: 1.15rem;
  margin-bottom: 1.25rem;
  border: 1px solid #edf2f7;
}

.form-section-title {
  font-size: 0.925rem;
  font-weight: 700;
  color: var(--nrs-blue);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.85rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-label {
  font-size: 0.775rem;
  font-weight: 600;
  color: var(--text-muted);
}

.form-control {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 0.85rem;
  outline: none;
  background: white;
  transition: all 0.15s ease;
}

.form-control:focus {
  border-color: var(--nrs-blue-light);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Children Repeater Table */
.children-table {
  width: 100%;
  margin-top: 0.5rem;
  border-collapse: collapse;
}

.children-table th {
  font-size: 0.725rem;
  color: var(--text-muted);
  text-align: left;
  padding: 0.4rem 0.5rem;
}

.children-table td {
  padding: 0.35rem 0.5rem;
}

/* ID Badge Modal Layout */
.id-badge-preview {
  display: flex;
  justify-content: center;
  padding: 1rem 0;
}

.id-card {
  width: 320px;
  height: 480px;
  background: white;
  border-radius: 16px;
  border: 2px solid #cbd5e1;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.id-card-header {
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
  color: white;
  padding: 1.25rem 1rem;
  text-align: center;
  border-bottom: 4px solid var(--nrs-gold);
}

.id-card-school-name {
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.id-card-school-sub {
  font-size: 0.7rem;
  color: #cbd5e1;
}

.id-card-body {
  flex: 1;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.id-photo-box {
  width: 100px;
  height: 115px;
  background: #f1f5f9;
  border: 3px solid #e2e8f0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #94a3b8;
  margin-bottom: 0.85rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.id-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.2rem;
}

.id-role {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--nrs-blue);
  margin-bottom: 0.25rem;
}

.id-code {
  font-family: monospace;
  background: #f8fafc;
  padding: 0.25rem 0.65rem;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #334155;
  border: 1px solid #e2e8f0;
  margin-bottom: 0.85rem;
}

.id-meta-grid {
  width: 100%;
  text-align: left;
  font-size: 0.75rem;
  background: #f8fafc;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid #edf2f7;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.id-meta-row {
  display: flex;
  justify-content: space-between;
}

.id-barcode {
  margin-top: auto;
  height: 28px;
  width: 80%;
  background: repeating-linear-gradient(
    90deg,
    #000,
    #000 2px,
    #fff 2px,
    #fff 4px,
    #000 4px,
    #000 7px,
    #fff 7px,
    #fff 9px
  );
  opacity: 0.8;
}

/* Employee Dossier View */
.dossier-box {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 1.75rem;
}

.dossier-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 2px solid #f1f5f9;
  margin-bottom: 1.5rem;
}

.dossier-avatar {
  width: 80px;
  height: 80px;
  border-radius: 16px;
  background: linear-gradient(135deg, #1e3a8a, #3b82f6);
  color: white;
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(30, 58, 138, 0.25);
}

.dossier-info h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
}

.dossier-section {
  margin-bottom: 1.5rem;
}

.dossier-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 0.35rem;
}

.dossier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

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

.dossier-label {
  font-size: 0.725rem;
  color: var(--text-muted);
  font-weight: 600;
}

.dossier-value {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
}

/* Toast Notification */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: #0f172a;
  color: white;
  padding: 0.75rem 1.25rem;
  border-radius: 8px;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
  font-size: 0.85rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: toastIn 0.2s ease-out;
}

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

/* Print Optimization */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  .app-header, .app-nav, .toolbar-card, .action-buttons, .modal-footer, .no-print {
    display: none !important;
  }
  .modal-overlay {
    position: static !important;
    background: none !important;
    padding: 0 !important;
    display: block !important;
  }
  .modal-container {
    box-shadow: none !important;
    max-width: 100% !important;
    border: none !important;
  }
  .id-card {
    border: 1px solid #000 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin: 20px auto;
  }
}

/* ===================================================
   Phase 2 Features: Bilingual, Scrollable Form, Photos, Dropdowns
   =================================================== */

/* 1. Bilingual Labels (Feature #5) */
.bilingual-label {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-bottom: 0.35rem;
}

.bilingual-label .label-en {
  font-size: 0.775rem;
  font-weight: 600;
  color: #334155;
  line-height: 1.25;
}

.bilingual-label .label-ti {
  font-size: 0.8rem;
  font-weight: 700;
  color: #1e3a8a;
  line-height: 1.25;
}

.bilingual-label .req {
  color: #dc2626;
  font-weight: 800;
  margin-left: 2px;
}

/* 2. Scrollable Modal Body & Sticky Jump Navigation (Feature #2) */
.modal-body.scrollable-body {
  overflow-y: auto;
  max-height: calc(85vh - 130px);
  scroll-behavior: smooth;
  padding: 0 1.5rem 1.5rem 1.5rem;
}

.form-jump-nav {
  position: sticky;
  top: 0;
  z-index: 25;
  background: #ffffff;
  border-bottom: 2px solid #e2e8f0;
  padding: 0.75rem 1.5rem;
  margin: 0 -1.5rem 1.25rem -1.5rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  overflow-x: auto;
  box-shadow: 0 2px 5px rgba(0,0,0,0.04);
}

.form-jump-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #1e40af;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 0.35rem 0.7rem;
  border-radius: 9999px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: all 0.15s ease;
}

.form-jump-link:hover {
  background: #dbeafe;
  color: #1d4ed8;
  transform: translateY(-1px);
}

.modal-body .form-section {
  scroll-margin-top: 75px;
}

/* 3. Photo Upload Component (Feature #3) */
.photo-upload-container {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: #f8fafc;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1.5px dashed #cbd5e1;
  margin-bottom: 1.25rem;
}

.photo-preview-box {
  width: 88px;
  height: 88px;
  border-radius: 12px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  overflow: hidden;
  border: 2px solid #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  position: relative;
  flex-shrink: 0;
}

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

.photo-controls {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.photo-btn-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.photo-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.9rem;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.photo-upload-btn:hover {
  background: #dbeafe;
}

.photo-remove-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.45rem 0.8rem;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  border-radius: 6px;
  font-size: 0.775rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.photo-remove-btn:hover {
  background: #fee2e2;
}

.photo-helper-text {
  font-size: 0.725rem;
  color: var(--text-muted);
}

/* Avatar Image Support across Views */
.emp-avatar img,
.staff-card-avatar img,
.dossier-avatar img,
.id-photo-box img {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  display: block;
}

/* Editable Combos */
.editable-combo-wrapper {
  width: 100%;
}

.editable-combo-wrapper input {
  font-size: 0.85rem;
}

/* ==========================================================================
   AUTHENTICATION & MODERN GLASSMORPHISM LOGIN STYLES
   Inspired by official Nicolas Robinson School aesthetic (Images 2, 3, 4, 5)
   ========================================================================== */

.login-page-wrapper {
  position: fixed;
  inset: 0;
  z-index: 99999;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 1.5rem;
  background-color: #0f172a;
}

.login-bg-media {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: brightness(0.6) saturate(1.15) contrast(1.05);
  transform: scale(1.02);
  transition: transform 12s ease;
  pointer-events: none;
}

.login-bg-overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(15, 23, 42, 0.65) 0%, rgba(10, 15, 30, 0.88) 100%),
              linear-gradient(135deg, rgba(30, 58, 138, 0.45) 0%, rgba(15, 23, 42, 0.7) 100%);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  pointer-events: none;
}

/* Glowing Ambient Orbs */
.glow-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.5;
  z-index: 1;
}

.glow-orb-1 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, #f59e0b, transparent 70%);
  top: -80px;
  right: 12%;
  animation: floatOrb1 10s ease-in-out infinite alternate;
}

.glow-orb-2 {
  width: 440px;
  height: 440px;
  background: radial-gradient(circle, #2563eb, transparent 70%);
  bottom: -90px;
  left: 10%;
  animation: floatOrb2 12s ease-in-out infinite alternate;
}

@keyframes floatOrb1 {
  0% { transform: translateY(0px) scale(1); }
  100% { transform: translateY(40px) scale(1.1); }
}

@keyframes floatOrb2 {
  0% { transform: translateY(0px) scale(1); }
  100% { transform: translateY(-40px) scale(1.08); }
}

/* Frosted Glass Card */
.login-glass-card {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 450px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 30px 60px -12px rgba(0, 0, 0, 0.45),
              0 0 0 1px rgba(255, 255, 255, 0.5),
              0 0 50px rgba(245, 158, 11, 0.2);
  padding: 2.5rem 2.25rem;
  animation: loginFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes loginFadeIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-card-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.login-logo-glow {
  width: 86px;
  height: 86px;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, #f59e0b, #1e40af, #3b82f6);
  box-shadow: 0 0 25px rgba(245, 158, 11, 0.45), 0 8px 16px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.login-logo-glow:hover {
  transform: scale(1.05) rotate(2deg);
}

.login-school-logo {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: contain;
  background: #ffffff;
}

.login-school-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 0.3rem 0;
  letter-spacing: -0.02em;
}

.login-sub-badge {
  display: inline-block;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.75rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
}

.login-greeting {
  font-size: 0.825rem;
  color: #64748b;
  margin: 0;
  line-height: 1.4;
}

/* Login Form Controls */
.login-field-group {
  margin-bottom: 0.85rem;
}

.login-field-label {
  display: block;
  font-size: 0.825rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 0.4rem;
}

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

.login-input-icon {
  position: absolute;
  left: 12px;
  font-size: 0.95rem;
  color: #64748b;
  pointer-events: none;
}

.login-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 2.4rem;
  font-size: 0.9rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  background: #f8fafc;
  color: #0f172a;
  transition: all 0.2s ease;
  font-family: inherit;
}

.login-input:focus {
  outline: none;
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.15);
}

.password-eye-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  opacity: 0.6;
  padding: 4px;
  transition: opacity 0.2s ease;
}

.password-eye-toggle:hover {
  opacity: 1;
}

.password-eye-toggle-inline {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  opacity: 0.6;
}

.login-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
}

.login-remember-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: #475569;
  cursor: pointer;
}

.login-forgot-link {
  color: #2563eb;
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s ease;
}

.login-forgot-link:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.login-submit-btn {
  width: 100%;
  padding: 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.login-submit-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #172554 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.55);
  transform: translateY(-1px);
}

.login-submit-btn:active {
  transform: translateY(0);
}

.login-submit-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.login-footer-info {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: #94a3b8;
}

.login-alert-box {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.825rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.login-alert-danger {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.login-alert-success {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  color: #047857;
}

/* ==========================================================================
   USER PROFILE DROPDOWN (HEADER)
   ========================================================================== */

.user-account-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.user-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.825rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-profile-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.45);
}

.user-avatar-circle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.3);
  font-size: 0.8rem;
}

.user-name-label {
  font-weight: 600;
  color: #ffffff;
}

.user-caret {
  font-size: 0.7rem;
  opacity: 0.8;
}

.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 230px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), 0 0 0 1px rgba(0, 0, 0, 0.05);
  z-index: 1000;
  overflow: hidden;
  padding: 0.4rem 0;
  animation: loginFadeIn 0.15s ease;
}

.user-dropdown-header {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  flex-direction: column;
}

.user-dropdown-header strong {
  font-size: 0.9rem;
  color: #0f172a;
}

.user-dropdown-header small {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.15rem;
}

.user-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  font-size: 0.825rem;
  font-weight: 500;
  color: #334155;
  text-decoration: none;
  transition: background 0.15s ease;
}

.user-dropdown-item:hover {
  background: #f8fafc;
  color: #1e40af;
}

.user-dropdown-item.text-danger {
  color: #dc2626;
}

.user-dropdown-item.text-danger:hover {
  background: #fef2f2;
  color: #b91c1c;
}

.user-dropdown-divider {
  height: 1px;
  background: #f1f5f9;
  margin: 0.35rem 0;
}

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* ==========================================================================
   MOBILE RESPONSIVENESS (Feature #5)
   Adaptive layouts for Tablet (<=992px), Mobile (<=768px), and Small Phone (<=480px)
   ========================================================================== */

@media (max-width: 992px) {
  .header-container {
    padding: 0.75rem 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-bar {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .filter-group {
    flex: 1 1 calc(50% - 0.5rem);
  }
}

@media (max-width: 768px) {
  /* Header Responsive */
  .header-container {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
  }

  .header-brand {
    gap: 0.6rem;
  }

  .school-logo-wrap {
    width: 38px;
    height: 38px;
  }

  .brand-text h1 {
    font-size: 1.1rem;
  }

  .brand-text p {
    font-size: 0.7rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .header-actions {
    margin-left: auto;
    gap: 0.4rem;
  }

  .lang-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
  }

  #headerAddBtn {
    padding: 0.35rem 0.65rem;
    font-size: 0.75rem;
  }

  .user-profile-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
  }

  .user-name-label {
    display: none; /* Icon only on mobile */
  }

  /* Hamburger Navigation Drawer */
  .mobile-menu-toggle {
    display: flex;
  }

  .app-nav {
    display: none;
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 9998;
    overflow-y: auto;
    padding: 1.25rem 1rem;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.25);
    border-bottom: 2px solid #2563eb;
  }

  .app-nav.mobile-open {
    display: block;
    animation: loginFadeIn 0.2s ease;
  }

  .nav-container {
    flex-direction: column;
    gap: 0.5rem;
    padding: 0;
  }

  .nav-tab {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 0.95rem;
    border-radius: 8px;
    justify-content: flex-start;
    border-bottom: 1px solid #f1f5f9;
  }

  .nav-tab.active {
    background: #eff6ff;
    color: #1d4ed8;
    border-bottom: 2px solid #2563eb;
  }

  /* Main Workspace */
  .main-content {
    padding: 1rem 0.75rem;
  }

  .dashboard-overview-cards,
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Table Horizontal Scrolling */
  .table-responsive,
  .nrs-table-container,
  .table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
  }

  table {
    min-width: 650px;
  }

  /* Modals on Mobile */
  .modal-card {
    width: 96% !important;
    max-width: 96% !important;
    max-height: 94vh !important;
    margin: 1rem auto;
    border-radius: 12px;
  }

  .modal-body {
    padding: 1rem !important;
  }

  .form-row,
  .form-grid-2,
  .form-grid-3,
  .form-grid-4 {
    grid-template-columns: 1fr !important;
  }

  /* Login Screen Responsive */
  .login-glass-card {
    padding: 2rem 1.25rem;
    max-width: 100%;
  }

  .login-school-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0.5rem;
  }

  .brand-text p {
    display: none;
  }

  .stats-metric-value {
    font-size: 1.5rem;
  }

  .btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
  }

  .login-page-wrapper {
    padding: 1rem;
  }

  .login-glass-card {
    padding: 1.75rem 1rem;
  }
}


