/* ═══════════════════════════════════════
   MC GAMES — PORTALE TECNICO
   Shared stylesheet
═══════════════════════════════════════ */
:root {
  --sb-w: 228px;
  --sb-bg: #0d1117;
  --sb-text: #8b949e;
  --sb-hover: rgba(255,255,255,0.05);
  --sb-active-bg: rgba(88,101,242,0.15);
  --sb-active: #818cf8;
  --accent: #5865f2;
  --accent-dark: #4752c4;
  --bg: #f0f2f5;
  --white: #ffffff;
  --border: #e4e7ec;
  --text: #111827;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --r: 10px;
  --r-lg: 14px;
  --shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  overflow: hidden;
  display: flex;
}

/* ── Layout ─────────────────────────────── */
.layout { display: flex; width: 100%; height: 100%; }

#sidebar-mount {
  width: var(--sb-w);
  min-width: var(--sb-w);
  background: var(--sb-bg);
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  scrollbar-width: none;
}
#sidebar-mount::-webkit-scrollbar { display: none; }

.main {
  flex: 1;
  min-width: 0;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.page-wrap {
  flex: 1;
  padding: 28px 32px;
  max-width: 1180px;
}

/* ── Sidebar ─────────────────────────────── */
.sb-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  text-decoration: none;
}
.sb-logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; color: #fff;
  letter-spacing: -0.5px; flex-shrink: 0;
}
.sb-name { font-size: 13px; font-weight: 700; color: #f0f6fc; line-height: 1.2; }
.sb-sub  { font-size: 10px; color: #484f58; margin-top: 1px; }
.sb-nav  { flex: 1; padding: 10px 0; }
.sb-group-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: #30363d;
  padding: 12px 16px 5px;
}
.sb-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 16px; font-size: 13px; color: var(--sb-text);
  text-decoration: none; transition: background 0.1s, color 0.1s;
  width: 100%;
}
.sb-item:hover { background: var(--sb-hover); color: #c9d1d9; }
.sb-item.active { background: var(--sb-active-bg); color: var(--sb-active); font-weight: 600; }
.sb-item svg { width: 15px; height: 15px; flex-shrink: 0; opacity: 0.7; }
.sb-item.active svg { opacity: 1; }
.sb-footer {
  padding: 12px 16px; font-size: 10px; color: #30363d;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* ── Page header ─────────────────────────── */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 24px; gap: 12px; flex-wrap: wrap;
}
.page-eyebrow { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 3px; }
.page-title { font-size: 20px; font-weight: 700; color: var(--text); line-height: 1.2; }
.page-sub { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.page-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* ── Buttons ─────────────────────────────── */
.btn {
  padding: 7px 15px; font-size: 13px; font-family: inherit;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--white); color: var(--text-2); cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  white-space: nowrap; line-height: 1.4;
}
.btn:hover { background: #f9fafb; border-color: #cbd5e1; }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); font-weight: 600; }
.btn-success:hover { background: #059669; border-color: #059669; }
.btn-danger  { color: var(--danger); border-color: #fecaca; background: #fff7f7; }
.btn-danger:hover  { background: #fee2e2; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-ghost { background: transparent; color: var(--text-3); border-color: transparent; }
.btn-ghost:hover { background: #f3f4f6; color: var(--text-2); border-color: var(--border); }

/* ── Cards ───────────────────────────────── */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; box-shadow: var(--shadow); }
.card-flush { padding: 0; overflow: hidden; }

/* ── Stats row ───────────────────────────── */
.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 24px; }
.stat-box { background: var(--white); border: 1px solid var(--border); border-radius: var(--r); padding: 16px 18px; box-shadow: var(--shadow); }
.stat-box .s-label { font-size: 11px; color: var(--text-3); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.stat-box .s-val   { font-size: 26px; font-weight: 700; color: var(--text); line-height: 1.1; }
.stat-box .s-sub   { font-size: 11px; color: var(--text-3); margin-top: 2px; }

/* ── Action cards (home) ─────────────────── */
.actions-primary   { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.actions-secondary { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 28px; }
.action-card {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: 22px; text-decoration: none; color: inherit; display: block;
  transition: border-color 0.15s, box-shadow 0.15s; position: relative; overflow: hidden;
  box-shadow: var(--shadow);
}
.action-card:hover { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88,101,242,0.1), var(--shadow-md); }
.action-card.primary { border-left: 3px solid var(--accent); }
.action-card.secondary { border-left: 3px solid var(--border); }
.action-card.secondary:hover { border-left-color: var(--accent); }
.ac-icon  { font-size: 26px; margin-bottom: 10px; display: block; }
.action-card.secondary .ac-icon { font-size: 20px; margin-bottom: 8px; }
.ac-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.action-card.secondary .ac-title { font-size: 13px; }
.ac-desc  { font-size: 12px; color: var(--text-2); line-height: 1.5; padding-right: 24px; }
.ac-arrow { position: absolute; bottom: 16px; right: 16px; font-size: 14px; color: var(--text-3); transition: color 0.15s, transform 0.15s; }
.action-card:hover .ac-arrow { color: var(--accent); transform: translateX(3px); }

/* ── Section label ───────────────────────── */
.sec-label { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 10px; }

/* ── Empty state ─────────────────────────── */
.empty-state { text-align: center; padding: 52px 20px; color: var(--text-3); }
.empty-state .es-ico   { font-size: 36px; margin-bottom: 12px; opacity: 0.4; }
.empty-state .es-title { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.empty-state .es-desc  { font-size: 12px; line-height: 1.5; }

/* ── Data table ──────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th { font-size: 11px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 14px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; background: #fafbfc; }
.data-table td { padding: 11px 14px; border-bottom: 1px solid #f3f4f6; color: var(--text-2); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: #fafbfc; }
.td-bold { font-weight: 600; color: var(--text) !important; }
.td-actions { display: flex; gap: 6px; white-space: nowrap; }

/* ── Badges ──────────────────────────────── */
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.badge-vlt   { background: #dbeafe; color: #1d4ed8; }
.badge-awp   { background: #fef3c7; color: #92400e; }
.badge-ok    { background: #d1fae5; color: #065f46; }
.badge-gray  { background: #f1f5f9; color: #475569; }

/* ── Search / filter row ─────────────────── */
.search-row { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.search-inp {
  flex: 1; min-width: 180px; max-width: 340px; padding: 8px 13px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--white); color: var(--text); font-family: inherit; outline: none;
  transition: border-color 0.15s;
}
.search-inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(88,101,242,0.1); }
select.search-inp { flex: 0; min-width: 120px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7' viewBox='0 0 12 7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position: right 10px center; padding-right: 28px; }

/* ── Toast ───────────────────────────────── */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #1f2937; color: #fff; padding: 10px 18px;
  border-radius: 8px; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-md); z-index: 9999;
  animation: toast-in 0.2s ease;
}
.toast.success { background: var(--success); }
.toast.error   { background: var(--danger); }
@keyframes toast-in { from { opacity:0; transform: translateY(8px); } to { opacity:1; transform: none; } }

/* ── Volatility colors ───────────────────── */
.vol-bassa   { color: #10b981; font-weight: 600; }
.vol-media   { color: #f59e0b; font-weight: 600; }
.vol-alta    { color: #ef4444; font-weight: 600; }
.vol-molto   { color: #7c3aed; font-weight: 600; }

/* ── Feature chips ───────────────────────── */
.feat-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.feat-chip { background: #f1f5f9; border: 1px solid var(--border); border-radius: 20px; padding: 2px 9px; font-size: 11px; color: var(--text-2); }
