/* =============================================================
   Attendance Desktop — Admin Panel stylesheet
   ============================================================= */

:root {
  --brand-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #2563eb 100%);
  --sidebar-bg: #0f172a;
  --sidebar-bg-hover: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #4f46e5;
  --page-bg: #f1f5f9;
  --card-radius: 16px;
  --shadow-soft: 0 10px 30px -12px rgba(15, 23, 42, 0.25);
  --transition-fast: all 0.18s ease;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--page-bg);
  color: #1e293b;
}

/* ---------------------------------------------------------------
   Login page
   --------------------------------------------------------------- */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-gradient);
  background-size: 200% 200%;
  animation: gradientShift 12s ease infinite;
  padding: 20px;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: #ffffff;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-soft);
  padding: 2.5rem 2.25rem;
  animation: floatUp 0.5s ease;
}

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

.login-logo {
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: var(--brand-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: #fff;
  margin: 0 auto 1rem;
  box-shadow: 0 8px 20px -6px rgba(79, 70, 229, 0.55);
}

.login-card h1 {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.25rem;
}

.login-card .subtitle {
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 1.75rem;
}

.btn-brand {
  background: var(--brand-gradient);
  border: none;
  color: #fff;
  font-weight: 600;
  padding: 0.65rem 1rem;
  border-radius: 10px;
  transition: var(--transition-fast);
}

.btn-brand:hover, .btn-brand:focus {
  filter: brightness(1.08);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px -8px rgba(79, 70, 229, 0.6);
}

.btn-brand:active { transform: translateY(0); }
.btn-brand:disabled { opacity: 0.7; transform: none; }

.password-toggle { cursor: pointer; color: #94a3b8; }
.password-toggle:hover { color: #4f46e5; }

.demo-hint {
  font-size: 0.78rem;
  color: #94a3b8;
  text-align: center;
  margin-top: 1.25rem;
  border-top: 1px dashed #e2e8f0;
  padding-top: 0.9rem;
}

/* ---------------------------------------------------------------
   App shell
   --------------------------------------------------------------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 270px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 1030;
  transition: var(--transition-fast);
  overflow-y: auto;
}

.sidebar .brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1.35rem 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .brand-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--brand-gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.1rem;
}

.sidebar .brand-name { font-weight: 700; color: #fff; font-size: 1.02rem; }

.sidebar-profile {
  padding: 1.1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.avatar-circle {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 6px 16px -4px rgba(79, 70, 229, 0.6);
}

.sidebar-profile .emp-name { color: #fff; font-weight: 600; font-size: 0.9rem; }
.sidebar-profile .emp-dept { font-size: 0.75rem; color: #94a3b8; }

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0.65rem;
  overflow-y: auto;
}

.sidebar-nav .nav-section-title {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748b;
  padding: 0.85rem 0.6rem 0.35rem;
}

.sidebar-nav .nav-link {
  color: var(--sidebar-text);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  margin-bottom: 0.2rem;
  font-size: 0.87rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  transition: var(--transition-fast);
}

.sidebar-nav .nav-link i { font-size: 1rem; width: 18px; text-align: center; }
.sidebar-nav .nav-link:hover { background: var(--sidebar-bg-hover); color: #fff; }
.sidebar-nav .nav-link.active { background: var(--sidebar-active); color: #fff; }
.sidebar-nav .nav-link.disabled { opacity: 0.4; pointer-events: none; }

.sidebar-footer {
  padding: 1rem 0.9rem 1.2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.sidebar-footer .btn { width: 100%; }

.system-status {
  margin-bottom: 0.85rem;
  font-size: 0.75rem;
  color: var(--sidebar-text);
}
.system-status .status-row {
  display: flex; align-items: center; gap: 0.45rem; margin-bottom: 0.3rem;
}
.system-status .status-row i { font-size: 8px; color: #94a3b8; }
.system-status .app-version { color: #64748b; font-size: 0.7rem; margin-top: 0.4rem; margin-bottom: 0; }

.main-content {
  margin-left: 270px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--brand-gradient);
  color: #fff;
  padding: 1.1rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  box-shadow: var(--shadow-soft);
}
.topbar h4 { margin: 0; font-weight: 700; }
.topbar .topbar-sub { font-size: 0.85rem; color: rgba(255, 255, 255, 0.85); }

.clock-box {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 0.5rem 1rem;
  text-align: center;
  backdrop-filter: blur(4px);
}
.clock-box .clock-time { font-size: 1.15rem; font-weight: 700; letter-spacing: 0.5px; }
.clock-box .clock-date { font-size: 0.72rem; color: rgba(255, 255, 255, 0.85); }

.page-body { padding: 1.5rem 1.75rem; flex: 1; }

/* Stat cards (dashboard grid of 16) */
.stat-card {
  border: none;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-soft);
  transition: var(--transition-fast);
  height: 100%;
  padding: 1rem;
}
.stat-card:hover { transform: translateY(-3px); }

.stat-card .stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.05rem; color: #fff;
  margin-bottom: 0.6rem;
}
.stat-card .stat-value { font-size: 1.35rem; font-weight: 700; line-height: 1.1; }
.stat-card .stat-label {
  font-size: 0.72rem; color: #64748b;
  text-transform: uppercase; letter-spacing: 0.3px;
  margin-top: 2px;
}

.icon-indigo { background: linear-gradient(135deg, #6366f1, #4f46e5); }
.icon-emerald { background: linear-gradient(135deg, #10b981, #059669); }
.icon-amber { background: linear-gradient(135deg, #f59e0b, #d97706); }
.icon-sky { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.icon-red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.icon-slate { background: linear-gradient(135deg, #64748b, #475569); }
.icon-pink { background: linear-gradient(135deg, #ec4899, #db2777); }
.icon-teal { background: linear-gradient(135deg, #14b8a6, #0d9488); }

.panel-card {
  border: none;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-soft);
}

.chart-card { padding: 1.1rem; }
.chart-card h6 { margin-bottom: 0.9rem; }
.chart-container { position: relative; height: 260px; }
.chart-container.small { height: 200px; }

.table-admin thead th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #64748b;
  border-bottom-width: 1px;
  white-space: nowrap;
}
.table-admin td, .table-admin th { vertical-align: middle; }

.badge-status { font-weight: 600; padding: 0.4em 0.75em; border-radius: 999px; }

.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.35);
  display: none; align-items: center; justify-content: center;
  z-index: 2000;
}
.loading-overlay.active { display: flex; }
.loading-overlay .spinner-border { width: 3rem; height: 3rem; color: #fff; }

.toast { min-width: 300px; }

@media (max-width: 991.98px) {
  .sidebar { left: -270px; }
  .sidebar.show { left: 0; }
  .main-content { margin-left: 0; }
  .sidebar-backdrop {
    display: none; position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.5); z-index: 1020;
  }
  .sidebar-backdrop.show { display: block; }
}
