/* ============================================================
   FiveM Hosting Portal - Stile base
   Layout responsive con Flexbox e Grid, sidebar dedicata.
   ============================================================ */

:root {
  --bg: #0f1115;
  --surface: #1a1d24;
  --surface-2: #232732;
  --accent: #2dd4bf;
  --accent-2: #6366f1;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --danger: #ef4444;
  --success: #22c55e;
  --warning: #f59e0b;
  --border: #2c313c;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Layout con sidebar --- */
.layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar .brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 1rem;
}

.sidebar a {
  color: var(--text);
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  transition: background 0.15s;
}

.sidebar a:hover,
.sidebar a.active {
  background: var(--surface-2);
  text-decoration: none;
}

.sidebar .spacer { flex: 1; }

.main {
  padding: 2rem;
  overflow-x: auto;
}

/* --- Header --- */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-header h1 { font-size: 1.5rem; margin: 0; }

/* --- Card / Grid --- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.2rem;
}

.card h3 { margin: 0 0 0.5rem; font-size: 1rem; color: var(--muted); }
.card .value { font-size: 1.8rem; font-weight: 700; }

/* --- Tabelle --- */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th { background: var(--surface-2); color: var(--muted); font-weight: 600; }

/* --- Form / Input --- */
label { display: block; margin-bottom: 0.3rem; color: var(--muted); }

input, select, textarea {
  width: 100%;
  padding: 0.6rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  margin-bottom: 1rem;
}

input:focus, select:focus { outline: 2px solid var(--accent); }

.btn {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #06231f;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { opacity: 0.9; }
.btn.secondary { background: var(--surface-2); color: var(--text); }
.btn.danger { background: var(--danger); color: #fff; }

/* --- Badge di stato --- */
.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
}
.badge.active, .badge.running { background: rgba(34,197,94,0.2); color: var(--success); }
.badge.suspended, .badge.stopped { background: rgba(239,68,68,0.2); color: var(--danger); }
.badge.preparing { background: rgba(245,158,11,0.2); color: var(--warning); }

/* --- Messaggi --- */
.alert { padding: 0.8rem 1rem; border-radius: 8px; margin-bottom: 1rem; }
.alert.error { background: rgba(239,68,68,0.15); color: var(--danger); }
.alert.success { background: rgba(34,197,94,0.15); color: var(--success); }

/* --- Auth (login) --- */
.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}
.auth-card { width: 360px; }

/* --- Progress bar disco --- */
.progress {
  height: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .sidebar .spacer { display: none; }
}
