/* Smart Campus Attendance, Safety Monitoring & Parent-Teacher Communication System */
:root {
  --bg-dark: #0f172a;
  --bg-card: #ffffff;
  --bg-surface: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --emerald: #10b981;
  --emerald-soft: #ecfdf5;
  --amber: #f59e0b;
  --amber-soft: #fffbeb;
  --crimson: #ef4444;
  --crimson-soft: #fef2f2;
  --blue-excused: #0284c7;
  --blue-excused-soft: #f0f9ff;
  --radius-lg: 14px;
  --radius-md: 10px;
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 40px rgba(15, 23, 42, 0.14);
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-surface);
  color: var(--text-main);
  line-height: 1.5;
}

/* Global Top Ecosystem Switcher Bar */
.ecosystem-topbar {
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 100%);
  color: #f8fafc;
  padding: 0.55rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.ecosystem-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: #fff;
  text-decoration: none;
}

.ecosystem-brand-badge {
  background: var(--primary);
  color: #fff;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.ecosystem-nav-pills {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.eco-pill {
  color: #cbd5e1;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.38rem 0.75rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.eco-pill:hover {
  background: rgba(255,255,255,0.14);
  color: #fff;
}

.eco-pill.active {
  background: var(--primary);
  color: #fff;
  border-color: #60a5fa;
}

.signalr-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  color: #94a3b8;
  padding: 0.25rem 0.6rem;
  background: rgba(0,0,0,0.25);
  border-radius: 99px;
}

.signalr-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 8px var(--emerald);
}

/* Common Buttons & Badges */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

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

.btn-emerald {
  background: var(--emerald);
  color: #fff;
}
.btn-emerald:hover {
  background: #059669;
}

.btn-crimson {
  background: var(--crimson);
  color: #fff;
}
.btn-crimson:hover {
  background: #dc2626;
}

.btn-amber {
  background: var(--amber);
  color: #fff;
}

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

.btn-sm {
  padding: 0.35rem 0.7rem;
  font-size: 0.78rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-green {
  background: var(--emerald-soft);
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-amber {
  background: var(--amber-soft);
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-red {
  background: var(--crimson-soft);
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.badge-blue {
  background: var(--blue-excused-soft);
  color: #0369a1;
  border: 1px solid #bae6fd;
}

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

/* Cards & Grids */
.card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

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

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.stat-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
}

/* Forms & Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}

.form-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
}

.form-control {
  padding: 0.55rem 0.75rem;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  background: #fff;
  color: var(--text-main);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* Data Tables */
.table-wrap {
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

table.data-table th {
  text-align: left;
  padding: 0.75rem 0.85rem;
  background: #f8fafc;
  color: #475569;
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  border-bottom: 1px solid var(--border-color);
}

table.data-table td {
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

table.data-table tr:hover td {
  background: #f8fafc;
}

/* Avatar */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  background: #e2e8f0;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Real-Time Push Toast Notification */
#pushToastContainer {
  position: fixed;
  top: 64px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  max-width: 380px;
  width: calc(100% - 40px);
}

.push-toast {
  background: #0f172a;
  color: #fff;
  border-left: 5px solid var(--emerald);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.25s ease-out;
}

.push-toast-title {
  font-weight: 700;
  font-size: 0.88rem;
  margin-bottom: 0.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.push-toast-body {
  font-size: 0.8rem;
  color: #cbd5e1;
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Printable Barcode ID Cards */
.badge-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.2rem;
}

.student-id-card {
  background: linear-gradient(180deg, #1e3a8a 0%, #1e3a8a 28%, #ffffff 28%, #ffffff 100%);
  border: 2px solid #cbd5e1;
  border-radius: 16px;
  padding: 1.1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.student-id-header {
  color: #fff;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 0.65rem;
}

.student-id-photo {
  width: 82px;
  height: 82px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: #f1f5f9;
  margin: 0 auto 0.5rem auto;
  display: block;
}

.barcode-bars {
  font-family: 'Courier New', monospace;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 0.5rem;
  margin-top: 0.65rem;
}

.barcode-visual {
  height: 36px;
  background: repeating-linear-gradient(
    90deg,
    #0f172a 0px,
    #0f172a 2px,
    transparent 2px,
    transparent 4px,
    #0f172a 4px,
    #0f172a 5px,
    transparent 5px,
    transparent 8px,
    #0f172a 8px,
    #0f172a 11px,
    transparent 11px,
    transparent 13px
  );
  margin-bottom: 0.25rem;
}

@media print {
  .no-print, .ecosystem-topbar, .admin-sidebar {
    display: none !important;
  }
  body {
    background: #fff;
  }
}

