/* ============================================================
   COLLEGE ERP – ATTENDANCE SYSTEM  |  style.css
   Theme: Institutional Navy + Emerald Accent
   ============================================================ */

:root {
  --navy:        #0f1b35;
  --navy-light:  #1a2d4f;
  --navy-mid:    #243659;
  --emerald:     #10b981;
  --emerald-lt:  #34d399;
  --emerald-dark:#059669;
  --amber:       #f59e0b;
  --red:         #ef4444;
  --blue:        #3b82f6;
  --white:       #ffffff;
  --bg:          #f0f4f8;
  --bg-card:     #ffffff;
  --text:        #1e293b;
  --text-muted:  #64748b;
  --border:      #e2e8f0;
  --sidebar-w:   260px;
  --radius:      12px;
  --shadow:      0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.12);
  --font-main:   'Plus Jakarta Sans', sans-serif;
  --font-mono:   'Space Grotesk', monospace;
}

/* RESET */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--font-main); background: var(--bg); color: var(--text);
       display: flex; min-height: 100vh; }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; font-family: inherit; }

/* ─── SIDEBAR ─────────────────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-light) 100%);
  display: flex; flex-direction: column;
  z-index: 100; overflow: hidden;
  transition: width .28s cubic-bezier(.4,0,.2,1), transform .28s ease;
  box-shadow: 4px 0 24px rgba(0,0,0,.18);
}

.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 22px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-icon { font-size: 1.6rem; }
.brand-text  { font-size: 1.05rem; font-weight: 700; color: var(--white);
               letter-spacing: -.2px; white-space: nowrap; }

.sidebar-user {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  background: rgba(255,255,255,.03);
}
.user-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(135deg, var(--emerald), var(--blue));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .95rem; color: #fff; flex-shrink: 0;
}
.user-name  { font-size: .85rem; font-weight: 600; color: #fff; white-space: nowrap;
              overflow: hidden; text-overflow: ellipsis; }
.user-role  { font-size: .7rem; font-weight: 500; text-transform: uppercase;
              letter-spacing: .5px; margin-top: 2px; }
.badge-admin       { color: var(--amber); }
.badge-faculty     { color: var(--emerald-lt); }
.badge-student     { color: #93c5fd; }
.badge-coordinator { color: #c4b5fd; }
.badge-hod         { color: #fda4af; }
.badge-director    { color: var(--amber); }

.nav-list { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-item a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px; border-radius: 0;
  color: rgba(255,255,255,.65); font-size: .88rem; font-weight: 500;
  transition: all .2s ease; position: relative;
}
.nav-item a:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.active a {
  color: #fff; background: linear-gradient(90deg, var(--emerald), transparent);
  font-weight: 600;
}
.nav-item.active a::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--emerald); border-radius: 0 2px 2px 0;
}
.nav-icon  { font-size: 1.1rem; width: 22px; text-align: center; flex-shrink: 0; }
.nav-label { white-space: nowrap; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.logout-btn {
  display: flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,.55); font-size: .86rem; font-weight: 500;
  transition: color .2s;
}
.logout-btn:hover { color: var(--red); }

/* ─── MAIN LAYOUT ─────────────────────────────────────────── */
.main-wrapper { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }
.main-content { flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.page-header {
  display: flex; align-items: center; gap: 16px;
  padding: 18px 28px; background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.sidebar-toggle {
  background: none; border: none; font-size: 1.3rem;
  color: var(--text-muted); padding: 4px 8px; border-radius: 8px;
  display: none;
}
.sidebar-toggle:hover { background: var(--bg); }
.page-title-wrap { flex: 1; }
.page-title { font-size: 1.3rem; font-weight: 700; color: var(--navy); }
.page-subtitle { font-size: .82rem; color: var(--text-muted); margin-top: 2px; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.clock { font-family: var(--font-mono); font-size: .9rem; color: var(--text-muted); }
.date-badge {
  background: var(--navy); color: #fff;
  padding: 4px 12px; border-radius: 20px;
  font-size: .78rem; font-weight: 600;
}

.content-body { flex: 1; padding: 28px; }

/* ─── CARDS ───────────────────────────────────────────────── */
.card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden;
}
.card-header {
  padding: 18px 22px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 1rem; font-weight: 700; color: var(--navy); }
.card-body  { padding: 22px; }

/* ─── STAT CARDS ──────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 18px; margin-bottom: 24px; }
.stat-card {
  background: var(--bg-card); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 22px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stat-icon {
  width: 54px; height: 54px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}
.stat-icon.green  { background: #d1fae5; }
.stat-icon.blue   { background: #dbeafe; }
.stat-icon.amber  { background: #fef3c7; }
.stat-icon.red    { background: #fee2e2; }
.stat-icon.purple { background: #ede9fe; }
.stat-value  { font-size: 1.9rem; font-weight: 800; color: var(--navy); font-family: var(--font-mono); line-height: 1; }
.stat-label  { font-size: .78rem; color: var(--text-muted); margin-top: 4px; font-weight: 500; }
.stat-delta  { font-size: .75rem; font-weight: 600; }
.stat-delta.up   { color: var(--emerald); }
.stat-delta.down { color: var(--red); }

/* ─── TABLES ──────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--bg); color: var(--text-muted);
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .6px; padding: 11px 14px; text-align: left;
  border-bottom: 2px solid var(--border);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .15s; }
tbody tr:hover { background: #f8fafc; }
tbody td { padding: 12px 14px; font-size: .86rem; color: var(--text); }

/* ─── BADGES / PILLS ──────────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px;
}
.pill-green  { background: #d1fae5; color: #065f46; }
.pill-red    { background: #fee2e2; color: #991b1b; }
.pill-amber  { background: #fef3c7; color: #92400e; }
.pill-blue   { background: #dbeafe; color: #1e40af; }
.pill-purple { background: #ede9fe; color: #5b21b6; }
.pill-gray   { background: #f1f5f9; color: #475569; }

/* ─── ATT PERCENTAGE BAR ──────────────────────────────────── */
.att-bar { background: #e2e8f0; border-radius: 99px; height: 8px; overflow: hidden; }
.att-bar-fill { height: 100%; border-radius: 99px; transition: width .6s ease; }
.att-ok   { background: linear-gradient(90deg,var(--emerald),var(--emerald-lt)); }
.att-warn { background: linear-gradient(90deg,var(--amber),#fcd34d); }
.att-crit { background: linear-gradient(90deg,var(--red),#f87171); }

/* ─── FORMS ───────────────────────────────────────────────── */
.form-group  { margin-bottom: 18px; }
label { display: block; font-size: .82rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], input[type=time], select, textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: 8px; font-family: inherit; font-size: .9rem; color: var(--text);
  background: var(--bg-card); transition: border-color .2s, box-shadow .2s;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--emerald); box-shadow: 0 0 0 3px rgba(16,185,129,.12);
}
.form-row { display: grid; grid-template-columns: repeat(auto-fit,minmax(200px,1fr)); gap: 16px; }

/* ─── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: 8px; border: none;
  font-family: inherit; font-size: .87rem; font-weight: 600;
  transition: all .2s; cursor: pointer; white-space: nowrap;
}
.btn-primary { background: var(--emerald); color: #fff; }
.btn-primary:hover { background: var(--emerald-dark); }
.btn-navy    { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-light); }
.btn-danger  { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-outline { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--emerald); color: var(--emerald); }
.btn-sm { padding: 6px 12px; font-size: .8rem; border-radius: 6px; }
.btn-icon { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 8px; }

/* ─── ATTENDANCE GRID ─────────────────────────────────────── */
.att-toggle {
  display: flex; gap: 6px; align-items: center;
}
.att-toggle input[type=radio] { display: none; }
.att-toggle label.att-label {
  width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: .8rem; cursor: pointer; transition: all .2s;
  color: var(--text-muted);
}
.att-toggle input[value="P"]:checked + label { background: var(--emerald); border-color: var(--emerald); color: #fff; }
.att-toggle input[value="A"]:checked + label { background: var(--red);     border-color: var(--red);     color: #fff; }
.att-toggle input[value="L"]:checked + label { background: var(--amber);   border-color: var(--amber);   color: #fff; }

/* ─── ALERTS ──────────────────────────────────────────────── */
.alert { padding: 13px 18px; border-radius: 10px; font-size: .88rem;
         font-weight: 500; margin-bottom: 18px; display: flex; gap: 10px; align-items: flex-start; }
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }

/* ─── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200;
  display: none; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--bg-card); border-radius: 16px; width: min(560px,90vw);
  box-shadow: var(--shadow-lg); animation: slideUp .25s ease;
}
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border);
                display: flex; align-items: center; justify-content: space-between; }
.modal-title  { font-size: 1.05rem; font-weight: 700; color: var(--navy); }
.modal-close  { background: none; border: none; font-size: 1.4rem; color: var(--text-muted);
                line-height: 1; transition: color .2s; }
.modal-close:hover { color: var(--red); }
.modal-body   { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border);
                display: flex; justify-content: flex-end; gap: 10px; }

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

/* ─── LOGIN PAGE ──────────────────────────────────────────── */
.login-page {
  min-height: 100vh; display: flex;
  background: linear-gradient(135deg, var(--navy) 0%, #1e3a5f 50%, var(--navy-light) 100%);
}
.login-hero {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 40px; text-align: center;
}
.login-hero h1 { font-size: 2.4rem; font-weight: 800; color: #fff; margin-bottom: 12px; }
.login-hero p  { color: rgba(255,255,255,.65); font-size: 1rem; max-width: 360px; }
.login-hero-art { font-size: 5rem; margin-bottom: 24px; }
.login-panel {
  width: 420px; flex-shrink: 0; background: var(--bg-card);
  display: flex; flex-direction: column; justify-content: center;
  padding: 52px 44px;
}
.login-panel h2 { font-size: 1.6rem; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.login-panel p  { color: var(--text-muted); font-size: .88rem; margin-bottom: 32px; }
.login-form .form-group { margin-bottom: 20px; }
.login-form input {
  padding: 12px 16px; font-size: .92rem;
}
.login-submit {
  width: 100%; padding: 13px; font-size: .96rem;
  background: linear-gradient(90deg, var(--emerald), var(--blue));
  border: none; border-radius: 10px; color: #fff; font-weight: 700;
  cursor: pointer; transition: opacity .2s;
}
.login-submit:hover { opacity: .9; }
.demo-creds { margin-top: 24px; background: var(--bg); border-radius: 10px; padding: 16px; }
.demo-creds h4 { font-size: .8rem; font-weight: 700; color: var(--text-muted); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .5px; }
.demo-cred-item { display: flex; justify-content: space-between; font-size: .8rem;
                  padding: 4px 0; border-bottom: 1px dashed var(--border); color: var(--text-muted); }
.demo-cred-item span:first-child { font-weight: 600; color: var(--text); }

/* ─── SEARCH BAR ──────────────────────────────────────────── */
.search-bar {
  position: relative; width: 100%; max-width: 320px;
}
.search-bar input {
  padding-left: 38px; border-radius: 8px; background: var(--bg);
  border: 1.5px solid transparent;
}
.search-bar input:focus { background: #fff; }
.search-bar::before { content: '🔍'; position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-size: .85rem; }

/* ─── TIMETABLE GRID ─────────────────────────────────────── */
.tt-grid { display: grid; grid-template-columns: 80px repeat(5,1fr); gap: 2px; }
.tt-cell { background: var(--bg); border-radius: 6px; padding: 8px; font-size: .78rem; min-height: 60px; }
.tt-header { font-weight: 700; color: var(--navy); font-size: .8rem; text-align: center; padding: 10px 4px; }
.tt-slot { background: #e0f2fe; border-left: 3px solid var(--blue); color: #0c4a6e; }
.tt-slot-lab { background: #f0fdf4; border-left: 3px solid var(--emerald); color: #14532d; }

/* ─── RESPONSIVE ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .sidebar-toggle { display: flex !important; }
  .login-hero { display: none; }
  .login-panel { width: 100%; padding: 40px 28px; }
}
@media (max-width: 600px) {
  .content-body { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
}

/* ─── LOADER ──────────────────────────────────────────────── */
.loader {
  display: inline-block; width: 22px; height: 22px;
  border: 3px solid rgba(16,185,129,.2);
  border-top-color: var(--emerald);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── ATTENDANCE SHEET (Faculty) ──────────────────────────── */
.att-sheet th, .att-sheet td { vertical-align: middle; }
.att-sheet .student-col { min-width: 180px; }
.student-thumb {
  width: 32px; height: 32px; border-radius: 50%; font-size: .8rem;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700; background: var(--navy); color: #fff; flex-shrink: 0;
}
.present-count, .absent-count {
  font-family: var(--font-mono); font-weight: 700; font-size: 1rem;
}
.present-count { color: var(--emerald); }
.absent-count  { color: var(--red); }

/* ─── REPORT PREVIEW ─────────────────────────────────────── */
.report-filters {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end;
  background: var(--bg); border-radius: 10px; padding: 18px; margin-bottom: 22px;
}
.report-filter-group { flex: 1; min-width: 150px; }
.report-filter-group label { font-size: .78rem; }
