/* iFEEL AMS — Main Stylesheet */
/* Aesthetic: Clean institutional with deep navy & amber accent */

:root {
  --navy: #0d1b3e;
  --navy-mid: #162450;
  --navy-light: #1e3270;
  --amber: #f5a623;
  --amber-light: #ffc34d;
  --amber-dark: #d4881c;
  --green: #27ae60;
  --red: #e74c3c;
  --orange: #e67e22;
  --white: #ffffff;
  --off-white: #f8f9fc;
  --gray-100: #eef1f7;
  --gray-200: #dde2ef;
  --gray-400: #8896b3;
  --gray-600: #4a5578;
  --text: #1a2440;
  --text-light: #5a6a8a;
  --shadow: 0 4px 24px rgba(13,27,62,0.12);
  --shadow-lg: 0 8px 48px rgba(13,27,62,0.2);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Sora', sans-serif;
  --mono: 'Space Mono', monospace;
  --transition: 0.2s ease;
}

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

body {
  font-family: 'Open Sans', sans-serif !important;
  background: var(--off-white);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* =================== NAVBAR =================== */
.navbar {
  background: #013194;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 68px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.brand-mark {
  width: 40px; height: 40px;
  background: var(--amber);
  color: var(--navy);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
}

.brand-text { line-height: 1.2; }
.brand-main { display: block; color: var(--white); font-weight: 700; font-size: 12px; letter-spacing: 0.0px; }
.brand-sub { display: block; color: var(--gray-400); font-size: 11px; letter-spacing: 0.5px; }

.nav-links {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  color: black;
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  transition: all var(--transition);
}
.nav-link svg { width: 16px; height: 16px; }
.nav-link:hover { background: rgba(255,255,255,0.08); color: var(--white); }
.nav-link.active { background: rgba(245,166,35,0.15); color: #fb8a4d; }

.nav-user {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 1px solid rgba(255,255,255,0.1);
}

.user-info { text-align: right; line-height: 1.3; }
.user-name { display: block; color: black; font-size: 13px; font-weight: 600; }
.user-role { display: block; color: var(--amber); font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; }

.btn-logout {
  padding: 7px 16px;
  background: rgba(231,76,60,0.15);
  border: 1px solid rgba(231,76,60,0.3);
  color: #ff8a7a;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition);
}
.btn-logout:hover { background: rgba(231,76,60,0.3); color: #fff; }

/* =================== FLASH =================== */
.flash {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 2rem;
  font-size: 14px;
  font-weight: 500;
}
.flash-success { background: #d4edda; color: #155724; border-bottom: 2px solid #27ae60; }
.flash-error   { background: #f8d7da; color: #721c24; border-bottom: 2px solid #e74c3c; }
.flash-warning { background: #fff3cd; color: #856404; border-bottom: 2px solid #f5a623; }
.flash button  { background: none; border: none; font-size: 20px; cursor: pointer; opacity: 0.6; }

/* =================== LAYOUT =================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.main-content {
  flex: 1;
  padding: 2.5rem 2rem;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

/* =================== PAGE HEADER =================== */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--gray-200);
}

.page-header-left {}
.page-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.1;
}
.page-subtitle {
  color: var(--text-light);
  font-size: 14px;
  margin-top: 6px;
}

/* =================== CARDS =================== */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  overflow: hidden;
}

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--white);
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-body { padding: 1.5rem; }

/* =================== STAT CARDS =================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--gray-100);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #e8f0fe; color: #1a73e8; }
.stat-icon.amber  { background: #fff8e1; color: var(--amber-dark); }
.stat-icon.green  { background: #e8f5e9; color: var(--green); }
.stat-icon.red    { background: #fce8e6; color: var(--red); }
.stat-icon.purple { background: #f3e5f5; color: #9c27b0; }

.stat-value { font-size: 2rem; font-weight: 700; color: var(--navy); font-family: 'Open Sans', sans-serif; line-height: 1; }
.stat-label { font-size: 12.5px; color: var(--text-light); margin-top: 4px; font-weight: 500; }

/* =================== TABLES =================== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
thead tr { background: #013194; }
thead th {
  padding: 13px 16px;
  text-align: left;
  color: var(--white);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}
tbody tr { border-bottom: 1px solid var(--gray-100); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: var(--gray-100); }
td { padding: 12px 16px; color: var(--text); vertical-align: middle; }

/* =================== BADGES =================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green  { background: #e8f5e9; color: #2e7d32; }
.badge-red    { background: #fce8e6; color: #c62828; }
.badge-orange { background: #fff3e0; color: #e65100; }
.badge-blue   { background: #e3f2fd; color: #1565c0; }
.badge-amber  { background: #fff8e1; color: #f57f17; }
.badge-gray   { background: var(--gray-100); color: var(--gray-600); }

/* =================== FORMS =================== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

input, select, textarea {
  padding: 10px 14px;
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.15);
}

/* =================== BUTTONS =================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-family: 'Open Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn svg { width: 15px; height: 15px; }
.btn-primary   { background: #013194; color: var(--white); }
.btn-primary:hover { background: var(--navy-light); transform: translateY(-1px); }
.btn-amber     { background: #013194; color: white; }
.btn-amber:hover { background: var(--amber-light); transform: translateY(-1px); }
.btn-green     { background: #fb864a; color: var(--white); }
.btn-green:hover { background: #219a52; }
.btn-red       { background: var(--red); color: var(--white); }
.btn-red:hover { background: #c0392b; }
.btn-outline   { background: transparent; color: var(--navy); border: 1.5px solid var(--gray-200); }
.btn-outline:hover { border-color: var(--navy); background: var(--gray-100); }
.btn-sm { padding: 6px 12px; font-size: 12.5px; }

/* =================== ATTENDANCE MARKS =================== */
.att-grid { display: flex; flex-direction: column; gap: 0; }
.att-row {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gray-100);
}
.att-row:last-child { border-bottom: none; }
.att-row:hover { background: var(--off-white); }
.att-num { font-family: 'Open Sans', sans-serif; font-size: 12px; color: var(--gray-400); }
.att-name { font-weight: 500; font-size: 14px; }
.att-roll { font-size: 11.5px; color: var(--text-light); font-family: 'Open Sans', sans-serif; }

.radio-group { display: flex; gap: 6px; }
.radio-label {
  cursor: pointer;
  position: relative;
}
.radio-label input[type=radio] { position: absolute; opacity: 0; width: 0; height: 0; }
.radio-btn {
  display: flex; align-items: center; justify-content: center;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  transition: all var(--transition);
  white-space: nowrap;
  user-select: none;
}
.radio-label input:checked + .radio-btn.present { background: #e8f5e9; border-color: var(--green); color: #2e7d32; }
.radio-label input:checked + .radio-btn.absent  { background: #fce8e6; border-color: var(--red); color: #c62828; }
.radio-label input:checked + .radio-btn.leave   { background: #fff8e1; border-color: var(--amber-dark); color: var(--amber-dark); }
.radio-btn:hover { border-color: var(--navy-light); }

/* =================== QUICK SELECT =================== */
.quick-select {
  display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
}
.quick-select span { font-size: 12px; color: var(--text-light); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }

/* =================== PERCENTAGE BAR =================== */
.pct-bar-wrap { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.pct-bar { flex: 1; height: 7px; background: var(--gray-200); border-radius: 10px; overflow: hidden; }
.pct-fill { height: 100%; border-radius: 10px; transition: width 0.6s ease; }
.pct-fill.good { background: var(--green); }
.pct-fill.warn { background: var(--amber); }
.pct-fill.bad  { background: var(--red); }
.pct-num { font-family: 'Open Sans', sans-serif; font-size: 12.5px; font-weight: 700; min-width: 40px; }
.pct-num.good { color: var(--green); }
.pct-num.warn { color: var(--amber-dark); }
.pct-num.bad  { color: var(--red); }

/* =================== LOGIN PAGE =================== */
.login-page {
  min-height: 100vh;
  background: #013194;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.login-card {
  background: var(--white);
  border-radius: 20px;
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.4);
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2rem;
}
.login-mark {
  width: 52px; height: 52px;
  background: var(--amber);
  color: var(--navy);
  font-family: 'Open Sans', sans-serif;
  font-weight: 700;
  font-size: 18px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.login-title { font-size: 22px; font-weight: 700; color: var(--navy); }
.login-sub { font-size: 13px; color: var(--text-light); margin-top: 2px; }

.login-heading { font-size: 1.5rem; font-weight: 700; color: var(--navy); margin-bottom: 0.4rem; }
.login-desc { font-size: 14px; color: var(--text-light); margin-bottom: 2rem; }

.login-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 1.5rem 0; color: var(--gray-400); font-size: 12px;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--gray-200);
}

.demo-creds {
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 1rem;
  font-size: 12.5px;
  color: var(--text-light);
}
.demo-creds strong { color: var(--navy); font-family: 'Open Sans', sans-serif; }
.demo-creds table { background: none; }
.demo-creds td { padding: 2px 8px 2px 0; background: none; color: var(--text-light); }
.demo-creds thead { display: none; }

/* =================== SECTION DIVIDER =================== */
.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gray-400);
  padding: 0 16px;
  margin: 1rem 0 0.5rem;
}

/* =================== FILTERS BAR =================== */
.filter-bar {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--gray-200);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: flex-end;
}
.filter-bar .form-group { min-width: 160px; flex: 1; margin: 0; }
.filter-bar .form-group label { margin-bottom: 5px; }

/* =================== TABS =================== */
.tabs {
  display: flex; gap: 2px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 1.5rem;
  width: fit-content;
}
.tab {
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  background: none;
  color: var(--gray-600);
  transition: all var(--transition);
  font-family: 'Open Sans', sans-serif;
  text-decoration: none;
}
.tab.active { background: var(--white); color: var(--navy); box-shadow: 0 1px 4px rgba(0,0,0,0.1); }
.tab:hover:not(.active) { color: var(--navy); }

/* =================== ALERT BOX =================== */
.alert {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert-warning { background: #fff8e1; border: 1px solid #ffe082; color: #6d4c00; }
.alert-info    { background: #e3f2fd; border: 1px solid #90caf9; color: #0d47a1; }
.alert-danger  { background: #fce8e6; border: 1px solid #ef9a9a; color: #b71c1c; }

/* =================== EMPTY STATE =================== */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-light);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.4; }
.empty-state h3 { font-size: 1.2rem; color: var(--text); margin-bottom: 0.5rem; }

/* =================== FOOTER =================== */
.footer {
  background: var(--navy);
  color: var(--gray-400);
  text-align: center;
  padding: 1.25rem 2rem;
  font-size: 12.5px;
  margin-top: auto;
}
.footer-sep { margin: 0 10px; opacity: 0.4; }

/* =================== RESPONSIVE =================== */
@media (max-width: 768px) {
  .navbar { padding: 0 1rem; gap: 1rem; }
  .nav-links { display: none; }
  .main-content { padding: 1.5rem 1rem; }
  .page-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { flex-direction: column; }
  .att-row { grid-template-columns: 40px 1fr; }
  .radio-group { grid-column: 1/-1; }
}

/* =================== PRINT =================== */
@media print {
  .navbar, .footer, .btn, .filter-bar, .flash, .no-print { display: none !important; }
  body { background: white; }
  .card { box-shadow: none; border: 1px solid #ccc; }
  thead tr { background: #1a2440 !important; -webkit-print-color-adjust: exact; }
}
