:root {
  --background: #0a0a0c;
  --foreground: #ededed;
  --accent: #7c3aed; /* Dark purple accent */
  --accent-secondary: #4c1d95; /* Deep purple */
  --card-bg: rgba(26, 26, 30, 0.6);
  --card-border: rgba(255, 255, 255, 0.1);
  --sidebar-bg: #111114;
  --text-muted: #a1a1aa;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

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

html, body {
  max-width: 100vw;
  overflow-x: hidden;
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
}

a { color: inherit; text-decoration: none; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--background); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ---- Layout ---- */
.dashboard-container { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--card-border);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
}

.main-content { flex: 1; margin-left: 260px; padding: 2.5rem; }

.glass-panel {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.solar-glow { box-shadow: 0 0 30px rgba(124, 58, 237, 0.04); }

.gradient-text {
  background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---- Sidebar ---- */
.sidebar-header { margin-bottom: 3rem; }
.sidebar-title { font-size: 1.5rem; font-weight: bold; }
.sidebar-subtitle { color: var(--text-muted); font-size: 0.8rem; }
.sidebar-footer { margin-top: auto; padding-top: 2rem; border-top: 1px solid var(--card-border); }
.sidebar-user { display: flex; align-items: center; gap: 0.75rem; }
.sidebar-user-avatar { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(45deg, var(--accent), var(--accent-secondary)); }
.sidebar-user-name { font-size: 0.9rem; font-weight: 500; }
.sidebar-user-role { font-size: 0.7rem; color: var(--text-muted); }

.nav-list { display: flex; flex-direction: column; gap: 0.5rem; }
.nav-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem; border-radius: 8px;
  color: var(--foreground); transition: all 0.2s ease; font-size: 0.9rem;
}
.nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--accent); }
.nav-item.active { color: var(--accent); background: rgba(124, 58, 237, 0.1); }

.btn-logout {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem; border-radius: 8px;
  background: rgba(239, 68, 68, 0.05); border: 1px solid rgba(239, 68, 68, 0.1);
  color: #ef4444; cursor: pointer; font-size: 0.85rem; font-weight: 500;
  transition: all 0.2s ease; width: 100%;
}
.btn-logout:hover { background: rgba(239, 68, 68, 0.1); border-color: #ef4444; }

/* ---- Utilities ---- */
.flex-column { display: flex; flex-direction: column; }
.flex-row { display: flex; flex-direction: row; }
.flex-between { justify-content: space-between; }
.flex-center { align-items: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

.gap-sm { gap: 0.5rem; } .gap-md { gap: 1rem; } .gap-lg { gap: 1.5rem; } .gap-xl { gap: 2.5rem; }
.mb-sm { margin-bottom: 0.5rem; } .mb-md { margin-bottom: 1rem; } .mb-lg { margin-bottom: 1.5rem; }
.mt-sm { margin-top: 0.5rem; } .mt-md { margin-top: 1rem; } .mt-xl { margin-top: 2.5rem; } .mt-auto { margin-top: auto; }

.text-muted { color: var(--text-muted); }
.text-accent { color: var(--accent); }
.text-red { color: #ef4444; }
.text-sm { font-size: 0.85rem; } .text-xs { font-size: 0.75rem; }
.text-center { text-align: center; } .text-right { text-align: right; }
.font-bold { font-weight: bold; } .font-semibold { font-weight: 600; }
.font-mono { font-family: monospace; }
.uppercase { text-transform: uppercase; }
.cursor-pointer { cursor: pointer; }
.relative { position: relative; }
.w-full { width: 100%; }
.border-bottom { border-bottom: 1px solid var(--card-border); }

.p-sm { padding: 0.75rem; } .p-md { padding: 1rem; } .p-lg { padding: 1.5rem; } .p-xl { padding: 2rem; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; }
.grid-main-side { display: grid; grid-template-columns: 1.5fr 1fr; }
.grid-overview { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.grid-cols-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }
.grid-logs { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.5fr 100px; align-items: center; }

/* ---- Cards / components ---- */
.profile-avatar-large {
  width: 100px; height: 100px; border-radius: 24px;
  background: linear-gradient(45deg, #111, #333);
  display: flex; align-items: center; justify-content: center; font-size: 2.5rem;
  overflow: hidden;
}
.profile-avatar-large img { width: 100%; height: 100%; object-fit: cover; }

.badge { background: rgba(255, 255, 255, 0.05); padding: 4px 12px; border-radius: 8px; font-size: 0.75rem; font-weight: 500; border: 1px solid var(--card-border); }
.badge-rank { background: rgba(124, 58, 237, 0.1); color: var(--accent); border-radius: 20px; font-weight: 600; font-size: 0.8rem; }

.mini-stat { padding: 1rem; background: rgba(0, 0, 0, 0.2); border-radius: 12px; text-align: center; }
.note-item { padding: 1rem; background: rgba(255, 255, 255, 0.02); border-radius: 12px; border: 1px solid var(--card-border); }
.penalty-item { border-left: 3px solid #ef4444; padding-left: 1rem; }

.risk-bar-bg { height: 4px; width: 80px; background: #333; border-radius: 2px; overflow: hidden; }
.risk-bar-fill { height: 100%; }

.btn-detail { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--card-border); padding: 4px 8px; border-radius: 4px; font-size: 0.7rem; color: var(--text-muted); cursor: pointer; }

.form-input {
  width: 100%; background: rgba(0, 0, 0, 0.2); border: 1px solid var(--card-border);
  border-radius: 8px; padding: 10px 14px; color: var(--foreground); font-size: 0.9rem;
  outline: none; transition: border 0.2s ease; font-family: monospace;
}
.form-input:focus { border-color: var(--accent); }

.btn-primary { width: 100%; background: var(--accent); border: none; color: #fff; padding: 12px; border-radius: 8px; font-weight: bold; cursor: pointer; transition: transform 0.2s ease; }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---- Stat cards ---- */
.stat-card { padding: 1.5rem; flex: 1; min-width: 200px; }
.stat-trend { font-size: 0.75rem; padding: 2px 8px; border-radius: 12px; }
.stat-trend.up { color: #10b981; background: rgba(16, 185, 129, 0.1); }
.stat-trend.down { color: #ef4444; background: rgba(239, 68, 68, 0.1); }

/* ---- Staff table ---- */
.staff-table { width: 100%; border-collapse: collapse; text-align: left; }
.th-style { padding: 1rem; color: var(--text-muted); font-size: 0.85rem; font-weight: 500; }
.td-style { padding: 1.25rem 1rem; font-size: 0.9rem; }
.staff-avatar { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--card-border); object-fit: cover; }
.staff-avatar-placeholder { width: 40px; height: 40px; border-radius: 12px; background: #333; display: flex; align-items: center; justify-content: center; }
.status-indicator { position: absolute; bottom: -2px; right: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--sidebar-bg); }
.status-indicator.active { background: #10b981; }
.status-indicator.vacation { background: #f59e0b; }
.status-indicator.deleted { background: #666; }
.status-text { font-size: 0.85rem; text-transform: capitalize; }
.status-text.active { color: #10b981; }
.status-text.vacation { color: #f59e0b; }
.status-text.deleted { color: #666; }
.dept-badge { background: rgba(255, 255, 255, 0.05); padding: 4px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: bold; border: 1px solid var(--card-border); color: var(--accent); }
.custom-select { background: var(--sidebar-bg); border: 1px solid var(--card-border); color: var(--foreground); padding: 6px 12px; border-radius: 8px; font-size: 0.85rem; outline: none; cursor: pointer; }
.btn-secondary { background: rgba(255, 255, 255, 0.05); border: 1px solid var(--card-border); color: var(--foreground); padding: 6px 12px; border-radius: 6px; cursor: pointer; font-size: 0.8rem; transition: all 0.2s ease; text-decoration: none; }
.btn-secondary:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--accent); }
.empty-state { text-align: center; padding: 3rem; color: var(--text-muted); }

/* ---- Login ---- */
.login-container { height: 100vh; width: 100vw; display: flex; align-items: center; justify-content: center; background: radial-gradient(circle at center, #2a1245 0%, #0a0a0c 100%); }
.login-card { width: 100%; max-width: 420px; animation: slideUp 0.6s ease-out; }
.error-message { background: rgba(239, 68, 68, 0.1); color: #ef4444; padding: 10px; border-radius: 8px; font-size: 0.85rem; text-align: center; border: 1px solid rgba(239, 68, 68, 0.2); }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Placeholder bar chart fallback ---- */
.bars { height: 200px; width: 100%; background: linear-gradient(to bottom, transparent, rgba(124,58,237,0.05)); border-bottom: 2px solid var(--accent); display: flex; align-items: flex-end; justify-content: space-around; padding: 0 1rem; }
.bars > div { width: 30px; background: var(--accent); border-radius: 4px 4px 0 0; }

@media (max-width: 900px) {
  .grid-main-side, .grid-overview, .grid-2 { grid-template-columns: 1fr; }
  .sidebar { position: relative; width: 100%; height: auto; }
  .main-content { margin-left: 0; }
  .dashboard-container { flex-direction: column; }
}
