/* ── Fulbito Admin — Verde profundo + Dorado ─── */

:root {
  --g900: #06130a;
  --g800: #0b1f12;
  --g700: #112e1b;
  --g600: #1b5e20;
  --g500: #2e7d32;
  --gold: #c9a227;
  --gold-l: #e0c35a;
  --gold-dim: rgba(201,162,39,.12);
  --surface: #0e2116;
  --card: #132a1b;
  --card-hover: #1a3a24;
  --txt: #edeae5;
  --txt2: #97a99c;
  --border: rgba(201,162,39,.1);
  --radius: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,.3);
  --sidebar-w: 240px;
  --font: 'DM Sans', system-ui, sans-serif;
  --font-h: 'Oswald', system-ui, sans-serif;
}

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

body {
  font-family: var(--font);
  background: var(--g900);
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100vh;
}

.screen { display: none; height: 100vh; }
.screen.active { display: flex; }

/* ════════════════════════════════════════════════
   LOGIN
   ════════════════════════════════════════════════ */

.login-bg {
  width: 100%; height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(27,94,32,.3) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(201,162,39,.08) 0%, transparent 50%),
    var(--g900);
}

.login-card {
  background: linear-gradient(160deg, var(--g800), var(--g700));
  border: 1px solid rgba(201,162,39,.3);
  border-radius: 16px;
  padding: 3rem 2.5rem;
  width: 100%; max-width: 400px;
  box-shadow: 0 12px 48px rgba(0,0,0,.5), 0 0 80px rgba(201,162,39,.04);
  text-align: center;
}

.login-icon { margin-bottom: .5rem; }
.app-icon-lg { width: 72px; height: 72px; border-radius: 16px; }

.login-title {
  font-family: var(--font-h);
  font-size: 2.2rem; font-weight: 700;
  color: var(--txt); margin-bottom: .25rem;
}
.login-title span { color: var(--gold); margin-left: 6px; }

.login-sub { color: var(--txt2); font-size: .85rem; margin-bottom: 2rem; }

.field { text-align: left; margin-bottom: 1.25rem; }

.field label {
  display: block; font-size: .75rem; font-weight: 600;
  color: var(--txt2); text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: .4rem;
}

.field input {
  width: 100%; padding: .7rem .9rem;
  background: var(--g900); border: 1px solid rgba(201,162,39,.2);
  border-radius: 8px; color: var(--txt);
  font-family: var(--font); font-size: .95rem;
  outline: none; transition: border-color .2s;
}
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,.1); }

.btn-gold {
  width: 100%; padding: .75rem;
  background: linear-gradient(135deg, var(--gold), #d4a72c);
  border: none; border-radius: 8px;
  color: var(--g900); font-family: var(--font-h);
  font-size: 1.1rem; font-weight: 600;
  letter-spacing: 1px; text-transform: uppercase;
  cursor: pointer; transition: all .2s;
  margin-top: .5rem;
}
.btn-gold:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn-gold:active { transform: translateY(0); }
.btn-gold:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.error-msg {
  color: #ef5350; font-size: .85rem;
  margin-top: .75rem; min-height: 1.2em;
}

/* ════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════ */

.sidebar {
  width: var(--sidebar-w); height: 100vh;
  background: var(--g800);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
}

.sidebar-brand {
  padding: 1.25rem 1.25rem .75rem;
  display: flex; align-items: center; gap: .6rem;
  border-bottom: 1px solid var(--border);
}

.brand-icon { font-size: 1.6rem; }
.brand-icon-img { width: 32px; height: 32px; border-radius: 6px; }

.brand-text {
  font-family: var(--font-h);
  font-size: 1.3rem; font-weight: 700; color: var(--txt);
}
.brand-text span { color: var(--gold); margin-left: 4px; }

.sidebar-nav {
  flex: 1; padding: 1rem .75rem;
  display: flex; flex-direction: column; gap: 2px;
}

.nav-item {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem 1rem; border-radius: 8px;
  color: var(--txt2); text-decoration: none;
  font-size: .9rem; font-weight: 500;
  transition: all .15s;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { background: var(--gold-dim); color: var(--txt); }
.nav-item.active { background: var(--gold-dim); color: var(--gold); }

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.admin-info {
  display: flex; flex-direction: column; gap: 2px;
  margin-bottom: .75rem;
}
.admin-info span:first-child {
  font-size: .8rem; color: var(--txt2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.admin-role {
  font-size: .65rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--gold); opacity: .8;
}

.btn-logout {
  width: 100%; padding: .5rem;
  background: transparent; border: 1px solid rgba(239,83,80,.25);
  border-radius: 6px; color: #ef5350;
  font-family: var(--font); font-size: .8rem; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.btn-logout:hover { background: rgba(239,83,80,.1); }

/* ════════════════════════════════════════════════
   MAIN CONTENT
   ════════════════════════════════════════════════ */

.main {
  flex: 1; height: 100vh; overflow-y: auto;
  padding: 2rem 2.5rem;
  background:
    radial-gradient(ellipse at 80% 10%, rgba(27,94,32,.1) 0%, transparent 50%),
    var(--g900);
}

.section { display: none; }
.section.active { display: block; animation: fadeIn .3s ease; }

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

.section-title {
  font-family: var(--font-h);
  font-size: 1.6rem; font-weight: 600; color: var(--txt);
  margin-bottom: 1.5rem;
  padding-left: .75rem;
  border-left: 3px solid var(--gold);
}

/* ── Metrics grid ──────────────────────────── */

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.metric-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex; align-items: center; gap: 1rem;
  box-shadow: var(--shadow);
  transition: border-color .2s;
}
.metric-card:hover { border-color: rgba(201,162,39,.25); }

.metric-icon {
  width: 48px; height: 48px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.metric-icon svg { width: 24px; height: 24px; }

.metric-value {
  font-family: var(--font-h);
  font-size: 2rem; font-weight: 700; color: var(--gold);
  line-height: 1;
}
.metric-label { font-size: .8rem; color: var(--txt2); margin-top: 2px; }
.metric-data { display: flex; flex-direction: column; }

/* ── Cards row ─────────────────────────────── */

.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.card-header {
  font-size: .75rem; font-weight: 600;
  color: var(--txt2); text-transform: uppercase;
  letter-spacing: .5px; margin-bottom: .5rem;
}

.card-value {
  font-family: var(--font-h);
  font-size: 1.8rem; font-weight: 700; color: var(--txt);
}
.card-value.error { color: #ef5350; }

/* ── Tables ────────────────────────────────── */

.table-toolbar {
  display: flex; gap: .75rem; margin-bottom: 1rem;
  align-items: center;
}

.search-input {
  flex: 1; max-width: 320px;
  padding: .55rem .9rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 8px; color: var(--txt);
  font-family: var(--font); font-size: .9rem;
  outline: none; transition: border-color .2s;
}
.search-input:focus { border-color: var(--gold); }
.search-input::placeholder { color: var(--txt2); }

.btn-outline {
  padding: .5rem 1rem;
  background: transparent; border: 1px solid var(--gold-dim);
  border-radius: 6px; color: var(--gold);
  font-family: var(--font); font-size: .8rem; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.btn-outline:hover { background: var(--gold-dim); }

.table-wrap { overflow-x: auto; }

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

thead th {
  background: var(--g800);
  color: var(--gold);
  font-family: var(--font-h);
  font-weight: 500; font-size: .78rem;
  text-transform: uppercase; letter-spacing: .5px;
  padding: .7rem 1rem;
  border-bottom: 2px solid var(--gold-dim);
  text-align: left; white-space: nowrap;
}

tbody td {
  padding: .6rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--txt);
}

tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--card-hover); }

.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 4px; font-size: .7rem;
  font-weight: 600; text-transform: uppercase;
  letter-spacing: .5px;
}
.badge-free { background: rgba(158,158,158,.15); color: #bdbdbd; }
.badge-pro  { background: rgba(33,150,243,.15); color: #42a5f5; }
.badge-max  { background: rgba(201,162,39,.15); color: var(--gold); }

/* ── Scrollbar ─────────────────────────────── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--g900); }
::-webkit-scrollbar-thumb { background: var(--g600); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ── Charts ────────────────────────────────── */

.charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.chart-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.chart-card-full { grid-column: 1 / -1; }

.chart-card canvas { max-height: 260px; }

/* ── Features grid ────────────────────────── */

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
}

.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.feature-card .feat-name {
  font-family: var(--font-h);
  font-size: 1.1rem; font-weight: 600; color: var(--txt);
  margin-bottom: .15rem;
}

.feature-card .feat-event {
  font-size: .72rem; color: var(--txt2); font-family: monospace;
  margin-bottom: .75rem;
}

.feat-bar-wrap {
  background: var(--g800);
  border-radius: 6px;
  height: 8px;
  overflow: hidden;
  margin-bottom: .6rem;
}

.feat-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-l));
  border-radius: 6px;
  transition: width .5s ease;
}

.feat-stats {
  display: flex; justify-content: space-between;
  font-size: .78rem; color: var(--txt2);
}

.feat-stats strong { color: var(--gold); }

/* ── Modal ─────────────────────────────────── */

.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.65);
  z-index: 1000;
  align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }

.modal-card {
  background: linear-gradient(160deg, var(--g800), var(--g700));
  border: 1px solid rgba(201,162,39,.3);
  border-radius: 16px;
  padding: 2rem;
  width: 100%; max-width: 420px;
  box-shadow: 0 12px 48px rgba(0,0,0,.5);
}

.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 1.5rem;
}

.modal-header h3 {
  font-family: var(--font-h);
  font-size: 1.3rem; font-weight: 600; color: var(--txt);
}

.modal-close {
  background: none; border: none; color: var(--txt2);
  font-size: 1.5rem; cursor: pointer; line-height: 1;
}
.modal-close:hover { color: var(--txt); }

.success-msg {
  color: #66bb6a; font-size: .85rem;
  margin-top: .75rem; min-height: 1.2em;
}

/* ── Sidebar buttons ──────────────────────── */

.btn-block {
  width: 100%; display: block;
  margin-bottom: .5rem;
  text-align: center;
}

/* ── Responsive ────────────────────────────── */
@media (max-width: 768px) {
  :root { --sidebar-w: 60px; }
  .brand-text, .nav-item span, .admin-info, .btn-logout span, .btn-block span { display: none; }
  .nav-item { justify-content: center; padding: .7rem; }
  .main { padding: 1.25rem; }
  .login-card { margin: 1rem; padding: 2rem 1.5rem; }
  .charts-row { grid-template-columns: 1fr; }
  .btn-block { font-size: .65rem; padding: .4rem; }
}
