/* =========================================================
   AttendanceTracker — professional theme, built on Bootstrap 5
   Concept: a teacher's roll book / ledger, digitized. Deep navy,
   paper-white surfaces, slab-serif headings, monospace data,
   rubber-stamp status colors.
   ========================================================= */
:root {
  --ink-navy: #1B2A4A;
  --ink-navy-2: #2E4368;
  --paper: #F5F6F2;
  --paper-raised: #FFFFFF;
  --paper-line: #E1E4DC;
  --ink-muted: #5B6478;
  --stamp-red: #C0392B;
  --stamp-green: #2F7A4F;
  --stamp-amber: #B8791F;
  --stamp-blue: #2E5C8A;

  --font-display: 'Zilla Slab', Georgia, 'Times New Roman', serif;
  --font-body: 'IBM Plex Sans', -apple-system, Segoe UI, Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --radius: 12px;
  --shadow-card: 0 10px 28px rgba(27, 42, 74, 0.08);
  --shadow-lift: 0 18px 40px rgba(27, 42, 74, 0.16);

  /* Bootstrap variable overrides for a cohesive brand */
  --bs-primary: var(--ink-navy);
  --bs-primary-rgb: 27, 42, 74;
  --bs-body-font-family: var(--font-body);
  --bs-body-color: var(--ink-navy);
  --bs-body-bg: var(--paper);
  --bs-link-color: var(--ink-navy);
  --bs-link-hover-color: var(--stamp-red);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

body { background: var(--paper); }
h1, h2, h3, h4, .brand, .footer-brand { font-family: var(--font-display); font-weight: 600; color: var(--ink-navy); }
.font-mono, .stat-card .num, td.mono { font-family: var(--font-mono); }

/* ---------- Navbar ---------- */
.at-nav {
  background: linear-gradient(180deg, var(--ink-navy), var(--ink-navy-2));
  box-shadow: 0 4px 18px rgba(0,0,0,0.14);
  padding-top: .65rem;
  padding-bottom: .65rem;
}
.at-nav .navbar-brand { font-family: var(--font-display); font-weight: 700; font-size: 1.2rem; color: #fff; }
.at-nav .nav-link { color: rgba(255,255,255,0.82); font-weight: 500; margin: 0 2px; border-radius: 8px; padding: .5rem .75rem; }
.at-nav .nav-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
.at-nav .nav-link.active { color: #fff; background: rgba(255,255,255,0.14); }
.nav-spacer { height: 76px; }

.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: .75rem; color: rgba(255,255,255,0.85); font-family: var(--font-mono); padding: .3rem .6rem; border: 1px solid rgba(255,255,255,0.2); border-radius: 999px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #4CB876; box-shadow: 0 0 0 3px rgba(76,184,118,0.25); }
.status-pill.offline .status-dot { background: #C0392B; box-shadow: 0 0 0 3px rgba(192,57,43,0.25); }

.btn-icon { color: #fff; border: 1px solid rgba(255,255,255,0.25); background: transparent; border-radius: 8px; width: 38px; height: 38px; display:inline-flex; align-items:center; justify-content:center; }
.btn-icon:hover { background: rgba(255,255,255,0.1); color: #fff; }
.avatar-chip { width: 28px; height: 28px; border-radius: 50%; background: var(--stamp-red); color:#fff; font-size:.72rem; font-weight:700; display:inline-flex; align-items:center; justify-content:center; }

.btn-stamp, .btn-primary {
  background: var(--stamp-red); border-color: var(--stamp-red); color: #fff;
  font-weight: 600; border-radius: 8px;
}
.btn-stamp:hover, .btn-primary:hover, .btn-primary:focus { background: #a4342a; border-color: #a4342a; color:#fff; }
.btn-outline-primary, .btn-outline-light { border-radius: 8px; font-weight: 600; }
.btn-outline-primary { color: var(--ink-navy); border-color: var(--paper-line); }
.btn-outline-primary:hover { background: var(--ink-navy); border-color: var(--ink-navy); }
.btn { border-radius: 8px; }

/* ---------- Hero sections ---------- */
.page-hero {
  background: linear-gradient(160deg, var(--ink-navy) 0%, var(--ink-navy-2) 60%, #3a537f 100%);
  color: #fff; padding: 56px 0 44px; margin-bottom: 8px;
}
.page-hero .breadcrumb-trail { font-family: var(--font-mono); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(255,255,255,0.65); margin-bottom: 10px; }
.page-hero .breadcrumb-trail a { color: rgba(255,255,255,0.85); }
.page-hero h1 { color: #fff; font-size: clamp(1.8rem, 3.4vw, 2.6rem); margin-bottom: 8px; }
.page-hero p { color: rgba(255,255,255,0.82); max-width: 62ch; margin-bottom: 0; }
.page-hero .eyebrow { color: #E8A793; }

.hero-home { padding: 90px 0 70px; position: relative; overflow: hidden; }
.hero-home::after {
  content: ''; position: absolute; inset: 0; opacity: .07; pointer-events:none;
  background-image: repeating-linear-gradient(180deg, #fff 0 1px, transparent 1px 34px);
}
.eyebrow { font-family: var(--font-mono); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--stamp-red); display: inline-flex; align-items: center; gap: 8px; }
.eyebrow::before { content:''; width: 22px; height: 1px; background: currentColor; display:inline-block; }
.page-hero .eyebrow::before { background: #E8A793; }

/* ---------- Sections & cards ---------- */
.section { padding: 56px 0; }
.section-alt { background: var(--paper-raised); border-top: 1px solid var(--paper-line); border-bottom: 1px solid var(--paper-line); }

.card { border: 1px solid var(--paper-line); border-radius: var(--radius); box-shadow: var(--shadow-card); }
.card:hover.hover-lift { box-shadow: var(--shadow-lift); transform: translateY(-3px); }
.hover-lift { transition: box-shadow .25s ease, transform .25s ease; }

.stat-card { background: var(--paper-raised); border: 1px solid var(--paper-line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow-card); border-left: 4px solid var(--ink-navy); }
.stat-card .num { font-size: 2.1rem; font-weight: 700; line-height: 1; }
.stat-card .label { color: var(--ink-muted); font-size: .85rem; margin-top: 6px; text-transform: uppercase; letter-spacing: .04em; }
.stat-card.present { border-left-color: var(--stamp-green); }
.stat-card.late { border-left-color: var(--stamp-amber); }
.stat-card.absent { border-left-color: var(--stamp-red); }
.stat-card.excused { border-left-color: var(--stamp-blue); }

.class-card, .report-card { background: var(--paper-raised); border: 1px solid var(--paper-line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-card); height: 100%; }
.class-card h3 { font-size: 1.15rem; margin-bottom: 14px; }
.class-card dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 0; font-size: .9rem; }
.class-card dt { color: var(--ink-muted); }
.class-card dd { margin: 0; text-align: right; }

.report-card .percent { font-family: var(--font-mono); font-size: 2.3rem; font-weight: 700; color: var(--ink-navy); margin: 6px 0; }
.progress-bar-track { height: 8px; border-radius: 999px; background: var(--paper-line); overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--stamp-green); border-radius: 999px; }

/* ---------- Tables ---------- */
.table-wrap { background: var(--paper-raised); border: 1px solid var(--paper-line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-card); }
table.at-table { margin-bottom: 0; }
table.at-table thead th { background: var(--ink-navy); color: #fff; font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .04em; border: none; padding: 14px 16px; }
table.at-table td { padding: 13px 16px; vertical-align: middle; border-color: var(--paper-line); }
table.at-table tbody tr:hover { background: rgba(27,42,74,0.03); }

.badge-status { font-weight: 600; font-size: .76rem; padding: .4em .7em; border-radius: 999px; }

/* ---------- Forms ---------- */
.auth-shell { padding: 70px 0; min-height: calc(100vh - 76px); display:flex; align-items:center; background: var(--paper); }
.form-card { background: var(--paper-raised); border: 1px solid var(--paper-line); border-radius: var(--radius); box-shadow: var(--shadow-lift); padding: 40px; max-width: 480px; width:100%; }
.form-card .form-control, .form-card .form-select, .form-control, .form-select { border-radius: 8px; border-color: var(--paper-line); padding: .6rem .85rem; }
.form-control:focus, .form-select:focus { border-color: var(--ink-navy); box-shadow: 0 0 0 .2rem rgba(27,42,74,0.12); }
.role-select .form-check { border: 1px solid var(--paper-line); border-radius: 10px; padding: 14px 10px; text-align:center; }
.role-select .form-check-input:checked ~ .form-check-label { color: var(--stamp-red); font-weight:600; }

.notice-banner { background: #FDF3EE; border: 1px solid #EFCBB6; color: #8a4a2f; padding: 12px 16px; border-radius: 10px; font-size: .9rem; }
.notice-banner.info { background:#EEF3FA; border-color:#C9D8EC; color:#2E5C8A; }

/* ---------- Notifications ---------- */
.notif-item { display:flex; gap: 14px; align-items:flex-start; padding: 16px; border: 1px solid var(--paper-line); border-radius: var(--radius); background: var(--paper-raised); margin-bottom: 10px; }
.notif-item.unread { border-left: 4px solid var(--stamp-red); background: #FFFBF9; }
.notif-icon { font-size: 1.3rem; }
.notif-time { color: var(--ink-muted); font-size: .78rem; white-space:nowrap; font-family: var(--font-mono); }

/* ---------- Profile ---------- */
.profile-avatar { width: 84px; height: 84px; border-radius: 50%; background: var(--ink-navy); color:#fff; font-family: var(--font-display); font-size: 1.8rem; display:flex; align-items:center; justify-content:center; box-shadow: var(--shadow-card); }
.role-tag { display:inline-block; background: var(--stamp-red); color:#fff; font-size:.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; padding: .25em .7em; border-radius: 999px; margin-top:6px; }

/* ---------- Footer ---------- */
.at-footer { background: var(--ink-navy); color: rgba(245,246,242,0.85); padding: 52px 0 22px; margin-top: 60px; }
.at-footer h5 { color: #fff; font-family: var(--font-body); font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 14px; }
.at-footer .footer-brand { font-family: var(--font-display); font-size: 1.15rem; color: #fff; font-weight: 700; margin-bottom: 10px; }
.footer-lede { color: rgba(245,246,242,0.65); font-size: .9rem; max-width: 34ch; }
.footer-links a { color: rgba(245,246,242,0.75); font-size: .9rem; line-height: 2.1; }
.footer-links a:hover { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); margin-top: 30px; padding-top: 18px; font-size: .82rem; color: rgba(245,246,242,0.55); }

/* ---------- About page ---------- */
.about-list li { padding: 10px 0 10px 30px; border-bottom: 1px solid var(--paper-line); position: relative; }
.about-list li::before { content: '✓'; position:absolute; left:0; color: var(--stamp-green); font-weight:700; }
.role-card { background: var(--paper-raised); border: 1px solid var(--paper-line); border-radius: var(--radius); padding: 26px; text-align:center; height:100%; box-shadow: var(--shadow-card); }
.role-icon { font-size: 2.2rem; margin-bottom: 10px; }
.cta { background: var(--ink-navy); color:#fff; border-radius: var(--radius); padding: 50px; text-align:center; }
.cta h2 { color:#fff; }
.cta p { color: rgba(255,255,255,0.8); }

/* ---------- Misc ---------- */
.demo-note { color: var(--ink-muted); font-size: .82rem; margin-top: 14px; }
.section-head { margin-bottom: 30px; }
.section-head h2 { font-size: clamp(1.4rem, 2.6vw, 2rem); }
.list-toolbar { display:flex; flex-wrap:wrap; gap: 12px; justify-content: space-between; align-items:center; margin-bottom: 20px; }
.feature-icon { width: 54px; height: 54px; border-radius: 12px; background: rgba(27,42,74,0.08); color: var(--ink-navy); display:flex; align-items:center; justify-content:center; font-size: 1.5rem; margin-bottom: 14px; }

@media (max-width: 767.98px) {
  .page-hero { padding: 42px 0 32px; text-align:left; }
  .hero-home { padding: 60px 0 44px; }
  .form-card { padding: 28px 22px; }
  .cta { padding: 34px 20px; }
}
