/* ══════════════════════════════════════════════════════════
   TECHNO-FUTURISTIC DARK THEME
   Slightly dark colors • Neon accents • Cyber aesthetics
   ══════════════════════════════════════════════════════════ */

/* ── CSS Variables ── */
:root {
  --bg-deep: #060b18;
  --bg-body: #0a0f1e;
  --bg-panel: #0f1628;
  --bg-panel-alt: #0d1220;
  --bg-card: #111a2e;
  --bg-input: #080d1a;
  --bg-navbar: #070c1a;
  --border: #1a2744;
  --border-glow: #1e3a5f;
  --border-accent: rgba(0, 224, 255, 0.25);
  --text-main: #dce6f5;
  --text-muted: #7b8fad;
  --text-dim: #4a5d7a;
  --accent: #00d4ff;
  --accent-glow: rgba(0, 212, 255, 0.15);
  --accent-strong: rgba(0, 212, 255, 0.3);
  --accent2: #a855f7;
  --accent2-glow: rgba(168, 85, 247, 0.15);
  --income: #00e68a;
  --income-glow: rgba(0, 230, 138, 0.15);
  --expense: #ff4d6a;
  --expense-glow: rgba(255, 77, 106, 0.15);
  --warning: #f0a500;
  --warning-glow: rgba(240, 165, 0, 0.15);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 8px;
  --radius-lg: 14px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(0, 212, 255, 0.08);
  --grid-line: rgba(0, 212, 255, 0.01);
}

/* ── Thème AURORA GLASS (alias pour compat) ── */
[data-theme="aurora"] { /* identique à :root, conservé pour compat */ }

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

body {
  font-family: var(--font);
  background: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ══════════════════════════════════════════════════════════
   AURORA GLASS — overlays décoratifs (injectés par theme.js)
   ══════════════════════════════════════════════════════════ */
.fs-bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }

/* Verre + saturation sur la navbar */
.navbar {
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
}

.fs-bg-aurora .blob {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: 0.75;
}
.fs-bg-aurora .blob-1 {
  top: 5%; left: 10%; width: 50vw; height: 50vw;
  background: radial-gradient(circle, #a855f7, transparent 65%);
  animation: fsFloat1 18s ease-in-out infinite;
}
.fs-bg-aurora .blob-2 {
  top: 30%; right: 5%; width: 45vw; height: 45vw;
  background: radial-gradient(circle, #06b6d4, transparent 65%);
  animation: fsFloat2 22s ease-in-out infinite;
}
.fs-bg-aurora .blob-3 {
  bottom: -10%; left: 30%; width: 55vw; height: 55vw;
  background: radial-gradient(circle, #ec4899, transparent 65%);
  animation: fsFloat3 26s ease-in-out infinite;
}
.fs-bg-aurora .grain {
  position: absolute; inset: 0; opacity: 0.15; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}
.fs-bg-aurora .vignette {
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(5,5,24,0.6) 100%);
}
@keyframes fsFloat1 { 0%,100%{transform:translate(0,0) scale(1);} 50%{transform:translate(8vw,5vh) scale(1.15);} }
@keyframes fsFloat2 { 0%,100%{transform:translate(0,0) scale(1);} 50%{transform:translate(-6vw,8vh) scale(0.9);} }
@keyframes fsFloat3 { 0%,100%{transform:translate(0,0) scale(1);} 50%{transform:translate(4vw,-6vh) scale(1.1);} }

@media (prefers-reduced-motion: reduce) {
  .fs-bg-aurora .blob { animation: none !important; }
}

/* ══════════════════════════════
   NAVBAR
   ══════════════════════════════ */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  background: var(--bg-navbar);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(0, 212, 255, 0.06);
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-center {
  display: flex;
  align-items: center;
  gap: 4px;
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── Nav links ── */
.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  letter-spacing: 0.3px;
  transition: color 0.25s, background 0.25s, text-shadow 0.25s;
  position: relative;
}

.nav-link:hover {
  color: var(--accent);
  background: var(--accent-glow);
  text-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
}

.nav-link.active {
  color: var(--accent);
  background: var(--accent-glow);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 20%;
  right: 20%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent);
}

/* ── Dropdown ── */
.nav-dropdown {
  position: relative;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font);
  letter-spacing: 0.3px;
  transition: color 0.25s, background 0.25s, text-shadow 0.25s;
}

.dropdown-toggle:hover {
  text-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
}

.dropdown-toggle:hover {
  color: var(--accent);
  background: var(--accent-glow);
}

.arrow {
  font-size: 10px;
  transition: transform 0.2s;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 180px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
  box-shadow: var(--shadow), 0 0 30px rgba(0, 212, 255, 0.05);
  z-index: 110;
}

.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 6px;
  background: var(--bg-panel);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  border-top: 1px solid var(--border);
}

.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  border-radius: 5px;
  transition: color 0.2s, background 0.2s;
}

.dropdown-item:hover {
  background: var(--accent-glow);
  color: var(--accent);
}

/* ── Hamburger ── */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: transform 0.3s;
  box-shadow: 0 0 6px rgba(0, 212, 255, 0.3);
}

/* ── Logout ── */
.btn-logout {
  background: transparent;
  border: 1px solid rgba(255, 77, 106, 0.3);
  color: var(--expense);
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.btn-logout:hover {
  background: var(--expense-glow);
  border-color: var(--expense);
  box-shadow: 0 0 12px rgba(255, 77, 106, 0.2);
}

/* ══════════════════════════════
   LAYOUT
   ══════════════════════════════ */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px;
  position: relative;
  z-index: 1;
}

/* ── Panel ── */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow), var(--shadow-glow);
  position: relative;
  overflow: hidden;
}

/* Subtle top glow line on panels */
.panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.3;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  margin: -20px -20px 20px;
  background: linear-gradient(135deg, var(--bg-panel), rgba(0, 212, 255, 0.03));
}

.panel-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ── Controls bar ── */
.controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ── Select ── */
select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font);
  background: var(--bg-input);
  color: var(--text-main);
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: auto;
}

select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 0 12px rgba(0, 212, 255, 0.1);
}

.limit-select {
  min-width: 80px !important;
}

/* ── Buttons ── */
.btn-add,
.btn-refresh,
.btn-print,
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 0.3px;
}

.btn-add {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.1), rgba(0, 212, 255, 0.05));
  color: var(--accent);
  border-color: rgba(0, 212, 255, 0.3);
}

.btn-add:hover {
  background: linear-gradient(135deg, rgba(0, 212, 255, 0.2), rgba(0, 212, 255, 0.1));
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(0, 212, 255, 0.2);
}

.btn-refresh {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(168, 85, 247, 0.05));
  color: var(--accent2);
  border-color: rgba(168, 85, 247, 0.3);
}

.btn-refresh:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.1));
  border-color: var(--accent2);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.2);
}

.btn-print {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-print:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}

.btn-primary {
  background: linear-gradient(135deg, #00b4d8, #0090b0);
  color: #fff;
  border: none;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  box-shadow: 0 2px 12px rgba(0, 180, 216, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #00c4e8, #00a0c0);
  box-shadow: 0 4px 20px rgba(0, 180, 216, 0.4);
}

.btn-primary:active {
  transform: scale(0.97);
}

/* ── Btn sizes ── */
.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* ── Secondary button ── */
.btn-secondary,
.btn.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.1), rgba(168, 85, 247, 0.05));
  color: var(--accent2);
  border-color: rgba(168, 85, 247, 0.3);
  transition: all 0.25s;
  letter-spacing: 0.3px;
}

.btn-secondary:hover,
.btn.btn-secondary:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.2), rgba(168, 85, 247, 0.1));
  border-color: var(--accent2);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.2);
}

/* ── Danger button ── */
.btn-danger,
.btn.btn-danger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid rgba(255, 77, 106, 0.3);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  background: linear-gradient(135deg, rgba(255, 77, 106, 0.12), rgba(255, 77, 106, 0.05));
  color: var(--expense);
  transition: all 0.25s;
  letter-spacing: 0.3px;
}

.btn-danger:hover,
.btn.btn-danger:hover {
  background: linear-gradient(135deg, rgba(255, 77, 106, 0.22), rgba(255, 77, 106, 0.12));
  border-color: var(--expense);
  box-shadow: 0 0 16px rgba(255, 77, 106, 0.2);
}

/* ── Ghost button ── */
.btn-ghost,
.btn.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  background: transparent;
  color: var(--text-muted);
  transition: all 0.2s;
}

.btn-ghost:hover,
.btn.btn-ghost:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
  background: rgba(255, 255, 255, 0.03);
}

/* ── Status bar (pagination info) ── */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 13px;
  color: var(--text-dim);
  border-top: 1px solid var(--border);
  margin: 20px -20px -20px;
}

.status-dots {
  display: flex;
  gap: 3px;
}

.status-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
}

.status-dots span:first-child {
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination button {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font);
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}

.pagination button:disabled {
  opacity: 0.3;
  cursor: default;
}

.pagination .page-info {
  color: var(--text-dim);
  font-size: 13px;
  padding: 0 8px;
}

/* ══════════════════════════════
   DATA TABLE
   ══════════════════════════════ */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead {
  position: sticky;
  top: 0;
  z-index: 2;
}

th {
  background: linear-gradient(135deg, #0d1628, #0f1a30);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(26, 39, 68, 0.5);
  color: var(--text-main);
  font-size: 13px;
}

tr {
  transition: background 0.15s;
}

tr:hover td {
  background: rgba(0, 212, 255, 0.03);
}

tr:nth-child(even) td {
  background: rgba(15, 22, 40, 0.4);
}

tr:nth-child(even):hover td {
  background: rgba(0, 212, 255, 0.05);
}

.col-actions {
  width: 60px;
  text-align: center;
}

.null-val {
  color: var(--text-dim);
  font-style: italic;
  font-size: 12px;
}

/* ══════════════════════════════
   CRUD — Add form panel
   ══════════════════════════════ */
.add-form-panel {
  animation: slideDown 0.25s ease;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
}

.add-record-form {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 4px 0;
}

.form-row-inline {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-row-inline label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.form-row-inline input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  background: var(--bg-input);
  color: var(--text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-row-inline input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 0 12px rgba(0, 212, 255, 0.08);
}

.add-form-actions {
  margin-top: 14px;
  display: flex;
  gap: 10px;
}

.btn-close-panel {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 22px;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
  line-height: 1;
}

.btn-close-panel:hover {
  color: var(--expense);
  background: var(--expense-glow);
}

/* ── Delete row button ── */
.btn-delete-row {
  background: rgba(255, 77, 106, 0.08);
  border: 1px solid rgba(255, 77, 106, 0.15);
  color: var(--expense);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 6px;
  transition: all 0.2s;
  line-height: 1;
}

.btn-delete-row:hover {
  color: #ff8fa3;
  background: rgba(255, 77, 106, 0.18);
  border-color: rgba(255, 77, 106, 0.4);
  box-shadow: 0 0 10px rgba(255, 77, 106, 0.15);
}

/* ══════════════════════════════
   ROLE BADGES
   ══════════════════════════════ */
.role-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  padding: 2px 8px;
  border-radius: 10px;
  vertical-align: middle;
  margin-left: 4px;
}

.role-admin {
  background: var(--expense-glow);
  color: var(--expense);
  text-shadow: 0 0 6px rgba(255, 77, 106, 0.3);
}

.role-user {
  background: var(--accent-glow);
  color: var(--accent);
  text-shadow: 0 0 6px rgba(0, 212, 255, 0.3);
}

.role-viewer {
  background: rgba(123, 143, 173, 0.15);
  color: var(--text-muted);
}

/* ── Roles grid (users page) ── */
.roles-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.role-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  flex: 1;
  min-width: 160px;
}

.role-desc {
  color: var(--text-muted);
  font-size: 13px;
}

/* ── Role select ── */
.role-select {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.2s;
}

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

/* ══════════════════════════════
   LOGIN PAGE
   ══════════════════════════════ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-deep);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

/* Animated background glow for login */
.login-page::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(0, 212, 255, 0.08), transparent 70%);
  top: 20%;
  left: 30%;
  animation: loginGlow 8s ease-in-out infinite alternate;
}

.login-page::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(168, 85, 247, 0.06), transparent 70%);
  bottom: 10%;
  right: 20%;
  animation: loginGlow 10s ease-in-out infinite alternate-reverse;
}

@keyframes loginGlow {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(30px, -20px) scale(1.1); }
}

.login-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
}

.login-logo {
  text-align: center;
  margin-bottom: 20px;
  animation: logoFadeIn 0.8s ease-out;
}

.login-logo .logo {
  width: 220px;
  height: auto;
  filter: drop-shadow(0 4px 24px rgba(0, 212, 255, 0.25));
}

.logo-container {
  animation: logoFadeIn 0.8s ease-out;
}

.logo {
  width: 240px;
  height: auto;
  filter: drop-shadow(0 4px 24px rgba(0, 212, 255, 0.2));
  transition: filter 0.3s, transform 0.3s;
}

.logo:hover {
  filter: drop-shadow(0 6px 32px rgba(0, 212, 255, 0.4));
  transform: scale(1.03);
}

@keyframes logoFadeIn {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.login-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 212, 255, 0.05);
  position: relative;
}

/* Glow line on top of login card */
.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  border-radius: 2px;
}

.login-card h1 {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
  color: var(--text-main);
  letter-spacing: 0.5px;
}

.login-subtitle {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 28px;
}

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

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.form-group input {
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--bg-input);
  color: var(--text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow), 0 0 16px rgba(0, 212, 255, 0.1);
}

.form-group input::placeholder {
  color: var(--text-dim);
}

.btn-login {
  margin-top: 4px;
  padding: 12px;
  background: linear-gradient(135deg, #00b4d8, #0090b0);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 4px 16px rgba(0, 180, 216, 0.3);
}

.btn-login:hover {
  background: linear-gradient(135deg, #00c4e8, #00a0c0);
  box-shadow: 0 6px 24px rgba(0, 180, 216, 0.4);
}

.btn-login:active {
  transform: scale(0.98);
}

.login-error {
  background: var(--expense-glow);
  color: var(--expense);
  border: 1px solid rgba(255, 77, 106, 0.25);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 14px;
  margin-top: 4px;
}

/* ── Row count badge ── */
.row-count {
  background: var(--accent-glow);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 20px;
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.2);
}

/* ══════════════════════════════
   RESPONSIVE
   ══════════════════════════════ */
@media (max-width: 768px) {
  .hamburger { display: flex; }

  .navbar-center,
  .navbar-right {
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-navbar);
    border-bottom: 1px solid var(--border);
    padding: 12px 20px;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    animation: slideDown 0.25s ease;
  }

  .navbar-center.open,
  .navbar-right.open {
    display: flex;
  }

  .navbar-right.open {
    top: auto;
    border-top: 1px solid var(--border);
  }

  .nav-dropdown { width: 100%; }
  .dropdown-menu {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    background: rgba(0, 212, 255, 0.03);
    opacity: 1;
    visibility: visible;
    min-width: 100%;
  }
  .dropdown-menu::before { display: none; }
  .dropdown-toggle .arrow { display: none; }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .navbar { padding: 0 16px; }
  .container { padding: 16px; }
  .panel { padding: 16px; }
  .controls { flex-direction: column; align-items: stretch; }
  .controls-right { margin-left: 0; justify-content: space-between; }
  select { min-width: 100%; }
  .limit-select { min-width: auto !important; width: 80px; }
  .login-card { padding: 28px 24px; }
  .budget-stats { flex-direction: column; }
  .form-row { flex-direction: column; }
  .expense-form select,
  .expense-form input { min-width: 100%; }
}

/* ══════════════════════════════
   BUDGET STATS
   ══════════════════════════════ */
.budget-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 20px;
}

.budget-stats.four-cols {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.stat-card {
  flex: 1;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

/* Glow bar at top of stat cards */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  opacity: 0.5;
}

.stat-card .stat-icon {
  font-size: 24px;
  margin-bottom: 8px;
}

.stat-card.accent {
  border-color: rgba(0, 212, 255, 0.2);
  background: linear-gradient(135deg, var(--bg-panel), rgba(0, 212, 255, 0.04));
}

.stat-card.accent::before {
  background: var(--accent);
  opacity: 0.7;
}

.stat-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-main);
}

.stat-card.accent .stat-value {
  color: var(--accent);
  text-shadow: 0 0 16px rgba(0, 212, 255, 0.3);
}

/* ══════════════════════════════
   EXPENSE FORM
   ══════════════════════════════ */
.expense-form {
  margin-top: 8px;
}

.form-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.expense-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.expense-form .flex-grow {
  flex: 1;
  min-width: 140px;
}

.expense-form label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.expense-form input,
.expense-form select {
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--bg-input);
  color: var(--text-main);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.expense-form input:focus,
.expense-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.expense-form input::placeholder {
  color: var(--text-dim);
}

.month-picker {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--bg-input);
  color: var(--text-main);
}

.year-picker {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--bg-input);
  color: var(--text-main);
  width: 100px;
}

.view-toggle {
  background: linear-gradient(135deg, var(--accent2), #7c3aed);
  color: #fff;
  border: none;
  padding: 8px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.3);
  transition: all 0.2s;
}

.view-toggle:hover {
  background: linear-gradient(135deg, #b86dff, #8b5cf6);
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
}

.dash-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

/* ── Search bar ── */
.search-bar { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.search-input {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  background: var(--bg-input);
  color: var(--text-main);
  width: 200px;
  transition: border-color 0.2s;
}
.search-input:focus {
  border-color: var(--accent2);
  outline: none;
  box-shadow: 0 0 0 2px var(--accent2-glow);
}
.btn-search {
  background: linear-gradient(135deg, var(--accent2), #7c3aed);
  color: #fff;
  border: none;
  padding: 8px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-search:hover {
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
}
.btn-search-clear {
  background: var(--expense);
  color: #fff;
  border: none;
  padding: 8px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  transition: all 0.2s;
}
.btn-search-clear:hover {
  box-shadow: 0 0 12px rgba(255, 77, 106, 0.3);
}
.search-results { margin-top: 8px; }
.search-section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  padding: 12px 16px 4px;
  margin: 0;
}

/* ══════════════════════════════
   CATEGORIES MANAGEMENT
   ══════════════════════════════ */
.cat-manage-list { display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.cat-manage-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.cat-manage-main {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
}
.cat-manage-icon { font-size: 22px; min-width: 30px; text-align: center; }
.cat-manage-name { font-weight: 600; color: var(--text-main); flex: 1; }
.cat-manage-count { font-size: 12px; color: var(--text-dim); }
.cat-manage-actions { display: flex; gap: 6px; }
.cat-manage-actions button {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 4px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}
.cat-manage-actions button:hover {
  background: var(--accent2-glow);
}
.cat-manage-subs {
  border-top: 1px solid var(--border);
  padding: 8px 16px 8px 50px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cat-manage-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}
.cat-sub-bullet { color: var(--accent2); font-weight: 600; }
.cat-sub-name { flex: 1; color: var(--text-muted); font-size: 14px; }

/* ── Category Grid ── */
.category-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cat-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  min-width: 180px;
  flex: 1;
  transition: border-color 0.2s;
}

.cat-card:hover {
  border-color: var(--border-glow);
}

.cat-icon { font-size: 18px; }
.cat-name { font-size: 14px; color: var(--text-muted); flex: 1; }
.cat-count { font-size: 12px; color: var(--text-dim); }
.cat-total { font-size: 14px; font-weight: 700; color: var(--accent); }

/* Category card variants */
.cat-card.income-card {
  border-color: rgba(0, 230, 138, 0.2);
}
.cat-card.income-card .cat-total {
  color: var(--income);
  text-shadow: 0 0 8px rgba(0, 230, 138, 0.3);
}
.cat-card.savings-card {
  border-color: rgba(168, 85, 247, 0.2);
}
.cat-card.savings-card .cat-total {
  color: var(--accent2);
  text-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

/* ── Delete Button ── */
.btn-delete {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  padding: 4px 8px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.btn-delete:hover {
  color: var(--expense);
  background: var(--expense-glow);
}

/* ── Permissions grid ── */
.perm-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}

.perm-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-panel-alt);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: .85rem;
  color: var(--text-main);
  transition: background 0.15s, border-color 0.15s;
}

.perm-checkbox:hover {
  background: rgba(0, 212, 255, 0.04);
  border-color: var(--accent);
}

.perm-checkbox input[type=checkbox] {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.page-perm-item {
  min-width: 220px;
  padding: 12px 14px;
  align-items: flex-start;
}

.page-perm-item strong { font-size: .9rem; }
.page-perm-item small { font-size: .75rem; line-height: 1.3; }

/* ── Colors ── */
.income-color { color: var(--income) !important; text-shadow: 0 0 8px rgba(0, 230, 138, 0.2); }
.expense-color { color: var(--expense) !important; text-shadow: 0 0 8px rgba(255, 77, 106, 0.2); }
.savings-color { color: var(--accent2) !important; text-shadow: 0 0 8px rgba(168, 85, 247, 0.2); }

/* ── Charts row ── */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.chart-panel { min-height: 0; }
.chart-container { position: relative; height: 260px; padding: 8px; }
.chart-container-wide { position: relative; height: 220px; padding: 8px 12px; }

/* ── Tabs ── */
.budget-tabs {
  display: flex;
  gap: 4px;
  margin: 24px 0 16px;
  border-bottom: 2px solid var(--border);
  padding-bottom: 0;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.2s, border-color 0.2s, text-shadow 0.2s;
  font-family: var(--font);
  letter-spacing: 0.3px;
}

.tab-btn:hover {
  color: var(--text-muted);
}

.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.3);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Button variants ── */
.btn-income {
  background: linear-gradient(135deg, #00b359, var(--income)) !important;
  box-shadow: 0 2px 10px rgba(0, 230, 138, 0.3);
}
.btn-income:hover {
  background: linear-gradient(135deg, #009147, #00b359) !important;
  box-shadow: 0 4px 16px rgba(0, 230, 138, 0.4);
}
.btn-savings {
  background: linear-gradient(135deg, #7c3aed, var(--accent2)) !important;
  box-shadow: 0 2px 10px rgba(168, 85, 247, 0.3);
}
.btn-savings:hover {
  background: linear-gradient(135deg, #6d28d9, #7c3aed) !important;
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.4);
}

/* ── Form status ── */
.form-status {
  font-size: 13px;
  padding: 4px 0;
  min-height: 20px;
  color: var(--text-dim);
}
.form-status.ok { color: var(--income); }
.form-status.error { color: var(--expense); }

/* ── Checkbox group ── */
.form-check-group {
  display: flex;
  align-items: flex-end;
}
.form-check-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  padding-bottom: 10px;
}
.form-check-group input[type=checkbox] {
  accent-color: var(--income);
  width: 16px;
  height: 16px;
}

/* ── Savings total ── */
.savings-total-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--bg-panel), rgba(168, 85, 247, 0.06));
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 10px;
  margin-bottom: 12px;
}
.savings-total-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.savings-total-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent2);
  text-shadow: 0 0 16px rgba(168, 85, 247, 0.4);
}

/* ── Budget responsive ── */
@media (max-width: 900px) {
  .budget-stats.four-cols {
    grid-template-columns: repeat(2, 1fr);
  }
  .charts-row {
    grid-template-columns: 1fr;
  }
  .chart-container {
    height: 220px;
  }
}

@media (max-width: 600px) {
  .budget-stats.four-cols {
    grid-template-columns: 1fr;
  }
  .tab-btn {
    font-size: 12px;
    padding: 8px 12px;
  }
  .savings-total-card {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
  .savings-total-value {
    font-size: 22px;
  }
}

/* ══════════════════════════════
   SORTABLE HEADERS
   ══════════════════════════════ */
th.sortable {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  position: relative;
  padding-right: 18px;
  transition: background 0.15s;
}
th.sortable:hover {
  background: rgba(0, 212, 255, 0.08);
  color: var(--text-main);
}
.sort-icon {
  display: inline-block;
  margin-left: 5px;
  font-size: 11px;
  color: var(--text-dim);
  vertical-align: middle;
}
.sort-icon.active {
  color: var(--accent);
  text-shadow: 0 0 6px rgba(0, 212, 255, 0.4);
}

/* ══════════════════════════════
   FILTER BAR
   ══════════════════════════════ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.filter-icon {
  font-size: 15px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.filter-input {
  flex: 1;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-main);
  font-size: 14px;
  font-family: inherit;
  padding: 7px 12px;
  outline: none;
  transition: border-color 0.15s;
}
.filter-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.filter-input::placeholder {
  color: var(--text-dim);
}
.btn-clear-filter {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.btn-clear-filter:hover {
  color: var(--expense);
  background: var(--expense-glow);
}
.filter-count {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  background: var(--accent-glow);
  border-radius: 10px;
  padding: 2px 10px;
}

/* ══════════════════════════════
   RECEIPT UPLOAD
   ══════════════════════════════ */
.file-input {
  font-size: 13px;
  color: var(--text-muted);
  padding: 6px 0;
  max-width: 180px;
}
.file-input::file-selector-button {
  background: linear-gradient(135deg, var(--accent2), #7c3aed);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  font-size: 12px;
  cursor: pointer;
  margin-right: 8px;
  transition: all 0.2s;
}
.file-input::file-selector-button:hover {
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.3);
}

.receipt-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
}
.receipt-thumb:hover {
  border-color: var(--accent);
  transform: scale(1.1);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}

/* ── Lightbox ── */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 10px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), 0 0 30px rgba(0, 212, 255, 0.1);
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: none;
  border: none;
  color: #fff;
  font-size: 36px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  transition: opacity 0.2s, text-shadow 0.2s;
}
.lightbox-close:hover {
  opacity: 1;
  text-shadow: 0 0 12px rgba(0, 212, 255, 0.5);
}

/* ══════════════════════════════
   INLINE EDIT MODE  
   ══════════════════════════════ */
.inline-edit-input {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--accent);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 13px;
  font-family: var(--font);
  width: 100%;
  box-sizing: border-box;
  box-shadow: 0 0 8px var(--accent-glow);
}
.inline-edit-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow), 0 0 12px rgba(0, 212, 255, 0.1);
}
select.inline-edit-input { min-width: 110px; }

.inline-subcat {
  background: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--accent);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 12px;
  font-family: var(--font);
  width: 100%;
  box-sizing: border-box;
  min-width: 110px;
}
.inline-subcat:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}
.subcat {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.inline-edit-file {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 140px;
}
.inline-check {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.editing-row {
  background: rgba(0, 212, 255, 0.04) !important;
}
.btn-edit-row,
.btn-edit {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}
.btn-edit-row:hover,
.btn-edit:hover {
  background: var(--accent-glow);
  color: #33e0ff;
}
.btn-save-row,
.btn-save-edit {
  background: none;
  border: none;
  color: var(--income);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}
.btn-save-row:hover,
.btn-save-edit:hover {
  background: var(--income-glow);
}
.btn-cancel-row,
.btn-cancel-edit {
  background: none;
  border: none;
  color: var(--expense);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 0.2s;
}
.btn-cancel-row:hover,
.btn-cancel-edit:hover {
  background: var(--expense-glow);
}

/* ══════════════════════════════
   PRINT
   ══════════════════════════════ */
@media print {
  body { background: #fff !important; color: #000 !important; }
  body::before { display: none; }
  .navbar, .hamburger, .controls, .status-bar, .filter-bar,
  .add-form-panel, .pagination, .btn-print, .col-actions,
  .btn-delete-row, .btn-edit-row { display: none !important; }
  .container { max-width: 100%; padding: 0; }
  .panel { background: transparent; border: none; box-shadow: none; padding: 8px 0; }
  .panel::before { display: none; }
  .panel-header { background: transparent; padding: 4px 0; }
  .panel-title { color: #000; font-size: 16px; }
  .row-count { color: #333; }
  .table-wrap { overflow: visible; }
  table { width: 100%; border-collapse: collapse; }
  th { background: #eee !important; color: #000 !important; border: 1px solid #ccc; padding: 6px 8px; font-size: 11px; }
  td { color: #000 !important; border: 1px solid #ccc; padding: 5px 8px; font-size: 11px; }
  tr:nth-child(even) { background: #f9f9f9 !important; }
  .null-val { color: #999 !important; }
  .sort-icon { display: none; }
}

/* ══════════════════════════════════════════════════════════
   GROCERY — Mobile-First Styles
   ══════════════════════════════════════════════════════════ */

/* ── Top bar & list selector ── */
.grocery-topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.grocery-list-selector {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.grocery-list-select {
  flex: 1;
  min-width: 0;
  background: var(--bg-panel);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 15px;
  appearance: auto;
}

/* ── Grocery Tabs ── */
.grocery-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.grocery-tabs::-webkit-scrollbar { display: none; }
.grocery-tabs .tab-btn {
  flex-shrink: 0;
  padding: 10px 16px;
  border: none;
  background: var(--bg-panel);
  color: var(--text-muted);
  border-radius: 8px 8px 0 0;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, text-shadow 0.2s;
  white-space: nowrap;
  min-height: 44px;
}
.grocery-tabs .tab-btn:hover { background: var(--bg-card); color: var(--text-main); }
.grocery-tabs .tab-btn.active {
  background: var(--bg-card);
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

/* ── Add item form ── */
.grocery-add-form { margin-bottom: 16px; }
.grocery-add-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.grocery-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 15px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.grocery-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow), 0 0 12px rgba(0, 212, 255, 0.08);
}
.grocery-input::placeholder { color: var(--text-dim); }
.grocery-select-cat {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 14px;
  min-width: 140px;
}
.grocery-input-sm {
  width: 80px;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 8px;
  font-size: 14px;
  text-align: center;
}
.grocery-input-sm:focus,
.grocery-select-cat:focus {
  outline: none;
  border-color: var(--accent);
}
.grocery-btn-add {
  min-height: 44px;
  white-space: nowrap;
  padding: 10px 20px;
  font-size: 15px;
}

.grocery-receipt-panel {
  margin-bottom: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
}

.grocery-receipt-help {
  margin: 4px 0 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.grocery-receipt-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.grocery-receipt-controls .grocery-input {
  min-width: 180px;
}

.grocery-receipt-preview {
  margin-top: 10px;
}

.grocery-receipt-preview-inner {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.grocery-receipt-table .grocery-input,
.grocery-receipt-table .grocery-input-sm {
  width: 100%;
  min-width: 0;
  font-size: 12px;
  padding: 6px 8px;
}

.grocery-receipt-actions {
  display: flex;
  justify-content: flex-end;
}

/* ── Items list ── */
.grocery-items-list { display: flex; flex-direction: column; gap: 8px; }

.grocery-group {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.grocery-group-header {
  padding: 10px 16px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-muted);
  background: linear-gradient(135deg, var(--bg-card), rgba(0, 212, 255, 0.02));
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.grocery-group-count {
  background: var(--bg-card);
  color: var(--text-dim);
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: auto;
}
.grocery-group-items { display: flex; flex-direction: column; }

.grocery-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(26, 39, 68, 0.5);
  transition: background 0.15s, opacity 0.3s;
}
.grocery-item:last-child { border-bottom: none; }
.grocery-item:hover { background: rgba(0, 212, 255, 0.03); }

.grocery-item-checked { opacity: 0.5; }
.grocery-item-checked .grocery-item-name {
  text-decoration: line-through;
  color: var(--text-dim);
}

.grocery-check-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border: 2px solid var(--accent);
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.grocery-check-btn:hover {
  background: var(--accent-glow);
  transform: scale(1.05);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.2);
}
.grocery-check-btn.checked {
  background: var(--income);
  border-color: var(--income);
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 230, 138, 0.3);
}

.grocery-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}
.grocery-item-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-main);
}
.grocery-qty {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 2px 6px;
  border-radius: 4px;
}
.grocery-price-tag {
  font-size: 13px;
  color: var(--income);
  font-weight: 500;
}
.grocery-checked-by {
  font-size: 12px;
  color: var(--text-dim);
  font-style: italic;
}

.grocery-delete-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--expense);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.grocery-delete-btn:hover { background: var(--expense-glow); }

/* ── Edit button ── */
.grocery-edit-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--accent);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.grocery-edit-btn:hover {
  background: var(--accent-glow);
}

/* ── Store tag ── */
.grocery-store-tag {
  font-size: 12px;
  color: var(--accent2);
  background: var(--accent2-glow);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.grocery-article-tag {
  font-size: 12px;
  color: #93c5fd;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.28);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

/* ── Store input in add form ── */
.grocery-input-store {
  max-width: 150px;
}

/* ── Sort bar ── */
.grocery-sort-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.grocery-sort-label {
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.grocery-sort-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font);
  white-space: nowrap;
}
.grocery-sort-btn:hover {
  border-color: var(--border-glow);
  color: var(--text-main);
}
.grocery-sort-btn.active {
  background: var(--accent-glow);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.15);
}

/* ── Drag handle ── */
.grocery-drag-handle {
  cursor: grab;
  font-size: 18px;
  color: var(--text-dim);
  padding: 0 4px;
  user-select: none;
  transition: color 0.2s;
  line-height: 1;
}
.grocery-drag-handle:hover {
  color: var(--accent);
}
.grocery-dragging {
  opacity: 0.5;
  background: var(--accent-glow);
  border-radius: 8px;
}

/* ── Edit form (inline) ── */
.grocery-item-editing {
  padding: 12px 16px;
  background: rgba(0, 212, 255, 0.04);
  border-bottom: 1px solid var(--border);
}
.grocery-edit-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.grocery-edit-form .grocery-input,
.grocery-edit-form .grocery-input-sm,
.grocery-edit-form .grocery-select-cat {
  font-size: 13px;
  padding: 8px 10px;
}
.grocery-edit-form .grocery-input { flex: 1; min-width: 120px; }
.grocery-edit-form .grocery-edit-store { max-width: 140px; }
.grocery-edit-actions {
  display: flex;
  gap: 6px;
}

.grocery-edit-form .grocery-edit-article-number {
  width: 110px;
}

/* ── Delete history button ── */
.grocery-delete-history {
  color: var(--text-dim);
  font-size: 14px;
}
.grocery-delete-history:hover {
  color: var(--expense);
}

/* ── Edit history row ── */
.grocery-history-editing td {
  background: rgba(0, 212, 255, 0.04);
  padding: 6px 8px;
  vertical-align: middle;
}
.grocery-history-editing .grocery-input,
.grocery-history-editing .grocery-select-cat,
.grocery-history-editing .grocery-input-sm {
  font-size: 13px;
  padding: 6px 8px;
  min-width: 0;
  width: 100%;
}
.grocery-hist-special-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.grocery-edit-history-btn {
  font-size: 13px;
}
.grocery-text-dim {
  color: var(--text-dim);
}

/* ── Special badge ── */
.grocery-special-badge {
  font-size: 11px;
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.12);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
  font-weight: 600;
  border: 1px solid rgba(251, 191, 36, 0.25);
  animation: grocery-special-pulse 2s ease-in-out infinite;
}
@keyframes grocery-special-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(251, 191, 36, 0.15); }
  50% { box-shadow: 0 0 10px rgba(251, 191, 36, 0.35); }
}

/* ── Special toggle (add form & edit form) ── */
.grocery-special-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}
.grocery-special-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #fbbf24;
  cursor: pointer;
}
.grocery-special-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}
.grocery-special-toggle input:checked + .grocery-special-label {
  color: #fbbf24;
}

/* ── Rabais input ── */
.grocery-input-rabais {
  max-width: 100px;
}

/* ── Price original (struck through) & net ── */
.grocery-price-original {
  text-decoration: line-through;
  opacity: 0.5;
  font-size: 12px;
}
.grocery-price-net {
  color: #fbbf24 !important;
  font-weight: 600;
}

/* ── Photo thumbnail ── */
.grocery-photo-thumb {
  width: 36px;
  height: 36px;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
  vertical-align: middle;
}
.grocery-photo-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.3);
}
.grocery-product-thumb {
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.18);
}
.grocery-photo-thumb-edit {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  border: 1px solid var(--border);
}

/* ── Photo upload button (in item row) ── */
.grocery-photo-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 15px;
  border-radius: 8px;
  transition: background 0.2s;
}
.grocery-photo-btn:hover {
  background: var(--accent-glow);
}
.grocery-photo-upload-btn {
  cursor: pointer;
  white-space: nowrap;
}

/* ── Photo row in edit form ── */
.grocery-edit-photo-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Lightbox ── */
.grocery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
}
.grocery-lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 12px;
  box-shadow: 0 0 40px rgba(0, 212, 255, 0.25);
  object-fit: contain;
}

/* ── Bottom bar ── */
.grocery-bottom-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: sticky;
  bottom: 8px;
  z-index: 10;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}
.grocery-counter {
  font-size: 14px;
  color: var(--text-muted);
}
.grocery-total {
  font-size: 15px;
  font-weight: 600;
  color: var(--income);
  margin-left: auto;
  text-shadow: 0 0 8px rgba(0, 230, 138, 0.3);
}

/* ── Empty state ── */
.grocery-empty {
  text-align: center;
  color: var(--text-dim);
  padding: 32px 16px;
  font-size: 15px;
}

/* ── Group checked ── */
.grocery-group-checked { opacity: 0.7; }
.grocery-group-checked .grocery-group-header { color: var(--text-dim); }

/* ── History table ── */
.grocery-search-bar { margin-bottom: 12px; }
.grocery-history-list { overflow-x: auto; }
.grocery-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.grocery-table th {
  background: linear-gradient(135deg, #0d1628, #0f1a30);
  color: var(--accent);
  padding: 10px 12px;
  text-align: left;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-size: 11px;
}
.grocery-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(26, 39, 68, 0.5);
  color: var(--text-main);
}
.grocery-table tr:hover td { background: rgba(0, 212, 255, 0.03); }

/* ── Price section ── */
.grocery-price-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.grocery-chart-wrap {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 24px;
  height: 300px;
  position: relative;
}
.grocery-section-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.grocery-alerts { display: flex; flex-direction: column; gap: 8px; }
.grocery-alert-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--expense);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.grocery-alert-name {
  font-weight: 600;
  color: var(--text-main);
  font-size: 15px;
}
.grocery-alert-detail {
  color: var(--text-muted);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.grocery-alert-badge {
  background: var(--expense-glow);
  color: var(--expense);
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 13px;
  text-shadow: 0 0 6px rgba(255, 77, 106, 0.3);
}

/* ── Suggestions ── */
.grocery-suggestions-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.grocery-suggestion-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.2s;
}
.grocery-suggestion-card:hover {
  border-color: var(--border-glow);
}
.grocery-suggestion-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-main);
}
.grocery-suggestion-meta {
  display: flex;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}
.grocery-suggestion-days {
  color: var(--warning);
  font-weight: 500;
}
.grocery-suggestion-price {
  font-size: 13px;
  color: var(--income);
}

/* ── Settings ── */
.grocery-settings-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.grocery-setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.grocery-setting-row label {
  font-size: 14px;
  color: var(--text-muted);
  min-width: 180px;
}
.grocery-inline-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}
.grocery-add-cat-form {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.grocery-custom-cats { display: flex; flex-direction: column; gap: 4px; }
.grocery-custom-cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-main);
}

/* ── Modal ── */
.grocery-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
}
.grocery-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
}
.grocery-modal-content {
  position: relative;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(0, 212, 255, 0.05);
}
.grocery-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.grocery-modal-header h3 {
  font-size: 18px;
  color: var(--text-main);
  letter-spacing: 0.3px;
}
.grocery-modal-body { padding: 20px; }
.grocery-modal-actions {
  margin-top: 20px;
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

/* ── Members ── */
.grocery-members { display: flex; flex-direction: column; gap: 6px; }
.grocery-member {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-input);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-main);
}
.grocery-role-badge {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
}

/* ── Grocery responsive ── */
@media (min-width: 640px) {
  .grocery-suggestions-grid {
    grid-template-columns: 1fr 1fr;
  }
  .grocery-add-row {
    flex-wrap: nowrap;
  }
}

@media (max-width: 639px) {
  .grocery-btn-add {
    width: 100%;
  }
  .grocery-select-cat {
    min-width: 0;
    flex: 1;
  }
  .grocery-input-sm {
    width: 60px;
  }
  .grocery-input-store {
    max-width: none;
    flex: 1;
  }
  .grocery-sort-bar {
    gap: 4px;
  }
  .grocery-sort-btn {
    padding: 5px 8px;
    font-size: 11px;
  }
  .grocery-edit-form {
    flex-direction: column;
  }
  .grocery-edit-form .grocery-input,
  .grocery-edit-form .grocery-select-cat,
  .grocery-edit-form .grocery-edit-store {
    min-width: 100%;
    max-width: none;
  }
  .grocery-input-rabais {
    max-width: none;
    width: 100%;
  }
  .grocery-edit-photo-row {
    width: 100%;
  }
  .grocery-table th,
  .grocery-table td {
    padding: 8px;
    font-size: 13px;
  }
}

/* ══════════════════════════════
   VOTING PAGE
   ══════════════════════════════ */
/* (Voting pages have their own styles.css, but base layout comes from here) */

/* ══════════════════════════════
   SCROLLBAR
   ══════════════════════════════ */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-deep);
}
::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--border-glow);
}

/* ══════════════════════════════
   SELECTION
   ══════════════════════════════ */
::selection {
  background: rgba(0, 212, 255, 0.25);
  color: #fff;
}

/* ══════════════════════════════
   FOCUS VISIBLE (Accessibility)
   ══════════════════════════════ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ══════════════════════════════════════════════════════════
   AURORA POLISH — overrides identitaires (chargé en dernier)
   Donne à la navbar et aux composants la signature Aurora.
   ══════════════════════════════════════════════════════════ */

/* Navbar : verre flou + bordure dégradée */
.navbar {
  background: linear-gradient(180deg, rgba(15, 12, 35, 0.55), rgba(10, 8, 28, 0.40));
  border-bottom: 1px solid transparent;
  border-image: linear-gradient(90deg, transparent, rgba(168,85,247,0.4), rgba(6,182,212,0.4), rgba(236,72,153,0.4), transparent) 1;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

/* Brand : glow doux sous le logo */
.navbar-brand .navbar-logo,
.navbar .navbar-logo {
  filter: drop-shadow(0 4px 16px rgba(168, 85, 247, 0.35));
  transition: filter 0.3s ease, transform 0.3s ease;
}
.navbar-brand:hover .navbar-logo {
  filter: drop-shadow(0 6px 24px rgba(236, 72, 153, 0.45));
  transform: scale(1.02);
}

/* Nav links : pill arrondie + hover gradient subtil */
.nav-link, .dropdown-toggle {
  border-radius: 999px;
  padding: 8px 16px;
  font-weight: 500;
  transition: color .25s, background .25s, box-shadow .25s, transform .15s;
  text-shadow: none;
}
.nav-link:hover, .dropdown-toggle:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
  text-shadow: 0 0 12px rgba(192, 132, 252, 0.5);
  transform: translateY(-1px);
}
.nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, rgba(168,85,247,0.20), rgba(6,182,212,0.15), rgba(236,72,153,0.20));
  box-shadow: 0 4px 16px rgba(168, 85, 247, 0.20), inset 0 0 0 1px rgba(255,255,255,0.10);
  text-shadow: 0 0 14px rgba(192, 132, 252, 0.5);
}
/* Underline gradient sous le lien actif (remplace l'ancien) */
.nav-link.active::after {
  background: var(--aurora-gradient);
  height: 2px;
  bottom: -3px;
  left: 25%; right: 25%;
  border-radius: 2px;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.6);
}

/* Dropdown : verre flou cohérent */
.dropdown-menu {
  background: rgba(20, 18, 45, 0.85);
  backdrop-filter: blur(24px) saturate(160%);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(168,85,247,0.10);
}
.dropdown-menu::before {
  background: rgba(20, 18, 45, 0.85);
  border-top-color: rgba(255,255,255,0.12);
}
.dropdown-item {
  border-radius: 8px;
}
.dropdown-item:hover {
  background: linear-gradient(135deg, rgba(168,85,247,0.18), rgba(6,182,212,0.12));
  color: #fff;
}

/* Hamburger : barres dégradé */
.hamburger span {
  background: linear-gradient(90deg, #a855f7, #06b6d4);
  box-shadow: 0 0 8px rgba(168, 85, 247, 0.5);
}

/* Logout : rose plutôt que rouge cyber */
.btn-logout {
  border: 1px solid rgba(244, 114, 182, 0.35);
  color: #f9a8d4;
  border-radius: 999px;
  background: rgba(236, 72, 153, 0.06);
  backdrop-filter: blur(10px);
}
.btn-logout:hover {
  background: rgba(236, 72, 153, 0.15);
  border-color: rgba(244, 114, 182, 0.6);
  color: #fff;
  box-shadow: 0 0 18px rgba(236, 72, 153, 0.30);
}

/* User badge : verre */
.user-badge {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
}

/* Panels : glass + glow line gradient */
.panel {
  background: rgba(20, 18, 45, 0.45);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255,255,255,0.10);
}
.panel::before {
  background: var(--aurora-gradient);
  opacity: 0.55;
  height: 1px;
  left: 5%; right: 5%;
}
.panel-header {
  background: linear-gradient(135deg, rgba(168,85,247,0.08), rgba(6,182,212,0.05));
  border-bottom-color: rgba(255,255,255,0.08);
}
.panel-title {
  background: linear-gradient(135deg, #f0eaff 0%, #c084fc 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Boutons primaires : gradient Aurora */
.btn-primary {
  background: var(--aurora-gradient) !important;
  border: none !important;
  box-shadow: 0 8px 24px rgba(168, 85, 247, 0.30) !important;
}
.btn-primary:hover {
  box-shadow: 0 10px 32px rgba(236, 72, 153, 0.40) !important;
  filter: brightness(1.08);
}

/* Inputs / select : verre */
input[type="text"], input[type="number"], input[type="date"], input[type="email"],
input[type="password"], textarea, select {
  background: rgba(10, 8, 25, 0.55);
  border: 1px solid rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-main);
  border-radius: 10px;
}
input:focus, textarea:focus, select:focus {
  border-color: rgba(192, 132, 252, 0.6) !important;
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.18), 0 0 16px rgba(168, 85, 247, 0.20) !important;
}

/* Sélection (Aurora purple) */
::selection {
  background: rgba(192, 132, 252, 0.35);
  color: #fff;
}

/* Scrollbar Aurora */
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(168,85,247,0.35), rgba(6,182,212,0.35));
}
::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(168,85,247,0.55), rgba(236,72,153,0.45));
}

/* ══════════════════════════════════════════════════════════
   FS SIDEBAR — sidebar pliable globale (composant _nav.php)
   ══════════════════════════════════════════════════════════ */
:root {
  --fs-sb-w: 240px;
  --fs-sb-w-collapsed: 68px;
  --fs-aurora: linear-gradient(135deg, #a855f7 0%, #06b6d4 50%, #ec4899 100%);
}

/* Cacher l'ancienne navbar (si encore présente sur une page) */
body .navbar { display: none !important; }

/* Alignement des icônes SVG inline dans les boutons / pills */
.tab-btn svg, .view-toggle svg, .btn svg, .stat-icon svg, .panel-title svg {
  vertical-align: -3px;
  margin-right: 6px;
  display: inline-block;
}
.stat-icon svg { width: 26px; height: 26px; margin-right: 0; vertical-align: middle; color: #c084fc; }

/* Décale le contenu pour la sidebar fixe */
body { padding-left: var(--fs-sb-w); transition: padding-left 280ms cubic-bezier(0.4, 0, 0.2, 1); }
body.fs-sb-collapsed { padding-left: var(--fs-sb-w-collapsed); }

.fs-sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--fs-sb-w);
  z-index: 100;
  display: flex; flex-direction: column;
  padding: 14px 10px;
  background: linear-gradient(180deg, rgba(15, 12, 35, 0.85), rgba(10, 8, 28, 0.78));
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 32px rgba(0, 0, 0, 0.35);
  transition: width 280ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}
body.fs-sb-collapsed .fs-sidebar { width: var(--fs-sb-w-collapsed); }

/* Brand */
.fs-sb-head {
  display: flex; align-items: center; gap: 10px;
  padding: 4px 6px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin-bottom: 10px;
}
.fs-sb-brand {
  display: flex; align-items: center; gap: 10px;
  flex: 1; min-width: 0;
  text-decoration: none;
}
.fs-sb-mark {
  width: 32px; height: 32px; border-radius: 9px;
  background: transparent;
  display: inline-flex; align-items: center; justify-content: center;
  filter: drop-shadow(0 4px 12px rgba(168, 85, 247, 0.45));
  flex-shrink: 0;
}
.fs-sb-mark svg { width: 100%; height: 100%; display: block; }
.fs-sb-name {
  color: #fff; font-weight: 700; font-size: 14px;
  white-space: nowrap; overflow: hidden;
  transition: opacity 180ms ease;
}
.fs-sb-toggle {
  width: 30px; height: 30px;
  background: transparent; border: none;
  color: rgba(255, 255, 255, 0.55);
  border-radius: 7px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 180ms ease;
  flex-shrink: 0;
}
.fs-sb-toggle:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }

/* Nav links */
.fs-sb-nav {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column; gap: 2px;
  padding-right: 2px;
  scrollbar-width: thin;
}
.fs-sb-link {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 10px 11px;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  font-size: 13.5px; font-weight: 500;
  border-radius: 10px;
  transition: background 180ms ease, color 180ms ease;
  white-space: nowrap;
}
.fs-sb-link:hover { background: rgba(255, 255, 255, 0.06); color: #fff; }
.fs-sb-link.active {
  background: linear-gradient(90deg, rgba(168, 85, 247, 0.22), rgba(6, 182, 212, 0.06) 80%);
  color: #fff;
}
.fs-sb-link.active::before {
  content: ''; position: absolute;
  left: -10px; top: 8px; bottom: 8px; width: 3px;
  background: var(--fs-aurora);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.6);
}
.fs-sb-ico {
  width: 22px; height: 22px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.fs-sb-lbl { transition: opacity 180ms ease; }

/* Séparateur "Outils" */
.fs-sb-sep {
  margin: 14px 8px 4px;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  position: relative;
}
.fs-sb-sep span { background: transparent; padding-right: 8px; }

/* Footer (user + logout) */
.fs-sb-foot {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  display: flex; flex-direction: column; gap: 4px;
}
.fs-sb-user {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
}
.fs-sb-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #06b6d4, #ec4899);
  color: #fff; font-weight: 700; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.35);
}
.fs-sb-uinfo {
  display: flex; flex-direction: column; min-width: 0;
  transition: opacity 180ms ease;
}
.fs-sb-uname {
  color: #fff; font-weight: 600; font-size: 12.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 140px;
}
.fs-sb-urole {
  color: rgba(255, 255, 255, 0.5); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.fs-sb-logout {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 11px;
  color: rgba(244, 114, 182, 0.85);
  font-size: 13px; font-weight: 600;
  text-decoration: none;
  border-radius: 10px;
  transition: all 180ms ease;
  white-space: nowrap;
}
.fs-sb-logout:hover { background: rgba(244, 114, 182, 0.12); color: #fff; }
.fs-sb-logout svg { flex-shrink: 0; }

/* État plié — masquer les labels et le texte */
body.fs-sb-collapsed .fs-sb-name,
body.fs-sb-collapsed .fs-sb-lbl,
body.fs-sb-collapsed .fs-sb-uinfo,
body.fs-sb-collapsed .fs-sb-sep span { opacity: 0; pointer-events: none; }
body.fs-sb-collapsed .fs-sb-sep {
  height: 1px; padding: 0; margin: 12px 8px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}
body.fs-sb-collapsed .fs-sb-link,
body.fs-sb-collapsed .fs-sb-logout,
body.fs-sb-collapsed .fs-sb-user { padding-left: 13px; padding-right: 13px; }

/* Tooltip au survol (uniquement quand plié) */
body.fs-sb-collapsed .fs-sb-link::after,
body.fs-sb-collapsed .fs-sb-logout::after {
  content: attr(data-tip);
  position: absolute; left: calc(var(--fs-sb-w-collapsed) - 4px); top: 50%;
  transform: translateY(-50%) translateX(-4px);
  background: rgba(10, 8, 28, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff; font-size: 12px; font-weight: 600;
  padding: 6px 10px; border-radius: 8px;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: all 180ms ease;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
body.fs-sb-collapsed .fs-sb-link:hover::after,
body.fs-sb-collapsed .fs-sb-logout:hover::after {
  opacity: 1; transform: translateY(-50%) translateX(0);
}
body.fs-sb-collapsed .fs-sb-logout { position: relative; }

/* Bouton mobile + backdrop */
.fs-sb-mobile-open {
  display: none;
  position: fixed; top: 14px; left: 14px;
  z-index: 99;
  width: 42px; height: 42px;
  background: rgba(15, 12, 35, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 11px;
  color: #fff; cursor: pointer;
  align-items: center; justify-content: center;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.fs-sb-backdrop {
  display: none;
  position: fixed; inset: 0; z-index: 90;
  background: rgba(5, 3, 20, 0.55);
  backdrop-filter: blur(4px);
  opacity: 0; transition: opacity 220ms ease;
}

/* ── Mobile ── */
@media (max-width: 900px) {
  body { padding-left: 0; }
  body.fs-sb-collapsed { padding-left: 0; }
  .fs-sidebar {
    transform: translateX(-100%);
    transition: transform 280ms cubic-bezier(0.4, 0, 0.2, 1);
    width: var(--fs-sb-w);
    box-shadow: 0 0 48px rgba(0, 0, 0, 0.6);
  }
  body.fs-sb-mobile-open .fs-sidebar { transform: translateX(0); }
  body.fs-sb-mobile-open .fs-sb-backdrop { display: block; opacity: 1; }
  .fs-sb-mobile-open { display: inline-flex; }
  .fs-sb-toggle { display: none; } /* pas de pli en mobile */
  /* En mobile la sidebar est toujours en mode complet quand ouverte */
  body.fs-sb-collapsed .fs-sb-name,
  body.fs-sb-collapsed .fs-sb-lbl,
  body.fs-sb-collapsed .fs-sb-uinfo,
  body.fs-sb-collapsed .fs-sb-sep span { opacity: 1; pointer-events: auto; }
  body.fs-sb-collapsed .fs-sidebar { width: var(--fs-sb-w); }
  /* Petit padding pour ne pas que le bouton mobile chevauche le contenu */
  main.container { padding-top: 70px; }
}


/* ─────────────────────────────────────────────────────────
 * Breadcrumbs (fil d'Ariane)
 * ───────────────────────────────────────────────────────── */
.fs-crumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px 0;
    font-size: 13px;
    color: rgba(226, 232, 240, 0.55);
    flex-wrap: wrap;
}
.fs-crumb-link {
    color: rgba(226, 232, 240, 0.7);
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    transition: background 160ms, color 160ms;
}
.fs-crumb-link:hover {
    color: #fff;
    background: rgba(168, 85, 247, 0.12);
}
.fs-crumb-current {
    color: #f5f3ff;
    font-weight: 600;
    padding: 4px 8px;
    background: linear-gradient(135deg, rgba(168,85,247,0.18), rgba(6,182,212,0.12));
    border-radius: 6px;
}
.fs-crumb-sep {
    opacity: 0.45;
    font-size: 14px;
    color: #c084fc;
    user-select: none;
}
@media (max-width: 900px) {
    .fs-crumbs { padding: 12px 14px 0; font-size: 12px; }
}

/* ─────────────────────────────────────────────────────────
 * Toasts (avec undo)
 * ───────────────────────────────────────────────────────── */
.fs-toasts {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: min(420px, calc(100vw - 32px));
}
.fs-toast {
    pointer-events: auto;
    position: relative;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: linear-gradient(180deg, rgba(20,16,42,0.96), rgba(14,10,32,0.96));
    border: 1px solid rgba(168,85,247,0.28);
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0,0,0,0.55), 0 0 0 1px rgba(255,255,255,0.04) inset;
    color: #f5f3ff;
    font-size: 14px;
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: fsToastIn 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.fs-toast.fs-toast-leaving {
    animation: fsToastOut 220ms ease forwards;
}
.fs-toast-success { border-color: rgba(34, 197, 94, 0.45); }
.fs-toast-success .fs-toast-bar { background: linear-gradient(90deg, #22c55e, #06b6d4); }
.fs-toast-error   { border-color: rgba(239, 68, 68, 0.55); }
.fs-toast-error   .fs-toast-bar { background: linear-gradient(90deg, #ef4444, #ec4899); }
.fs-toast-info    .fs-toast-bar { background: linear-gradient(90deg, #a855f7, #06b6d4); }

.fs-toast-msg { flex: 1; line-height: 1.35; }
.fs-toast-action {
    background: rgba(168,85,247,0.18);
    color: #e9d5ff;
    border: 1px solid rgba(168,85,247,0.45);
    border-radius: 8px;
    padding: 6px 12px;
    font: 600 12.5px/1 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: background 160ms, transform 120ms;
}
.fs-toast-action:hover { background: rgba(168,85,247,0.32); transform: translateY(-1px); }
.fs-toast-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    transition: color 160ms;
}
.fs-toast-close:hover { color: #fff; }
.fs-toast-bar {
    position: absolute;
    bottom: 0; left: 0;
    height: 3px;
    width: 100%;
    transform-origin: left;
    animation: fsToastBar linear forwards;
}
@keyframes fsToastIn {
    from { opacity: 0; transform: translateX(40px) scale(0.96); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes fsToastOut {
    to { opacity: 0; transform: translateX(20px) scale(0.96); }
}
@keyframes fsToastBar {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}
@media (max-width: 600px) {
    .fs-toasts { bottom: 14px; right: 14px; left: 14px; max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
    .fs-toast { animation: none; }
    .fs-toast-bar { animation: none; opacity: 0; }
}

/* ─────────────────────────────────────────────────────────
 * Skeleton loaders
 * ───────────────────────────────────────────────────────── */
.fs-sk-wrap { display: flex; flex-direction: column; gap: 10px; padding: 8px 0; }
.fs-sk {
    display: block;
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.04) 0%,
        rgba(168,85,247,0.10) 40%,
        rgba(6,182,212,0.08) 60%,
        rgba(255,255,255,0.04) 100%
    );
    background-size: 200% 100%;
    border-radius: 8px;
    animation: fsSkShimmer 1.6s linear infinite;
}
.fs-sk-line { height: 14px; }
.fs-sk-cell { height: 18px; border-radius: 6px; }
.fs-sk-table { display: flex; flex-direction: column; gap: 12px; }
.fs-sk-row { display: flex; gap: 14px; align-items: center; }
.fs-sk-card {
    display: flex; flex-direction: column; gap: 12px;
    padding: 18px;
    border-radius: 14px;
    background: rgba(255,255,255,0.02);
    border: 1px solid rgba(168,85,247,0.12);
}
@keyframes fsSkShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@media (prefers-reduced-motion: reduce) {
    .fs-sk { animation: none; }
}

/* ─────────────────────────────────────────────────────────
 * Bottom nav (mobile)
 * ───────────────────────────────────────────────────────── */
.fs-bnav { display: none; }
@media (max-width: 900px) {
  .fs-bnav {
    position: fixed; left: 0; right: 0; bottom: 0;
    z-index: 95;
    display: flex;
    background: linear-gradient(180deg, rgba(15,12,35,0.92), rgba(10,8,28,0.96));
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(168,85,247,0.18);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0)) 4px;
    box-shadow: 0 -8px 28px rgba(0,0,0,0.45);
  }
  .fs-bnav-link {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px;
    padding: 8px 4px; min-height: 54px;
    color: rgba(226,232,240,0.65);
    text-decoration: none;
    background: none; border: none; cursor: pointer;
    border-radius: 12px;
    font: 500 11px/1.1 'Inter', sans-serif;
    transition: color 160ms, background 160ms;
  }
  .fs-bnav-link:hover { color: #fff; background: rgba(168,85,247,0.10); }
  .fs-bnav-link.active {
    color: #f5f3ff;
    background: linear-gradient(135deg, rgba(168,85,247,0.22), rgba(6,182,212,0.15));
  }
  .fs-bnav-link.active .fs-bnav-ico { filter: drop-shadow(0 2px 8px rgba(168,85,247,0.5)); }
  .fs-bnav-ico { display: inline-flex; align-items: center; }
  .fs-bnav-lbl { font-weight: 600; letter-spacing: 0.2px; }

  /* Espace pour ne pas que le bottom nav cache le contenu */
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0)); }
  .fs-toasts { bottom: calc(74px + env(safe-area-inset-bottom, 0)); }
}

/* ─────────────────────────────────────────────────────────
 * Palette de commandes (Cmd+K)
 * ───────────────────────────────────────────────────────── */
.fs-palette {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh;
  animation: fsPaletteIn 180ms ease;
}
.fs-palette[hidden] { display: none; }
.fs-palette-backdrop {
  position: absolute; inset: 0;
  background: rgba(5,3,20,0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.fs-palette-box {
  position: relative;
  width: min(580px, calc(100vw - 32px));
  background: linear-gradient(180deg, rgba(20,16,42,0.98), rgba(14,10,32,0.98));
  border: 1px solid rgba(168,85,247,0.30);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.04) inset;
  overflow: hidden;
  display: flex; flex-direction: column;
  max-height: 70vh;
}
.fs-palette-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.fs-palette-icon { color: #c084fc; display: inline-flex; }
.fs-palette-input {
  flex: 1; background: transparent; border: none; outline: none;
  color: #f5f3ff; font: 500 16px/1.2 'Inter', sans-serif;
}
.fs-palette-input::placeholder { color: rgba(226,232,240,0.4); }
.fs-palette-kbd, .fs-palette-foot kbd {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: #c084fc;
  padding: 2px 7px;
  border-radius: 5px;
  font: 600 11px/1 'SF Mono', ui-monospace, monospace;
}
.fs-palette-list {
  list-style: none; margin: 0; padding: 6px;
  overflow-y: auto;
  max-height: 50vh;
}
.fs-palette-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  color: #e5e7eb;
  transition: background 120ms, color 120ms;
}
.fs-palette-item.active,
.fs-palette-item:hover {
  background: linear-gradient(135deg, rgba(168,85,247,0.22), rgba(6,182,212,0.12));
  color: #fff;
}
.fs-palette-i-ico { color: #c084fc; display: inline-flex; flex-shrink: 0; }
.fs-palette-i-lbl { flex: 1; font-weight: 600; font-size: 14px; }
.fs-palette-i-file { color: rgba(226,232,240,0.45); font-size: 12px; font-family: 'SF Mono', ui-monospace, monospace; }
.fs-palette-empty {
  padding: 24px 16px; text-align: center;
  color: rgba(226,232,240,0.55); font-size: 14px;
}
.fs-palette-foot {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding: 10px 16px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 12px; color: rgba(226,232,240,0.55);
}
.fs-palette-foot span { display: inline-flex; align-items: center; gap: 6px; }
@keyframes fsPaletteIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) { .fs-palette { animation: none; } }
@media (max-width: 600px) {
  .fs-palette { padding-top: 6vh; }
  .fs-palette-box { width: calc(100vw - 16px); max-height: 80vh; }
  .fs-palette-i-file { display: none; }
}

/* ─────────────────────────────────────────────────────────
 * Couleurs sémantiques pour les montants
 * ───────────────────────────────────────────────────────── */
.fs-amount-pos  { color: #4ade80; font-variant-numeric: tabular-nums; }
.fs-amount-neg  { color: #f87171; font-variant-numeric: tabular-nums; }
.fs-amount-zero { color: rgba(226,232,240,0.65); font-variant-numeric: tabular-nums; }
