/*
 * ============================================
 * GESTIONALE REFLEXMANIA - DESIGN SYSTEM 2026
 * Glassmorphism + Neomorphism UI
 * ============================================
 */

/* ============================================
   FONTS - Google Fonts Import
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,200..800;1,200..800&family=JetBrains+Mono:wght@400;500;600&display=swap');

/* ============================================
   CSS CUSTOM PROPERTIES - DESIGN TOKENS
   ============================================ */
:root {
  /* === TYPOGRAPHY === */
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  /* === BRAND COLORS - ReflexMania Amber === */
  --brand-50: #fffbeb;
  --brand-100: #fef3c7;
  --brand-200: #fde68a;
  --brand-300: #fcd34d;
  --brand-400: #fbbf24;
  --brand-500: #f59e0b;
  --brand-600: #d97706;
  --brand-700: #b45309;
  --brand-800: #92400e;
  --brand-900: #78350f;
  --brand-950: #451a03;

  /* === SEMANTIC COLORS === */
  --success-400: #4ade80;
  --success-500: #22c55e;
  --success-600: #16a34a;

  --warning-400: #facc15;
  --warning-500: #eab308;
  --warning-600: #ca8a04;

  --error-400: #f87171;
  --error-500: #ef4444;
  --error-600: #dc2626;

  --info-400: #60a5fa;
  --info-500: #3b82f6;
  --info-600: #2563eb;

  /* === GLASS EFFECTS === */
  --glass-blur: 20px;
  --glass-blur-heavy: 40px;
  --glass-saturation: 180%;

  /* === SHADOWS === */
  --shadow-glow: 0 0 40px -10px;
  --shadow-float: 0 25px 50px -12px;
  --shadow-card: 0 10px 40px -10px;
  --shadow-button: 0 4px 14px 0;

  /* === BORDERS === */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-2xl: 32px;
  --radius-full: 9999px;

  /* === TRANSITIONS === */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 350ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* === SPACING === */
  --space-px: 1px;
  --space-0: 0;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
}

/* ============================================
   DARK THEME (Default)
   ============================================ */
[data-theme="dark"], :root {
  --bg-base: #09090b;
  --bg-elevated: #18181b;
  --bg-surface: #27272a;
  --bg-muted: #3f3f46;

  --glass-bg: rgba(24, 24, 27, 0.7);
  --glass-bg-light: rgba(39, 39, 42, 0.5);
  --glass-border: rgba(63, 63, 70, 0.5);
  --glass-border-light: rgba(82, 82, 91, 0.3);

  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-inverse: #09090b;

  --border-default: #27272a;
  --border-subtle: #3f3f46;
  --border-strong: #52525b;

  --shadow-color: rgba(0, 0, 0, 0.5);
  --glow-brand: rgba(245, 158, 11, 0.3);
  --glow-success: rgba(34, 197, 94, 0.3);
  --glow-error: rgba(239, 68, 68, 0.3);

  /* Gradient Mesh Background */
  --gradient-mesh:
    radial-gradient(ellipse 80% 50% at 20% -20%, rgba(245, 158, 11, 0.15), transparent),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(180, 83, 9, 0.1), transparent),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(39, 39, 42, 0.5), transparent);
}

/* ============================================
   LIGHT THEME
   ============================================ */
[data-theme="light"] {
  --bg-base: #fafafa;
  --bg-elevated: #ffffff;
  --bg-surface: #f4f4f5;
  --bg-muted: #e4e4e7;

  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-bg-light: rgba(244, 244, 245, 0.6);
  --glass-border: rgba(228, 228, 231, 0.8);
  --glass-border-light: rgba(212, 212, 216, 0.5);

  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-muted: #71717a;
  --text-inverse: #fafafa;

  --border-default: #e4e4e7;
  --border-subtle: #d4d4d8;
  --border-strong: #a1a1aa;

  --shadow-color: rgba(0, 0, 0, 0.1);
  --glow-brand: rgba(217, 119, 6, 0.2);
  --glow-success: rgba(22, 163, 74, 0.2);
  --glow-error: rgba(220, 38, 38, 0.2);

  --gradient-mesh:
    radial-gradient(ellipse 80% 50% at 20% -20%, rgba(254, 243, 199, 0.6), transparent),
    radial-gradient(ellipse 60% 40% at 80% 100%, rgba(253, 230, 138, 0.3), transparent),
    radial-gradient(ellipse 50% 50% at 50% 50%, rgba(244, 244, 245, 0.8), transparent);
}

/* ============================================
   BASE STYLES
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Ambient Background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--gradient-mesh);
  pointer-events: none;
  z-index: -1;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

a {
  color: var(--brand-500);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--brand-400);
}

code, pre {
  font-family: var(--font-mono);
}

/* ============================================
   GLASS CARD COMPONENT
   ============================================ */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
}

.glass-light {
  background: var(--glass-bg-light);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  border: 1px solid var(--glass-border-light);
  border-radius: var(--radius-lg);
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturation));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card) var(--shadow-color);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.glass-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-float) var(--shadow-color);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  border-radius: var(--radius-lg);
  border: none;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Primary Button */
.btn-primary {
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-600) 100%);
  color: var(--text-inverse);
  box-shadow: var(--shadow-button) var(--glow-brand);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--brand-400) 0%, var(--brand-500) 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px 0 var(--glow-brand);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

/* Secondary Button (Glass) */
.btn-secondary {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--glass-bg-light);
  border-color: var(--border-strong);
}

/* Ghost Button */
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--glass-bg-light);
  color: var(--text-primary);
}

/* Danger Button */
.btn-danger {
  background: linear-gradient(135deg, var(--error-500) 0%, var(--error-600) 100%);
  color: white;
  box-shadow: var(--shadow-button) var(--glow-error);
}

.btn-danger:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--error-400) 0%, var(--error-500) 100%);
  transform: translateY(-1px);
}

/* Success Button */
.btn-success {
  background: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
  color: white;
  box-shadow: var(--shadow-button) var(--glow-success);
}

.btn-success:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--success-400) 0%, var(--success-500) 100%);
  transform: translateY(-1px);
}

/* Button Sizes */
.btn-sm {
  padding: var(--space-2) var(--space-3);
  font-size: 0.75rem;
  border-radius: var(--radius-md);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: 1rem;
  border-radius: var(--radius-xl);
}

/* Icon Button */
.btn-icon {
  padding: var(--space-3);
  aspect-ratio: 1;
}

/* ============================================
   FORM INPUTS
   ============================================ */
.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--glass-bg-light);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  outline: none;
  transition: all var(--transition-fast);
}

.input::placeholder {
  color: var(--text-muted);
}

.input:hover {
  border-color: var(--border-strong);
}

.input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--glow-brand);
}

.input-error {
  border-color: var(--error-500);
}

.input-error:focus {
  box-shadow: 0 0 0 3px var(--glow-error);
}

/* Select */
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2371717a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--space-3) center;
  padding-right: var(--space-10);
}

/* Checkbox & Radio */
.checkbox-wrapper,
.radio-wrapper {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  cursor: pointer;
}

.checkbox,
.radio {
  appearance: none;
  width: 1.25rem;
  height: 1.25rem;
  background: var(--glass-bg-light);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.radio {
  border-radius: var(--radius-full);
}

.checkbox:checked,
.radio:checked {
  background: var(--brand-500);
  border-color: var(--brand-500);
}

.checkbox:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.375rem;
  height: 0.625rem;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: translate(-50%, -60%) rotate(45deg);
}

.radio:checked::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0.5rem;
  height: 0.5rem;
  background: white;
  border-radius: var(--radius-full);
  transform: translate(-50%, -50%);
}

/* ============================================
   BADGES & TAGS
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: var(--space-1) var(--space-3);
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  white-space: nowrap;
}

.badge-brand {
  background: rgba(245, 158, 11, 0.15);
  color: var(--brand-400);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success-400);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-warning {
  background: rgba(234, 179, 8, 0.15);
  color: var(--warning-400);
  border: 1px solid rgba(234, 179, 8, 0.3);
}

.badge-error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error-400);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
  background: rgba(59, 130, 246, 0.15);
  color: var(--info-400);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-neutral {
  background: var(--glass-bg-light);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}

/* Badge with dot indicator */
.badge-dot::before {
  content: '';
  width: 0.375rem;
  height: 0.375rem;
  border-radius: var(--radius-full);
  background: currentColor;
}

/* ============================================
   TABLES
   ============================================ */
.table-container {
  overflow-x: auto;
  border-radius: var(--radius-xl);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
}

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

.table th {
  padding: var(--space-4);
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  background: var(--glass-bg-light);
  border-bottom: 1px solid var(--glass-border);
}

.table td {
  padding: var(--space-4);
  border-bottom: 1px solid var(--glass-border-light);
  color: var(--text-secondary);
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--glass-bg-light);
}

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

/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 280px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur-heavy)) saturate(var(--glass-saturation));
  -webkit-backdrop-filter: blur(var(--glass-blur-heavy)) saturate(var(--glass-saturation));
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform var(--transition-base);
}

.sidebar-header {
  padding: var(--space-6);
  border-bottom: 1px solid var(--glass-border-light);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-600) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-button) var(--glow-brand);
}

.sidebar-logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

.sidebar-logo-text span {
  color: var(--brand-500);
}

.sidebar-nav {
  flex: 1;
  padding: var(--space-4);
  overflow-y: auto;
}

.sidebar-section {
  margin-bottom: var(--space-6);
}

.sidebar-section-title {
  padding: var(--space-2) var(--space-3);
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.9375rem;
  transition: all var(--transition-fast);
  margin-bottom: var(--space-1);
}

.sidebar-link:hover {
  background: var(--glass-bg-light);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: rgba(245, 158, 11, 0.1);
  color: var(--brand-500);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.sidebar-link-icon {
  width: 20px;
  height: 20px;
  opacity: 0.8;
}

.sidebar-link.active .sidebar-link-icon {
  opacity: 1;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--brand-500);
  color: var(--text-inverse);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  min-width: 1.25rem;
  text-align: center;
}

.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid var(--glass-border-light);
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 280px;
  right: 0;
  height: 72px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur-heavy)) saturate(var(--glass-saturation));
  -webkit-backdrop-filter: blur(var(--glass-blur-heavy)) saturate(var(--glass-saturation));
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  z-index: 30;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.navbar-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.navbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.navbar-breadcrumb a {
  color: var(--text-muted);
}

.navbar-breadcrumb a:hover {
  color: var(--brand-500);
}

.navbar-breadcrumb-separator {
  color: var(--text-muted);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.navbar-search {
  position: relative;
}

.navbar-search-input {
  width: 280px;
  padding: var(--space-2) var(--space-4);
  padding-left: var(--space-10);
  background: var(--glass-bg-light);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
}

.navbar-search-input:focus {
  width: 360px;
  border-color: var(--brand-500);
  box-shadow: 0 0 0 3px var(--glow-brand);
}

.navbar-search-icon {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

/* User Avatar */
.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--brand-500) 0%, var(--brand-700) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  color: white;
  cursor: pointer;
  transition: transform var(--transition-fast);
}

.avatar:hover {
  transform: scale(1.05);
}

.avatar img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */
.main-content {
  margin-left: 280px;
  padding-top: 72px;
  min-height: 100vh;
}

.page-content {
  padding: var(--space-6);
  max-width: 1600px;
}

.page-header {
  margin-bottom: var(--space-6);
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ============================================
   STAT CARDS
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.stat-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: var(--space-5);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--stat-color, var(--brand-500)), transparent);
  opacity: 0;
  transition: opacity var(--transition-base);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card) var(--shadow-color);
}

.stat-card:hover::before {
  opacity: 1;
}

.stat-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--stat-bg, rgba(245, 158, 11, 0.1));
  color: var(--stat-color, var(--brand-500));
}

.stat-card-trend {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.75rem;
  font-weight: 600;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-full);
}

.stat-card-trend.up {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success-400);
}

.stat-card-trend.down {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error-400);
}

.stat-card-value {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-card-label {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Stat card color variants */
.stat-card.brand { --stat-color: var(--brand-500); --stat-bg: rgba(245, 158, 11, 0.1); }
.stat-card.success { --stat-color: var(--success-500); --stat-bg: rgba(34, 197, 94, 0.1); }
.stat-card.warning { --stat-color: var(--warning-500); --stat-bg: rgba(234, 179, 8, 0.1); }
.stat-card.error { --stat-color: var(--error-500); --stat-bg: rgba(239, 68, 68, 0.1); }
.stat-card.info { --stat-color: var(--info-500); --stat-bg: rgba(59, 130, 246, 0.1); }

/* ============================================
   NOTIFICATION/ALERT TOASTS
   ============================================ */
.toast-container {
  position: fixed;
  top: var(--space-6);
  right: var(--space-6);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float) var(--shadow-color);
  min-width: 320px;
  max-width: 420px;
  animation: slideInRight var(--transition-spring) forwards;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.toast-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.toast-message {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.toast-close {
  flex-shrink: 0;
  padding: var(--space-1);
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition-fast);
}

.toast-close:hover {
  color: var(--text-primary);
}

.toast.success { border-left: 3px solid var(--success-500); }
.toast.error { border-left: 3px solid var(--error-500); }
.toast.warning { border-left: 3px solid var(--warning-500); }
.toast.info { border-left: 3px solid var(--info-500); }

/* ============================================
   DROPDOWNS
   ============================================ */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: var(--space-2);
  min-width: 200px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float) var(--shadow-color);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition-fast);
  z-index: 50;
}

.dropdown.open .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  color: var(--text-secondary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.dropdown-item:hover {
  background: var(--glass-bg-light);
  color: var(--text-primary);
}

.dropdown-item:first-child {
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.dropdown-item:last-child {
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.dropdown-divider {
  height: 1px;
  background: var(--glass-border);
  margin: var(--space-2) 0;
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur-heavy));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-float) var(--shadow-color);
  transform: scale(0.95);
  transition: transform var(--transition-spring);
}

.modal-overlay.open .modal {
  transform: scale(1);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--glass-border-light);
}

.modal-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-close:hover {
  background: var(--glass-bg-light);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-6);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--glass-border-light);
}

/* ============================================
   TABS
   ============================================ */
.tabs {
  display: flex;
  gap: var(--space-1);
  background: var(--glass-bg-light);
  padding: var(--space-1);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
}

.tab {
  padding: var(--space-2) var(--space-4);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

.tab.active {
  background: var(--bg-elevated);
  color: var(--text-primary);
  box-shadow: 0 1px 3px var(--shadow-color);
}

/* ============================================
   THEME TOGGLE
   ============================================ */
.theme-toggle {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg-light);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.theme-toggle:hover {
  background: var(--glass-bg);
  color: var(--brand-500);
  border-color: var(--brand-500);
}

.theme-toggle-icon {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-base);
}

.theme-toggle:hover .theme-toggle-icon {
  transform: rotate(15deg);
}

/* ============================================
   LOADING STATES
   ============================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--glass-bg-light) 25%,
    var(--glass-bg) 50%,
    var(--glass-bg-light) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--brand-500);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress {
  height: 8px;
  background: var(--glass-bg-light);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-500), var(--brand-400));
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* ============================================
   EMPTY STATE
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
}

.empty-state-icon {
  width: 80px;
  height: 80px;
  margin-bottom: var(--space-4);
  color: var(--text-muted);
  opacity: 0.5;
}

.empty-state-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  color: var(--text-muted);
  font-size: 0.9375rem;
  max-width: 400px;
  margin-bottom: var(--space-6);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-brand { color: var(--brand-500); }
.text-success { color: var(--success-500); }
.text-warning { color: var(--warning-500); }
.text-error { color: var(--error-500); }

.bg-brand { background-color: var(--brand-500); }
.bg-success { background-color: var(--success-500); }
.bg-warning { background-color: var(--warning-500); }
.bg-error { background-color: var(--error-500); }

.font-mono { font-family: var(--font-mono); }

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Icon sizing utilities (Tailwind-compatible) */
.h-4 { height: 1rem; }
.w-4 { width: 1rem; }
.h-5 { height: 1.25rem; }
.w-5 { width: 1.25rem; }
.h-6 { height: 1.5rem; }
.w-6 { width: 1.5rem; }
.h-8 { height: 2rem; }
.w-8 { width: 2rem; }
.h-10 { height: 2.5rem; }
.w-10 { width: 2.5rem; }
.h-12 { height: 3rem; }
.w-12 { width: 3rem; }

/* Margin utilities (Tailwind-compatible) */
.m-0 { margin: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }
.ml-1 { margin-left: 0.25rem; }
.ml-2 { margin-left: 0.5rem; }
.ml-3 { margin-left: 0.75rem; }
.ml-4 { margin-left: 1rem; }
.mr-1 { margin-right: 0.25rem; }
.mr-2 { margin-right: 0.5rem; }
.mr-3 { margin-right: 0.75rem; }
.mr-4 { margin-right: 1rem; }
.-ml-1 { margin-left: -0.25rem; }
.-mr-1 { margin-right: -0.25rem; }
.mr-1\.5 { margin-right: 0.375rem; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-8 { margin-bottom: 2rem; }
.-mb-8 { margin-bottom: -2rem; }
.-ml-px { margin-left: -1px; }

/* Padding utilities */
.p-2 { padding: 0.5rem; }
.p-4 { padding: 1rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.pt-1\.5 { padding-top: 0.375rem; }
.pt-4 { padding-top: 1rem; }
.pb-8 { padding-bottom: 2rem; }
.pb-20 { padding-bottom: 5rem; }

/* Flex utilities */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-1 { flex: 1 1 0%; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.space-x-3 > * + * { margin-left: 0.75rem; }
.space-x-4 > * + * { margin-left: 1rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }

/* Grid utilities */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* Position utilities */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { top: 0; right: 0; bottom: 0; left: 0; }
.top-4 { top: 1rem; }
.left-4 { left: 1rem; }
.right-0 { right: 0; }
.z-10 { z-index: 10; }
.z-50 { z-index: 50; }

/* Transform origin utilities */
.origin-top-right { transform-origin: top right; }

/* Translate utilities */
.translate-y-0 { transform: translateY(0); }

/* Width utilities */
.w-0\.5 { width: 0.125rem; }
.w-56 { width: 14rem; }
.w-full { width: 100%; }
.min-w-0 { min-width: 0; }
.min-w-full { min-width: 100%; }
.max-w-lg { max-width: 32rem; }
.min-h-screen { min-height: 100vh; }

/* Height utilities */
.h-full { height: 100%; }
.min-h-full { min-height: 100%; }

/* Text utilities */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.font-medium { font-weight: 500; }
.font-bold { font-weight: 700; }
.font-normal { font-weight: 400; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.whitespace-nowrap { white-space: nowrap; }
.whitespace-pre-wrap { white-space: pre-wrap; }

/* Color text utilities */
.text-gray-400 { color: #9ca3af; }
.text-gray-500 { color: #6b7280; }
.text-gray-700 { color: #374151; }
.text-gray-800 { color: #1f2937; }
.text-gray-900 { color: #111827; }
.text-white { color: #ffffff; }
.text-red-400 { color: #f87171; }
.text-red-600 { color: #dc2626; }
.text-red-800 { color: #991b1b; }
.text-green-400 { color: #4ade80; }
.text-green-600 { color: #16a34a; }
.text-green-800 { color: #166534; }
.text-blue-600 { color: #2563eb; }
.text-yellow-600 { color: #ca8a04; }
.text-primary-600 { color: var(--brand-600); }
.text-primary-900 { color: var(--brand-900); }

/* Background utilities */
.bg-white { background-color: #ffffff; }
.bg-gray-50 { background-color: #f9fafb; }
.bg-gray-100 { background-color: #f3f4f6; }
.bg-gray-200 { background-color: #e5e7eb; }
.bg-gray-500 { background-color: #6b7280; }
.bg-red-50 { background-color: #fef2f2; }
.bg-red-100 { background-color: #fee2e2; }
.bg-green-50 { background-color: #f0fdf4; }
.bg-green-100 { background-color: #dcfce7; }
.bg-green-600 { background-color: #16a34a; }
.bg-blue-100 { background-color: #dbeafe; }
.bg-yellow-100 { background-color: #fef9c3; }
.bg-orange-600 { background-color: #ea580c; }
.bg-primary-100 { background-color: var(--brand-100); }
.bg-primary-600 { background-color: var(--brand-600); }
.bg-opacity-75 { opacity: 0.75; }

/* Border utilities */
.border { border-width: 1px; }
.border-b { border-bottom-width: 1px; }
.border-t { border-top-width: 1px; }
.border-transparent { border-color: transparent; }
.border-gray-200 { border-color: #e5e7eb; }
.border-gray-300 { border-color: #d1d5db; }
.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }

/* Ring utilities */
.ring-1 { box-shadow: 0 0 0 1px var(--ring-color, currentColor); }
.ring-black { --ring-color: black; }
.ring-opacity-5 { --ring-opacity: 0.05; }

/* Shadow utilities */
.shadow { box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); }
.shadow-sm { box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05); }
.shadow-lg { box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); }
.shadow-xl { box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1); }
.ring-8 { box-shadow: 0 0 0 8px var(--ring-color, white); }
.ring-white { --ring-color: white; }

/* Overflow utilities */
.overflow-hidden { overflow: hidden; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Display utilities */
.hidden { display: none; }
.block { display: block; }

/* Misc utilities */
.divide-y > * + * { border-top-width: 1px; }
.divide-gray-200 > * + * { border-color: #e5e7eb; }
.object-cover { object-fit: cover; }
.transition { transition-property: all; transition-duration: 150ms; }
.transition-opacity { transition-property: opacity; }
.transform { transform: translateX(var(--tw-translate-x, 0)) translateY(var(--tw-translate-y, 0)); }

/* Hover states */
.hover\:text-gray-500:hover { color: #6b7280; }
.hover\:text-primary-900:hover { color: var(--brand-900); }
.hover\:bg-gray-50:hover { background-color: #f9fafb; }
.hover\:bg-gray-100:hover { background-color: #f3f4f6; }
.hover\:bg-green-700:hover { background-color: #15803d; }
.hover\:bg-orange-700:hover { background-color: #c2410c; }
.hover\:bg-primary-700:hover { background-color: var(--brand-700); }

/* Scope selectors for table styling */
[scope="col"] {
  /* Add column header styling if needed */
}

/* Focus states */
.focus\:outline-none:focus { outline: none; }
.focus\:ring-2:focus { box-shadow: 0 0 0 2px var(--ring-color, var(--brand-500)); }
.focus\:ring-offset-2:focus { box-shadow: 0 0 0 2px white, 0 0 0 4px var(--ring-color, var(--brand-500)); }
.focus\:ring-primary-500:focus { --ring-color: var(--brand-500); }
.focus\:ring-green-500:focus { --ring-color: #22c55e; }
.focus\:ring-orange-500:focus { --ring-color: #f97316; }
.focus\:border-primary-500:focus { border-color: var(--brand-500); }

/* SVG icon base styles - forza dimensioni corrette */
svg {
  flex-shrink: 0;
}

/* Forza SVG a rispettare le dimensioni delle classi */
svg.h-4 { height: 1rem !important; width: auto; }
svg.w-4 { width: 1rem !important; height: auto; }
svg.h-5 { height: 1.25rem !important; width: auto; }
svg.w-5 { width: 1.25rem !important; height: auto; }
svg.h-6 { height: 1.5rem !important; width: auto; }
svg.w-6 { width: 1.5rem !important; height: auto; }
svg.h-8 { height: 2rem !important; width: auto; }
svg.w-8 { width: 2rem !important; height: auto; }
svg.h-12 { height: 3rem !important; width: auto; }
svg.w-12 { width: 3rem !important; height: auto; }

/* SVG con entrambe le classi h-X e w-X */
svg.h-4.w-4 { height: 1rem !important; width: 1rem !important; }
svg.h-5.w-5 { height: 1.25rem !important; width: 1.25rem !important; }
svg.h-6.w-6 { height: 1.5rem !important; width: 1.5rem !important; }
svg.h-8.w-8 { height: 2rem !important; width: 2rem !important; }
svg.h-12.w-12 { height: 3rem !important; width: 3rem !important; }

/* Flow-root per clearfix */
.flow-root { display: flow-root; }

/* List styles */
ul { list-style: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* SM breakpoint (min-width: 640px) */
@media (min-width: 640px) {
  .sm\:flex { display: flex; }
  .sm\:items-center { align-items: center; }
  .sm\:justify-between { justify-content: space-between; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sm\:col-span-2 { grid-column: span 2 / span 2; }
  .sm\:text-sm { font-size: 0.875rem; line-height: 1.25rem; }
  .sm\:my-8 { margin-top: 2rem; margin-bottom: 2rem; }
  .sm\:max-w-lg { max-width: 32rem; }
  .sm\:w-full { width: 100%; }
  .sm\:p-0 { padding: 0; }
  .sm\:mt-0 { margin-top: 0; }
}

/* LG breakpoint (min-width: 1024px) */
@media (min-width: 1024px) {
  .lg\:col-span-2 { grid-column: span 2 / span 2; }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .navbar {
    left: 0;
  }

  .main-content {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .page-content {
    padding: var(--space-4);
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .navbar-search {
    display: none;
  }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-fade-in { animation: fadeIn var(--transition-base) forwards; }
.animate-fade-in-up { animation: fadeInUp var(--transition-base) forwards; }
.animate-fade-in-down { animation: fadeInDown var(--transition-base) forwards; }
.animate-scale-in { animation: scaleIn var(--transition-spring) forwards; }

/* Staggered animations */
.stagger-1 { animation-delay: 50ms; }
.stagger-2 { animation-delay: 100ms; }
.stagger-3 { animation-delay: 150ms; }
.stagger-4 { animation-delay: 200ms; }
.stagger-5 { animation-delay: 250ms; }
