/* ============================================================
   ADMIN THEME
   Shares the same design tokens as the public-facing index.php
   (carbon / red brand system) so the admin panel and the
   employee-facing page feel like one product.
============================================================ */

:root {
  --carbon:    #0D0D0D;
  --carbon-2:  #171717;
  --red:       #E82B1F;
  --red-dark:  #B01F15;
  --red-glow:  rgba(232,43,31,0.25);
  --red-soft:  rgba(232,43,31,0.08);
  --steel:     #4A5568;
  --ash:       #9CA3AF;
  --fog:       #F1F5F9;
  --white:     #FFFFFF;
  --gold:      #F59E0B;
  --green:     #10B981;
  --radius:    12px;
  --shadow:    0 4px 24px rgba(0,0,0,0.10);
  --shadow-lg: 0 12px 48px rgba(0,0,0,0.16);

  --sidebar-w: 250px;
  --topbar-h:  64px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.admin-body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--fog);
  color: var(--carbon);
  margin: 0;
}

a { text-decoration: none; }

/* ============================
   LAYOUT SHELL
============================ */
.admin-shell { display: flex; min-height: 100vh; }

/* ---- Sidebar ---- */
.admin-sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--carbon);
  color: var(--white);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 1040;
  transition: transform .25s ease;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.admin-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.admin-sidebar-brand img { height: 30px; }
.admin-sidebar-brand span {
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 1.2px;
  color: var(--white);
}
.brand-dot {
  width: 8px; height: 8px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--red);
  animation: pulse 2s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 6px var(--red); }
  50%      { box-shadow: 0 0 16px var(--red), 0 0 30px var(--red-glow); }
}

.admin-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.admin-nav-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--ash);
  padding: 8px 12px 6px;
}
.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 2px;
  transition: all .15s;
}
.admin-nav-link i { font-size: 16px; width: 18px; text-align: center; }
.admin-nav-link:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.admin-nav-link.active {
  background: var(--red-soft);
  color: var(--white);
  box-shadow: inset 3px 0 0 var(--red);
}
.admin-nav-link.active i { color: var(--red); }

.admin-sidebar-foot {
  padding: 14px 20px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 11px;
  color: var(--ash);
}
.admin-sidebar-foot a { color: var(--ash); }
.admin-sidebar-foot a:hover { color: var(--white); }

/* ---- Topbar ---- */
.admin-topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1020;
}
.admin-topbar-title { font-size: 16px; font-weight: 700; color: var(--carbon); }
.admin-topbar-toggle {
  display: none;
  border: none;
  background: transparent;
  font-size: 20px;
  color: var(--carbon);
  margin-right: 12px;
}

.admin-user {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
  transition: background .15s;
}
.admin-user:hover { background: var(--fog); }
.admin-user-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--carbon);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  overflow: hidden;
  flex-shrink: 0;
}
.admin-user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.admin-user-name { font-size: 13px; font-weight: 600; color: var(--carbon); line-height: 1.2; }
.admin-user-role { font-size: 11px; color: var(--ash); line-height: 1.2; }

/* ---- Main content ---- */
.admin-main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.admin-content { padding: 28px 30px 60px; }

.admin-page-header { margin-bottom: 22px; }
.admin-page-title { font-size: 22px; font-weight: 800; color: var(--carbon); margin: 0 0 4px; }
.admin-page-sub { font-size: 13px; color: var(--steel); margin: 0; }

@media (max-width: 991px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.show { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .admin-main { margin-left: 0; }
  .admin-topbar-toggle { display: inline-flex; align-items: center; }
}

/* ============================
   CARDS / STATS
============================ */
.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
}
.stat-icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-icon.red   { background: var(--red-soft);            color: var(--red); }
.stat-icon.gold  { background: rgba(245,158,11,0.1);        color: var(--gold); }
.stat-icon.green { background: rgba(16,185,129,0.1);        color: var(--green); }
.stat-icon.steel { background: rgba(74,85,104,0.1);          color: var(--steel); }
.stat-value { font-size: 22px; font-weight: 800; color: var(--carbon); line-height: 1.1; }
.stat-value a { color: inherit; }
.stat-label { font-size: 12px; color: var(--steel); margin-top: 2px; }

.admin-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.admin-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid #EEF1F5;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-card-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--carbon);
  margin: 0;
}
.admin-card-body { padding: 20px; }

/* ============================
   BUTTONS
============================ */
.btn-brand {
  background: var(--red);
  color: var(--white);
  font-weight: 700;
  font-size: 14px;
  padding: 11px 24px;
  border-radius: 8px;
  border: none;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(232,43,31,0.3);
}
.btn-brand:hover { background: var(--red-dark); color: var(--white); transform: translateY(-1px); }

.btn-outline-brand {
  background: transparent;
  color: var(--carbon);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 8px;
  border: 1.5px solid #E2E8F0;
  transition: all .2s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-outline-brand:hover { border-color: var(--red); color: var(--red); }

/* ============================
   FORMS
============================ */
.admin-body .form-control, .admin-body .form-select {
  font-size: 14px;
  padding: 10px 14px;
  border: 1.5px solid #E2E8F0;
  border-radius: 8px;
  color: var(--carbon);
  transition: border-color .2s, box-shadow .2s;
}
.admin-body .form-control:focus, .admin-body .form-select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(232,43,31,0.1);
  outline: none;
}
.admin-body .form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--steel);
  text-transform: uppercase;
  letter-spacing: .4px;
  margin-bottom: 6px;
}

/* ============================
   TABLES
============================ */
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.admin-table thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  color: var(--ash);
  padding: 10px 14px;
  border-bottom: 1.5px solid #EEF1F5;
  white-space: nowrap;
}
.admin-table tbody td {
  padding: 12px 14px;
  border-bottom: 1px solid #F1F5F9;
  color: var(--carbon);
  vertical-align: middle;
}
.admin-table tbody tr:hover { background: var(--fog); }

/* ============================
   BADGES
============================ */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}
.badge-status.pending   { background: rgba(245,158,11,0.12); color: var(--gold); }
.badge-status.completed { background: rgba(16,185,129,0.12); color: var(--green); }
.badge-status.red       { background: var(--red-soft);       color: var(--red); }

/* ============================
   ALERTS (used by session Validate())
============================ */
.admin-body .alert {
  border: none;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 16px;
}
.admin-body .alert-danger  { background: var(--red-soft); color: var(--red-dark); }
.admin-body .alert-success { background: rgba(16,185,129,0.1); color: #087f5b; }

/* ============================
   MODALS (Bootstrap 5)
============================ */
.admin-body .modal-content { border: none; border-radius: var(--radius); overflow: hidden; }
.admin-body .modal-header {
  background: var(--carbon);
  color: var(--white);
  border: none;
  padding: 18px 22px;
}
.admin-body .modal-title { font-weight: 700; font-size: 16px; }
.admin-body .modal-body { padding: 22px; }
.admin-body .modal-footer { border-top: 1px solid #EEF1F5; padding: 16px 22px; }

/* ============================
   UTIL
============================ */
.text-brand { color: var(--red) !important; }
.scrollbar-thin::-webkit-scrollbar { width: 6px; }
.scrollbar-thin::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }
