/* =========================================================================
   SSH ATTENDANCE APP — PREMIUM RED & CRIMSON DARK THEME SYSTEM
   ========================================================================= */

:root {
  --color-bg-dark: #0a0407;
  --color-card-bg: rgba(26, 10, 15, 0.78);
  --color-card-border: rgba(255, 42, 75, 0.12);
  
  /* Red Theme Palette */
  --color-primary: #ff2a4b;
  --color-secondary: #ff5252;
  --color-accent: #d32f2f;
  --color-accent-pink: #ff1744;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;

  --text-primary: #ffffff;
  --text-muted: #fda4af;
  --text-subtle: #9f1239;

  /* Red Gradients */
  --grad-primary: linear-gradient(135deg, #ff2a4b 0%, #991b1b 100%);
  --grad-accent: linear-gradient(135deg, #ff1744 0%, #d32f2f 100%);
  --grad-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --grad-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --grad-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);

  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* Base resets & typography */
html {
  background-color: var(--color-bg-dark);
  color: var(--text-primary);
  font-family: var(--font-body);
}

/* Background Glowing Orbs - Crimson Red */
.glow-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(140px);
  pointer-events: none;
  z-index: 1;
  opacity: 0.28;
}

.glow-orb-1 {
  width: 500px; height: 500px;
  background: #ff2a4b;
  top: -100px; left: -100px;
}

.glow-orb-2 {
  width: 600px; height: 600px;
  background: #991b1b;
  bottom: -150px; right: -150px;
}

.glow-orb-3 {
  width: 400px; height: 400px;
  background: #ff1744;
  top: 40%; left: 40%;
}

.bg-grid {
  position: fixed;
  inset: 0;
  background-image: 
    linear-gradient(rgba(255, 42, 75, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 42, 75, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 2;
}

/* =========================================================================
   SIDEBAR & LAYOUT
   ========================================================================= */
.admin-layout {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 10;
}

.admin-sidebar {
  width: 270px;
  background: rgba(18, 6, 10, 0.95);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 42, 75, 0.15);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; bottom: 0; left: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.5rem 1.25rem;
  border-bottom: 1px solid rgba(255, 42, 75, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-logo .logo-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading);
  font-weight: 900; font-size: 1.1rem; color: #ffffff;
  box-shadow: 0 4px 16px rgba(255, 42, 75, 0.4);
}

.sidebar-logo .logo-text {
  font-family: var(--font-heading);
  font-weight: 800; font-size: 1.1rem; color: #ffffff;
}

.sidebar-logo .logo-text span {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-badge {
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  background: rgba(255, 42, 75, 0.15); color: #ff4d6d;
  border: 1px solid rgba(255, 42, 75, 0.3);
  padding: 0.2rem 0.6rem; border-radius: 50px; align-self: flex-start;
}

.sidebar-nav {
  flex: 1; padding: 1.25rem 0.85rem;
  display: flex; flex-direction: column; gap: 0.25rem;
}

.sidebar-section-label {
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em;
  color: rgba(253, 164, 175, 0.4); padding: 0.5rem 0.75rem 0.25rem;
}

.sidebar-nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 0.9rem; border-radius: 12px;
  color: rgba(255, 255, 255, 0.7); font-size: 0.88rem; font-weight: 600;
  text-decoration: none; transition: all 0.2s ease;
}

.sidebar-nav-item:hover {
  background: rgba(255, 42, 75, 0.08); color: #ffffff;
}

.sidebar-nav-item.active {
  background: var(--grad-primary);
  color: #ffffff; font-weight: 800;
  box-shadow: 0 8px 20px rgba(255, 42, 75, 0.35);
}

.sidebar-nav-icon { font-size: 1.1rem; }

.sidebar-footer {
  padding: 1.25rem; border-top: 1px solid rgba(255, 42, 75, 0.12);
  display: flex; flex-direction: column; gap: 0.85rem;
}

.sidebar-user-info { display: flex; align-items: center; gap: 0.75rem; }

.sidebar-avatar {
  width: 38px; height: 38px; border-radius: 50%;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; color: #ffffff; font-size: 1rem;
}

.sidebar-user-name { font-size: 0.88rem; font-weight: 700; color: #ffffff; }
.sidebar-user-role { font-size: 0.72rem; color: var(--text-muted); }

.btn-logout {
  width: 100%; padding: 0.6rem;
  background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171; border-radius: 10px; font-size: 0.82rem; font-weight: 700;
  cursor: pointer; transition: all 0.2s ease;
}
.btn-logout:hover { background: rgba(239, 68, 68, 0.25); }

/* =========================================================================
   MAIN TOPBAR & CONTENT
   ========================================================================= */
.admin-main {
  flex: 1; margin-left: 270px;
  display: flex; flex-direction: column; min-width: 0;
}

.admin-topbar {
  height: 70px;
  background: rgba(18, 6, 10, 0.8);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 42, 75, 0.15);
  padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 90;
}

.admin-topbar-title {
  font-family: var(--font-heading); font-size: 1.35rem; font-weight: 800; color: #ffffff;
}

.admin-content { padding: 2rem; flex: 1; }
.admin-section { display: none; }
.admin-section.active { display: block; }

.section-actions-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 1.5rem; gap: 1rem;
}

.section-actions-bar h2 {
  font-family: var(--font-heading); font-size: 1.4rem; font-weight: 800; color: #ffffff;
}

.section-actions-bar h2 span {
  background: var(--grad-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* =========================================================================
   TABLES & CARDS
   ========================================================================= */
.admin-table-wrapper {
  background: var(--color-card-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--color-card-border);
  border-radius: 20px; overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

.admin-table-scroll { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; text-align: left; }

.admin-table th {
  padding: 1rem 1.25rem; font-size: 0.75rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(255, 42, 75, 0.12);
  background: rgba(10, 4, 7, 0.6); white-space: nowrap;
}

.admin-table td {
  padding: 1rem 1.25rem; font-size: 0.88rem; color: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(255, 42, 75, 0.05); vertical-align: middle;
}

.admin-table tr:hover td { background: rgba(255, 42, 75, 0.03); }

.filter-bar { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.filter-bar input, .filter-bar select, .filter-bar button {
  background: rgba(10, 4, 7, 0.8);
  border: 1px solid rgba(255, 42, 75, 0.2);
  border-radius: 10px; padding: 0.6rem 1rem; font-size: 0.85rem; color: #ffffff;
  outline: none; font-family: inherit;
}
.filter-bar input:focus, .filter-bar select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 12px rgba(255, 42, 75, 0.25);
}

/* =========================================================================
   STAT CARDS & CHARTS
   ========================================================================= */
.stats-grid-8 {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; margin-bottom: 2rem;
}
@media (max-width: 1200px) { .stats-grid-8 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .stats-grid-8 { grid-template-columns: 1fr; } }

.stat-card-v2 {
  background: var(--color-card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--color-card-border);
  border-radius: 18px; padding: 1.25rem 1.5rem;
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 1.25rem;
}

.stat-card-v2::before {
  content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%;
  background: var(--grad-primary);
}

.stat-card-v2.card-green::before { background: var(--grad-success); }
.stat-card-v2.card-pink::before { background: var(--grad-accent); }
.stat-card-v2.card-warning::before { background: var(--grad-warning); }
.stat-card-v2.card-danger::before { background: var(--grad-danger); }

.stat-icon-v2 {
  width: 48px; height: 48px; border-radius: 14px;
  background: rgba(255, 42, 75, 0.1);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; flex-shrink: 0;
}

.stat-info-v2 .stat-num {
  font-family: var(--font-heading); font-size: 1.75rem; font-weight: 800; color: #ffffff; line-height: 1.1;
}

.stat-info-v2 .stat-txt {
  font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-muted); margin-top: 0.25rem;
}

.charts-grid-2x2 {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; margin-bottom: 2rem;
}
@media (max-width: 992px) { .charts-grid-2x2 { grid-template-columns: 1fr; } }

.chart-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: 20px; padding: 1.5rem;
  display: flex; flex-direction: column;
}

.chart-card-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.25rem;
}

.chart-title { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; color: #fff; }
.chart-subtitle { font-size: 0.78rem; color: var(--text-muted); }

.chart-body {
  flex: 1; display: flex; align-items: center; justify-content: center;
  min-height: 220px; position: relative;
}

/* =========================================================================
   BADGES & MODULE CARDS
   ========================================================================= */
.skill-tag {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: rgba(255, 42, 75, 0.1); border: 1px solid rgba(255, 42, 75, 0.25);
  color: #ff4d6d; padding: 0.25rem 0.65rem; border-radius: 50px;
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
}

.badge-status {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.3rem 0.75rem; border-radius: 50px; font-size: 0.75rem; font-weight: 700;
}

.badge-approved  { background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.3); color: var(--color-success); }
.badge-pending   { background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.3); color: var(--color-warning); }
.badge-rejected  { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.3); color: var(--color-danger); }
.badge-present   { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.badge-absent    { background: rgba(239, 68, 68, 0.15); color: #f87171; }

.cards-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
@media (max-width: 1100px) { .cards-grid-3 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 700px)  { .cards-grid-3 { grid-template-columns: 1fr; } }

.module-card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: 18px; padding: 1.5rem;
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 1rem; position: relative; transition: all 0.25s ease;
}

.module-card:hover {
  border-color: rgba(255, 42, 75, 0.35);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(255, 42, 75, 0.12);
}

.module-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem; }
.module-card-title { font-family: var(--font-heading); font-size: 1.15rem; font-weight: 800; color: #fff; }
.module-card-sub { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.2rem; }

.module-card-body { display: flex; flex-direction: column; gap: 0.6rem; font-size: 0.85rem; }
.info-row { display: flex; align-items: center; justify-content: space-between; padding: 0.4rem 0; border-bottom: 1px dashed rgba(255, 42, 75, 0.1); }
.info-row:last-child { border-bottom: none; }
.info-key { color: var(--text-muted); font-size: 0.78rem; }
.info-val { color: #ffffff; font-weight: 600; text-align: right; }

.work-report-card {
  background: var(--color-card-bg); border: 1px solid var(--color-card-border);
  border-radius: 16px; padding: 1.25rem; display: flex; gap: 1.25rem; align-items: flex-start;
}
.work-report-content { flex: 1; }

.btn-sm-action {
  padding: 0.4rem 0.75rem; border-radius: 8px; font-size: 0.78rem; font-weight: 700;
  cursor: pointer; border: none; transition: all 0.2s ease; display: inline-flex; align-items: center; gap: 0.3rem;
}
.btn-approve { background: rgba(16, 185, 129, 0.15); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.btn-approve:hover { background: var(--color-success); color: #fff; }
.btn-reject { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.btn-reject:hover { background: var(--color-danger); color: #fff; }

.glass-panel {
  background: var(--color-card-bg); backdrop-filter: blur(20px);
  border: 1px solid var(--color-card-border); border-radius: 20px; padding: 1.5rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

/* =========================================================================
   RED THEME LOGIN PAGE
   ========================================================================= */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 2rem 1rem; position: relative; z-index: 10;
}

.login-card {
  width: 100%; max-width: 440px;
  background: rgba(18, 6, 10, 0.88);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 42, 75, 0.2);
  border-radius: 24px; padding: 2.5rem 2.25rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.6), 0 0 50px rgba(255, 42, 75, 0.15);
  display: flex; flex-direction: column; gap: 1.5rem;
}

.login-logo { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }

.login-logo .logo-icon {
  width: 46px; height: 46px; border-radius: 12px;
  background: var(--grad-primary);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-heading); font-weight: 900; font-size: 1.3rem; color: #ffffff;
  box-shadow: 0 8px 20px rgba(255, 42, 75, 0.4);
}

.login-logo .logo-text {
  font-family: var(--font-heading); font-weight: 800; font-size: 1.4rem; color: #ffffff;
}

.login-logo .logo-text span {
  background: var(--grad-primary);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

.login-header { text-align: center; }
.login-header h1 { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 800; color: #ffffff; margin-bottom: 0.35rem; }
.login-header p { font-size: 0.875rem; color: var(--text-muted); }

.login-form { display: flex; flex-direction: column; gap: 1.25rem; }
.login-form-group { display: flex; flex-direction: column; gap: 0.4rem; }
.login-form-group label { font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }

.input-wrapper {
  position: relative; display: flex; align-items: center;
  background: rgba(10, 4, 7, 0.8);
  border: 1px solid rgba(255, 42, 75, 0.2);
  border-radius: 12px; padding: 0 0.85rem;
}

.input-wrapper:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 16px rgba(255, 42, 75, 0.3);
}

.input-icon { font-size: 1.1rem; margin-right: 0.65rem; opacity: 0.7; }
.input-wrapper input {
  width: 100%; padding: 0.85rem 0; background: transparent; border: none;
  color: #ffffff; font-size: 0.95rem; outline: none; font-family: inherit;
}

.toggle-password { background: transparent; border: none; cursor: pointer; font-size: 1.1rem; padding: 0.2rem; opacity: 0.7; }

.login-error {
  background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 10px; padding: 0.75rem 1rem; color: #f87171; font-size: 0.85rem; font-weight: 600; text-align: center;
}

.login-btn {
  width: 100%; padding: 0.95rem 1.5rem; border: none; border-radius: 12px;
  background: var(--grad-primary); color: #ffffff; font-size: 0.95rem; font-weight: 800;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  box-shadow: 0 8px 24px rgba(255, 42, 75, 0.35); margin-top: 0.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
}

.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(255, 42, 75, 0.5);
}

.login-divider {
  display: flex; align-items: center; text-align: center; font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.08em; color: rgba(253, 164, 175, 0.4);
}

.login-divider::before, .login-divider::after { content: ''; flex: 1; border-bottom: 1px solid rgba(255, 42, 75, 0.12); }
.login-divider::before { margin-right: 0.75rem; }
.login-divider::after { margin-left: 0.75rem; }

.login-footer { text-align: center; font-size: 0.78rem; color: var(--text-muted); }

/* ================= RESPONSIVE MOBILE & TABLET MENU ================= */
.mobile-nav-toggle {
  display: none;
  background: rgba(255, 42, 75, 0.15);
  border: 1px solid rgba(255, 42, 75, 0.3);
  color: #ffffff;
  border-radius: 10px;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: pointer;
  align-items: center;
  gap: 0.4rem;
}

.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(6, 4, 7, 0.75);
  backdrop-filter: blur(8px);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

@media (max-width: 1024px) {
  .mobile-nav-toggle { display: inline-flex !important; }
  .admin-main { margin-left: 0 !important; }
  
  .admin-sidebar {
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    z-index: 101 !important;
    box-shadow: 10px 0 40px rgba(0, 0, 0, 0.8) !important;
  }

  .admin-sidebar.sidebar-open {
    transform: translateX(0) !important;
  }

  .mobile-overlay.overlay-open {
    display: block !important;
    opacity: 1 !important;
  }
}

