/* ===================================================================
   SCHOOL CLOCK-IN & FEE TRACKING - MINIMALIST DESIGN SYSTEM
   Ultra-clean, high-utility, typography-driven monochromatic UI
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  /* Monochromatic Base Palette (Zinc/Slate) */
  --bg-main: #fafafa;
  --surface-card: #ffffff;
  --surface-subtle: #f4f4f5;
  --surface-hover: #f9fafb;
  --border: #e4e4e7;
  --border-subtle: #f1f5f9;
  
  --text-main: #09090b;
  --text-muted: #71717a;
  --text-subtle: #a1a1aa;
  --text-inverse: #ffffff;

  --primary: #18181b;
  --primary-hover: #27272a;
  --primary-subtle: #f4f4f5;

  /* Restrained Semantic Colors - Applied ONLY for Status */
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --success-border: #bbf7d0;
  --success-text: #15803d;

  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #b91c1c;

  --warning: #d97706;
  --warning-bg: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #b45309;

  --info-bg: #f8fafc;
  --info-border: #e2e8f0;
  --info-text: #334155;

  /* Typography & Layout Metrics */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-xs: 3px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

/* Base Reset & Typography */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--text-main);
  background-color: var(--bg-main);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

/* Layout Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.75rem 1.25rem;
}

/* Slim 52px Navbar */
.navbar {
  background: var(--surface-card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.navbar-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1rem, 2vw, 2.5rem);
  padding: 0 clamp(1rem, 2.2vw, 2.25rem);
  width: 100%;
}

/* Left Group containing Brand, Divider, and Nav - Expands to fill available space */
.navbar-left {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 1.3vw, 1.5rem);
  min-width: 0;
  flex: 1;
}

/* Brand - Locked with flex-shrink: 0 so it never shrinks or gets overlapped */
.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand-logo-icon {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease;
}

.brand-logo-icon:hover {
  transform: scale(1.05);
}

.brand-text {
  display: flex;
  align-items: center;
}

.brand-title {
  font-size: clamp(0.96rem, 1.05vw, 1.08rem);
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-main);
  white-space: nowrap;
}

.brand-period-pill {
  display: none;
}

/* Subtle separator between school title and nav buttons */
.navbar-divider {
  width: 1px;
  height: 24px;
  background: var(--border);
  flex-shrink: 0;
}

/* Main Navigation Container - Expands across middle section */
.main-nav {
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

/* Navigation Links - Evenly proportioned across the bar */
.nav-links {
  display: flex;
  list-style: none;
  gap: clamp(0.25rem, 0.55vw, 0.65rem);
  align-items: center;
  width: 100%;
  justify-content: space-evenly;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.44rem clamp(0.48rem, 0.7vw, 0.88rem);
  font-size: clamp(0.78rem, 0.83vw, 0.86rem);
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-link svg {
  width: clamp(14px, 1.1vw, 16px);
  height: clamp(14px, 1.1vw, 16px);
  stroke-width: 2;
  color: currentColor;
  flex-shrink: 0;
}

.nav-link:hover {
  color: var(--text-main);
  background: var(--surface-subtle);
  border-color: var(--border-subtle);
}

.nav-link.active {
  color: var(--primary);
  background: var(--primary-subtle);
  border-color: hsla(var(--primary-hsl), 0.18);
  font-weight: 600;
}

.nav-link.active svg {
  color: var(--primary);
}

/* User & Action Controls */
.nav-actions {
  display: flex;
  align-items: center;
  gap: clamp(0.55rem, 0.85vw, 0.95rem);
  flex-shrink: 0;
}

.nav-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--primary);
  color: var(--text-inverse);
  padding: 0.44rem clamp(0.65rem, 0.85vw, 1rem);
  border-radius: var(--radius-sm);
  font-size: clamp(0.80rem, 0.83vw, 0.85rem);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-action-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.34rem clamp(0.55rem, 0.75vw, 0.8rem);
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: clamp(0.78rem, 0.81vw, 0.83rem);
  box-shadow: var(--shadow-sm);
}

.user-badge-name {
  font-weight: 600;
  color: var(--text-main);
}

.user-badge-role {
  color: var(--primary);
  background: var(--primary-subtle);
  border: 1px solid hsla(var(--primary-hsl), 0.18);
  padding: 0.1rem 0.4rem;
  border-radius: var(--radius-xs);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.btn-signout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  padding: 0.25rem;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
}

.btn-signout:hover {
  color: var(--danger-text);
  background: var(--danger-bg);
}

@media (min-width: 769px) and (max-width: 1100px) {
  .navbar-left {
    gap: 0.75rem;
  }
  .nav-links {
    gap: 0.15rem;
  }
  .nav-link {
    padding: 0.32rem 0.5rem;
    font-size: 0.78rem;
    gap: 0.3rem;
  }
  .brand-title {
    font-size: 0.9rem;
  }
}

/* Page Header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-wrap: wrap;
}

.page-title-group h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.page-title-group p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

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

/* Date Selector */
.date-selector-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface-card);
  border: 1px solid var(--border);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
}

.date-selector-pill input[type="date"] {
  border: none;
  background: transparent;
  color: var(--text-main);
  font-weight: 500;
  outline: none;
  cursor: pointer;
}

/* Minimalist Stat Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s;
}

.stat-card:hover {
  border-color: #d4d4d8;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

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

.stat-icon {
  display: none; /* Removed emoji icons for minimalist density */
}

.stat-value {
  font-size: 1.65rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-main);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.stat-footer {
  margin-top: 0.6rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Minimalist Control / Filter Toolbar */
.control-bar {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.85rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 220px;
}

.search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  display: flex;
  align-items: center;
}

.search-icon svg {
  width: 14px;
  height: 14px;
  stroke-width: 2;
}

.search-input {
  width: 100%;
  padding: 0.4rem 0.65rem 0.4rem 2rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.search-input:focus {
  background: #ffffff;
  border-color: var(--primary);
}

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

.filter-select {
  padding: 0.4rem 0.65rem;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.8rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

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

.btn-reset {
  padding: 0.4rem 0.65rem;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-reset:hover {
  color: var(--text-main);
  border-color: var(--border);
}

/* Minimalist Data Tables */
.table-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.5rem;
}

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

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-variant-numeric: tabular-nums;
}

.data-table thead {
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: 0.65rem 0.9rem;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  white-space: nowrap;
}

.data-table td {
  padding: 0.75rem 0.9rem;
  font-size: 0.84rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color 0.1s;
}

.data-table tbody tr:hover {
  background-color: var(--surface-hover);
}

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

/* Table Cells */
.student-cell {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.student-avatar {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.student-name {
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.2;
}

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

/* Minimalist Badges & Status Chips */
.class-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-main);
}

.fee-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.3;
}

.fee-badge-paid, .stat-badge-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.fee-badge-unpaid, .stat-badge-danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}

.fee-badge-none, .stat-badge-muted {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.stat-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 500;
}

.stat-badge-info {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-xs);
  font-size: 0.72rem;
  font-weight: 600;
}

.badge-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.badge-danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}

.badge-primary {
  background: var(--primary-subtle);
  border: 1px solid hsla(var(--primary-hsl), 0.25);
  color: var(--primary);
}

.bus-rate-tag {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* Action Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--primary);
  color: var(--text-inverse);
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--surface-card);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.btn-secondary:hover {
  background: var(--surface-subtle);
  border-color: #d4d4d8;
}

.filter-preset-btn {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  text-decoration: none;
}

.filter-preset-btn.active,
.btn-secondary.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  font-weight: 600;
}

.filter-preset-btn.active:hover,
.btn-secondary.active:hover {
  background: var(--primary-hover);
  color: #fff;
  border-color: var(--primary-hover);
}

.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface-card);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
}

.btn-danger:hover {
  background: var(--danger-bg);
}

/* Quick Pay Button & Table Action Links */
.btn-quick-pay,
.btn-table-action {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-xs);
  font-size: 0.74rem;
  font-weight: 500;
  text-decoration: none;
  display: inline-block;
  transition: color 0.15s, background 0.15s;
}

.btn-quick-pay:hover,
.btn-table-action:hover {
  color: var(--text-main);
  background: var(--surface-subtle);
}

/* Morning Arrival Clock-In Toggle */
.btn-clock-in {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--surface-card);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-clock-in:hover {
  background: var(--primary);
  color: var(--text-inverse);
  border-color: var(--primary);
}

.clocked-in-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
}

.btn-undo-clockin {
  background: transparent;
  border: none;
  color: var(--danger-text);
  cursor: pointer;
  font-size: 0.75rem;
  opacity: 0.6;
  line-height: 1;
  transition: opacity 0.15s;
}

.btn-undo-clockin:hover {
  opacity: 1;
}

/* Minimalist HTML5 Progress Bar */
.attendance-progress {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  border: none;
  width: 100%;
  max-width: 100px;
  height: 6px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background-color: var(--border);
}

.attendance-progress::-webkit-progress-bar {
  background-color: var(--border);
  border-radius: var(--radius-full);
}

.attendance-progress::-webkit-progress-value {
  background-color: var(--success);
  border-radius: var(--radius-full);
}

.attendance-progress::-moz-progress-bar {
  background-color: var(--success);
  border-radius: var(--radius-full);
}

/* Minimalist Forms & Cards */
.form-card {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  max-width: 640px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.15rem;
}

.form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.45rem 0.65rem;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 0.84rem;
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
}

.form-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Modal Dialog */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

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

.modal-content {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 440px;
  overflow: hidden;
}

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

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

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.btn-close-modal:hover {
  color: var(--text-main);
}

.modal-body {
  padding: 1.25rem;
}

.modal-footer {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--surface-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Minimalist Alerts & Toast */
.messages-wrapper {
  margin-bottom: 1.25rem;
}

.alert {
  padding: 0.65rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.alert-success {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.alert-error, .alert-danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}

.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.toast {
  background: var(--primary);
  color: var(--text-inverse);
  padding: 0.6rem 0.9rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s;
}

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

/* Minimalist Receipt Card */
.receipt-container {
  max-width: 620px;
  margin: 1.5rem auto;
}

.receipt-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2.25rem;
}

.receipt-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.receipt-school-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.receipt-title {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Helpers */
.text-muted { color: var(--text-muted) !important; }
.text-danger { color: var(--danger-text) !important; }
.text-success { color: var(--success-text) !important; }

/* ============================================================
   NATIVE-STYLE MOBILE BOTTOM NAVIGATION & APP BAR
   ============================================================ */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--surface-card);
  border-top: 1px solid var(--border);
  z-index: 999;
  padding: 0 0.5rem;
  padding-bottom: env(safe-area-inset-bottom);
  justify-content: space-around;
  align-items: center;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  height: 100%;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 500;
  gap: 3px;
  transition: color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item svg {
  transition: transform 0.15s ease;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
  color: var(--primary);
  font-weight: 600;
}

.bottom-nav-item.active svg {
  transform: scale(1.1);
}

.bottom-nav-fab {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--text-inverse);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  margin-top: -16px;
  flex-shrink: 0;
  border: 3px solid var(--surface-card);
  transition: transform 0.15s ease, background-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-fab:hover,
.bottom-nav-fab:active {
  transform: scale(1.08);
  background: #09090b;
}

/* Visibility utilities */
.mobile-only {
  display: none !important;
}

.desktop-only {
  display: block;
}

/* Mobile Student Card System */
.student-cards-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.student-card-item {
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.student-card-item[data-clocked-in="true"] {
  border-left: 4px solid var(--success-border);
  background: #f0fdf4;
}

.student-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.student-card-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.student-card-fees {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.75rem;
  padding: 0.45rem 0.6rem;
  background: var(--surface-subtle);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.student-card-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.25rem;
}

.student-card-actions .btn-clockin {
  flex: 1;
  min-height: 44px;
  font-size: 0.88rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
}

.student-card-actions .btn-quick-fee {
  min-height: 44px;
  padding: 0 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-main);
  white-space: nowrap;
}

/* Mobile Filter Drawer Toggle */
.filter-drawer-toggle {
  display: none;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
}

/* ============================================================
   RESPONSIVE MEDIA QUERIES (14-inch Laptop & Compact Desktops)
   ============================================================ */
@media (max-width: 1366px) {
  .navbar-inner {
    padding: 0 1rem;
    gap: 1.25rem;
  }

  .navbar-left {
    gap: 0.85rem;
  }

  .brand-title {
    font-size: 0.95rem;
  }

  .nav-links {
    gap: 0.35rem;
  }

  .nav-link {
    padding: 0.42rem 0.62rem;
    font-size: 0.81rem;
    gap: 0.38rem;
  }

  .nav-link svg {
    width: 14px;
    height: 14px;
  }

  .nav-actions {
    gap: 0.65rem;
  }

  .nav-action-btn {
    padding: 0.42rem 0.85rem;
    font-size: 0.81rem;
  }

  .user-badge {
    padding: 0.32rem 0.65rem;
    font-size: 0.79rem;
  }
}

@media (max-width: 1120px) {
  .navbar-inner {
    padding: 0 0.75rem;
    gap: 0.85rem;
  }

  .navbar-left {
    gap: 0.65rem;
  }

  .nav-links {
    gap: 0.2rem;
  }

  .nav-link {
    padding: 0.38rem 0.5rem;
    font-size: 0.78rem;
    gap: 0.3rem;
  }

  .brand-title {
    font-size: 0.9rem;
  }
}

/* ============================================================
   RESPONSIVE MEDIA QUERIES (Mobile & Tablet)
   ============================================================ */
@media (max-width: 768px) {
  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .mobile-bottom-nav {
    display: flex;
  }

  .mobile-only {
    display: block !important;
  }

  .desktop-only {
    display: none !important;
  }

  /* Compact 52px top bar on mobile */
  .navbar-inner {
    height: 52px;
    padding: 0 0.5rem;
    flex-direction: row;
    justify-content: space-between;
  }

  .nav-links {
    display: none;
  }

  .nav-actions .nav-action-btn {
    display: none;
  }

  .brand-text .brand-title {
    font-size: 0.88rem;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .brand-period-pill {
    display: none;
  }

  .user-badge-role {
    display: none;
  }

  /* 2x2 Stats Grid */
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .stat-card {
    padding: 0.75rem 0.85rem;
    border-radius: var(--radius-sm);
  }

  .stat-title {
    font-size: 0.68rem;
  }

  .stat-value {
    font-size: 1.2rem;
    margin: 0.2rem 0;
  }

  .stat-footer {
    font-size: 0.68rem;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .stat-footer span:last-child {
    display: none;
  }

  /* Page Header compact */
  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    margin-bottom: 1rem;
  }

  .page-title-group h2 {
    font-size: 1.25rem;
  }

  .header-actions {
    width: 100%;
  }

  .header-actions .btn-primary,
  .header-actions .btn-secondary,
  .date-selector-pill {
    width: 100%;
    justify-content: center;
  }

  /* Control / Filter Bar on Mobile */
  .control-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    margin-bottom: 1rem;
  }

  .search-input-wrapper {
    width: 100%;
  }

  .filter-group {
    display: none;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    background: var(--surface-subtle);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
  }

  .filter-group.show-mobile {
    display: flex !important;
  }

  .filter-drawer-toggle {
    display: flex;
  }

  .filter-select {
    width: 100%;
    min-height: 42px;
  }

  /* Mobile Bottom Sheet Modal */
  .modal-overlay {
    align-items: flex-end;
    padding: 0;
  }

  .modal-content {
    max-width: 100%;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    max-height: 85vh;
    overflow-y: auto;
  }

  /* Touch input zoom prevention */
  input, select, textarea {
    font-size: 16px !important;
  }

  .site-footer {
    display: none;
  }
}
