/* ============================================================
   DASHBOARD TEMPLATE - Glassmorphic Theme (Dark & Light)
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ---------- CSS Variables - Dark Theme (Default) ---------- */
:root {
  --bg-body: linear-gradient(135deg, #0a0c1a 0%, #101525 50%, #0d1020 100%);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-hover: rgba(255, 255, 255, 0.06);
  --text-primary: #e2e8f0;
  --text-secondary: rgba(255, 255, 255, 0.5);
  --text-muted: rgba(255, 255, 255, 0.3);
  --accent-purple: #818cf8;
  --accent-green: #34d399;
  --accent-pink: #f472b6;
  --accent-blue: #60a5fa;
  --accent-yellow: #fbbf24;
  --accent-red: #f87171;
  --sidebar-width: 160px;
  --sidebar-collapsed: 56px;
  --topbar-height: 80px;
  --input-bg: rgba(255, 255, 255, 0.05);
  --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --dropdown-bg: rgba(20, 20, 30, 0.95);
  --table-row-hover: rgba(255, 255, 255, 0.02);
  --table-header-bg: rgba(0, 0, 0, 0.2);
  --table-border: rgba(255, 255, 255, 0.05);
  --scrollbar-thumb: rgba(255, 255, 255, 0.1);
  --tooltip-bg: rgba(8, 10, 30, 0.97);
}

/* ---------- CSS Variables - Light Theme ---------- */
[data-theme="light"] {
  --bg-body: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #ffffff 100%);
  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-border: rgba(100, 116, 139, 0.12);
  --glass-hover: rgba(255, 255, 255, 0.85);
  --text-primary: #1e293b;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --accent-purple: #6366f1;
  --accent-green: #059669;
  --accent-pink: #db2777;
  --accent-blue: #2563eb;
  --accent-yellow: #d97706;
  --accent-red: #dc2626;
  --input-bg: rgba(255, 255, 255, 0.8);
  --card-shadow: 0 4px 16px rgba(0, 0, 0, 0.05), 0 1px 3px rgba(0, 0, 0, 0.03);
  --dropdown-bg: rgba(255, 255, 255, 0.97);
  --table-row-hover: rgba(99, 102, 241, 0.04);
  --table-header-bg: rgba(248, 250, 252, 0.95);
  --table-border: rgba(100, 116, 139, 0.1);
  --scrollbar-thumb: rgba(100, 116, 139, 0.2);
  --tooltip-bg: rgba(255, 255, 255, 0.98);
}

/* ---------- Page Tint System ---------- */
.page-tint {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.6s ease;
}

/* Primary gradient blob - top left */
.page-tint::before {
  content: '';
  position: absolute;
  top: -20%;
  left: -10%;
  width: 80%;
  height: 80%;
  border-radius: 50%;
  background: var(--tint-primary, #818cf8);
  opacity: 0.18;
  filter: blur(80px);
  transition: background 0.6s ease, opacity 0.6s ease;
}

/* Secondary gradient blob - bottom right */
.page-tint::after {
  content: '';
  position: absolute;
  bottom: -20%;
  right: -10%;
  width: 70%;
  height: 70%;
  border-radius: 50%;
  background: var(--tint-secondary, #f472b6);
  opacity: 0.12;
  filter: blur(80px);
  transition: background 0.6s ease, opacity 0.6s ease;
}

/* Light theme tint adjustments */
[data-theme="light"] .page-tint::before {
  opacity: 0.25;
}

[data-theme="light"] .page-tint::after {
  opacity: 0.18;
}

/* Accent glow layer - top center */
.page-tint-accent {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse 120% 80% at 50% -20%, var(--tint-accent, rgba(129, 140, 248, 0.2)) 0%, transparent 50%);
  transition: background 0.6s ease;
}

/* Third color blob - center right */
.page-tint-third {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  top: 20%;
  right: -5%;
  width: 50%;
  height: 60%;
  border-radius: 50%;
  background: var(--tint-tertiary, #60a5fa);
  opacity: 0.1;
  filter: blur(100px);
  transition: background 0.6s ease, opacity 0.6s ease;
}

/* Page-specific color schemes */
.tint-dashboard  { --tint-primary: #a855f7; --tint-secondary: #c084fc; --tint-tertiary: #d8b4fe; --tint-accent: rgba(168, 85, 247, 0.2); }
.tint-resources  { --tint-primary: #34d399; --tint-secondary: #22d3ee; --tint-tertiary: #a3e635; --tint-accent: rgba(52, 211, 153, 0.2); }
.tint-projects   { --tint-primary: #60a5fa; --tint-secondary: #818cf8; --tint-tertiary: #22d3ee; --tint-accent: rgba(96, 165, 250, 0.2); }
.tint-users      { --tint-primary: #f472b6; --tint-secondary: #a855f7; --tint-tertiary: #fb7185; --tint-accent: rgba(244, 114, 182, 0.2); }
.tint-costs      { --tint-primary: #fb923c; --tint-secondary: #fbbf24; --tint-tertiary: #f472b6; --tint-accent: rgba(251, 146, 60, 0.2); }
.tint-aws        { --tint-primary: #f97316; --tint-secondary: #fb923c; --tint-tertiary: #fbbf24; --tint-accent: rgba(249, 115, 22, 0.2); }
.tint-settings   { --tint-primary: #a78bfa; --tint-secondary: #818cf8; --tint-tertiary: #c084fc; --tint-accent: rgba(167, 139, 250, 0.18); }

/* Mesh gradient overlay for depth */
.page-mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
  background-image: 
    radial-gradient(at 20% 30%, rgba(129, 140, 248, 0.12) 0px, transparent 50%),
    radial-gradient(at 80% 10%, rgba(244, 114, 182, 0.08) 0px, transparent 50%),
    radial-gradient(at 10% 70%, rgba(52, 211, 153, 0.06) 0px, transparent 50%),
    radial-gradient(at 90% 60%, rgba(96, 165, 250, 0.06) 0px, transparent 50%),
    radial-gradient(at 50% 90%, rgba(167, 139, 250, 0.08) 0px, transparent 50%);
}

/* ---------- Animations ---------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes pulse-soft {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.7; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  10% { transform: translate(-1%, -1%); }
  20% { transform: translate(1%, 1%); }
  30% { transform: translate(-1%, 1%); }
  40% { transform: translate(1%, -1%); }
  50% { transform: translate(-1%, 0%); }
  60% { transform: translate(1%, 0%); }
  70% { transform: translate(0%, 1%); }
  80% { transform: translate(0%, -1%); }
  90% { transform: translate(1%, 1%); }
}

.fade-up {
  animation: fadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.shimmer {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.05) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 2s infinite;
}

/* Noise texture overlay */
.noise-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  animation: grain 0.5s steps(10) infinite;
}

[data-theme="light"] .noise-overlay {
  opacity: 0.02;
}

/* ---------- Glass Card ---------- */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

[data-theme="light"] .glass-card::before {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

.glass-card:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border);
  transform: translateY(-2px);
  box-shadow: var(--card-shadow);
}

.glass-card:hover::before {
  opacity: 1;
}

.glass-card-solid {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
}

[data-theme="light"] .glass-card-solid {
  background: rgba(255, 255, 255, 0.8);
}

/* Glowing card variant */
.glass-card-glow {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.glass-card-glow::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 17px;
  background: linear-gradient(135deg, var(--tint-primary, #818cf8), var(--tint-secondary, #f472b6));
  opacity: 0;
  z-index: -1;
  transition: opacity 0.3s ease;
}

.glass-card-glow:hover::after {
  opacity: 0.15;
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: 80px;
  left: 12px;
  bottom: 12px;
  width: var(--sidebar-width);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  transition: width 0.22s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease;
  overflow: visible;
}

[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

.sidebar-nav {
  overflow: hidden;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.sidebar-toggle {
  position: absolute;
  top: 50%;
  right: -12px;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 10px;
  transition: all 0.2s ease;
  z-index: 110;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.sidebar-toggle:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border);
  color: var(--text-primary);
  transform: translateY(-50%) scale(1.1);
}

[data-theme="light"] .sidebar-toggle {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ---------- Nav Items ---------- */
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin: 2px 8px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
}

.sidebar.collapsed .nav-item {
  justify-content: center;
  padding: 10px;
  margin: 2px 8px;
}

.nav-item:hover {
  background: var(--glass-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--glass-hover);
  color: var(--text-primary);
}

[data-theme="light"] .nav-item:hover,
[data-theme="light"] .nav-item.active {
  background: rgba(99, 102, 241, 0.1);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--tint, var(--accent-purple));
  border-radius: 0 2px 2px 0;
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ---------- Top Bar ---------- */
.topbar-select {
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-primary);
  padding: 8px 12px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.topbar-select:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border);
}

.topbar-select:focus {
  outline: none;
  border-color: var(--accent-purple);
}

[data-theme="light"] .topbar-select {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .page-title {
  background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ---------- Stat Cards ---------- */
.stat-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 16px 18px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at 0% 0%, var(--card-glow, rgba(129, 140, 248, 0.1)) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.stat-card:hover {
  background: var(--glass-hover);
  transform: translateY(-4px);
  box-shadow: var(--card-shadow);
}

.stat-card:hover::before {
  opacity: 1;
}

[data-theme="light"] .stat-card {
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(100, 116, 139, 0.12);
}

[data-theme="light"] .stat-card:hover {
  background: rgba(255, 255, 255, 0.9);
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stat-change {
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.stat-change.positive { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.stat-change.negative { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.stat-change.neutral  { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }

/* ---------- Status Badges ---------- */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-active   { background: rgba(52, 211, 153, 0.15); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.3); }
.status-warning  { background: rgba(251, 191, 36, 0.15); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.3); }
.status-error    { background: rgba(248, 113, 113, 0.15); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.3); }
.status-info     { background: rgba(96, 165, 250, 0.15); color: #60a5fa; border: 1px solid rgba(96, 165, 250, 0.3); }
.status-neutral  { background: rgba(148, 163, 184, 0.15); color: #94a3b8; border: 1px solid rgba(148, 163, 184, 0.3); }

/* ---------- Priority Badges ---------- */
.priority-high     { background: rgba(248, 113, 113, 0.2); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.4); }
.priority-medium   { background: rgba(251, 191, 36, 0.2); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.4); }
.priority-low      { background: rgba(52, 211, 153, 0.2); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.4); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple) 0%, #6366f1 100%);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(129, 140, 248, 0.4);
}

.btn-secondary {
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
  background: var(--glass-hover);
}

[data-theme="light"] .btn-secondary {
  background: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .btn-secondary:hover {
  background: #fff;
}

.btn-danger {
  background: rgba(248, 113, 113, 0.2);
  color: var(--accent-red);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.3);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Form Inputs ---------- */
.input {
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
  width: 100%;
}

.input:focus {
  outline: none;
  border-color: var(--accent-purple);
  background: var(--glass-hover);
}

.input::placeholder {
  color: var(--text-muted);
}

[data-theme="light"] .input {
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05) inset;
}

[data-theme="light"] .input:focus {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.select {
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
}

[data-theme="light"] .select {
  background: rgba(255, 255, 255, 0.9);
}

/* ---------- Tables ---------- */
.table-container {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
}

[data-theme="light"] .table-container {
  background: rgba(255, 255, 255, 0.6);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 12px 16px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--glass-bg);
  border-bottom: 1px solid var(--glass-border);
}

[data-theme="light"] th {
  background: rgba(248, 250, 252, 0.8);
}

td {
  padding: 12px 16px;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--glass-border);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--table-row-hover);
}

/* ---------- Tabs ---------- */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--glass-bg);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
}

[data-theme="light"] .tabs {
  background: rgba(255, 255, 255, 0.6);
}

.tab {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-secondary);
  background: transparent;
  border: none;
}

.tab:hover {
  color: var(--text-primary);
  background: var(--glass-hover);
}

.tab.active {
  background: var(--glass-hover);
  color: var(--text-primary);
}

[data-theme="light"] .tab.active {
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ---------- Progress Bar ---------- */
.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.3s ease;
}

/* ---------- Tooltips (Recharts) ---------- */
.recharts-tooltip-wrapper {
  outline: none;
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* ---------- Theme Toggle ---------- */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: var(--glass-hover);
  transform: scale(1.05);
}

[data-theme="light"] .theme-toggle {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* ---------- Filter Chips ---------- */
.filter-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.filter-chip:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border);
  color: var(--text-primary);
}

.filter-chip.active {
  background: rgba(129, 140, 248, 0.2);
  border-color: rgba(129, 140, 248, 0.4);
  color: #a5b4fc;
}

[data-theme="light"] .filter-chip {
  background: rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .filter-chip.active {
  background: rgba(99, 102, 241, 0.15);
  color: #6366f1;
}

/* ---------- Utility Classes ---------- */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--text-primary); }
.text-success { color: var(--accent-green); }
.text-warning { color: var(--accent-yellow); }
.text-error { color: var(--accent-red); }
.text-info { color: var(--accent-blue); }

.font-mono { font-family: 'SF Mono', 'Fira Code', monospace; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .sidebar {
    width: var(--sidebar-collapsed);
  }
  
  .nav-item span {
    display: none;
  }
}


/* ---------- Chart Axis Colors for Light Mode ---------- */
[data-theme="light"] .recharts-cartesian-axis-tick text,
[data-theme="light"] .recharts-cartesian-axis-line,
[data-theme="light"] .recharts-cartesian-axis-tick-line {
  fill: rgba(30, 41, 59, 0.6) !important;
  stroke: rgba(30, 41, 59, 0.3) !important;
}

[data-theme="light"] .recharts-cartesian-grid line {
  stroke: rgba(30, 41, 59, 0.1) !important;
}

[data-theme="light"] .recharts-legend-item-text {
  color: var(--text-secondary) !important;
}

[data-theme="light"] .recharts-tooltip-wrapper .recharts-default-tooltip {
  background: var(--tooltip-bg) !important;
  border-color: var(--glass-border) !important;
}

/* Fix for tip text in light mode */
[data-theme="light"] .tip-text {
  color: var(--text-secondary);
}


/* ============================================================
   LIGHT MODE COMPREHENSIVE FIXES
   ============================================================ */

/* Reduce tint intensity in light mode */
[data-theme="light"] .page-tint::before {
  opacity: 0.06;
  filter: blur(150px);
}

[data-theme="light"] .page-tint::after {
  opacity: 0.04;
  filter: blur(150px);
}

[data-theme="light"] .page-tint-third {
  opacity: 0.03;
  filter: blur(180px);
}

[data-theme="light"] .page-tint-accent {
  opacity: 0.3;
}

[data-theme="light"] .page-mesh {
  opacity: 0.1;
}

/* Logo and App Title visibility */
[data-theme="light"] .app-logo,
[data-theme="light"] .logo-text {
  color: #1e293b !important;
  -webkit-text-fill-color: #1e293b !important;
}

[data-theme="light"] .app-name {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
}

/* Page Title gradient for light mode */
[data-theme="light"] .page-title,
[data-theme="light"] h1,
[data-theme="light"] h2 {
  color: #1e293b !important;
  -webkit-text-fill-color: #1e293b !important;
}

/* Glass cards with subtle background */
[data-theme="light"] .glass-card {
  background: rgba(255, 255, 255, 0.65);
  border-color: rgba(100, 116, 139, 0.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

[data-theme="light"] .glass-card:hover {
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .glass-card-solid {
  background: rgba(255, 255, 255, 0.75);
}

/* Sidebar improvements */
[data-theme="light"] .sidebar {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(100, 116, 139, 0.12);
}

[data-theme="light"] .nav-item {
  color: #475569;
}

[data-theme="light"] .nav-item:hover,
[data-theme="light"] .nav-item.active {
  background: rgba(99, 102, 241, 0.08);
  color: #1e293b;
}

/* Stat card text visibility */
[data-theme="light"] .stat-value {
  color: #1e293b;
}

[data-theme="light"] .stat-label {
  color: #64748b;
}

[data-theme="light"] .stat-change.positive {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
}

[data-theme="light"] .stat-change.negative {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
}

/* Status badges with better contrast */
[data-theme="light"] .status-active {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
  border-color: rgba(5, 150, 105, 0.3);
}

[data-theme="light"] .status-warning {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.3);
}

[data-theme="light"] .status-error {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.3);
}

[data-theme="light"] .status-info {
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
  border-color: rgba(37, 99, 235, 0.3);
}

[data-theme="light"] .status-neutral {
  background: rgba(100, 116, 139, 0.12);
  color: #64748b;
  border-color: rgba(100, 116, 139, 0.3);
}

/* Priority badges */
[data-theme="light"] .priority-high {
  background: rgba(220, 38, 38, 0.12);
  color: #dc2626;
  border-color: rgba(220, 38, 38, 0.3);
}

[data-theme="light"] .priority-medium {
  background: rgba(217, 119, 6, 0.12);
  color: #b45309;
  border-color: rgba(217, 119, 6, 0.3);
}

[data-theme="light"] .priority-low {
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
  border-color: rgba(5, 150, 105, 0.3);
}

/* Progress bar background */
[data-theme="light"] .progress-bar {
  background: rgba(100, 116, 139, 0.15);
}

/* Dropdown and select menus */
[data-theme="light"] .topbar-select {
  background: rgba(255, 255, 255, 0.8);
  color: #1e293b;
  border-color: rgba(100, 116, 139, 0.2);
}

[data-theme="light"] .topbar-select:hover {
  background: rgba(255, 255, 255, 0.95);
}

/* Modal overlays */
[data-theme="light"] .modal-overlay {
  background: rgba(15, 23, 42, 0.4);
}

/* Kanban columns */
[data-theme="light"] .kanban-column {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(100, 116, 139, 0.12);
}

/* Epic sidebar */
[data-theme="light"] .epic-sidebar {
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(100, 116, 139, 0.12);
}

/* Issue cards */
[data-theme="light"] .issue-card {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(100, 116, 139, 0.1);
}

[data-theme="light"] .issue-card:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* Epic cards */
[data-theme="light"] .epic-card {
  background: rgba(255, 255, 255, 0.6);
}

[data-theme="light"] .epic-card:hover {
  background: rgba(255, 255, 255, 0.8);
}

/* Text color overrides for inline styles */
[data-theme="light"] [style*="color: #e2e8f0"],
[data-theme="light"] [style*="color:#e2e8f0"] {
  color: #1e293b !important;
}

[data-theme="light"] [style*="color: rgba(255, 255, 255"],
[data-theme="light"] [style*="color:rgba(255, 255, 255"],
[data-theme="light"] [style*="color: rgba(255,255,255"] {
  color: #475569 !important;
}

/* Ensure all text is visible */
[data-theme="light"] span,
[data-theme="light"] p,
[data-theme="light"] div {
  --tw-text-opacity: 1;
}

/* Icon colors in light mode */
[data-theme="light"] svg {
  color: inherit;
}

/* Tooltip in light mode */
[data-theme="light"] .tooltip {
  background: rgba(255, 255, 255, 0.95);
  color: #1e293b;
  border: 1px solid rgba(100, 116, 139, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}


/* ---------- App Title & Page Title Gradients ---------- */

/* Dark mode - App name (Sentinel) */
.app-name {
  background: linear-gradient(135deg, #e0e7ff 0%, #c7d2fe 50%, #a5b4fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Dark mode - Page title */
.page-title {
  background: linear-gradient(135deg, #a5b4fc 0%, #818cf8 50%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Light mode overrides */
[data-theme="light"] .app-name {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

[data-theme="light"] .page-title {
  background: linear-gradient(135deg, #4f46e5 0%, #6366f1 50%, #7c3aed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Ensure secondary text in light mode has good contrast */
[data-theme="light"] .text-muted,
[data-theme="light"] [style*="var(--text-muted)"] {
  color: #64748b !important;
}

[data-theme="light"] .text-secondary,
[data-theme="light"] [style*="var(--text-secondary)"] {
  color: #475569 !important;
}


/* ---------- Light Mode: Dark backgrounds in cards ---------- */

/* Fix dark overlay backgrounds in light mode */
[data-theme="light"] [style*="background: rgba(0,0,0,0.2)"],
[data-theme="light"] [style*="background: rgba(0, 0, 0, 0.2)"],
[data-theme="light"] [style*="background: rgba(0,0,0,0.25)"],
[data-theme="light"] [style*="background: rgba(0, 0, 0, 0.25)"],
[data-theme="light"] [style*="background: rgba(0,0,0,0.3)"],
[data-theme="light"] [style*="background: rgba(0, 0, 0, 0.3)"] {
  background: rgba(100, 116, 139, 0.08) !important;
}

/* Kanban column backgrounds */
[data-theme="light"] [style*="background: rgba(255,255,255,0.02)"],
[data-theme="light"] [style*="background: rgba(255, 255, 255, 0.02)"],
[data-theme="light"] [style*="background: rgba(255,255,255,0.03)"],
[data-theme="light"] [style*="background: rgba(255, 255, 255, 0.03)"] {
  background: rgba(255, 255, 255, 0.6) !important;
}

/* Column borders */
[data-theme="light"] [style*="border: 1px solid rgba(255,255,255,0.05)"],
[data-theme="light"] [style*="border: 1px solid rgba(255, 255, 255, 0.05)"] {
  border-color: rgba(100, 116, 139, 0.12) !important;
}

/* Column header gradients */
[data-theme="light"] [style*="background: linear-gradient(180deg, rgba(255,255,255,0.03)"] {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.4) 100%) !important;
}

/* Text colors using inline rgba */
[data-theme="light"] [style*="color: rgba(255,255,255,0.1)"],
[data-theme="light"] [style*="background: rgba(255,255,255,0.1)"] {
  background: rgba(100, 116, 139, 0.1) !important;
}

/* Fix priority badge backgrounds for light mode */
[data-theme="light"] [style*="background: rgba(239,68,68,0.2)"] {
  background: rgba(220, 38, 38, 0.15) !important;
}

[data-theme="light"] [style*="background: rgba(245,158,11,0.2)"] {
  background: rgba(217, 119, 6, 0.15) !important;
}

[data-theme="light"] [style*="background: rgba(255,255,255,0.05)"] {
  background: rgba(100, 116, 139, 0.08) !important;
}


/* ---------- Modal animations ---------- */
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- Light Mode: Modal/Dialog fixes ---------- */
[data-theme="light"] [style*="background: rgba(0,0,0,0.6)"],
[data-theme="light"] [style*="background: rgba(0, 0, 0, 0.6)"] {
  background: rgba(15, 23, 42, 0.35) !important;
}

/* Modal background fix - ensure dropdown-bg is used properly */
[data-theme="light"] [style*="var(--dropdown-bg)"] {
  background-color: rgba(255, 255, 255, 0.98);
}


/* ---------- Light Mode: Inputs and selects ---------- */
[data-theme="light"] .input,
[data-theme="light"] select.input,
[data-theme="light"] .topbar-select {
  background: rgba(255, 255, 255, 0.9) !important;
  border-color: rgba(100, 116, 139, 0.2) !important;
  color: #1e293b !important;
}

[data-theme="light"] .input::placeholder {
  color: #94a3b8 !important;
}

[data-theme="light"] .input:focus,
[data-theme="light"] select.input:focus {
  background: #ffffff !important;
  border-color: var(--accent-purple) !important;
}

/* Hero stat tiles in Overview - make them more visible */
[data-theme="light"] [style*="background: linear-gradient(135deg, rgba(16, 185, 129"] {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(16, 185, 129, 0.04) 100%) !important;
}

[data-theme="light"] [style*="background: linear-gradient(135deg, rgba(239, 68, 68"] {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.12) 0%, rgba(239, 68, 68, 0.04) 100%) !important;
}

[data-theme="light"] [style*="background: linear-gradient(135deg, rgba(245, 158, 11"] {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0.04) 100%) !important;
}

[data-theme="light"] [style*="background: linear-gradient(135deg, rgba(139, 92, 246"] {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.12) 0%, rgba(139, 92, 246, 0.04) 100%) !important;
}


/* ---------- Light Mode: Epic Cards more opaque ---------- */
[data-theme="light"] .epic-sidebar-card {
  background: linear-gradient(135deg, color-mix(in srgb, var(--epic-color, #6b7280) 40%, white) 0%, color-mix(in srgb, var(--epic-color, #6b7280) 15%, white) 100%) !important;
  border: 1px solid rgba(100, 116, 139, 0.1) !important;
}

[data-theme="light"] .epic-sidebar-card:hover {
  background: color-mix(in srgb, var(--epic-color, #6b7280) 45%, white) !important;
}

/* Epic card stat boxes - white bg in light mode */
[data-theme="light"] .epic-stat-box {
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid rgba(100, 116, 139, 0.1);
}

/* Epic progress bar background */
[data-theme="light"] .epic-progress-bar {
  background: rgba(100, 116, 139, 0.15) !important;
}

/* All Issues card stat boxes in light mode */
[data-theme="light"] [style*="background: rgba(0,0,0,0.2)"],
[data-theme="light"] [style*="background: rgba(0, 0, 0, 0.2)"] {
  background: rgba(255, 255, 255, 0.6) !important;
  border: 1px solid rgba(100, 116, 139, 0.08);
}
