/* ═══════════════════════════════════════════════════════════════════════════
   SynapseX AI - Design System "Aurora" (Enterprise)
   Professional palette: navy primary, darker surfaces, Inter font
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
  /* ── Typography ── */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, monospace;

  /* ── Primary (navy enterprise) ── */
  --aurora-primary:      #1e40af;
  --aurora-primary-hover: #1e3a8a;
  --aurora-primary-dim:  rgba(30, 64, 175, 0.12);
  --aurora-accent:       #2563eb;
  --aurora-accent-dim:   rgba(37, 99, 235, 0.12);
  --aurora-amber:        #D97706;
  --aurora-amber-dim:    rgba(217, 119, 6, 0.12);
  --aurora-emerald:      #059669;
  --aurora-emerald-dim:  rgba(5, 150, 105, 0.12);
  --aurora-rose:         #DC2626;
  --aurora-rose-dim:     rgba(220, 38, 38, 0.12);
  --aurora-violet:       #6D28D9;
  --aurora-violet-dim:   rgba(109, 40, 217, 0.12);
  /* Accenti neon (uso moderato, enterprise) */
  --aurora-cyan:        #06B6D4;
  --aurora-cyan-dim:    rgba(6, 182, 212, 0.15);

  /* ── Surfaces (darker, enterprise) ── */
  --surface-bg:          #F1F5F9;
  --surface-card:        #FFFFFF;
  --surface-elevated:    #FFFFFF;
  --surface-muted:       #E2E8F0;
  --surface-hover:       #F1F5F9;

  /* ── Dark sidebar ── */
  --sidebar-bg:          #0c1222;
  --sidebar-bg-hover:    #1e293B;
  --sidebar-border:      rgba(255, 255, 255, 0.06);
  --sidebar-text:        #94A3B8;
  --sidebar-text-hover:  #F8FAFC;
  --sidebar-active:      #60A5FA;
  --sidebar-active-bg:   rgba(96, 165, 250, 0.12);
  --sidebar-live:       var(--aurora-cyan);

  /* ── Text ── */
  --text-primary:        #0F172A;
  --text-secondary:      #334155;
  --text-muted:          #475569;
  --text-disabled:       #94A3B8;

  /* ── Borders ── */
  --border-default:      #CBD5E1;
  --border-strong:       #94A3B8;
  --border-focus:        var(--aurora-primary);

  /* ── Semantic ── */
  --success:             #059669;
  --success-bg:          rgba(5, 150, 105, 0.12);
  --warning:             #D97706;
  --warning-bg:          rgba(217, 119, 6, 0.12);
  --error:               #DC2626;
  --error-bg:            rgba(220, 38, 38, 0.12);
  --info:                var(--aurora-primary);
  --info-bg:             var(--aurora-primary-dim);

  /* ── Shadows ── */
  --shadow-sm:   0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md:   0 4px 6px -1px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.06);
  --shadow-lg:   0 10px 15px -3px rgba(15, 23, 42, 0.1), 0 4px 6px -4px rgba(15, 23, 42, 0.06);
  --shadow-xl:   0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  --shadow-glow: 0 0 40px -10px rgba(30, 64, 175, 0.2);

  /* ── Radius ── */
  --radius-sm:   6px;
  --radius-md:   10px;
  --radius-lg:   14px;

  /* ── Transitions ── */
  --ease-out:    cubic-bezier(0.33, 1, 0.68, 1);
  --duration:    200ms;
}

/* ── Dark mode overrides ── */
.dark {
  --surface-bg:        #0f172a;
  --surface-card:      #1e293b;
  --surface-elevated:  #1e293b;
  --surface-muted:     #334155;
  --surface-hover:     #334155;

  --text-primary:      #f1f5f9;
  --text-secondary:    #cbd5e1;
  --text-muted:        #94a3b8;
  --text-disabled:     #64748b;

  --border-default:    #334155;
  --border-strong:     #475569;

  --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md:   0 4px 6px -1px rgba(0, 0, 0, 0.35);
  --shadow-lg:   0 10px 15px -3px rgba(0, 0, 0, 0.4);
  --shadow-xl:   0 20px 25px -5px rgba(0, 0, 0, 0.4);
  --radius-xl:   18px;
  --radius-2xl:  24px;
}

/* ── Base ── */
body {
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Aurora gradient background (enterprise, muted) ── */
.aurora-bg {
  background: linear-gradient(135deg, var(--surface-bg) 0%, #E2E8F0 50%, #E8EEF4 100%);
  background-attachment: fixed;
}

.aurora-bg-dark {
  background: linear-gradient(180deg, var(--sidebar-bg) 0%, #1E293B 100%);
}

/* ── Sidebar: scrollbar nascosta (scroll attivo) ── */
.admin-sidebar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.admin-sidebar::-webkit-scrollbar {
  display: none;
}

/* ── Utility: hide element ── */
.hidden {
  display: none !important;
}

/* ── Glass card effect ── */
.glass-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: var(--shadow-md);
}

.dark .glass-card {
  background: rgba(30, 41, 59, 0.92);
  border: 1px solid rgba(51, 65, 85, 0.9);
}

/* ── Animations ── */
@keyframes aurora-shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

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

@keyframes aurora-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.animate-fade-in {
  animation: aurora-fade-in 0.4s var(--ease-out) forwards;
}

.animate-stagger > * {
  animation: aurora-fade-in 0.4s var(--ease-out) forwards;
  opacity: 0;
}

.animate-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.animate-stagger > *:nth-child(2) { animation-delay: 0.1s; }
.animate-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.animate-stagger > *:nth-child(4) { animation-delay: 0.2s; }
.animate-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.animate-stagger > *:nth-child(6) { animation-delay: 0.3s; }

/* ── Focus ring (accessibility) ── */
*:focus-visible {
  outline: 2px solid var(--aurora-primary);
  outline-offset: 2px;
}

/* ── Scrollbar styling ── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface-muted);
  border-radius: 4px;
}

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

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

/* ── Tables (Aurora) ── */
.a-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-sm);
}

/* Inside card: no extra border, card provides container */
.a-card .a-table-wrap {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border: none;
  background: transparent;
  box-shadow: none;
}

.a-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.a-table thead th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  background: var(--surface-muted);
  border-bottom: 1px solid var(--border-strong);
  white-space: nowrap;
}

.a-table thead th.text-center { text-align: center; }
.a-table thead th.text-right  { text-align: right; }

.a-table tbody td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border-default);
  vertical-align: middle;
  color: var(--text-primary);
  transition: background-color var(--duration) var(--ease-out);
}

.a-table tbody tr:last-child td {
  border-bottom: none;
}

.a-table tbody tr:hover td {
  background: var(--surface-hover);
}

.a-table tbody td.text-center { text-align: center; }
.a-table tbody td.text-right  { text-align: right; }

.a-table-empty {
  padding: 1.25rem 1.5rem 3rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ── Badges (shared across layouts) ── */
.a-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  border: 1px solid;
}
.a-badge.blue, .a-badge-primary { background: var(--aurora-primary-dim); color: var(--aurora-primary); border-color: var(--aurora-primary); }
.a-badge.green, .a-badge-success { background: var(--aurora-emerald-dim); color: var(--aurora-emerald); border-color: var(--aurora-emerald); }
.a-badge.amber, .a-badge-warning { background: var(--aurora-amber-dim); color: var(--aurora-amber); border-color: var(--aurora-amber); }
.a-badge.red, .a-badge-danger { background: var(--aurora-rose-dim); color: var(--aurora-rose); border-color: var(--aurora-rose); }
.a-badge.gray, .a-badge-secondary, .a-badge-muted { background: var(--surface-muted); color: var(--text-muted); border-color: var(--border-default); }
/* Live indicator (connessione real-time) */
.a-badge-live, .a-live-dot { color: var(--aurora-cyan); }
.a-live-dot { box-shadow: 0 0 8px var(--aurora-cyan-dim); }
