/* ===================================
   FLOFLEET - BASE STYLES
   Variabili CSS, utilities, componenti comuni
   =================================== */

:root {
  --bg: #0a0e1a;
  --panel: #0f1423;
  --panel-light: #14182b;
  --border: rgba(255,255,255,.08);
  --text: #e8eefc;
  --text-muted: #8b98b8;
  --accent: #4f8cff;
  --success: #22c55e;
  --warning: #f59e0b;
  --danger: #ef4444;
  --shadow: 0 8px 24px rgba(0,0,0,.3);
  --navbar-height: 64px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
}

/* ===================================
   NAVBAR
   =================================== */

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  background: linear-gradient(180deg, 
    rgba(15, 20, 35, 0.98) 0%, 
    rgba(10, 14, 26, 0.95) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(79, 140, 255, 0.1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 10000;
}

/* ===================================
   LAYOUT
   =================================== */

.main-content {
  margin-top: var(--navbar-height);
  min-height: calc(100vh - var(--navbar-height));
  padding: 0 32px 32px;
  position: relative;
  z-index: 1;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 32px;
}

/* ===================================
   CARDS
   =================================== */

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s;
}

.card:hover {
  transform: translateY(-2px);
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--panel-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-body {
  padding: 24px;
}

/* ===================================
   GRID
   =================================== */

.grid {
  display: grid;
  gap: 24px;
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* ===================================
   BUTTONS
   =================================== */

.btn {
  background: var(--panel-light);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  background: var(--panel);
  border-color: var(--accent);
  transform: translateY(-1px);
}

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

.btn-primary,
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.btn-primary:hover:not(:disabled),
.btn.primary:hover:not(:disabled) {
  background: #3d7ae8;
}

/* ===================================
   STATUS BADGES
   =================================== */

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

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

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

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 2s infinite;
}

.status-dot.connected {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(34,197,94,.2);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===================================
   PAGE HEADER
   =================================== */

.page-header {
  margin-bottom: 32px;
}

.page-header h1 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.page-header p {
  color: var(--text-muted);
  font-size: 16px;
}

/* ===================================
   UTILITIES
   =================================== */

.center { text-align: center; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.strong { font-size: 15px; font-weight: 700; }

/* ===================================
   SCROLLBAR
   =================================== */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

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

::-webkit-scrollbar-thumb:hover {
  background: var(--panel-light);
}

* {
  scrollbar-width: thin;
  scrollbar-color: var(--border) var(--bg);
}

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

@media (max-width: 768px) {
  .main-content {
    padding: 0 16px 16px;
  }
  
  .container {
    padding-top: 16px;
  }
}