:root {
  --primary: #f97316;
  --bg: #0d1117;
  --bg-panel: #161b22;
  --border: #30363d;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --radius: 12px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: inherit; text-decoration: none; }

.admin-layout { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: #0a0e14; border-right: 1px solid var(--border); padding: 1.5rem 1rem; flex-shrink: 0; }
.sidebar-brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; color: #58a6ff; margin-bottom: 2rem; padding: 0 .5rem; }
.brand-icon { width: 34px; height: 34px; border-radius: 8px; background: #1f6feb; display: flex; align-items: center; justify-content: center; }
.sidebar nav { display: flex; flex-direction: column; gap: .25rem; }
.sidebar nav a { padding: .7rem .8rem; border-radius: 8px; color: var(--text-dim); font-weight: 600; font-size: .92rem; }
.sidebar nav a:hover { background: #161b22; color: var(--text); }
.sidebar nav a.active { background: #1f2937; color: #58a6ff; }
.sidebar nav a.logout { margin-top: 1.5rem; color: #f85149; }

.content { flex: 1; padding: 2rem; overflow-x: auto; }
.content-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.content-header h1 { font-size: 1.6rem; }

.cards-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; }
.stat-card { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
.stat-top { display: flex; justify-content: space-between; align-items: center; color: var(--text-dim); font-size: .78rem; font-weight: 700; letter-spacing: .04em; margin-bottom: .75rem; }
.stat-value { font-size: 2.1rem; font-weight: 800; }
.stat-value.blue { color: #58a6ff; }
.stat-value.green { color: #3fb950; }
.stat-value.teal { color: #2dd4bf; }
.stat-value.orange { color: #e6b673; }
.stat-value.purple { color: #d2a8ff; }

.panel { background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; margin-bottom: 1.5rem; }
.panel h2 { font-size: 1.1rem; margin-bottom: 1.25rem; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-grid label { display: flex; flex-direction: column; gap: .4rem; font-size: .88rem; font-weight: 600; color: var(--text-dim); }
.form-grid input, .form-grid select, .form-grid textarea { background: #0d1117; border: 1px solid var(--border); border-radius: 8px; padding: .65rem .8rem; color: var(--text); font: inherit; }
.form-grid input[type=color] { padding: .2rem; height: 42px; }
.form-grid .full { grid-column: 1 / -1; }
.checkbox-row-admin { grid-column: 1 / -1; display: flex; align-items: center; gap: .5rem; font-size: .88rem; color: var(--text-dim); }
.checkbox-row-admin input { width: auto; }

.btn { display: inline-flex; align-items: center; gap: .5rem; padding: .65rem 1.2rem; border-radius: 8px; font-weight: 700; border: none; cursor: pointer; font-size: .88rem; }
.btn-primary { background: var(--primary); color: #1a0f04; grid-column: 1 / -1; justify-self: start; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-danger { background: #f85149; color: #fff; }
.btn-sm { padding: .4rem .8rem; font-size: .78rem; }

.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { text-align: left; padding: .75rem .6rem; border-bottom: 1px solid var(--border); font-size: .88rem; vertical-align: top; }
.data-table th { color: var(--text-dim); font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.inline-form { display: inline-block; }
.actions-cell { display: flex; gap: .5rem; }

.badge { display: inline-block; padding: .25rem .6rem; border-radius: 999px; font-size: .72rem; font-weight: 700; }
.badge-on { background: rgba(63,185,80,.15); color: #3fb950; }
.badge-off { background: rgba(248,81,73,.15); color: #f85149; }

.banner-list { display: flex; flex-direction: column; gap: 1rem; }
.banner-item { display: flex; align-items: center; gap: 1rem; border: 1px solid var(--border); border-radius: 10px; padding: .75rem; }
.banner-item img { width: 90px; height: 60px; object-fit: cover; border-radius: 6px; }
.banner-info { flex: 1; display: flex; flex-direction: column; gap: .25rem; }
.banner-actions { display: flex; gap: .5rem; }

.pix-preview { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; }
.pix-preview img { border-radius: 8px; border: 1px solid var(--border); }
.pix-preview textarea { flex: 1; min-width: 220px; background: #0d1117; border: 1px solid var(--border); border-radius: 8px; padding: .7rem; color: var(--text); font-family: monospace; font-size: .8rem; }

.logo-preview { max-width: 140px; border-radius: 8px; border: 1px solid var(--border); grid-column: 1 / -1; }

.preset-grid { display: flex; flex-wrap: wrap; gap: .6rem; }
.preset-swatch { display: inline-flex; align-items: center; gap: .55rem; padding: .5rem .95rem; border-radius: 999px; border: 1px solid var(--border); background: #0d1117; color: var(--text); font-size: .8rem; font-weight: 600; font-family: inherit; cursor: pointer; }
.preset-swatch::before { content: ""; width: 16px; height: 16px; border-radius: 50%; flex-shrink: 0; border: 1px solid rgba(255,255,255,.2); background: linear-gradient(135deg, var(--sw1) 50%, var(--sw2) 50%); }
.preset-swatch:hover { border-color: var(--sw1); color: var(--sw1); }

.help-text { color: var(--text-dim); font-size: .88rem; margin-bottom: 1rem; }

.alert { padding: .9rem 1.1rem; border-radius: 8px; margin-bottom: 1.25rem; font-weight: 600; font-size: .9rem; }
.alert-ok { background: rgba(63,185,80,.12); color: #3fb950; border: 1px solid rgba(63,185,80,.3); }
.alert-error { background: rgba(248,81,73,.12); color: #f85149; border: 1px solid rgba(248,81,73,.3); }

.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.auth-card { width: 100%; max-width: 380px; background: var(--bg-panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; }
.auth-card h1 { font-size: 1.4rem; margin-bottom: .3rem; }
.auth-sub { color: var(--text-dim); font-size: .88rem; margin-bottom: 1.5rem; }
.auth-card form { display: flex; flex-direction: column; gap: .4rem; }
.auth-card label { font-size: .85rem; font-weight: 600; color: var(--text-dim); margin-top: .6rem; }
.auth-card input { background: #0d1117; border: 1px solid var(--border); border-radius: 8px; padding: .7rem .9rem; color: var(--text); font: inherit; }
.auth-card button { margin-top: 1.25rem; background: var(--primary); color: #1a0f04; border: none; border-radius: 8px; padding: .8rem; font-weight: 700; cursor: pointer; }

@media (max-width: 860px) {
  .admin-layout { flex-direction: column; }
  .sidebar { width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
}
