/* ═══════════════════════════════════════════════════════════════════════════════
   Sulla Soglia — Admin CSS Condiviso
   Estratto da: admin.html, admin-pois.html, admin-bandi.html, admin-eventi.html,
               admin-giovani.html, admin-newsletter.html
   ═══════════════════════════════════════════════════════════════════════════════ */

/* ────────────────────────────────────────────────────────────────────────────
   1. RESET & BASE
   ──────────────────────────────────────────────────────────────────────────── */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: #f5f4f0;
  color: #2c2c2a;
  min-height: 100vh;
}

/* ────────────────────────────────────────────────────────────────────────────
   2. ADMIN SIDEBAR NAVIGATION
   ──────────────────────────────────────────────────────────────────────────── */

.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 200px;
  background: #3a100a;
  color: #e8e4dc;
  display: flex;
  flex-direction: column;
  z-index: 7000;
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform 0.25s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 16px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #b53a1e;
  color: white;
  font-weight: 700;
  font-size: 14px;
  text-decoration: none;
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.sidebar-nav {
  flex: 1;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 13px;
  border: none;
  background: none;
  cursor: pointer;
  transition: all 0.15s;
  width: 100%;
  text-align: left;
  font-family: inherit;
}

.sidebar-link:hover {
  color: white;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.14);
  border-right: 3px solid #c9a35c;
}

.sidebar-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.sidebar-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer {
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 1px;
}

/* Theme toggle icon switching */
.theme-icon-light {
  display: none;
}
[data-theme='dark'] .theme-icon-dark {
  display: none;
}
[data-theme='dark'] .theme-icon-light {
  display: block;
}

/* Mobile topbar — hidden on desktop */
.admin-topbar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: #3a100a;
  color: white;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  z-index: 6999;
}

.topbar-menu-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.topbar-menu-btn .sidebar-icon {
  width: 22px;
  height: 22px;
}

.topbar-title {
  font-size: 0.95rem;
  font-weight: 600;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 6998;
}
.sidebar-overlay.open {
  display: block;
}

/* Body layout offset for sidebar */
body.has-admin-sidebar {
  margin-left: 200px;
}

/* Desktop: sidebar always visible */
@media (min-width: 769px) {
  .admin-topbar {
    display: none !important;
  }
  .sidebar-overlay {
    display: none !important;
  }
}

/* Mobile: sidebar hidden, topbar visible */
@media (max-width: 768px) {
  .admin-sidebar {
    transform: translateX(-100%);
  }
  .admin-sidebar.open {
    transform: translateX(0);
  }
  .admin-topbar {
    display: flex;
  }
  body.has-admin-sidebar {
    margin-left: 0;
    padding-top: 52px;
  }
}

/* Legacy header support (pages not yet migrated) */
header {
  background: #b53a1e;
  color: white;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

header h1 {
  font-size: 1rem;
  font-weight: 600;
}

.header-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.nav-btn {
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  background: transparent;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s;
  font-family: inherit;
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.nav-btn.active {
  background: rgba(255, 255, 255, 0.25);
}

/* ────────────────────────────────────────────────────────────────────────────
   3. CONTAINER & LAYOUT
   ──────────────────────────────────────────────────────────────────────────── */

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 16px;
}

.container--xs {
  max-width: 800px;
}
.container--narrow {
  max-width: 900px;
}
.container--form {
  max-width: 1000px;
}
.container--wide {
  max-width: 1400px;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

/* ────────────────────────────────────────────────────────────────────────────
   4. TOOLBAR
   ──────────────────────────────────────────────────────────────────────────── */

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.toolbar h2 {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}

/* ────────────────────────────────────────────────────────────────────────────
   5. FORM ELEMENTS
   ──────────────────────────────────────────────────────────────────────────── */

input,
select,
textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 13px;
  background: white;
  color: #2c2c2a;
  font-family: inherit;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #b53a1e;
  box-shadow: 0 0 0 3px rgba(192, 68, 40, 0.1);
}

textarea {
  resize: vertical;
  min-height: 70px;
}

.search-box {
  flex: 1;
  max-width: 260px;
}

.q-filter,
.cat-filter {
  min-width: 160px;
}

.form-row {
  margin-bottom: 12px;
}

.form-row label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #888;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.coords-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* ────────────────────────────────────────────────────────────────────────────
   6. BUTTONS
   ──────────────────────────────────────────────────────────────────────────── */

.btn,
.filter-btn,
.btn-refresh {
  padding: 7px 16px;
  border-radius: 7px;
  border: 1px solid #ddd;
  background: white;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.btn:hover,
.btn-refresh:hover {
  background: #f0f0f0;
}

.filter-btn {
  padding: 6px 14px;
  font-size: 13px;
}

.filter-btn.active {
  background: #b53a1e;
  color: white;
  border-color: #b53a1e;
}

.btn-primary {
  background: #b53a1e;
  color: white;
  border-color: #b53a1e;
}

.btn-primary:hover {
  background: #993c1d;
}

.btn-danger {
  border-color: #e24b4a;
  color: #a32d2d;
}

.btn-danger:hover {
  background: #fcebeb;
}

.btn-success {
  background: #49a078;
  color: white;
  border-color: #49a078;
}

.btn-success:hover {
  background: #357a5a;
}

.btn-warning {
  background: #e5a100;
  color: white;
  border-color: #e5a100;
}

.btn-warning:hover {
  background: #c28a00;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

/* ────────────────────────────────────────────────────────────────────────────
   7. BADGES
   ──────────────────────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  background: #b53a1e;
  color: white;
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.badge.zero {
  background: #888;
}

.badge-bozza {
  background: #f5f5f5;
  color: #616161;
}

.badge-approvato {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-pubblicato {
  background: #e3f2fd;
  color: #1565c0;
}

.badge-rifiutato {
  background: #fcebeb;
  color: #a32d2d;
}

.badge-racconto {
  background: #ede7f6;
  color: #5e35b1;
}

.badge-proposta {
  background: #e3f2fd;
  color: #1565c0;
}

.badge-mappa_emotiva {
  background: #fff8e1;
  color: #f57f17;
}

.badge-denuncia_creativa {
  background: #fce4ec;
  color: #ad1457;
}

.badge-esperienza_rifiuto {
  background: #e0f2f1;
  color: #00695c;
}

.badge-strutturale {
  background: #f5f5f5;
  color: #616161;
}

.badge-aperto {
  background: #e3f2fd;
  color: #1565c0;
}

.badge-invitato {
  background: #ede7f6;
  color: #5e35b1;
}

.badge-cerchio_tenuto {
  background: #fff8e1;
  color: #f57f17;
}

.badge-impegno_preso {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-verificato {
  background: #c8e6c9;
  color: #1b5e20;
}

.badge-disatteso {
  background: #fcebeb;
  color: #a32d2d;
}

.badge-attivo {
  background: #e8f5e9;
  color: #2e7d32;
}

.badge-concluso {
  background: #f5f5f5;
  color: #616161;
}

.badge-sospeso {
  background: #fff8e1;
  color: #f57f17;
}

.tipo-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tipo-errore {
  background: #fcebeb;
  color: #a32d2d;
}

.tipo-mancante {
  background: #e6f1fb;
  color: #185fa5;
}

.tipo-suggerimento {
  background: #faeeda;
  color: #854f0b;
}

/* ────────────────────────────────────────────────────────────────────────────
   8. CARDS
   ──────────────────────────────────────────────────────────────────────────── */

.card {
  background: white;
  border-radius: 10px;
  border: 1px solid #e8e8e4;
  padding: 20px;
  margin-bottom: 12px;
  overflow: hidden;
}

.card.letta {
  opacity: 0.55;
}

.card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 10px;
}

.card-date {
  font-size: 11px;
  color: #888;
  margin-left: auto;
}

.card-luogo {
  font-size: 0.85rem;
  font-weight: 600;
  color: #444;
}

.card-body {
  padding: 0 16px 14px;
}

.card-desc {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #333;
  margin-bottom: 10px;
  white-space: pre-wrap;
}

.card-meta {
  font-size: 0.78rem;
  color: #888;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.card-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.btn-letta {
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid #b53a1e;
  color: #b53a1e;
  background: white;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-letta:hover {
  background: #faece7;
}

.btn-letta.done {
  border-color: #888;
  color: #888;
}

.btn-poi {
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid #185fa5;
  color: #185fa5;
  background: white;
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  transition: all 0.15s;
}

.btn-poi:hover {
  background: #e6f1fb;
}

.btn-del {
  padding: 5px 14px;
  border-radius: 6px;
  border: 1px solid #ddd;
  color: #888;
  background: white;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-del:hover {
  border-color: #e24b4a;
  color: #a32d2d;
  background: #fcebeb;
}

.panel {
  background: white;
  border-radius: 10px;
  border: 1px solid #e8e8e4;
  padding: 20px;
  position: sticky;
  top: 20px;
}
@media (max-width: 768px) {
  .panel {
    position: static;
  }
}

.panel h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0efeb;
}

/* ────────────────────────────────────────────────────────────────────────────
   9. TABLES & DATA
   ──────────────────────────────────────────────────────────────────────────── */

.poi-table,
.data-table {
  background: white;
  border-radius: 10px;
  border: 1px solid #e8e8e4;
  overflow: hidden;
  overflow-x: auto;
}

/* Utility wrapper mobile-friendly per tabelle admin (ADM-P1-1). */
.table-scroll-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  background: #f8f7f4;
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #e8e8e4;
  white-space: nowrap;
}

td {
  padding: 10px 12px;
  border-bottom: 1px solid #f0efeb;
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: #fafaf8;
}

tr.inattivo td {
  opacity: 0.45;
}

.cat-pill {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.coords {
  font-size: 11px;
  color: #888;
  font-family: monospace;
}

.coords.missing {
  color: #e24b4a;
}

.td-actions {
  display: flex;
  gap: 6px;
}

/* ────────────────────────────────────────────────────────────────────────────
   10. AUTH MODAL
   ──────────────────────────────────────────────────────────────────────────── */

#auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
#auth-overlay.is-hidden { display: none; }

#auth-box {
  background: white;
  border-radius: 12px;
  padding: 2rem;
  width: 340px;
  max-width: 90vw;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}

#auth-box h2 {
  font-size: 1rem;
  margin-bottom: 0.4rem;
  color: #2c2c2a;
}

#auth-box p {
  font-size: 0.82rem;
  color: #888;
  margin-bottom: 1.2rem;
}

#auth-input {
  width: 100%;
  border: 1.5px solid #ddd;
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 14px;
  margin-bottom: 0.8rem;
  outline: none;
}

#auth-input:focus {
  border-color: #b53a1e;
}

#auth-btn {
  width: 100%;
  background: #b53a1e;
  color: white;
  border: none;
  border-radius: 7px;
  padding: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

#auth-btn:hover {
  background: #993c1d;
}

#auth-err {
  color: #a32d2d;
  font-size: 0.82rem;
  margin-top: 0.5rem;
  display: none;
}

/* ────────────────────────────────────────────────────────────────────────────
   11. MESSAGES & FEEDBACK
   ──────────────────────────────────────────────────────────────────────────── */

.empty {
  text-align: center;
  padding: 3rem;
  color: #888;
  font-size: 0.9rem;
}

.loading {
  text-align: center;
  padding: 3rem;
  color: #888;
}

.msg {
  padding: 10px 14px;
  border-radius: 7px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}

.msg.ok {
  background: #e1f5ee;
  color: #085041;
  border: 1px solid #5dcaa5;
}

.msg.err {
  background: #fcebeb;
  color: #a32d2d;
  border: 1px solid #f09595;
}

/* ────────────────────────────────────────────────────────────────────────────
   12. TOAST NOTIFICATIONS (nuovo)
   ──────────────────────────────────────────────────────────────────────────── */

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 5000;
}

.toast {
  background: white;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.3s ease;
  max-width: 320px;
}

.toast-success {
  border-left: 4px solid #49a078;
  color: #085041;
}

.toast-error {
  border-left: 4px solid #e24b4a;
  color: #a32d2d;
}

.toast-info {
  border-left: 4px solid #185fa5;
  color: #1565c0;
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ────────────────────────────────────────────────────────────────────────────
   13. ROLE BADGE (per giovani)
   ──────────────────────────────────────────────────────────────────────────── */

.role-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 500;
}

/* ────────────────────────────────────────────────────────────────────────────
   14. UTILITY CLASSES
   ──────────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .show-mobile-only {
    display: none !important;
  }
}

/* ────────────────────────────────────────────────────────────────────────────
   15. DASHBOARD GIOVANI — cards statistiche
   ──────────────────────────────────────────────────────────────────────────── */

.dash-card {
  background: white;
  border-radius: 10px;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dash-card .number {
  font-size: 2rem;
  font-weight: 700;
  color: #b53a1e;
  line-height: 1;
}

.dash-card .label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #2c2c2a;
}

.dash-card .sub {
  font-size: 0.75rem;
  color: #888;
}

/* ────────────────────────────────────────────────────────────────────────────
   16. DARK MODE — attivato via [data-theme="dark"] su <html>
   ──────────────────────────────────────────────────────────────────────────── */

[data-theme='dark'] body {
  background: #1c1916;
  color: #e8e4dc;
}

/* Sfondo e superfici */
[data-theme='dark'] .card,
[data-theme='dark'] .panel,
[data-theme='dark'] .poi-table,
[data-theme='dark'] .data-table {
  background: #2b2720;
  border-color: #3c3830;
}

[data-theme='dark'] .card h3,
[data-theme='dark'] .panel h3,
[data-theme='dark'] .card-luogo {
  color: #e8e4dc;
}

[data-theme='dark'] .card-desc {
  color: #c8c4bc;
}

[data-theme='dark'] .card-meta,
[data-theme='dark'] .card-date {
  color: #9a9690;
}

/* Header (mantiene terracotta, testo chiaro) */
[data-theme='dark'] header {
  background: #3a100a;
}

[data-theme='dark'] .admin-sidebar {
  background: #1a0a05;
  border-right: 1px solid #2b1810;
}

[data-theme='dark'] .sidebar-brand {
  border-bottom-color: #2b1810;
}

[data-theme='dark'] .sidebar-footer {
  border-top-color: #2b1810;
}

[data-theme='dark'] .sidebar-link.active {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme='dark'] .admin-topbar {
  background: #1a0a05;
}

/* Tabelle */
[data-theme='dark'] th {
  background: #242018;
  color: #9a9690;
  border-bottom-color: #3c3830;
}

[data-theme='dark'] td {
  border-bottom-color: #2c2820;
  color: #e8e4dc;
}

[data-theme='dark'] tr:hover td {
  background: #302a21;
}

[data-theme='dark'] tr.inattivo td {
  opacity: 0.35;
}

/* Form elements */
[data-theme='dark'] input,
[data-theme='dark'] select,
[data-theme='dark'] textarea {
  background: #242018;
  border-color: #3c3830;
  color: #e8e4dc;
}

[data-theme='dark'] input:focus,
[data-theme='dark'] select:focus,
[data-theme='dark'] textarea:focus {
  border-color: #d4785f;
  box-shadow: 0 0 0 3px rgba(212, 120, 95, 0.15);
}

[data-theme='dark'] .form-row label {
  color: #9a9690;
}

/* Bottoni secondari */
[data-theme='dark'] .btn,
[data-theme='dark'] .filter-btn,
[data-theme='dark'] .btn-refresh {
  background: #2b2720;
  border-color: #3c3830;
  color: #e8e4dc;
}

[data-theme='dark'] .btn:hover,
[data-theme='dark'] .btn-refresh:hover {
  background: #302a21;
}

[data-theme='dark'] .filter-btn.active {
  background: #b53a1e;
  color: white;
  border-color: #b53a1e;
}

/* Bottone letta / poi / del */
[data-theme='dark'] .btn-letta {
  background: #2b2720;
  border-color: #d4785f;
  color: #d4785f;
}

[data-theme='dark'] .btn-letta:hover {
  background: #3a1e18;
}

[data-theme='dark'] .btn-letta.done {
  border-color: #5c5852;
  color: #5c5852;
}

[data-theme='dark'] .btn-poi {
  background: #2b2720;
  border-color: #4a7cb5;
  color: #7caed9;
}

[data-theme='dark'] .btn-poi:hover {
  background: #1a2a3a;
}

[data-theme='dark'] .btn-del {
  background: #2b2720;
  border-color: #3c3830;
  color: #9a9690;
}

[data-theme='dark'] .btn-del:hover {
  border-color: #e24b4a;
  color: #e24b4a;
  background: #2a1515;
}

[data-theme='dark'] .btn-danger {
  border-color: #e24b4a;
  color: #e24b4a;
}

[data-theme='dark'] .btn-danger:hover {
  background: #2a1515;
}

/* Auth modal */
[data-theme='dark'] #auth-overlay {
  background: rgba(0, 0, 0, 0.75);
}

[data-theme='dark'] #auth-box {
  background: #2b2720;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

[data-theme='dark'] #auth-box h2 {
  color: #e8e4dc;
}

[data-theme='dark'] #auth-box p {
  color: #9a9690;
}

[data-theme='dark'] #auth-input {
  background: #1c1916;
  border-color: #3c3830;
  color: #e8e4dc;
}

[data-theme='dark'] #auth-input:focus {
  border-color: #d4785f;
}

[data-theme='dark'] #auth-err {
  color: #e24b4a;
}

/* Toast notifications (mantieni colori semantici) */
[data-theme='dark'] .toast {
  background: #2b2720;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-theme='dark'] .toast-success {
  border-left-color: #49a078;
  color: #7dd4ae;
}

[data-theme='dark'] .toast-error {
  border-left-color: #e24b4a;
  color: #f08080;
}

[data-theme='dark'] .toast-info {
  border-left-color: #4a7cb5;
  color: #7caed9;
}

/* Messaggi feedback */
[data-theme='dark'] .msg.ok {
  background: #0d2b22;
  color: #7dd4ae;
  border-color: #49a078;
}

[data-theme='dark'] .msg.err {
  background: #2a1515;
  color: #f08080;
  border-color: #e24b4a;
}

[data-theme='dark'] .empty,
[data-theme='dark'] .loading {
  color: #9a9690;
}

/* Badge status — leggibili su sfondo scuro */
[data-theme='dark'] .badge {
  background: #b53a1e;
  color: white;
}

[data-theme='dark'] .badge.zero {
  background: #5c5852;
  color: #e8e4dc;
}

[data-theme='dark'] .badge-bozza {
  background: #302a21;
  color: #b0aca4;
}

[data-theme='dark'] .badge-approvato {
  background: #0d2b22;
  color: #7dd4ae;
}

[data-theme='dark'] .badge-pubblicato {
  background: #1a2a3a;
  color: #7caed9;
}

[data-theme='dark'] .badge-rifiutato {
  background: #2a1515;
  color: #f08080;
}

[data-theme='dark'] .badge-racconto {
  background: #221a36;
  color: #b39ddb;
}

[data-theme='dark'] .badge-proposta {
  background: #1a2a3a;
  color: #7caed9;
}

[data-theme='dark'] .badge-mappa_emotiva {
  background: #2b2200;
  color: #ffd54f;
}

[data-theme='dark'] .badge-denuncia_creativa {
  background: #2a1025;
  color: #f48fb1;
}

[data-theme='dark'] .badge-esperienza_rifiuto {
  background: #0d2b28;
  color: #80cbc4;
}

[data-theme='dark'] .badge-strutturale {
  background: #302a21;
  color: #b0aca4;
}

[data-theme='dark'] .badge-attivo {
  background: #0d2b22;
  color: #7dd4ae;
}

[data-theme='dark'] .badge-concluso {
  background: #302a21;
  color: #b0aca4;
}

[data-theme='dark'] .badge-sospeso {
  background: #2b2200;
  color: #ffd54f;
}

[data-theme='dark'] .badge-verificato {
  background: #0d2b22;
  color: #7dd4ae;
}

[data-theme='dark'] .badge-disatteso {
  background: #2a1515;
  color: #f08080;
}

[data-theme='dark'] .badge-aperto {
  background: #1a2a3a;
  color: #7caed9;
}

[data-theme='dark'] .badge-invitato {
  background: #221a36;
  color: #b39ddb;
}

[data-theme='dark'] .badge-cerchio_tenuto {
  background: #2b2200;
  color: #ffd54f;
}

[data-theme='dark'] .badge-impegno_preso {
  background: #0d2b22;
  color: #7dd4ae;
}

[data-theme='dark'] .tipo-errore {
  background: #2a1515;
  color: #f08080;
}

[data-theme='dark'] .tipo-mancante {
  background: #1a2a3a;
  color: #7caed9;
}

[data-theme='dark'] .tipo-suggerimento {
  background: #2b1e00;
  color: #ffb74d;
}

/* Dashboard giovani */
[data-theme='dark'] .dash-card {
  background: #2b2720;
}

[data-theme='dark'] .dash-card .number {
  color: #d4785f;
}

[data-theme='dark'] .dash-card .label {
  color: #e8e4dc;
}

[data-theme='dark'] .dash-card .sub {
  color: #9a9690;
}

/* Panel border separator */
[data-theme='dark'] .panel h3 {
  border-bottom-color: #3c3830;
}

/* Coords */
[data-theme='dark'] .coords {
  color: #9a9690;
}

/* Nav buttons in header (su sfondo scuro header) — invariati, già su terracotta */
[data-theme='dark'] .nav-btn {
  border-color: rgba(255, 255, 255, 0.3);
  color: white;
}

/* ────────────────────────────────────────────────────────────────────────────
   15. DARK MODE TOGGLE
   ──────────────────────────────────────────────────────────────────────────── */

.dark-toggle {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  margin-left: auto;
}

.dark-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ────────────────────────────────────────────────────────────────────────────
   17. CONFIRM MODAL
   ──────────────────────────────────────────────────────────────────────────── */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}
.confirm-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.confirm-box {
  background: white;
  border-radius: 12px;
  padding: 24px 28px;
  max-width: 380px;
  width: 90vw;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
}
.confirm-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: #2c2c2a;
}
.confirm-msg {
  font-size: 0.85rem;
  color: #666;
  margin-bottom: 20px;
  line-height: 1.5;
}
.confirm-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

[data-theme='dark'] .confirm-box {
  background: #2b2720;
}
[data-theme='dark'] .confirm-title {
  color: #e8e4dc;
}
[data-theme='dark'] .confirm-msg {
  color: #9a9690;
}

/* ────────────────────────────────────────────────────────────────────────────
   18. CHAR COUNTER
   ──────────────────────────────────────────────────────────────────────────── */

.char-counter {
  font-size: 11px;
  color: #aaa;
  text-align: right;
  margin-top: 2px;
}
.char-counter.near-limit {
  color: #c07628;
}
.char-counter.at-limit {
  color: #a32d2d;
}

[data-theme='dark'] .char-counter {
  color: #9a9690;
}
[data-theme='dark'] .char-counter.near-limit {
  color: #ffb74d;
}
[data-theme='dark'] .char-counter.at-limit {
  color: #f08080;
}

/* ────────────────────────────────────────────────────────────────────────────
   19. TABLE SORTING
   ──────────────────────────────────────────────────────────────────────────── */

thead th[data-sort='asc']::after {
  content: ' \25B2';
  font-size: 10px;
}
thead th[data-sort='desc']::after {
  content: ' \25BC';
  font-size: 10px;
}
thead th:not(.no-sort) {
  user-select: none;
}
thead th:not(.no-sort):hover {
  color: #b53a1e;
}

[data-theme='dark'] thead th:not(.no-sort):hover {
  color: #d4785f;
}

/* ────────────────────────────────────────────────────────────────────────────
   20. FIELD VALIDATION
   ──────────────────────────────────────────────────────────────────────────── */

.field-error input,
.field-error select,
.field-error textarea {
  border-color: #e24b4a !important;
  box-shadow: 0 0 0 3px rgba(226, 75, 74, 0.1) !important;
}
.field-error-msg {
  font-size: 11px;
  color: #a32d2d;
  margin-top: 3px;
  display: block;
}

[data-theme='dark'] .field-error-msg {
  color: #f08080;
}

/* ────────────────────────────────────────────────────────────────────────────
   21. ROW LOADING STATE
   ──────────────────────────────────────────────────────────────────────────── */

tr.row-loading {
  opacity: 0.5;
  pointer-events: none;
}
tr.row-loading td::after {
  content: none;
}

/* ────────────────────────────────────────────────────────────────────────────
   22. UNDO TOAST
   ──────────────────────────────────────────────────────────────────────────── */

.toast-undo {
  border-left: 4px solid #555;
  color: #333;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
  transition: opacity 0.3s;
}
[data-theme='dark'] .toast-undo {
  color: #e8e4dc;
}
.toast-undo-btn {
  background: none;
  border: 1px solid currentColor;
  border-radius: 4px;
  padding: 3px 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  color: inherit;
  font-family: inherit;
}
.toast-undo-btn:hover {
  background: rgba(0, 0, 0, 0.08);
}

/* ────────────────────────────────────────────────────────────────────────────
   23. HAMBURGER MENU MOBILE
   ──────────────────────────────────────────────────────────────────────────── */

.hamburger {
  display: none;
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 18px;
  cursor: pointer;
  line-height: 1;
}
.mobile-nav-drawer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 8000;
}
.mobile-nav-drawer.open {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}
.mobile-nav-inner {
  background: #b53a1e;
  width: 260px;
  max-width: 90vw;
  min-height: 100vh;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mobile-nav-inner .nav-btn {
  display: block;
  text-align: left;
  padding: 10px 14px;
  font-size: 14px;
}
.mobile-nav-close {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: white;
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 18px;
  cursor: pointer;
  align-self: flex-end;
  margin-bottom: 8px;
}

[data-theme='dark'] .mobile-nav-inner {
  background: #3a100a;
}

@media (max-width: 768px) {
  .hamburger {
    display: block;
  }
  .header-nav .nav-btn,
  .header-nav .dark-toggle {
    display: none;
  }
  .header-nav {
    gap: 8px;
  }
}

/* ────────────────────────────────────────────────────────────────────────────
   24. MOBILE TOUCH TARGETS
   ──────────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .td-actions .btn-sm {
    min-height: 44px;
    min-width: 44px;
    padding: 10px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .btn-letta,
  .btn-del,
  .btn-poi {
    min-height: 44px;
    padding: 10px 16px;
  }
  .topbar-menu-btn {
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
  }
  .filter-btn {
    min-height: 44px;
    padding: 10px 14px;
  }
}

/* ────────────────────────────────────────────────────────────────────────────
   25. MOBILE CARD LAYOUT FOR TABLES
   ──────────────────────────────────────────────────────────────────────────── */

@media (max-width: 600px) {
  .poi-table,
  .data-table,
  .bandi-table,
  .eventi-table {
    overflow-x: visible;
  }
  table {
    display: block;
  }
  thead {
    display: none;
  }
  tbody {
    display: block;
  }
  tr {
    display: block;
    background: white;
    border-radius: 10px;
    border: 1px solid #e8e8e4;
    margin-bottom: 12px;
    padding: 12px 14px;
  }
  [data-theme='dark'] tr {
    background: #2b2720;
    border-color: #3c3830;
  }
  td {
    display: flex;
    border: none;
    padding: 4px 0;
    font-size: 13px;
    align-items: center;
  }
  td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    min-width: 90px;
    flex-shrink: 0;
  }
  .td-actions {
    justify-content: flex-start;
    gap: 8px;
    margin-top: 8px;
  }
}

/* ── Admin dark mode supplemental (elements not covered above) ── */
[data-theme='dark'] .modal-overlay {
  background: rgba(0, 0, 0, 0.7);
}
[data-theme='dark'] .modal-content {
  background: #1e1e1e;
  color: #e0e0e0;
}
[data-theme='dark'] .btn-secondary {
  background: #333;
  color: #e0e0e0;
}
[data-theme='dark'] .stats-grid .stat-card {
  background: #2a2a2a;
}
[data-theme='dark'] .msg {
  background: #2a2a2a;
  color: #aaa;
}

/* ═══════════════════════════════════════════════════════════════════════════════
   N. ADMIN MODAL, DASHBOARD, CHIPS, BULK ACTIONS — design tokens + classi
   Introdotti in Fase 1 UX refactor — non rimuovere senza rifattorizzare
      admin-modal.js e pagine che li usano (admin.html hub, future migrazioni).
   ═══════════════════════════════════════════════════════════════════════════════ */

:root {
  /* Z-index scale */
  --z-sidebar: 200;
  --z-topbar: 300;
  --z-dropdown: 500;
  --z-modal-backdrop: 900;
  --z-modal: 901;
  --z-modal-nested: 911;
  --z-toast: 1000;
  --z-confirm: 1100;

  /* Modal */
  --modal-bg: #ffffff;
  --modal-backdrop: rgba(0, 0, 0, 0.55);
  --modal-radius: 12px;
  --modal-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  --modal-width-sm: 420px;
  --modal-width-md: 640px;
  --modal-width-lg: 840px;
  --modal-width-xl: 1080px;
  --modal-padding-x: 24px;
  --modal-padding-y: 20px;
  --modal-header-border: 1px solid #ece9e3;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 120ms;
  --dur-base: 200ms;
  --dur-slow: 320ms;

  /* Dashboard card */
  --dash-card-bg: #ffffff;
  --dash-card-border: #e4e1db;
  --dash-card-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  --dash-card-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.08);

  /* Chips */
  --chip-bg: #f3f1ec;
  --chip-fg: #2c2c2a;
  --chip-active-bg: #c04428;
  --chip-active-fg: #ffffff;
  --chip-border: #e4e1db;

  /* Bulk bar */
  --bulk-bar-bg: #2c2c2a;
  --bulk-bar-fg: #ffffff;
}

[data-theme='dark'] {
  --modal-bg: #2b2720;
  --modal-backdrop: rgba(0, 0, 0, 0.7);
  --modal-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  --modal-header-border: 1px solid #3c3830;
  --dash-card-bg: #2b2720;
  --dash-card-border: #3c3830;
  --chip-bg: #302a21;
  --chip-fg: #e8e4dc;
  --chip-border: #3c3830;
  --bulk-bar-bg: #3a100a;
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-fast: 0ms;
    --dur-base: 0ms;
    --dur-slow: 0ms;
  }
}

/* --- Admin Modal --- */
.adm-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--modal-backdrop);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
}
.adm-modal-overlay.open {
  opacity: 1;
}
.adm-modal-overlay.nested {
  z-index: var(--z-modal-nested);
}

.adm-modal {
  background: var(--modal-bg);
  color: var(--color-text, #2c2c2a);
  border-radius: var(--modal-radius);
  box-shadow: var(--modal-shadow);
  width: 100%;
  max-width: var(--modal-width-md);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  transform: translateY(16px) scale(0.98);
  transition: transform var(--dur-base) var(--ease-out);
  z-index: var(--z-modal);
}
.adm-modal-overlay.open .adm-modal {
  transform: translateY(0) scale(1);
}

.adm-modal--sm {
  max-width: var(--modal-width-sm);
}
.adm-modal--md {
  max-width: var(--modal-width-md);
}
.adm-modal--lg {
  max-width: var(--modal-width-lg);
}
.adm-modal--xl {
  max-width: var(--modal-width-xl);
}
.adm-modal--full {
  max-width: none;
  width: 100%;
  height: 100%;
  max-height: none;
  border-radius: 0;
}

.adm-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: var(--modal-padding-y) var(--modal-padding-x);
  border-bottom: var(--modal-header-border);
  flex-shrink: 0;
}
.adm-modal-title {
  font-size: 1rem;
  font-weight: 700;
  flex: 1;
  line-height: 1.3;
}
.adm-modal-close {
  background: transparent;
  border: none;
  font-size: 22px;
  line-height: 1;
  color: #888;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background var(--dur-fast);
}
.adm-modal-close:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #2c2c2a;
}
[data-theme='dark'] .adm-modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #e8e4dc;
}

.adm-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--modal-padding-y) var(--modal-padding-x);
  min-height: 0;
}
.adm-modal-body.is-loading {
  opacity: 0.5;
  pointer-events: none;
}

.adm-modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px var(--modal-padding-x);
  border-top: var(--modal-header-border);
  flex-wrap: wrap;
  flex-shrink: 0;
}
.adm-modal-footer .btn-ghost {
  background: transparent;
  border: 1px solid #ddd;
  color: inherit;
}
[data-theme='dark'] .adm-modal-footer .btn-ghost {
  border-color: #3c3830;
}

/* Detail fields */
.adm-detail {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.adm-detail-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.adm-detail-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
}
.adm-detail-value {
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  white-space: pre-wrap;
}
[data-theme='dark'] .adm-detail-label {
  color: #9a9690;
}

/* Form inside modal */
.adm-form-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 14px;
}
.adm-form-row label {
  font-size: 12px;
  font-weight: 600;
  color: #555;
}
[data-theme='dark'] .adm-form-row label {
  color: #c7c3bb;
}
.adm-form-row input,
.adm-form-row select,
.adm-form-row textarea {
  border: 1px solid #ddd;
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  background: #ffffff;
  color: inherit;
  width: 100%;
}
.adm-form-row input:focus,
.adm-form-row select:focus,
.adm-form-row textarea:focus {
  border-color: #c04428;
  outline: 2px solid rgba(192, 68, 40, 0.15);
  outline-offset: 0;
}
[data-theme='dark'] .adm-form-row input,
[data-theme='dark'] .adm-form-row select,
[data-theme='dark'] .adm-form-row textarea {
  background: #1c1917;
  border-color: #44403c;
  color: #e7e5e4;
}
.adm-form-row textarea {
  min-height: 90px;
  resize: vertical;
}
.adm-form-hint {
  font-size: 11px;
  color: #888;
}
.adm-form-error {
  font-size: 12px;
  color: #991b1b;
  margin-top: 2px;
}

/* Mobile: modale full-screen */
@media (max-width: 600px) {
  .adm-modal-overlay {
    padding: 0;
    align-items: stretch;
  }
  .adm-modal {
    max-width: none;
    max-height: none;
    width: 100%;
    height: 100dvh;
    border-radius: 0;
    transform: translateY(24px);
  }
  .adm-modal-overlay.open .adm-modal {
    transform: translateY(0);
  }
}

/* --- Dashboard hub --- */
.dash-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.dash-hub-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--dash-card-bg);
  border: 1px solid var(--dash-card-border);
  border-radius: 10px;
  box-shadow: var(--dash-card-shadow);
  padding: 16px 18px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-fast) var(--ease-out);
  position: relative;
}
.dash-hub-card:hover,
.dash-hub-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--dash-card-shadow-hover);
  outline: none;
}
.dash-hub-card .val {
  font-size: 1.8rem;
  font-weight: 800;
  color: #c04428;
  line-height: 1;
}
[data-theme='dark'] .dash-hub-card .val {
  color: #d4785f;
}
.dash-hub-card .lbl {
  font-size: 13px;
  font-weight: 600;
  color: inherit;
}
.dash-hub-card .sub {
  font-size: 11px;
  color: #888;
}
.dash-hub-card.is-urgent .val {
  color: #a32d2d;
}
.dash-hub-card.is-urgent::before {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e24b4a;
  box-shadow: 0 0 0 3px rgba(226, 75, 74, 0.2);
}
.dash-hub-card.is-zero .val {
  color: #888;
}
[data-theme='dark'] .dash-hub-card.is-zero .val {
  color: #7a7670;
}

.dash-section-title {
  font-size: 14px;
  font-weight: 700;
  color: #555;
  margin: 24px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
[data-theme='dark'] .dash-section-title {
  color: #c7c3bb;
}

.dash-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 800px) {
  .dash-two-col {
    grid-template-columns: 1fr;
  }
}

.dash-feed {
  background: var(--dash-card-bg);
  border: 1px solid var(--dash-card-border);
  border-radius: 10px;
  padding: 14px 18px;
  box-shadow: var(--dash-card-shadow);
}
.dash-feed-item {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.4;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.dash-feed-item:last-child {
  border-bottom: none;
}
.dash-feed-item .t {
  color: #888;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
[data-theme='dark'] .dash-feed-item {
  border-bottom-color: rgba(255, 255, 255, 0.05);
}
[data-theme='dark'] .dash-feed-item .t {
  color: #9a9690;
}
.dash-feed-item .ok {
  color: #065f46;
}
.dash-feed-item .warn {
  color: #92400e;
}
.dash-feed-item .err {
  color: #991b1b;
}
[data-theme='dark'] .dash-feed-item .ok {
  color: #7dd4ae;
}
[data-theme='dark'] .dash-feed-item .warn {
  color: #fde68a;
}
[data-theme='dark'] .dash-feed-item .err {
  color: #f08080;
}

.dash-quick-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-quick-actions .btn {
  justify-content: flex-start;
  text-align: left;
}

/* --- Chips --- */
.chip-toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.chip {
  background: var(--chip-bg);
  color: var(--chip-fg);
  border: 1px solid var(--chip-border);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background var(--dur-fast);
}
.chip:hover {
  background: #e4e1db;
}
[data-theme='dark'] .chip:hover {
  background: #3c3830;
}
.chip.is-active {
  background: var(--chip-active-bg);
  color: var(--chip-active-fg);
  border-color: var(--chip-active-bg);
}
.chip-dismiss {
  background: transparent;
  border: none;
  margin-left: 4px;
  cursor: pointer;
  color: inherit;
  opacity: 0.7;
}
.chip-dismiss:hover {
  opacity: 1;
}

/* --- Bulk action bar --- */
.bulk-bar {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(100px);
  background: var(--bulk-bar-bg);
  color: var(--bulk-bar-fg);
  border-radius: 10px;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: var(--z-toast);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  transition: transform var(--dur-base) var(--ease-out);
  font-size: 13px;
}
.bulk-bar.open {
  transform: translateX(-50%) translateY(0);
}
.bulk-bar .count {
  font-weight: 700;
}
.bulk-bar .btn-ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: inherit;
}
.bulk-bar .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* --- Bulk selection (Fase 3) --- */
col.col-bulk {
  width: 36px;
}
.bulk-th,
.bulk-td {
  width: 36px;
  text-align: center;
  padding: 6px 4px !important;
}
.bulk-th input[type='checkbox'],
.bulk-td input[type='checkbox'] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--color-primary, #c04428);
  margin: 0;
}
.bulk-bar-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.bulk-bar .btn {
  font-size: 13px;
  padding: 6px 12px;
}
.bulk-bar.is-busy {
  opacity: 0.6;
  pointer-events: none;
}
tr[data-bulk-selected='1'] td {
  background: rgba(192, 68, 40, 0.05);
}
[data-theme='dark'] tr[data-bulk-selected='1'] td {
  background: rgba(212, 120, 95, 0.08);
}

@media (max-width: 600px) {
  .bulk-bar {
    left: 10px;
    right: 10px;
    bottom: 12px;
    transform: translateY(120px);
  }
  .bulk-bar.open {
    transform: translateY(0);
  }
}

/* Responsive: sidebar offset already handled by .has-admin-sidebar, dashboard e modali lo ereditano */
