:root {
  --green-950: #052E16;
  --green-900: #14532D;
  --green-800: #166534;
  --green-700: #15803D;
  --green-600: #16A34A;
  --green-500: #22C55E;
  --green-400: #4ADE80;
  --green-300: #86EFAC;
  --green-200: #BBF7D0;
  --green-100: #DCFCE7;
  --green-50: #F0FDF4;
  --gold-600: #CA8A04;
  --gold-500: #EAB308;
  --gold-400: #FACC15;
  --gold-300: #FDE047;
  --gold-200: #FEF08A;
  --gold-100: #FEF9C3;
  --gold-50: #FFFDE7;
  --red: #EF4444;
  --blue: #3B82F6;
  --sidebar-width: 260px;
  --sidebar-collapsed: 72px;
  --topbar-height: 68px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

:root {
  --primary: var(--green-800);
  --primary-dark: var(--green-900);
  --primary-light: var(--green-600);
  --accent: var(--gold-500);
  --accent-hover: var(--gold-600);
  --accent-light: var(--gold-100);
  --green: var(--green-500);
  --bg: var(--green-50);
  --card: #FFFFFF;
  --text: var(--green-900);
  --text-secondary: #4B7B5E;
  --text-muted: #86B394;
  --border: var(--green-100);
  --shadow: 0 1px 3px rgba(21,83,45,0.08), 0 1px 2px rgba(21,83,45,0.04);
  --shadow-md: 0 4px 16px rgba(21,83,45,0.1);
  --shadow-lg: 0 8px 32px rgba(21,83,45,0.14);
  --shadow-glow: 0 0 20px rgba(34,197,94,0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.dark {
  --primary: var(--green-200);
  --primary-dark: var(--green-100);
  --primary-light: var(--green-400);
  --bg: #0A1F14;
  --card: #0F2E1D;
  --text: var(--green-50);
  --text-secondary: var(--green-300);
  --text-muted: var(--green-600);
  --border: #1A3D28;
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.6);
  --shadow-glow: 0 0 20px rgba(34,197,94,0.08);
}

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

:disabled, .disabled, [disabled] { cursor: not-allowed !important; }
input, select, textarea { cursor: text; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; min-height: 100vh; overflow-x: hidden; }
html, body { -webkit-tap-highlight-color: transparent; overscroll-behavior: none; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }
input { font-family: inherit; }
ul { list-style: none; }
::selection { background: var(--green-200); color: var(--green-900); }
.dark ::selection { background: var(--green-700); color: var(--green-50); }

.app { display: flex; min-height: 100vh; }

.app.locked { filter: blur(24px) saturate(0.6); pointer-events: none; user-select: none; transition: filter 0.6s ease; }
.app:not(.locked) { filter: blur(0) saturate(1); transition: filter 0.6s ease; }

.sidebar {
  position: fixed; top: 0; left: 0; height: 100vh; width: var(--sidebar-width);
  background: linear-gradient(180deg, var(--green-900) 0%, var(--green-800) 40%, #0D3B1E 100%);
  color: #fff; z-index: 1000;
  display: flex; flex-direction: column;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: 2px 0 20px rgba(5,46,22,0.3);
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 0%, rgba(234,179,8,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px; padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06); min-height: var(--topbar-height);
  white-space: nowrap; overflow: hidden; position: relative;
}
.sidebar-brand .brand-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: var(--green-900); flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(234,179,8,0.3);
}
.sidebar-logo { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.sidebar.collapsed .sidebar-logo { display: none; }
.sidebar-brand .valour-logo { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.02em; background: linear-gradient(135deg, #fff 60%, var(--gold-300)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.sidebar-brand .valour-logo span { -webkit-text-fill-color: var(--gold-400); }
.sidebar-brand .valour-sub { font-size: 0.6rem; color: rgba(255,255,255,0.4); font-weight: 400; display: block; margin-top: -2px; }
.sidebar-close { display: none; }
@media (max-width: 768px) {
  .sidebar-close {
    display: flex; align-items: center; justify-content: center;
    margin-left: auto; color: rgba(255,255,255,0.4); font-size: 1.1rem;
    transition: var(--transition); flex-shrink: 0; width: 36px; height: 36px;
    border-radius: 8px; background: none; border: none; cursor: pointer;
  }
  .sidebar-close:hover { color: #fff; background: rgba(255,255,255,0.08); }
  .sidebar:not(.open) .sidebar-close { display: none; }
}
.sidebar-toggle {
  margin-left: auto; color: rgba(255,255,255,0.4); font-size: 1.1rem;
  transition: var(--transition); flex-shrink: 0;
}
.sidebar-toggle:hover { color: var(--gold-400); transform: rotate(90deg); }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; overflow-x: hidden; }
.nav-item {
  display: flex; align-items: center; gap: 14px; padding: 11px 20px;
  color: rgba(255,255,255,0.45); font-size: 0.875rem; font-weight: 500;
  transition: var(--transition); cursor: pointer; white-space: nowrap;
  border-right: 3px solid transparent; position: relative;
}
.nav-item i { width: 20px; text-align: center; font-size: 1.1rem; flex-shrink: 0; transition: transform 0.3s var(--bounce), color 0.3s; }
.nav-item:hover { color: rgba(255,255,255,0.85); background: rgba(255,255,255,0.05); }
.nav-item:hover i { transform: scale(1.2) rotate(-8deg); }
.nav-item:active i { transform: scale(0.9); }
.nav-item.active { color: #fff; background: rgba(234,179,8,0.08); border-right-color: var(--gold-500); box-shadow: inset 0 0 20px rgba(234,179,8,0.03); }
.nav-item.active i { color: var(--gold-400); }
.nav-item.active::after {
  content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--gold-500);
  border-radius: 0 2px 2px 0; box-shadow: 0 0 12px rgba(234,179,8,0.6);
  animation: slideInIndicator 0.3s var(--bounce);
}
.nav-item .nav-label { transition: opacity 0.2s; }
.sidebar.collapsed .nav-item .nav-label { opacity: 0; width: 0; overflow: hidden; }
.sidebar.collapsed .nav-item { padding: 11px 26px; justify-content: center; }
.sidebar.collapsed .nav-item.active::after { display: none; }
.sidebar.collapsed .sidebar-brand { padding: 18px 16px; justify-content: center; }
.sidebar.collapsed .sidebar-brand .valour-logo,
.sidebar.collapsed .sidebar-brand .valour-sub { display: none; }
.sidebar.collapsed .sidebar-toggle { margin-left: 0; }
.sidebar-footer {
  padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 12px; white-space: nowrap;
}
.sidebar-footer .org-badge { font-size: 0.7rem; color: rgba(255,255,255,0.35); }
.sidebar.collapsed .sidebar-footer { justify-content: center; padding: 16px; }
.sidebar.collapsed .sidebar-footer .org-badge { display: none; }
.logout-item { margin-top: auto; border-top: 1px solid rgba(255,255,255,0.06); padding-top: 12px; margin-bottom: 0; color: rgba(255,255,255,0.5); }
.logout-item:hover { color: #FCA5A5 !important; background: rgba(239,68,68,0.08) !important; }
.logout-item:hover i { color: #FCA5A5; }
.sidebar.collapsed .logout-item { padding: 11px 26px; justify-content: center; }
.nav-section-label {
  padding: 16px 20px 6px; font-size: 0.65rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: rgba(255,255,255,0.2); font-weight: 600;
}
.sidebar.collapsed .nav-section-label { display: none; }

.main-wrapper {
  margin-left: var(--sidebar-width); flex: 1; display: flex; flex-direction: column;
  min-height: 100vh; transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.sidebar.collapsed + .main-wrapper,
.sidebar.collapsed ~ .main-wrapper { margin-left: var(--sidebar-collapsed); }

.topbar {
  position: sticky; top: 0; z-index: 100;
  height: var(--topbar-height); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px;
  backdrop-filter: blur(16px) saturate(1.8);
  -webkit-backdrop-filter: blur(16px) saturate(1.8);
  background: rgba(255,255,255,0.75);
}
.dark .topbar { background: rgba(15,46,29,0.85); border-bottom-color: #1A3D28; }
.refresh-progress {
  position: absolute; bottom: -1px; left: 0; height: 2px;
  background: linear-gradient(90deg, var(--green-500), var(--gold-500));
  width: 100%; z-index: 101;
  animation: refreshCountdown 10s linear;
  transform-origin: left;
  opacity: 0.7;
}
.refresh-progress.paused { animation-play-state: paused; }
@keyframes refreshCountdown { from { transform: scaleX(1); } to { transform: scaleX(0); } }
.topbar-search {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border-radius: 12px; padding: 0 14px;
  width: 280px; height: 40px; border: 1.5px solid transparent;
  transition: var(--transition);
}
.topbar-search:focus-within {
  border-color: var(--green-400); background: var(--card);
  box-shadow: 0 0 0 4px rgba(34,197,94,0.1);
}
.topbar-search i { color: var(--text-muted); font-size: 0.9rem; }
.topbar-search input { border: none; background: transparent; outline: none; width: 100%; font-size: 0.85rem; color: var(--text); }
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.topbar-btn {
  width: 38px; height: 38px; border-radius: 10px; display: flex;
  align-items: center; justify-content: center;
  color: var(--text-secondary); font-size: 1rem; transition: var(--transition);
  position: relative;
}
.topbar-btn:hover { background: var(--green-50); color: var(--green-700); }
.dark .topbar-btn:hover { background: rgba(34,197,94,0.1); }
.topbar-btn:active { transform: scale(0.92); }
.topbar-btn .fa-bell { transition: transform 0.2s; }
.topbar-btn:hover .fa-bell { animation: ring 1s ease; }
.topbar-btn .badge {
  position: absolute; top: 4px; right: 4px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--red); border: 2px solid var(--card);
  animation: pulse 2s ease infinite;
}
.topbar-datetime { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.3; margin-right: 12px; }
.topbar-datetime .date { font-size: 0.75rem; color: var(--text-muted); font-weight: 500; }
.topbar-datetime .time { font-size: 0.85rem; color: var(--text); font-weight: 600; }
.topbar-datetime .time::after { content: ''; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--green-500); margin-left: 6px; vertical-align: middle; animation: pulse 2s ease infinite; }
.topbar-profile {
  display: flex; align-items: center; gap: 10px; padding: 4px 12px 4px 4px;
  border-radius: 12px; transition: var(--transition); cursor: pointer;
}
.topbar-profile:hover { background: var(--green-50); }
.dark .topbar-profile:hover { background: rgba(34,197,94,0.08); }
.topbar-profile .avatar {
  width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--green-600), var(--green-700));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.85rem;
  box-shadow: 0 2px 6px rgba(22,163,74,0.3);
}
.topbar-profile .name { font-size: 0.85rem; font-weight: 600; }
.topbar-profile .role { font-size: 0.7rem; color: var(--text-muted); }

.content { flex: 1; padding: 28px; overflow-y: auto; background-image: radial-gradient(rgba(34,197,94,0.03) 1px, transparent 1px); background-size: 24px 24px; }
.page { display: none; }
.page.active { display: block; animation: pageEnter 0.5s ease; }
.page.active > * { animation: staggerFade 0.5s ease both; }
.page.active > *:nth-child(1) { animation-delay: 0.02s; }
.page.active > *:nth-child(2) { animation-delay: 0.06s; }
.page.active > *:nth-child(3) { animation-delay: 0.10s; }
.page.active > *:nth-child(4) { animation-delay: 0.14s; }
.page.active > *:nth-child(5) { animation-delay: 0.18s; }

@keyframes pageEnter { from { opacity: 0; } to { opacity: 1; } }
@keyframes staggerFade { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes countUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: translateX(0); } }
@keyframes shimmer { 0% { background-position: -200px 0; } 100% { background-position: calc(200px + 100%) 0; } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes lockFadeIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes glow { 0%, 100% { box-shadow: 0 0 8px rgba(234,179,8,0.2); } 50% { box-shadow: 0 0 20px rgba(234,179,8,0.4); } }
@keyframes gradientShift { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
@keyframes rowEnter { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: translateX(0); } }
@keyframes ring { 0% { transform: rotate(0); } 10% { transform: rotate(15deg); } 20% { transform: rotate(-15deg); } 30% { transform: rotate(10deg); } 40% { transform: rotate(-10deg); } 50%,100% { transform: rotate(0); } }
@keyframes kpiFlash { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,0.3); } 100% { box-shadow: 0 0 0 20px rgba(34,197,94,0); } }
@keyframes slideInIndicator { from { height: 0; opacity: 0; } to { height: 20px; opacity: 1; } }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.02); } }
@keyframes fadeScaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes countdown { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes statusPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); } 50% { box-shadow: 0 0 0 6px rgba(34,197,94,0); } }



.lock-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--green-900) 0%, #0D3B1E 40%, var(--green-800) 70%, #0A2F15 100%);
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.lock-screen::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 20% 50%, rgba(234,179,8,0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 50%, rgba(34,197,94,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.lock-screen.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.lock-card {
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(20px) saturate(1.5);
  -webkit-backdrop-filter: blur(20px) saturate(1.5);
  border-radius: var(--radius); padding: 48px 40px 40px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.3);
  text-align: center; width: 380px; max-width: 90vw;
  animation: lockFadeIn 0.6s var(--bounce);
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
}
.lock-card::before {
  content: ''; position: absolute; inset: -1px;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(234,179,8,0.3), rgba(34,197,94,0.1), rgba(234,179,8,0.3));
  z-index: -1;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  -webkit-mask-composite: xor;
  padding: 1px;
}
.lock-logo { width: 100px; height: 100px; border-radius: 24px; object-fit: cover; margin: 0 auto 20px; display: block; box-shadow: 0 8px 32px rgba(0,0,0,0.3); animation: float 4s ease infinite; }
.lock-title { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.02em; color: #fff; }
.lock-title span { color: var(--gold-400); }
.lock-subtitle { font-size: 0.85rem; color: rgba(255,255,255,0.4); margin: 4px 0 28px; }
.lock-input-group { display: flex; gap: 8px; }
.lock-input {
  flex: 1; padding: 14px 18px; border-radius: 12px;
  border: 1.5px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: #fff; font-size: 0.95rem; outline: none;
  transition: var(--transition);
}
.lock-input:focus { border-color: var(--gold-500); background: rgba(255,255,255,0.1); box-shadow: 0 0 0 4px rgba(234,179,8,0.12); }
.lock-input::placeholder { color: rgba(255,255,255,0.3); }
.lock-btn {
  width: 50px; height: 50px; border-radius: 12px;
  background: linear-gradient(135deg, var(--gold-500), var(--gold-600));
  color: var(--green-900); display: flex; align-items: center;
  justify-content: center; font-size: 1.1rem;
  transition: var(--transition); flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(234,179,8,0.3);
}
.lock-btn:hover { transform: translateX(3px) scale(1.03); box-shadow: 0 6px 20px rgba(234,179,8,0.4); }
.lock-btn:active { transform: scale(0.95); }

/* Google Sign‑In button styles */
.google-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: #ffffff;
  border: 1px solid #c4c7c5;
  border-radius: 20px;
  padding: 16px 32px;
  cursor: pointer;
  transition: background-color 0.2s, box-shadow 0.2s;
  text-decoration: none;
}
.google-btn:hover {
  background-color: #f7f9fa;
  box-shadow: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
}
.google-icon {
  width: 24px;
  height: 24px;
  margin-right: 12px;
}
.google-text {
  color: #1f1f1f;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.25px;
}
.lock-error { color: #FCA5A5; font-size: 0.8rem; margin-top: 12px; font-weight: 500; display: none; }
.lock-error.show { display: block; animation: fadeUp 0.3s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.page-header { margin-bottom: 24px; }
.page-header .page-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--green-600); margin-bottom: 6px;
  background: rgba(34,197,94,0.08); padding: 3px 10px; border-radius: 6px;
  animation: fadeScaleIn 0.4s var(--bounce);
}

.page-title { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.page-subtitle { font-size: 0.875rem; color: var(--text-secondary); margin-top: 4px; }

.kpi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi-card {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow); transition: var(--transition);
  position: relative; overflow: hidden;
  border: 1px solid var(--border);
  border-top: 3px solid transparent;
}
.kpi-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--green-400), var(--green-500), var(--gold-400));
  opacity: 0; transition: opacity 0.3s;
}
.kpi-card:hover {
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transform: translateY(-3px) scale(1.03);
  border-color: transparent;
}
.kpi-card:hover::before { opacity: 1; }
.kpi-card .kpi-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.kpi-card .kpi-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; flex-shrink: 0;
  transition: var(--transition);
}
.kpi-card:hover .kpi-icon { transform: scale(1.05); }
.kpi-card.flash { animation: kpiFlash 0.5s ease; }
.kpi-card .kpi-label { font-size: 0.8rem; color: var(--text-secondary); font-weight: 500; margin-bottom: 4px; }
.kpi-card .kpi-value { font-size: 1.65rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; }
.kpi-card .kpi-change { font-size: 0.75rem; margin-top: 6px; font-weight: 500; display: flex; align-items: center; gap: 4px; }
.kpi-card .kpi-change.up { color: var(--green-600); }
.kpi-card .kpi-change.down { color: var(--red); }
.kpi-bg-accent .kpi-icon { background: rgba(234,179,8,0.12); color: var(--gold-600); }
.kpi-bg-blue .kpi-icon { background: rgba(22,163,74,0.12); color: var(--green-600); } /* Uses green colors despite name - keeping for backwards compatibility */
.kpi-bg-green .kpi-icon { background: rgba(34,197,94,0.12); color: var(--green-500); }
.kpi-bg-red .kpi-icon { background: rgba(239,68,68,0.12); color: var(--red); }
.kpi-bg-primary .kpi-icon { background: rgba(21,83,45,0.08); color: var(--green-700); }
.dark .kpi-bg-primary .kpi-icon { background: rgba(240,253,244,0.08); color: var(--green-300); }

.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 20px; transition: var(--transition);
  border: 1px solid var(--border);
}
.card:hover { box-shadow: var(--shadow-md); transform: scale(1.01); }
.card-header {
  padding: 18px 24px 0; display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 1rem; font-weight: 600; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card-header h3 i { color: var(--green-600); }
.card-body { padding: 18px 24px 24px; }
.chart-card .card-body { padding: 12px 20px 20px; }
.card-wide { grid-column: 1 / -1; }
.chart-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px; margin-bottom: 24px; }
.chart-grid .card { margin-bottom: 0; }
.chart-card canvas { width: 100% !important; max-height: 280px; }
.chart-card { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.chart-card:hover { transform: translateY(-2px) scale(1.02); box-shadow: var(--shadow-md), var(--shadow-glow); }

.table-card { margin-bottom: 24px; }
.table-container { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
thead { position: sticky; top: 0; z-index: 2; }
th {
  text-align: left; padding: 12px 14px; font-weight: 600;
  font-size: 0.75rem; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--green-700);
  background: var(--green-50); border-bottom: 2px solid var(--green-200);
  white-space: nowrap;
}
.dark th { background: #0A2F15; color: var(--green-300); border-bottom-color: #1A3D28; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--green-600); }
th.sortable i { margin-left: 4px; font-size: 0.7rem; opacity: 0.4; }
td { padding: 11px 14px; border-bottom: 1px solid var(--border); color: var(--text); white-space: nowrap; }
tbody tr { transition: background 0.15s; animation: rowEnter 0.35s ease both; }
tbody tr:nth-child(even) { background: rgba(21,83,45,0.02); }
.dark tbody tr:nth-child(even) { background: rgba(240,253,244,0.02); }
tbody tr:hover { background: rgba(34,197,94,0.06); }
.dark tbody tr:hover { background: rgba(34,197,94,0.08); }
tbody tr:last-child td { border-bottom: none; }
tbody tr:nth-child(1) { animation-delay: 0.01s; }
tbody tr:nth-child(2) { animation-delay: 0.03s; }
tbody tr:nth-child(3) { animation-delay: 0.05s; }
tbody tr:nth-child(4) { animation-delay: 0.07s; }
tbody tr:nth-child(5) { animation-delay: 0.09s; }
tbody tr:nth-child(6) { animation-delay: 0.11s; }
tbody tr:nth-child(7) { animation-delay: 0.13s; }
tbody tr:nth-child(8) { animation-delay: 0.15s; }
tbody tr:nth-child(9) { animation-delay: 0.17s; }
tbody tr:nth-child(10) { animation-delay: 0.19s; }
tbody tr:nth-child(n+11) { animation-delay: 0.21s; }

.search-bar {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg); border-radius: 12px; padding: 0 16px;
  height: 44px; border: 1.5px solid var(--border);
  margin-bottom: 16px; transition: var(--transition);
}
.search-bar:focus-within { border-color: var(--green-400); box-shadow: 0 0 0 4px rgba(34,197,94,0.08); width: 320px; }
@media (max-width: 992px) { .search-bar:focus-within { width: 240px; } }
@media (max-width: 768px) { .search-bar:focus-within { width: 200px; } }
.search-icon { color: var(--text-muted); font-size: 0.95rem; }
.search-input { border: none; background: transparent; outline: none; width: 100%; font-size: 0.875rem; color: var(--text); }
.search-input::placeholder { color: var(--text-muted); }
.table-controls { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-group { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
  padding: 6px 16px; border-radius: 8px; font-size: 0.8rem;
  font-weight: 500; color: var(--text-secondary);
  background: var(--bg); transition: var(--transition);
  border: 1px solid transparent;
}
.filter-btn:hover { color: var(--green-700); background: var(--green-100); }
.filter-btn.active { background: var(--green-600); color: #fff; box-shadow: 0 2px 8px rgba(22,163,74,0.3); }

.table-link { color: var(--green-600); font-weight: 500; text-decoration: underline; font-size: 0.8rem; }
.table-link:hover { color: var(--green-800); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.pagination button { width: 34px; height: 34px; border-radius: 8px; font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); transition: var(--transition); }
.pagination button:hover { background: var(--green-100); color: var(--green-700); }
.pagination button.active { background: var(--green-600); color: #fff; box-shadow: 0 2px 8px rgba(22,163,74,0.3); }
.pagination button:disabled { opacity: 0.3; cursor: default; }

.status-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 600; }
.status-paid, .status-delivered { background: rgba(34,197,94,0.1); color: var(--green-600); }
.status-pending { background: rgba(234,179,8,0.1); color: var(--gold-600); animation: statusPulse 2s ease infinite; }
.status-generated, .status-sent { background: rgba(22,163,74,0.08); color: var(--green-700); }
.status-failed { background: rgba(239,68,68,0.1); color: var(--red); }

.sports-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.sport-card {
  background: var(--card); border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow); cursor: pointer;
  position: relative; overflow: hidden;
  transition: var(--transition);
  border: 1px solid var(--border);
  animation: staggerFade 0.5s ease both;
}
.sport-card:hover {
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  transform: translateY(-5px) scale(1.02);
  border-color: var(--green-200);
}
.sport-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, rgba(34,197,94,0.04), transparent); opacity: 0; transition: opacity 0.3s; pointer-events: none; border-radius: inherit; }
.sport-card:hover::after { opacity: 1; }
.sport-card:active { transform: translateY(-2px) scale(0.99); }
.sport-card .sport-icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; margin-bottom: 16px;
  transition: var(--transition);
}
.sport-card:hover .sport-icon { transform: scale(1.1) rotate(-5deg); }
.sport-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.sport-card .sport-meta { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 16px; }
.sport-card .sport-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.sport-card .sport-stat .stat-value { font-size: 1.1rem; font-weight: 700; }
.sport-card .sport-stat .stat-label { font-size: 0.7rem; color: var(--text-muted); }
.sport-card .sport-growth { position: absolute; top: 20px; right: 20px; font-size: 0.8rem; font-weight: 600; padding: 4px 10px; border-radius: 8px; }
.sport-card .sport-growth.positive { background: rgba(34,197,94,0.1); color: var(--green-600); }
.sport-card .sport-growth.negative { background: rgba(239,68,68,0.1); color: var(--red); }

.setting-section { margin-bottom: 24px; }
.setting-section-title { font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.05em; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid var(--border); }
.setting-row:last-of-type { border-bottom: none; }
.setting-row label { font-weight: 500; font-size: 0.9rem; }
.setting-row label small { display: block; font-weight: 400; font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.form-input { padding: 8px 14px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--bg); color: var(--text); font-size: 0.875rem; width: 320px; transition: var(--transition); }
.form-input:focus { outline: none; border-color: var(--green-400); box-shadow: 0 0 0 4px rgba(34,197,94,0.08); }
.toggle-group { display: flex; gap: 4px; background: var(--bg); border-radius: 10px; padding: 3px; }
.toggle-btn { padding: 6px 18px; border-radius: 8px; font-size: 0.8rem; font-weight: 500; color: var(--text-secondary); transition: var(--transition); }
.toggle-btn.active { background: var(--card); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; border-radius: 10px; font-size: 0.85rem; font-weight: 600; transition: var(--transition); position: relative; overflow: hidden; }
.btn-primary { background: linear-gradient(135deg, var(--green-600), var(--green-700)); color: #fff; box-shadow: 0 4px 12px rgba(22,163,74,0.3); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(22,163,74,0.4); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--green-50); color: var(--green-700); }

.about-card .about-content { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
.about-logo { text-align: center; padding: 40px 20px; position: relative; }
.about-logo::before { content: ''; position: absolute; top: 20px; left: 50%; transform: translateX(-50%); width: 160px; height: 160px; border-radius: 50%; background: radial-gradient(circle, rgba(234,179,8,0.06), transparent 70%); pointer-events: none; }
.about-logo-img { width: 120px; height: 120px; border-radius: 24px; object-fit: cover; margin-bottom: 16px; box-shadow: 0 8px 32px rgba(0,0,0,0.12); transform: perspective(600px) rotateY(0deg); transition: transform 0.5s ease; }
.about-logo-img:hover { transform: perspective(600px) rotateY(5deg); }
.about-section h3 i { color: var(--green-600); margin-right: 8px; font-size: 0.95rem; }
.valour-logo-large {
  font-size: 2.5rem; font-weight: 800; letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--green-800), var(--green-700) 40%, var(--gold-500));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.dark .valour-logo-large { background: linear-gradient(135deg, var(--green-200), var(--green-300) 40%, var(--gold-400)); -webkit-background-clip: text; background-clip: text; }
.valour-logo-large span { -webkit-text-fill-color: var(--gold-500); }
.about-organizer { font-size: 0.9rem; color: var(--text-secondary); margin-top: 6px; }
.about-section { margin-bottom: 24px; }
.about-section h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.about-section p { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.7; }
.about-section ul li { display: flex; align-items: center; gap: 10px; padding: 6px 0; font-size: 0.875rem; color: var(--text-secondary); }
.about-section ul li i { width: 18px; color: var(--green-600); }

@media (min-width: 769px) {
  .sidebar-overlay { display: none !important; }
  .mobile-menu-btn { display: none !important; }
}

.refreshing .kpi-value { animation: pulse 0.6s ease; }
.loading-row td { position: relative; }
.loading-row td::after {
  content: ''; position: absolute; inset: 8px 14px;
  background: linear-gradient(90deg, var(--green-100) 25%, var(--green-200) 50%, var(--green-100) 75%);
  background-size: 200px 100%; animation: shimmer 1.5s infinite; border-radius: 4px;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--green-200); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--green-300); }
.dark ::-webkit-scrollbar-thumb { background: var(--green-700); }
.dark ::-webkit-scrollbar-thumb:hover { background: var(--green-600); }
.content::-webkit-scrollbar-track { background: transparent; }


.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; cursor: pointer; inset: 0; background: var(--text-muted); border-radius: 24px; transition: 0.3s; }
.switch .slider::before { content: ''; position: absolute; height: 18px; width: 18px; left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.3s; }
.switch input:checked + .slider { background: var(--green-500); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ====== MOBILE-FIRST RESPONSIVE ====== */

canvas { max-width: 100%; }

/* Small phones (<480px) */
@media (max-width: 480px) {
  html { font-size: 14px; }
  body { overflow-x: hidden; }

  /* ===== Lock screen ===== */
  .lock-card { padding: 28px 16px 24px; width: 94vw; }
  .lock-logo { width: 64px; height: 64px; margin-bottom: 12px; }
  .lock-title { font-size: 1.3rem; }
  .lock-subtitle { font-size: 0.7rem; margin-bottom: 16px; }
  .google-btn { padding: 10px 16px; border-radius: 12px; }
  .google-text { font-size: 14px; }
  .google-icon { width: 18px; height: 18px; margin-right: 6px; }

  /* ===== Sidebar - slide-out overlay ===== */
  .sidebar { width: 0; overflow: hidden; border-right: none; }
  .sidebar.open { width: min(300px, 85vw); }
  .sidebar.collapsed { width: 0; }
  .sidebar.open.collapsed { width: min(300px, 85vw); }
  .sidebar-toggle { display: none; }
  .sidebar-brand { padding: 14px 16px; min-height: 56px; }
  .sidebar.open .sidebar-brand { padding: 14px 20px; }
  .sidebar-nav { padding: 6px 0; }
  .sidebar.open .nav-item { padding: 14px 20px; }
  .nav-item { min-height: 48px; font-size: 0.9rem; }
  .sidebar-footer { padding: 12px 16px; }
  .sidebar.open .sidebar-footer { padding: 12px 20px; }

  .sidebar-overlay {
    position: fixed; inset: 0; z-index: 999;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
  }
  .sidebar.open ~ .sidebar-overlay,
  .sidebar.open + .sidebar-overlay { opacity: 1; pointer-events: auto; }

  .main-wrapper { margin-left: 0 !important; }

  /* ===== Topbar ===== */
  .topbar { padding: 0 6px; height: 48px; }
  .topbar-search { width: 36px; height: 36px; padding: 0; gap: 0; border: none; background: transparent; }
  .topbar-search input { display: none; }
  .topbar-search i { font-size: 0.95rem; color: var(--text-secondary); }
  .topbar-search:focus-within { width: 100%; border-color: transparent; box-shadow: none; background: transparent; position: absolute; left: 0; right: 0; z-index: 200; padding: 0 44px 0 12px; }
  .topbar-search:focus-within input { display: block; font-size: 0.85rem; }
  .topbar-actions { gap: 2px; }
  .topbar-btn { width: 36px; height: 36px; border-radius: 8px; font-size: 0.9rem; }
  .mobile-menu-btn { display: flex !important; }
  .topbar-datetime { display: none; }
  .topbar-profile .name,
  .topbar-profile .role { display: none; }
  .topbar-profile { padding: 2px; gap: 0; }
  .topbar-profile .avatar { width: 30px; height: 30px; font-size: 0.7rem; }

  /* ===== Page headers ===== */
  .page-header { margin-bottom: 8px; }
  .page-badge { font-size: 0.6rem; padding: 2px 8px; margin-bottom: 3px; }
  .page-title { font-size: 1.05rem; }
  .page-subtitle { font-size: 0.7rem; margin-top: 2px; }

  /* ===== KPI grid ===== */
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
  .kpi-card { padding: 10px; }
  .kpi-card .kpi-icon { width: 28px; height: 28px; font-size: 0.8rem; }
  .kpi-card .kpi-label { font-size: 0.6rem; }
  .kpi-card .kpi-value { font-size: 1.1rem; }
  .kpi-card .kpi-top { margin-bottom: 6px; }

  /* ===== Charts ===== */
  .chart-grid { grid-template-columns: 1fr; gap: 10px; margin-bottom: 12px; }
  .chart-grid .card-wide { grid-column: 1; }
  .chart-card canvas { max-height: 220px; min-height: 180px; }
  .chart-card .card-body { padding: 4px 8px 10px; }
  .chart-card .card-header { padding: 8px 10px 0; }
  .chart-card .card-header h3 { font-size: 0.75rem; }
  .card-body { padding: 8px 12px 14px; }
  .card-header { padding: 8px 12px 0; }
  .card-header h3 { font-size: 0.8rem; }
  .card { margin-bottom: 10px; }

  /* ===== Tables ===== */
  .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  td, th { padding: 7px 5px; font-size: 0.68rem; }
  th { font-size: 0.62rem; padding: 7px 5px; }

  /* ===== Search bars ===== */
  .search-bar { height: 38px; padding: 0 10px; }
  .search-input { font-size: 0.78rem; }
  .search-bar:focus-within { width: 100% !important; }

  /* ===== Sports grid ===== */
  .sports-grid { grid-template-columns: 1fr; gap: 10px; }
  .sport-card { padding: 12px; }
  .sport-card .sport-icon { width: 34px; height: 34px; font-size: 0.95rem; margin-bottom: 8px; }
  .sport-card h3 { font-size: 0.9rem; }
  .sport-card .sport-stats { gap: 4px; }
  .sport-card .sport-stat .stat-value { font-size: 0.9rem; }
  .sport-card .sport-growth { top: 8px; right: 8px; font-size: 0.6rem; padding: 2px 6px; }

  /* ===== Settings ===== */
  .form-input { width: 100%; max-width: 100%; }
  .setting-row { flex-direction: column; align-items: flex-start; gap: 8px; padding: 10px 0; }
  .setting-row label { font-size: 0.8rem; }
  .setting-row label small { display: inline; }
  .setting-section-title { font-size: 0.7rem; }
  .toggle-group { align-self: flex-start; }

  /* ===== Buttons ===== */
  .btn { padding: 8px 12px; font-size: 0.75rem; border-radius: 8px; }
  .btn-primary:hover { transform: none; }

  /* ===== Filter controls ===== */
  .table-controls { gap: 6px; flex-direction: column; align-items: stretch; }
  .filter-group { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; padding-bottom: 4px; }
  .filter-btn { padding: 8px 12px; min-height: 38px; font-size: 0.72rem; white-space: nowrap; flex-shrink: 0; }

  /* ===== Pagination ===== */
  .pagination { gap: 4px; }
  .pagination button { width: 36px; height: 36px; font-size: 0.75rem; min-width: 36px; }

  /* ===== Status badges ===== */
  .status-badge { padding: 2px 6px; font-size: 0.62rem; }

  /* ===== About ===== */
  .about-card .about-content { grid-template-columns: 1fr; }
  .about-logo { padding: 20px 10px; }
  .about-logo-img { width: 80px; height: 80px; }
  .valour-logo-large { font-size: 1.6rem; }
  .about-section h3 { font-size: 0.85rem; }
  .about-section p { font-size: 0.75rem; }
  .about-section ul li { font-size: 0.75rem; padding: 4px 0; }

  /* ===== Content ===== */
  .content { padding: 6px; }

  /* ===== Table link ===== */
  .table-link { font-size: 0.65rem; }

  /* ===== Disable stagger animations on mobile for performance ===== */
  tbody tr { animation: none !important; }
  .page.active > * { animation: none !important; }
  .sport-card { animation: none !important; }
  .card { transform: none !important; }
  .card:hover { transform: none !important; }
  .chart-card:hover { transform: none !important; }
  .kpi-card:hover { transform: none !important; }
  .sport-card:hover { transform: none !important; }
}

/* Large phones / small tablets (481-768px) */
@media (min-width: 481px) and (max-width: 768px) {
  html { font-size: 15px; }

  .sidebar { width: 0; overflow: hidden; border-right: none; }
  .sidebar.open { width: min(300px, 80vw); }
  .sidebar.collapsed { width: 0; }
  .sidebar.open.collapsed { width: min(300px, 80vw); }
  .sidebar-brand { padding: 14px 16px; min-height: 60px; }
  .sidebar.open .sidebar-brand { padding: 14px 20px; }
  .sidebar-nav { padding: 8px 0; }
  .sidebar.open .nav-item { padding: 14px 20px; }
  .nav-item { min-height: 48px; }
  .sidebar-footer { padding: 12px 16px; }
  .sidebar.open .sidebar-footer { padding: 12px 20px; }

  .sidebar-overlay {
    position: fixed; inset: 0; z-index: 999;
    background: rgba(0,0,0,0.5); backdrop-filter: blur(4px);
    opacity: 0; pointer-events: none; transition: opacity 0.3s ease;
  }
  .sidebar.open ~ .sidebar-overlay,
  .sidebar.open + .sidebar-overlay { opacity: 1; pointer-events: auto; }

  .main-wrapper { margin-left: 0 !important; }
  .mobile-menu-btn { display: flex !important; }
  .sidebar-toggle { display: none; }

  .topbar { padding: 0 10px; height: 54px; }
  .topbar-search { width: 100px; height: 36px; }
  .topbar-actions { gap: 3px; }
  .topbar-btn { width: 36px; height: 36px; border-radius: 8px; font-size: 0.9rem; }
  .topbar-datetime { display: none; }
  .topbar-profile .name,
  .topbar-profile .role { display: none; }

  .content { padding: 10px; }
  .page-title { font-size: 1.15rem; }
  .page-header { margin-bottom: 10px; }

  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .kpi-card { padding: 12px; }
  .kpi-card .kpi-value { font-size: 1.2rem; }

  .chart-grid { grid-template-columns: 1fr; gap: 12px; }
  .chart-card canvas { max-height: 240px; min-height: 200px; }
  .card-body { padding: 10px 14px 16px; }
  .card-header { padding: 10px 14px 0; }
  .card-header h3 { font-size: 0.85rem; }

  .table-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  td, th { padding: 8px 6px; font-size: 0.7rem; }
  th { font-size: 0.65rem; }

  .search-bar { height: 38px; padding: 0 10px; }
  .search-input { font-size: 0.8rem; }
  .search-bar:focus-within { width: 100%; }

  .sports-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .sport-card { padding: 14px; }
  .sport-card .sport-icon { width: 38px; height: 38px; font-size: 1rem; }
  .sport-card h3 { font-size: 0.95rem; }

  .form-input { width: 100%; max-width: 100%; }
  .setting-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .setting-row label small { display: inline; }
  .toggle-group { align-self: flex-start; }

  .filter-btn { padding: 8px 12px; min-height: 38px; font-size: 0.72rem; }
  .pagination button { width: 36px; height: 36px; }

  .table-controls { gap: 8px; }
  .btn { padding: 8px 12px; font-size: 0.78rem; }

  /* Disable hover transforms on touch devices for performance */
  .card { transform: none !important; }
  .card:hover { transform: none !important; }
  .chart-card:hover { transform: none !important; }
  .kpi-card:hover { transform: none !important; }
  .sport-card:hover { transform: none !important; }

  .about-card .about-content { grid-template-columns: 1fr; }

  .status-badge { font-size: 0.65rem; }
}

/* Tablets / small laptops (769-1200px) */
@media (min-width: 769px) and (max-width: 1200px) {
  .sidebar { width: var(--sidebar-collapsed); }
  .sidebar .nav-item { padding: 12px 26px; justify-content: center; }
  .sidebar .nav-item .nav-label { opacity: 0; width: 0; overflow: hidden; }
  .sidebar .nav-item.active::after { display: none; }
  .sidebar .sidebar-brand { padding: 18px 16px; justify-content: center; }
  .sidebar .sidebar-brand .valour-logo,
  .sidebar .sidebar-brand .valour-sub { display: none; }
  .sidebar .sidebar-toggle { display: none; }
  .sidebar .sidebar-footer { justify-content: center; padding: 16px; }
  .sidebar .sidebar-footer .org-badge { display: none; }
  .sidebar .nav-section-label { display: none; }
  .main-wrapper { margin-left: var(--sidebar-collapsed); }

  .nav-item:hover .nav-label {
    position: fixed; left: var(--sidebar-collapsed); margin-top: -2px;
    background: var(--green-800); color: #fff; padding: 8px 14px;
    border-radius: 8px; font-size: 0.8rem; white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3); z-index: 1001;
    opacity: 1; width: auto; overflow: visible;
    border: 1px solid rgba(255,255,255,0.1);
    pointer-events: none; animation: fadeScaleIn 0.2s ease;
  }

  .chart-grid { grid-template-columns: 1fr 1fr; }
  .kpi-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
  .content { padding: 20px; }
  .topbar { padding: 0 16px; }
  .topbar-search { width: 200px; }
  .topbar-datetime { display: none; }
  .about-card .about-content { grid-template-columns: 1fr; }
  .form-input { width: 240px; }
}

/* Override hover effects on touch devices */
@media (hover: none) {
  .kpi-card:hover,
  .sport-card:hover,
  .card:hover,
  .chart-card:hover,
  .topbar-btn:hover,
  .nav-item:hover { transform: none !important; box-shadow: var(--shadow) !important; }
  .kpi-card:hover::before { opacity: 0; }
  .sport-card:hover::after { opacity: 0; }
  .sport-card:hover .sport-icon { transform: none; }
  .topbar-profile:hover { background: transparent; }
  .nav-item:hover i { transform: none; }
}


