/* ===== HIGH-OCTANE DYNAMISM ===== */
@keyframes pde-scan {
  0% { top: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

.pde-scanner {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-red), transparent);
  box-shadow: 0 0 10px var(--accent-red);
  z-index: 10;
  pointer-events: none;
  animation: pde-scan 4s linear infinite;
}

.staggered-item {
  animation: fadeUp 0.5s ease backwards;
}

.staggered-item:nth-child(1) { animation-delay: 0.1s; }
.staggered-item:nth-child(2) { animation-delay: 0.2s; }
.staggered-item:nth-child(3) { animation-delay: 0.3s; }
.staggered-item:nth-child(4) { animation-delay: 0.4s; }
.staggered-item:nth-child(5) { animation-delay: 0.5s; }
@keyframes heartbeat {
  0% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0.6; transform: scale(1); }
}

@keyframes pulse-red {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.pulse-red {
  animation: pulse-red 2s infinite;
}
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;700;800&display=swap');

:root {
  --bg-primary: #0A0F1E;
  --bg-secondary: #0F172A;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-card2: rgba(51, 65, 85, 0.4);
  --accent-gold: #F59E0B;
  --accent-gold-light: #FCD34D;
  --accent-blue: #38BDF8;
  --accent-blue-dark: #0EA5E9;
  --accent-green: #10B981;
  --accent-red: #EF4444;
  --accent-purple: #8B5CF6;
  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;
  --border: rgba(255, 255, 255, 0.08);
  --border-gold: rgba(245, 158, 11, 0.3);
  --shadow: 0 8px 32px rgba(0,0,0,0.4);
  --shadow-gold: 0 4px 24px rgba(245,158,11,0.2);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --sidebar-w: 260px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --glass: blur(16px) saturate(180%) contrast(110%);
  --margin-x: 60px;
}

/* ===== SHARED UI COMPONENTS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}
.stat-card:hover {
  border-color: rgba(245, 158, 11, 0.3);
  transform: translateY(-2px);
}
.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}
.stat-info { flex: 1; }
.stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  line-height: 1.2;
}
.stat-label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }

@media (max-width: 1024px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

.live-clock-container {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 0 16px;
  border-right: 1px solid var(--border);
  margin-right: 12px;
  line-height: 1.2;
}
.clock-date {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}
.clock-time {
  font-size: 15px;
  font-family: 'Outfit', sans-serif;
  color: var(--accent-blue);
  font-weight: 700;
}

/* ===== LIGHT MODE ===== */
[data-theme-light] {
  --bg-primary: #F0F4F8;
  --bg-secondary: #E2EAF4;
  --bg-card: #FFFFFF;
  --bg-card2: #F8FAFC;
  --text-primary: #1E293B;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --border: rgba(14, 165, 233, 0.18);
  --border-gold: rgba(245, 158, 11, 0.35);
  --shadow: 0 8px 32px rgba(0,0,0,0.1);
}
[data-theme-light] body { background: var(--bg-primary); }
[data-theme-light] .login-bg {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(14,165,233,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(245,158,11,0.06) 0%, transparent 50%),
    linear-gradient(135deg, #E8F0FE 0%, #F0F4F8 50%, #EAF2FB 100%);
}
[data-theme-light] .topbar {
  background: rgba(240,244,248,0.95);
  border-bottom-color: var(--border);
}
[data-theme-light] .sidebar { box-shadow: 2px 0 20px rgba(0,0,0,0.08); }


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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

h1,h2,h3,h4,h5 { font-family: 'Outfit', sans-serif; }

.hidden { display: none !important; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--accent-blue-dark); border-radius: 3px; }

/* ===== LOGIN SCREEN ===== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-bg {
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(14,165,233,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(245,158,11,0.1) 0%, transparent 50%),
    linear-gradient(135deg, #060d1a 0%, #0A1628 50%, #0d1e35 100%);
  z-index: 0;
}

.login-bg::after {
  content: '';
  position: fixed; inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 60px, rgba(56,189,248,0.04) 60px, rgba(56,189,248,0.04) 61px),
    repeating-linear-gradient(90deg, transparent, transparent 60px, rgba(56,189,248,0.04) 60px, rgba(56,189,248,0.04) 61px);
}

.login-card {
  position: relative; z-index: 1;
  background: rgba(19,35,56,0.85);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 44px;
  width: 100%; max-width: 440px;
  box-shadow: var(--shadow), 0 0 60px rgba(56,189,248,0.08);
  animation: fadeUp 0.6s ease;
}

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

.login-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }

.logo-icon {
  width: 52px; height: 52px;
  background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card2));
  border: 1px solid var(--border-gold);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow-gold);
}
.logo-icon svg { width: 100%; height: 100%; }

.login-brand { font-family: 'Outfit', sans-serif; font-size: 26px; font-weight: 800; color: var(--text-primary); letter-spacing: 2px; }
.login-tagline { font-size: 11px; color: var(--accent-gold); font-weight: 500; letter-spacing: 0.5px; margin-top: 2px; }

.login-title { font-size: 24px; font-weight: 700; color: var(--text-primary); margin-bottom: 6px; }
.login-subtitle { font-size: 14px; color: var(--text-secondary); margin-bottom: 32px; }

.login-form { display: flex; flex-direction: column; gap: 18px; }

.form-group { display: flex; flex-direction: column; gap: 7px; }
.form-group label { font-size: 13px; font-weight: 500; color: var(--text-secondary); }
.form-group input, .form-group select, .form-group textarea {
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 14px; font-family: 'Inter', sans-serif;
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--accent-blue);
  background: rgba(56,189,248,0.07);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.12);
}
.form-group input::placeholder { color: var(--text-muted); }
.form-group select option { background: var(--bg-card); color: var(--text-primary); }

.form-row { display: flex; align-items: center; justify-content: space-between; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); cursor: pointer; }
.forgot-link { font-size: 13px; color: var(--accent-blue); text-decoration: none; }
.forgot-link:hover { color: var(--accent-gold); }

.btn-login {
  background: linear-gradient(135deg, var(--accent-gold), #D97706);
  border: none; border-radius: var(--radius-sm);
  padding: 13px; font-size: 15px; font-weight: 700;
  font-family: 'Outfit', sans-serif;
  color: #0A1628; cursor: pointer;
  transition: var(--transition);
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-gold);
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 32px rgba(245,158,11,0.35); }
.btn-login:active { transform: translateY(0); }

.login-footer { text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 24px; }

/* ===== WORKFLOW COMMAND CENTER ===== */
.workflow-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-primary);
}

.workflow-btn:hover {
  background: rgba(56, 189, 248, 0.08);
  border-color: var(--accent-blue);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.workflow-icon {
  font-size: 20px;
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
}

.workflow-btn:hover .workflow-icon {
  background: var(--accent-blue);
  color: #0A1628;
}

/* ===== SECURITY UI ===== */
.login-error-banner {
  background: rgba(239,68,68,0.12);
  border: 1px solid rgba(239,68,68,0.35);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px; font-weight: 500;
  color: var(--accent-red);
  margin-bottom: 16px;
  animation: fadeUp 0.25s ease;
}
.login-attempts-warn {
  background: rgba(245,158,11,0.1);
  border: 1px solid rgba(245,158,11,0.25);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 12px; font-weight: 500;
  color: var(--accent-gold);
  margin-bottom: 8px;
}
.password-wrap {
  position: relative; display: flex; align-items: center;
}
.password-wrap input { flex: 1; padding-right: 44px; }
.pwd-toggle {
  position: absolute; right: 12px;
  background: none; border: none; cursor: pointer;
  font-size: 16px; color: var(--text-muted);
  transition: var(--transition); padding: 0;
  line-height: 1;
}
.pwd-toggle:hover { color: var(--accent-blue); }

/* Shake animation for failed login */
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%      { transform: translateX(-10px); }
  40%      { transform: translateX(10px); }
  60%      { transform: translateX(-8px); }
  80%      { transform: translateX(8px); }
}
.shake { animation: shake 0.5s ease; }

/* Session timer */
.session-timer {
  display: flex; align-items: center; gap: 6px;
  background: rgba(16,185,129,0.1);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: 99px; padding: 4px 12px;
  font-size: 12px; font-weight: 700;
  color: var(--accent-green);
  transition: var(--transition);
  white-space: nowrap;
}
.session-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-green);
  animation: pulse 2s infinite;
}
.session-timer.session-warning {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.25);
  color: var(--accent-red);
}
.session-timer.session-warning .session-dot { background: var(--accent-red); }
@keyframes pulse {
  0%,100% { opacity: 1; } 50% { opacity: 0.3; }
}

/* ===== APP LAYOUT ===== */
.app {
  display: flex; height: 100vh; overflow: hidden;
}

.main-content {
  margin-left: var(--sidebar-w);
  height: 100vh;
  overflow-y: auto;
  padding: 0;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
}

.module {
  padding: 40px var(--margin-x) 80px var(--margin-x);
  display: none;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}
.module.active { display: block; }

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 2px; flex-wrap: wrap; gap: 8px;
  margin-top: 0;
}
.page-title { font-size: 20px; font-weight: 700; color: var(--text-primary); line-height: 1.1; }
.page-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  backdrop-filter: var(--glass);
  -webkit-backdrop-filter: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: var(--transition);
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.card-title { font-size: 16px; font-weight: 600; color: var(--text-primary); }

/* ===== STATS GRID ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 16px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex; align-items: center; gap: 18px;
  position: relative; overflow: hidden;
  transition: var(--transition);
}
.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: var(--stat-color, var(--accent-blue));
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(56,189,248,0.3); }

.stat-icon {
  width: 52px; height: 52px;
  background: rgba(56,189,248,0.1);
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-info { flex: 1; }
.stat-value { font-size: 28px; font-weight: 800; font-family: 'Outfit', sans-serif; color: var(--text-primary); }
.stat-label { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.stat-change { font-size: 12px; font-weight: 600; margin-top: 6px; }
.stat-change.up { color: var(--accent-green); }
.stat-change.down { color: var(--accent-red); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; font-family: 'Inter', sans-serif;
  cursor: pointer; border: none; transition: var(--transition);
  text-decoration: none; white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-gold), #D97706);
  color: #0A1628;
  box-shadow: 0 4px 16px rgba(245,158,11,0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(245,158,11,0.35); }
.btn-secondary {
  background: rgba(56,189,248,0.1);
  color: var(--accent-blue); border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(56,189,248,0.18); }
.btn-danger { background: rgba(239,68,68,0.15); color: var(--accent-red); border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-sm { padding: 6px 14px; font-size: 12px; }

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; }
table {
  width: 100%; border-collapse: collapse;
  font-size: 14px;
}
thead th {
  text-align: left; padding: 12px 16px;
  font-size: 12px; font-weight: 600;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
}
tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(56,189,248,0.06);
  color: var(--text-secondary);
  vertical-align: middle;
}
tbody tr:hover td { background: rgba(56,189,248,0.04); color: var(--text-primary); }
tbody tr:last-child td { border-bottom: none; }

/* ===== BADGE ===== */
.badge {
  display: inline-flex; align-items: center;
  padding: 4px 10px; border-radius: 99px;
  font-size: 11px; font-weight: 600; letter-spacing: 0.3px;
}
.badge-green { background: rgba(16,185,129,0.15); color: var(--accent-green); }
.badge-red { background: rgba(239,68,68,0.15); color: var(--accent-red); }
.badge-blue { background: rgba(56,189,248,0.15); color: var(--accent-blue); }
.badge-gold { background: rgba(245,158,11,0.15); color: var(--accent-gold); }
.badge-purple { background: rgba(139,92,246,0.15); color: var(--accent-purple); }

/* ===== GRID LAYOUTS ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }

/* ===== WIDGET PANEL (Dashboard customizer) ===== */
.widget-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  animation: fadeUp 0.25s ease;
}
.widget-panel-title {
  font-size: 13px; font-weight: 700;
  color: var(--accent-gold); margin-bottom: 14px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.widget-toggles {
  display: flex; flex-wrap: wrap; gap: 12px;
}
.widget-toggle-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary);
  cursor: pointer; padding: 6px 12px;
  background: var(--bg-card2); border-radius: var(--radius-sm);
  border: 1px solid var(--border); transition: var(--transition);
}
.widget-toggle-item:hover { border-color: var(--accent-gold); color: var(--text-primary); }
.widget-toggle-item input[type="checkbox"] { accent-color: var(--accent-gold); width: 14px; height: 14px; }

/* ===== BAR CHART TOOLTIP ===== */
.bar-tooltip {
  position: fixed; z-index: 9999;
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-size: 12px; color: var(--text-primary);
  box-shadow: var(--shadow);
  pointer-events: none; display: none;
  white-space: nowrap;
  animation: fadeUp 0.15s ease;
}

/* ===== SEARCH / FILTER BAR ===== */
.toolbar {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 16px; flex-wrap: wrap;
}
.search-input {
  flex: 1; min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  font-size: 14px; font-family: 'Inter', sans-serif;
  color: var(--text-primary); outline: none;
  transition: var(--transition);
}
.search-input:focus { border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(56,189,248,0.12); }
.search-input::placeholder { color: var(--text-muted); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(6,13,26,0.8);
  backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp { from { opacity:0; transform:translateY(20px); } to { opacity:1; transform:translateY(0); } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 24px;
}
.modal-title { font-size: 20px; font-weight: 700; }
.modal-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 20px;
  transition: var(--transition); padding: 4px;
}
.modal-close:hover { color: var(--accent-red); }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }

/* ===== TOPBAR ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 var(--margin-x);
  height: 48px;
  background: rgba(10, 22, 40, 0.85);
  backdrop-filter: var(--glass);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.topbar-search {
  flex: 1;
  max-width: 400px;
  min-width: 150px;
  position: relative; display: flex; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 8px 14px; gap: 10px;
  transition: var(--transition);
}
.topbar-search:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(56,189,248,0.12);
}
.topbar-search-icon { font-size: 14px; color: var(--text-muted); flex-shrink: 0; }
.topbar-search-input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 14px; font-family: 'Inter', sans-serif;
  color: var(--text-primary);
}
.topbar-search-input::placeholder { color: var(--text-muted); }

/* Search results dropdown */
.global-search-results {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  max-height: 320px; overflow-y: auto; z-index: 200;
}
.search-result-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer;
  transition: var(--transition);
  border-bottom: 1px solid rgba(56,189,248,0.06);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: rgba(56,189,248,0.07); }
.search-result-icon { font-size: 18px; flex-shrink: 0; }
.search-result-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.search-result-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.search-no-results { padding: 20px; text-align: center; color: var(--text-muted); font-size: 13px; }

/* Topbar actions */
.topbar-actions {
  display: flex; align-items: center; gap: 14px; flex-shrink: 0; position: relative;
}
.topbar-btn {
  background: none; border: none; cursor: pointer;
  font-size: 16px; position: relative; padding: 2px;
  transition: var(--transition); color: var(--text-secondary);
}
.topbar-btn:hover { transform: scale(1.1); color: var(--text-primary); }
.notif-badge {
  position: absolute; top: -2px; right: -4px;
  background: var(--accent-red); color: #fff;
  font-size: 9px; font-weight: 700;
  width: 16px; height: 16px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg-primary);
}
.topbar-divider { width: 1px; height: 28px; background: var(--border); }
.topbar-user { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.user-avatar-sm {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-gold), #D97706);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #0A1628; flex-shrink: 0;
}
.topbar-username { font-size: 13px; font-weight: 600; color: var(--text-primary); }

/* Notification panel */
.notif-panel {
  position: absolute; top: calc(100% + 4px); right: 0;
  width: 320px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; z-index: 500;
  animation: slideUp 0.25s ease;
}
.notif-header {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 14px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 14px;
}
.notif-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid rgba(56,189,248,0.06);
}
.notif-item:last-of-type { border-bottom: none; }
.notif-icon { font-size: 20px; flex-shrink: 0; margin-top: 2px; }
.notif-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.notif-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* Chart legend (for topbar charts) */
.chart-legend { display: flex; gap: 14px; align-items: center; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ===== BREADCRUMB ===== */
.topbar-breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--text-muted);
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.bc-home { font-size: 12px; }
.bc-sep  { color: var(--text-muted); opacity: 0.5; }
.bc-current { color: var(--text-secondary); font-weight: 600; }

/* ===== TOPBAR ICON BUTTONS ===== */
.topbar-icon-btn {
  font-size: 14px !important;
  background: var(--bg-card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  padding: 6px 10px !important;
  color: var(--text-secondary) !important;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}
.topbar-icon-btn:hover {
  background: rgba(56,189,248,0.1) !important;
  color: var(--text-primary) !important;
  transform: none !important;
}

/* ===== ONBOARDING TOUR ===== */
.tour-overlay {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(6,13,26,0.7);
  pointer-events: none;
}
.tour-tooltip {
  position: fixed; bottom: 32px; right: 32px; z-index: 1000;
  background: var(--bg-card);
  border: 1px solid var(--accent-gold);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  width: 340px;
  box-shadow: 0 16px 60px rgba(0,0,0,0.5), 0 0 0 1px rgba(245,158,11,0.2);
  animation: slideUp 0.3s ease;
}
.tour-step-indicator {
  font-size: 11px; font-weight: 700;
  color: var(--accent-gold); letter-spacing: 0.5px;
  margin-bottom: 8px; text-transform: uppercase;
}
.tour-title {
  font-size: 17px; font-weight: 800;
  font-family: 'Outfit', sans-serif;
  color: var(--text-primary); margin-bottom: 10px;
}
.tour-body {
  font-size: 13px; color: var(--text-secondary);
  line-height: 1.65; margin-bottom: 20px;
}
.tour-footer { display: flex; justify-content: flex-end; gap: 10px; }

/* ===== PRESENTATION MODE ===== */
.presentation-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: linear-gradient(135deg, #060d1a 0%, #0A1628 60%, #0d1e35 100%);
  display: flex; flex-direction: column;
  padding: 32px;
  overflow-y: auto;
}
.presentation-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 40px;
}
.presentation-logo {
  display: flex; align-items: center; gap: 14px;
  font-size: 20px; font-weight: 700; color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
}
.presentation-kpis {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 16px; margin-bottom: 40px;
}
.pres-kpi-card {
  background: var(--bg-card);
  border: 1px solid rgba(56,189,248,0.15);
  border-radius: var(--radius);
  padding: 28px 20px;
  text-align: center;
  transition: var(--transition);
}
.pres-kpi-val {
  font-size: 28px; font-weight: 800;
  font-family: 'Outfit', sans-serif;
  margin-bottom: 8px;
}
.pres-kpi-label {
  font-size: 12px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.pres-section-title {
  font-size: 16px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 16px; font-family: 'Outfit', sans-serif;
}
.pres-projects-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 32px;
}
.pres-project {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.pres-proj-name { font-size: 14px; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.pres-proj-loc  { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.pres-proj-bar  { height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; margin-bottom: 6px; }
.pres-proj-fill { height: 100%; background: linear-gradient(90deg, var(--accent-gold), var(--accent-blue)); border-radius: 4px; }
.pres-proj-pct  { font-size: 12px; color: var(--accent-gold); font-weight: 700; }
.presentation-footer {
  margin-top: auto;
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* ===== KPI TREND ===== */
.stat-trend { font-size: 11px; font-weight: 700; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.trend-up   { color: var(--accent-green); }
.trend-down { color: var(--accent-red); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1100px) {
  .presentation-kpis { grid-template-columns: repeat(3,1fr); }
}
@media (max-width: 900px) {
  .main-content { margin-left: 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .module { padding: 20px 16px; }
  .topbar { padding: 10px 16px; gap: 8px; }
  .topbar-username { display: none; }
  .topbar-breadcrumb { display: none; }
  .topbar-icon-btn { display: none; }
  .presentation-kpis { grid-template-columns: repeat(2,1fr); }
  .tour-tooltip { bottom: 16px; right: 16px; width: calc(100vw - 32px); }
}
@media (max-width: 600px) {
  .login-card { padding: 32px 22px; margin: 16px; }
  .stats-grid { grid-template-columns: 1fr; }
  .presentation-kpis { grid-template-columns: 1fr 1fr; }
}

/* Project Cards & Overlap Fixes */
.project-big-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.proj-title { font-size: 18px; font-weight: 700; color: var(--text-primary); }
.proj-desc { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.proj-info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin: 16px 0;
  padding: 12px 0;
  border-top: 1px solid rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.proj-info-item { flex: 1; min-width: 120px; }
.proj-info-label { display: block; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.proj-info-value { display: block; font-size: 14px; font-weight: 600; margin-top: 2px; }

.milestones { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.milestone { display: flex; align-items: center; gap: 8px; padding: 6px 10px; background: rgba(255,255,255,0.02); border-radius: 6px; }
.milestone-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.milestone-name { font-size: 12px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== ALERTS & ANIMATIONS ===== */
.pulse {
  animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
