/* ============================================================
   assets/css/app.css — Attendance Management System Styles
   ============================================================ */

:root {
  --sidebar-w: 260px;
  --topbar-h: 62px;
  --primary:   #2563eb;
  --primary-d: #1d4ed8;
  --primary-l: #eff6ff;
  --accent:    #0ea5e9;
  --success:   #16a34a;
  --warning:   #d97706;
  --danger:    #dc2626;
  --info:      #0891b2;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #ffffff;
  --sidebar-active-bg: #1e3a8a;
  --body-bg:   #f1f5f9;
  --card-bg:   #ffffff;
  --border:    #e2e8f0;
  --text-main: #1e293b;
  --text-muted:#64748b;
  --radius:    10px;
  --shadow:    0 2px 12px rgba(0,0,0,.07);
  --shadow-md: 0 4px 20px rgba(0,0,0,.10);
  --font:      'DM Sans', sans-serif;
  --font-mono: 'DM Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--body-bg);
  color: var(--text-main);
  margin: 0;
  font-size: 14.5px;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  z-index: 1000;
  transition: transform .25s ease;
  overflow-y: auto;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.07);
}
.brand-icon {
  width: 40px; height: 40px;
  background: var(--primary);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  flex-shrink: 0;
}
.brand-name { color: #fff; font-weight: 700; font-size: 16px; display: block; line-height: 1; }
.brand-sub  { color: var(--sidebar-text); font-size: 11px; display: block; margin-top: 2px; }

.sidebar-menu { flex: 1; padding: 12px 0; }

.menu-section {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #475569;
  padding: 14px 20px 5px;
  text-transform: uppercase;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 0;
  transition: background .15s, color .15s;
}
.menu-item i { font-size: 16px; width: 20px; text-align: center; }
.menu-item:hover { color: #fff; background: rgba(255,255,255,.06); }
.menu-item.active {
  color: var(--sidebar-active);
  background: var(--sidebar-active-bg);
  border-left: 3px solid var(--primary);
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-avatar { font-size: 28px; color: #64748b; }
.admin-name   { color: #cbd5e1; font-size: 13px; font-weight: 600; }
.admin-role   { color: #475569; font-size: 11px; }
.btn-logout {
  margin-left: auto;
  color: #475569;
  font-size: 20px;
  text-decoration: none;
  transition: color .2s;
}
.btn-logout:hover { color: #ef4444; }

/* ── Main layout ─────────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left .25s ease;
}

/* ── Topbar ──────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 14px;
  position: sticky; top: 0; z-index: 900;
  box-shadow: var(--shadow);
}
.sidebar-toggle {
  background: none; border: none;
  font-size: 22px; color: var(--text-muted);
  cursor: pointer; padding: 4px;
  border-radius: 6px;
  transition: background .15s;
}
.sidebar-toggle:hover { background: var(--body-bg); }
.topbar-title { font-size: 17px; font-weight: 700; color: var(--text-main); flex: 1; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-date  { color: var(--text-muted); font-size: 13px; }

/* ── Page content ────────────────────────────────────────── */
.page-content { padding: 26px 28px; flex: 1; }

/* ── Stat cards ──────────────────────────────────────────── */
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: box-shadow .2s;
}
.stat-card:hover { box-shadow: var(--shadow-md); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.stat-icon.blue   { background: #eff6ff; color: var(--primary); }
.stat-icon.green  { background: #f0fdf4; color: var(--success); }
.stat-icon.orange { background: #fffbeb; color: var(--warning); }
.stat-icon.red    { background: #fef2f2; color: var(--danger); }
.stat-icon.cyan   { background: #ecfeff; color: var(--info); }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.stat-value { font-size: 28px; font-weight: 700; color: var(--text-main); line-height: 1.1; }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.card-header {
  background: transparent;
  border-bottom: 1px solid var(--border);
  padding: 16px 20px;
  font-weight: 700;
  font-size: 15px;
  display: flex; align-items: center; gap: 8px;
}
.card-body { padding: 20px; }

/* ── Tables ──────────────────────────────────────────────── */
.table { font-size: 13.5px; }
.table th { font-weight: 600; color: var(--text-muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; background: #f8fafc; }
.table td, .table th { padding: 12px 14px; vertical-align: middle; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* ── Attendance table ────────────────────────────────────── */
.att-table th, .att-table td { white-space: nowrap; }
.att-table .radio-group { display: flex; gap: 6px; flex-wrap: wrap; }
.att-radio-label {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 10px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
}
.att-radio-label input[type=radio] { display: none; }
.att-radio-label:hover { border-color: var(--primary); color: var(--primary); }
.att-radio-label.checked-present  { border-color: var(--success); background: #f0fdf4; color: var(--success); }
.att-radio-label.checked-leave     { border-color: var(--warning); background: #fffbeb; color: var(--warning); }
.att-radio-label.checked-half_day  { border-color: var(--info);    background: #ecfeff; color: var(--info); }
.att-radio-label.checked-absent    { border-color: var(--danger);  background: #fef2f2; color: var(--danger); }
.att-radio-label.checked-holiday   { border-color: var(--primary); background: var(--primary-l); color: var(--primary); }

/* ── Badges ──────────────────────────────────────────────── */
.badge { font-weight: 600; font-size: 11.5px; padding: 4px 9px; }

/* ── Forms ───────────────────────────────────────────────── */
.form-label { font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.form-control, .form-select {
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}
.input-group-text { border: 1.5px solid var(--border); background: #f8fafc; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn { font-weight: 600; font-size: 13.5px; border-radius: 8px; }
.btn-primary   { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); }

/* ── Date nav ────────────────────────────────────────────── */
.date-nav {
  display: flex; align-items: center; gap: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  box-shadow: var(--shadow);
}
.date-nav .date-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
  flex: 1;
  text-align: center;
}
.date-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.date-badge.sunday, .date-badge.saturday { background: #fee2e2; color: #b91c1c; }
.date-badge.holiday  { background: #e0e7ff; color: #3730a3; }
.date-badge.weekday  { background: #d1fae5; color: #065f46; }

/* ── Remarks input ───────────────────────────────────────── */
.remarks-input {
  font-size: 12.5px;
  padding: 5px 9px;
  min-width: 140px;
  height: 34px;
}

/* ── Login page ──────────────────────────────────────────── */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0f172a 100%);
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  padding: 40px 36px;
}
.login-logo {
  text-align: center;
  margin-bottom: 28px;
}
.login-logo .logo-icon {
  width: 64px; height: 64px;
  background: var(--primary);
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 32px; color: #fff;
  margin-bottom: 12px;
}
.login-logo h1 { font-size: 22px; font-weight: 800; color: var(--text-main); margin: 0; }
.login-logo p  { color: var(--text-muted); font-size: 13px; margin: 4px 0 0; }

/* ── Leave summary bars ──────────────────────────────────── */
.leave-bar-wrap { height: 8px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.leave-bar-fill { height: 100%; border-radius: 4px; transition: width .5s ease; }

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 992px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-wrapper { margin-left: 0; }
  .page-content { padding: 16px; }
}

/* ── Utilities ───────────────────────────────────────────── */
.fw-700 { font-weight: 700 !important; }
.text-tiny { font-size: 11px; }
.gap-8 { gap: 8px; }
.rounded-pill-sm { border-radius: 20px; }

/* ── Print ───────────────────────────────────────────────── */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-wrapper { margin-left: 0 !important; }
  .page-content { padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ccc !important; }
}
