/* ===== Spot Tracker — Design System (Event Tracker Style) ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #0f0e1a; --bg-2: #141228; --bg-3: #1a1838;
  --card: rgba(38, 33, 92, 0.25); --card-solid: #1a1838;
  --border: rgba(127, 119, 221, 0.2); --border-hover: rgba(127, 119, 221, 0.45);
  --purple: #7F77DD; --purple-dark: #5a52b8; --purple-light: rgba(127, 119, 221, 0.15);
  --teal: #5DCAA5; --teal-light: rgba(93, 202, 165, 0.15);
  --yellow: #F5A623; --yellow-light: rgba(245, 166, 35, 0.15);
  --red: #E05C6E; --red-light: rgba(224, 92, 110, 0.15);
  --blue: #7F77DD; --blue-dark: #5a52b8;
  --green: #5DCAA5; --green-dark: #3aaa88;
  --gray: #8884c4;
  --text: #EEEDFE; --text-muted: #9b97d4; --text-dim: #6b67a8; --text-light: #6b67a8;
  --bg-card: var(--card-solid); --bg-sidebar: rgba(20,18,40,0.88); --bg-hover: rgba(127,119,221,0.08);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --radius: 12px; --radius-sm: 8px; --radius-lg: 18px;
  --shadow: 0 2px 8px rgba(0,0,0,0.3), 0 0 0 1px rgba(127,119,221,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.4), 0 0 0 1px rgba(127,119,221,0.1);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(127,119,221,0.15);
  --glow-purple: 0 0 24px rgba(127, 119, 221, 0.25);
  --sidebar-w: 240px;
}

/* ===== LIGHT THEME — soft lavender, mai bianco puro ===== */
[data-theme="light"] {
  --bg: #e6e4f0; --bg-2: #dddbe8; --bg-3: #eae8f2;
  --card: rgba(234, 231, 245, 0.75); --card-solid: #eae8f2;
  --border: rgba(100, 92, 170, 0.16); --border-hover: rgba(100, 92, 170, 0.32);
  --purple: #6358c4; --purple-dark: #4e45a8; --purple-light: rgba(99, 88, 196, 0.12);
  --teal: #2a9d78; --teal-light: rgba(42, 157, 120, 0.12);
  --yellow: #c07b10; --yellow-light: rgba(192, 123, 16, 0.12);
  --red: #b83040; --red-light: rgba(184, 48, 64, 0.12);
  --blue: #6358c4; --blue-dark: #4e45a8;
  --green: #2a9d78; --green-dark: #1e8562;
  --gray: #7872b0;
  --text: #2d2a4a; --text-muted: #656090; --text-dim: #908cb8; --text-light: #908cb8;
  --bg-card: #eae8f2; --bg-sidebar: rgba(228,225,240,0.96); --bg-hover: rgba(100,92,170,0.07);
  --shadow: 0 2px 8px rgba(80,70,140,0.07), 0 0 0 1px rgba(100,92,170,0.05);
  --shadow-md: 0 4px 16px rgba(80,70,140,0.09), 0 0 0 1px rgba(100,92,170,0.07);
  --shadow-lg: 0 12px 40px rgba(80,70,140,0.12), 0 0 0 1px rgba(100,92,170,0.08);
  --glow-purple: 0 0 20px rgba(99, 88, 196, 0.12);
}
[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(232,229,244,0.97) 0%, rgba(222,218,238,0.98) 100%);
  box-shadow: 4px 0 24px rgba(80,70,140,0.08);
}
[data-theme="light"] .sidebar::before { background: linear-gradient(90deg, transparent, var(--purple), var(--teal), transparent); opacity: 0.35; }
[data-theme="light"] .login-card { background: rgba(234, 231, 245, 0.92); }
[data-theme="light"] .login-page { background: var(--bg); }
[data-theme="light"] .modal { background: rgba(234, 231, 245, 0.97); }
[data-theme="light"] .modal-head, [data-theme="light"] .modal-foot { background: rgba(234, 231, 245, 0.98); }
[data-theme="light"] th { background: rgba(220, 216, 236, 0.7); }
[data-theme="light"] .table th { background: rgba(220, 216, 236, 0.7); }
[data-theme="light"] input[type="text"], [data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"], [data-theme="light"] input[type="date"],
[data-theme="light"] input[type="number"], [data-theme="light"] select, [data-theme="light"] textarea {
  background: rgba(240, 238, 248, 0.7);
}
[data-theme="light"] select option { background: #eae8f2; color: var(--text); }
[data-theme="light"] .stat-card .stat-value { color: var(--text); }
[data-theme="light"] .stat-card .stat-label { color: var(--text-muted); }
[data-theme="light"] .stat-card.blue   { background: linear-gradient(135deg, rgba(99,88,196,0.14) 0%, rgba(99,88,196,0.08) 100%); border-color: rgba(99,88,196,0.2); }
[data-theme="light"] .stat-card.green  { background: linear-gradient(135deg, rgba(42,157,120,0.14) 0%, rgba(42,157,120,0.08) 100%); border-color: rgba(42,157,120,0.2); }
[data-theme="light"] .stat-card.yellow { background: linear-gradient(135deg, rgba(192,123,16,0.14) 0%, rgba(192,123,16,0.08) 100%); border-color: rgba(192,123,16,0.2); }
[data-theme="light"] .stat-card.purple { background: linear-gradient(135deg, rgba(99,88,196,0.16) 0%, rgba(42,157,120,0.06) 100%); border-color: rgba(99,88,196,0.22); }
[data-theme="light"] .stat-card.orange { background: linear-gradient(135deg, rgba(192,123,16,0.16) 0%, rgba(192,100,16,0.06) 100%); border-color: rgba(192,123,16,0.22); }
[data-theme="light"] .stat-card:hover { box-shadow: 0 8px 28px rgba(80,70,140,0.12); }
[data-theme="light"] .sidebar-footer { background: rgba(218, 214, 234, 0.5); }
[data-theme="light"] .nav-item { color: var(--text-muted); background: rgba(100,92,170,0.05); }
[data-theme="light"] .nav-item:hover { background: rgba(100,92,170,0.1); color: var(--text); }
[data-theme="light"] .nav-item.active {
  background: linear-gradient(135deg, rgba(99,88,196,0.15) 0%, rgba(42,157,120,0.08) 100%);
  color: var(--purple);
  box-shadow: 0 0 16px rgba(99,88,196,0.08), inset 0 0 0 1px rgba(99,88,196,0.15);
}
[data-theme="light"] .user-name { color: var(--text); }
[data-theme="light"] .user-role { color: var(--text-muted); }
[data-theme="light"] .user-avatar { background: linear-gradient(135deg, var(--purple), rgba(42,157,120,0.6)); box-shadow: 0 0 0 2px rgba(234,231,245,0.9), 0 0 12px rgba(99,88,196,0.15); }
[data-theme="light"] .btn-icon { color: var(--text-muted); }
[data-theme="light"] .btn-icon:hover { color: var(--text); background: rgba(100,92,170,0.1); }
[data-theme="light"] .sidebar-brand { -webkit-text-fill-color: unset; }
[data-theme="light"] .card { background: var(--card); }
[data-theme="light"] .card:hover { box-shadow: var(--shadow-md); }
[data-theme="light"] .card-head { background: rgba(100,92,170,0.05); }
[data-theme="light"] .btn-primary { box-shadow: 0 2px 8px rgba(99,88,196,0.2); }
[data-theme="light"] .btn-primary:hover { box-shadow: 0 4px 20px rgba(99,88,196,0.35); }
[data-theme="light"] .btn-secondary { background: rgba(100,92,170,0.08); }
[data-theme="light"] .btn-secondary:hover { background: rgba(100,92,170,0.14); }
[data-theme="light"] .tab-btn.active { color: var(--purple); border-bottom-color: var(--purple); }
[data-theme="light"] ::-webkit-scrollbar-track { background: var(--bg); }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: #b5b0cc; }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: var(--purple); }
[data-theme="light"] .toast-success { background: rgba(42,157,120,0.14); border-color: rgba(42,157,120,0.25); color: var(--teal); }
[data-theme="light"] .toast-error { background: rgba(184,48,64,0.14); border-color: rgba(184,48,64,0.25); color: var(--red); }
[data-theme="light"] .toast-info { background: rgba(99,88,196,0.14); border-color: rgba(99,88,196,0.25); color: var(--purple); }
[data-theme="light"] .modal-overlay { background: rgba(45,42,74,0.35); }
[data-theme="light"] .login-logo h1 { -webkit-text-fill-color: transparent; }

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--purple); text-decoration: none; cursor: pointer; }
button { cursor: pointer; font-family: var(--font); font-size: inherit; }
input, select, textarea { font-family: var(--font); font-size: inherit; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #3C3489; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--purple); }
.hidden { display: none !important; }

/* ===== ANIMATIONS ===== */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes shimmerBtn { 0% { left: -80%; } 100% { left: 120%; } }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===== UTILITIES ===== */
.text-muted { color: var(--text-muted); font-size: .85rem; }
.text-green { color: var(--teal); }
.text-red { color: var(--red); }
.text-yellow { color: var(--yellow); }
.text-blue { color: var(--purple); }

/* ===== LOGIN ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  position: relative;
  z-index: 1;
  padding: 20px;
}
.login-container { width: 100%; max-width: 920px; padding: 1rem; }
.login-card {
  background: rgba(26, 24, 56, 0.85);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(127,119,221,0.1);
  backdrop-filter: blur(20px);
  animation: slideUp 0.4s ease;
}
.login-logo { text-align: center; margin-bottom: 2rem; }
.login-logo-img {
  width: 100%; max-width: 860px; height: auto; display: block; margin: 0 auto 1rem;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.45), 0 3px 10px rgba(0,0,0,0.25);
}
.login-logo h1 {
  font-size: 2rem; font-weight: 800;
  background: linear-gradient(135deg, #7F77DD 0%, #5DCAA5 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  letter-spacing: -0.04em;
  margin: .5rem 0 .2rem;
}
.login-logo p { color: var(--text-muted); font-size: .9rem; }
.login-footer { text-align: center; color: var(--text-dim); font-size: .75rem; margin-top: 1.5rem; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; color: var(--text-muted); font-size: .83rem; font-weight: 500; margin-bottom: .3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"],
input[type="number"], select, textarea {
  width: 100%;
  background: rgba(15, 14, 26, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--text-light); }
select option { background: #1a1838; color: var(--text); }
input:focus, select:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px rgba(127,119,221,0.15); }
textarea { resize: vertical; min-height: 80px; }
.search-input { max-width: 200px; }
.select-input { max-width: 180px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 500;
  font-size: .875rem;
  transition: all .15s;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.btn-primary {
  background: linear-gradient(135deg, var(--purple) 0%, var(--purple-dark) 100%);
  color: white;
  box-shadow: 0 2px 8px rgba(127,119,221,0.3);
}
.btn-primary::after {
  content: ''; position: absolute; top: -50%; left: -80%; width: 60%; height: 200%;
  background: rgba(255,255,255,0.12); transform: skewX(-20deg); pointer-events: none;
}
.btn-primary:hover::after { animation: shimmerBtn 0.55s ease forwards; }
.btn-primary:hover { box-shadow: 0 4px 20px rgba(127,119,221,0.55); transform: translateY(-1px); }
.btn-secondary { background: rgba(127,119,221,0.1); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--border-hover); background: rgba(127,119,221,0.2); }
.btn-danger { background: rgba(224, 92, 110, 0.2); color: var(--red); border-color: rgba(224, 92, 110, 0.3); }
.btn-danger:hover { background: var(--red); color: white; }
.btn-success { background: linear-gradient(135deg, var(--teal) 0%, #3aaa88 100%); color: #0f0e1a; font-weight: 600; box-shadow: 0 2px 8px rgba(93,202,165,0.3); }
.btn-success:hover { box-shadow: 0 4px 16px rgba(93,202,165,0.5); transform: translateY(-1px); }
.btn-warning { background: rgba(245, 166, 35, 0.2); color: var(--yellow); border-color: rgba(245, 166, 35, 0.3); }
.btn-warning:hover { background: var(--yellow); color: #0f0e1a; }
.btn-sm { padding: 5px 10px; font-size: .78rem; }
.btn-full { width: 100%; justify-content: center; padding: .75rem; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none !important; }
.btn-icon {
  background: none;
  border: none;
  color: rgba(255,255,255,0.45);
  font-size: 1rem;
  padding: .3rem .5rem;
  border-radius: 4px;
  transition: color .15s, background .15s;
}
.btn-icon:hover { color: #fff; background: rgba(127,119,221,0.15); }
.btn.copied { background: var(--teal) !important; border-color: var(--teal) !important; color: #0f0e1a !important; }

/* ===== ALERTS ===== */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: .875rem; margin-top: .75rem; }
.alert-error { background: rgba(224,92,110,0.1); color: var(--red); border-left: 3px solid var(--red); }
.alert-success { background: rgba(93,202,165,0.1); color: var(--teal); border-left: 3px solid var(--teal); }

/* ===== APP LAYOUT ===== */
.app { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: linear-gradient(180deg, rgba(20,18,40,0.88) 0%, rgba(15,14,26,0.95) 100%);
  border-right: 1px solid rgba(127,119,221,0.15);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  backdrop-filter: blur(32px) saturate(1.4);
  box-shadow: 4px 0 32px rgba(0,0,0,0.4);
  overflow: hidden;
}
.sidebar::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--purple), var(--teal), transparent);
  opacity: 0.5; z-index: 1;
}
.sidebar-logo {
  padding: 16px 16px 4px;
  text-align: center;
  position: relative; z-index: 1;
}
.sidebar-logo-img {
  height: 9rem; width: auto; max-width: 100%; object-fit: contain; opacity: 0.9;
  transition: opacity 0.2s; border-radius: 12px;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3));
}
.sidebar-logo-img:hover { opacity: 1; }
.sidebar-header {
  position: relative; z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 10px 16px 12px;
  border-bottom: 1px solid rgba(127,119,221,0.12);
}
.sidebar-brand {
  font-size: 1rem; font-weight: 800; letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--purple), var(--teal));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.sidebar-nav {
  position: relative; z-index: 1;
  flex: 1; padding: 8px 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 3px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  margin: 2px 8px;
  border-radius: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
  border: none;
  background: none;
}
.nav-item:hover { background: rgba(127,119,221,0.08); color: var(--text); }
.nav-item.active {
  background: linear-gradient(135deg, rgba(127,119,221,0.16) 0%, rgba(93,202,165,0.08) 100%);
  color: #fff; font-weight: 600;
  box-shadow: 0 0 20px rgba(127,119,221,0.1), inset 0 0 0 1px rgba(127,119,221,0.18);
}
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 20%; bottom: 20%; width: 3px;
  background: linear-gradient(180deg, var(--purple), var(--teal)); border-radius: 0 4px 4px 0;
}
.nav-icon { width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 1rem; }
.nav-label { flex: 1; white-space: nowrap; font-size: .83rem; font-weight: 500; }
.sidebar-footer {
  position: relative; z-index: 1;
  display: flex;
  align-items: center;
  gap: .5rem;
  padding: 10px 12px;
  border-top: 1px solid rgba(127,119,221,0.12);
  background: rgba(10, 9, 18, 0.4);
}
.user-pill { display: flex; align-items: center; gap: .5rem; flex: 1; overflow: hidden; }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--purple), rgba(15,14,26,0.6));
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(15,14,26,0.9), 0 0 16px rgba(127,119,221,0.2);
}
.user-info { overflow: hidden; }
.user-name { font-size: .8rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: rgba(255,255,255,0.9); }
.user-role { font-size: .7rem; color: var(--text-muted); text-transform: capitalize; }

/* ===== MAIN ===== */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 28px;
  max-width: calc(100vw - var(--sidebar-w));
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* ===== PAGE ===== */
.page { display: block; animation: fadeIn 0.2s ease; }
.page.hidden { display: none; }
.page-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 24px;
}
.page-header h2 { font-size: 1.5rem; font-weight: 700; flex: 1; letter-spacing: -0.02em; }
.page-actions { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }

/* ===== STATS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  border-radius: 14px;
  padding: 1.4rem 1rem 1.2rem;
  text-align: center;
  transition: all .25s;
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(12px);
}
.stat-card::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(255,255,255,0.06) 0%, transparent 70%);
  pointer-events: none;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 28px rgba(0,0,0,0.4); }
.stat-card.blue   { background: linear-gradient(135deg, rgba(127,119,221,0.2) 0%, rgba(90,82,184,0.15) 100%); border-color: rgba(127,119,221,0.25); box-shadow: 0 4px 16px rgba(127,119,221,0.15); }
.stat-card.green  { background: linear-gradient(135deg, rgba(93,202,165,0.2) 0%, rgba(93,202,165,0.1) 100%); border-color: rgba(93,202,165,0.25); box-shadow: 0 4px 16px rgba(93,202,165,0.15); }
.stat-card.yellow { background: linear-gradient(135deg, rgba(245,166,35,0.2) 0%, rgba(245,166,35,0.1) 100%); border-color: rgba(245,166,35,0.25); box-shadow: 0 4px 16px rgba(245,166,35,0.15); }
.stat-card.purple { background: linear-gradient(135deg, rgba(127,119,221,0.25) 0%, rgba(93,202,165,0.1) 100%); border-color: rgba(127,119,221,0.3); box-shadow: 0 4px 16px rgba(127,119,221,0.2); }
.stat-card.orange { background: linear-gradient(135deg, rgba(245,166,35,0.25) 0%, rgba(245,130,35,0.1) 100%); border-color: rgba(245,166,35,0.3); box-shadow: 0 4px 16px rgba(245,166,35,0.2); }
.stat-icon { font-size: 2rem; margin-bottom: .5rem; position: relative; z-index: 1; }
.stat-value { font-size: 2.2rem; font-weight: 800; line-height: 1; position: relative; z-index: 1; color: #fff; }
.stat-num { font-size: 2.2rem; font-weight: 800; line-height: 1; position: relative; z-index: 1; color: #fff; }
.stat-label { color: rgba(255,255,255,0.65); font-size: .78rem; margin-top: .35rem; position: relative; z-index: 1; font-weight: 500; }
.stat-lbl { color: rgba(255,255,255,0.65); font-size: .78rem; margin-top: .35rem; position: relative; z-index: 1; font-weight: 500; }

/* ===== CARD ===== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  animation: fadeIn 0.2s ease;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.card:hover { border-color: var(--border-hover); box-shadow: var(--shadow-md); }
.card-head {
  padding: .9rem 1rem;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: .9rem;
  background: rgba(127,119,221,0.04);
}

/* ===== ROW-2 ===== */
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ===== TABLE ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: .875rem;
}
.table th {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 14px;
  background: rgba(15, 14, 26, 0.6);
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.table td {
  padding: 11px 14px;
  border-bottom: 1px solid rgba(127,119,221,0.08);
  vertical-align: middle;
}
.table tbody tr:hover td { background: rgba(127,119,221,0.05); }
.table tbody tr:last-child td { border-bottom: none; }
.td-loading { text-align: center; padding: 2rem; color: var(--text-muted); }
.td-actions { display: flex; gap: .3rem; white-space: nowrap; }

/* ===== TABS ===== */
.tab-btn {
  padding: 10px 18px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s;
  background: none;
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text); background: rgba(127,119,221,0.05); }
.tab-btn.active { color: var(--purple); border-bottom-color: var(--purple); }

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: .73rem;
  font-weight: 600;
  white-space: nowrap;
}
.badge-green, .badge-success { background: var(--teal-light); color: var(--teal); border: 1px solid rgba(93,202,165,0.3); }
.badge-blue { background: var(--purple-light); color: var(--purple); border: 1px solid rgba(127,119,221,0.3); }
.badge-yellow, .badge-warning { background: var(--yellow-light); color: var(--yellow); border: 1px solid rgba(245,166,35,0.3); }
.badge-red, .badge-danger { background: var(--red-light); color: var(--red); border: 1px solid rgba(224,92,110,0.3); }
.badge-gray { background: rgba(127,119,221,0.1); color: var(--text-muted); border: 1px solid var(--border); }
.badge-purple { background: var(--purple-light); color: var(--purple); border: 1px solid rgba(127,119,221,0.3); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 7, 18, 0.7);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: rgba(26, 24, 56, 0.97);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(127,119,221,0.1);
  backdrop-filter: blur(20px);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  position: sticky; top: 0;
  background: rgba(26, 24, 56, 0.98);
  z-index: 1;
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
}
.modal-head h3 { font-size: 1.05rem; font-weight: 600; }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
  position: sticky; bottom: 0;
  background: rgba(26, 24, 56, 0.98);
  backdrop-filter: blur(20px);
}
.modal-box { /* alias for older markup */
  background: rgba(26, 24, 56, 0.97);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
}

/* ===== TOAST ===== */
#toasts, #toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideIn .25s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 360px;
  border: 1px solid transparent;
  backdrop-filter: blur(12px);
}
.toast-success { background: rgba(93,202,165,0.2); border-color: rgba(93,202,165,0.4); color: var(--teal); }
.toast-error { background: rgba(224,92,110,0.2); border-color: rgba(224,92,110,0.4); color: var(--red); }
.toast-info { background: rgba(127,119,221,0.2); border-color: rgba(127,119,221,0.4); color: var(--purple); }

/* ===== SIMPLE LIST ===== */
.simple-list { padding: .5rem 0; }
.simple-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .65rem 1rem;
  border-bottom: 1px solid rgba(127,119,221,0.08);
  font-size: 1rem;
}
.simple-list-item:last-child { border-bottom: none; }
.simple-list-item .item-title { color: var(--text); font-size: 1.05rem; font-weight: 600; }
.simple-list-item .item-title a { font-size: 1.05rem !important; }
.simple-list-item .item-meta { color: var(--text); font-size: .9rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .row-2 { grid-template-columns: 1fr; }
  .sidebar { width: 60px; min-width: 60px; }
  .sidebar-brand, .nav-label, .user-info, .sidebar-footer .btn-icon, .sidebar-logo { display: none; }
  .sidebar-header { justify-content: center; }
  .nav-item { justify-content: center; padding: .7rem; margin: 2px 4px; }
  .sidebar-footer { justify-content: center; }
  .main { margin-left: 60px; max-width: calc(100vw - 60px); }
}
@media (max-width: 600px) {
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .page-actions { width: 100%; }
  .search-input, .select-input { max-width: 100%; width: 100%; }
}
