:root { --bg:#f3f6fc; --card:#fff; --ink:#0f1b3d; --muted:#5b6474; --line:#e1e7f2; --brand:#1452d9; --brand2:#0d40b0; --danger:#dc2626; --ok:#16a34a; --side:#0f1b3d; --side2:#16255a; }
@media (prefers-color-scheme: dark) { :root { --bg:#0b1226; --card:#141d38; --ink:#eef2ff; --muted:#9aa6c4; --line:#26335c; --brand:#5b8cff; --brand2:#7aa2ff; --danger:#f87171; --ok:#4ade80; } }
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 "Segoe UI", system-ui, sans-serif; background: var(--bg); color: var(--ink); }
a { color: var(--brand); }
button { font: inherit; font-weight: 600; background: var(--brand); color: #fff; border: 1px solid var(--brand); border-radius: 9px; padding: 9px 16px; cursor: pointer; }
button:hover { background: var(--brand2); }
button:disabled { opacity: .6; cursor: wait; }
button.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
button.danger { background: var(--danger); border-color: var(--danger); }
input, select { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.muted { color: var(--muted); } .small { font-size: 13px; } .err { color: var(--danger); } .ok { color: var(--ok); }
.logo { flex: 0 0 40px; height: 40px; border-radius: 11px; background: linear-gradient(135deg,#3b6bff,#1452d9); color: #fff; font-weight: 800; font-size: 20px; display: flex; align-items: center; justify-content: center; }

/* entrar / registrarse */
body.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(160deg, var(--side) 0%, var(--side2) 60%, #1452d9 140%); padding: 20px; }
.auth-box { background: var(--card); border-radius: 16px; padding: 28px 28px 20px; width: 100%; max-width: 400px; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.auth-brand { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.auth-brand strong { display: block; letter-spacing: .14em; font-size: 17px; }
.auth-brand small { color: var(--muted); font-size: 12px; letter-spacing: .06em; }
.auth h1 { margin: 0 0 4px; font-size: 22px; }
.auth .lead { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.auth form label { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.auth form label input { font-weight: 400; }
.auth form button { width: 100%; margin-top: 4px; padding: 11px; }
.auth .swap { text-align: center; font-size: 14px; margin: 14px 0 0; }
.auth .foot { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }

/* panel de administración */
body.admin { padding: 24px; max-width: 1300px; margin: 0 auto; }
.admin header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.admin header h1 { margin: 0; font-size: 22px; flex: 1; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.card h2 { margin: 0 0 8px; font-size: 16px; }
.card .big { font-size: 22px; font-weight: 700; }
.box { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-bottom: 16px; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--line); }
.pill.ok { background: #dcfce7; color: #166534; } .pill.err { background: #fee2e2; color: #991b1b; } .pill.warn { background: #fef3c7; color: #92400e; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions button { padding: 4px 10px; font-size: 13px; }
progress { width: 100%; }

/* panel 3.1 */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); }
.between { justify-content: space-between; }
.box h2 { margin: 0 0 10px; font-size: 18px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px 16px; margin: 10px 0; }
.box label, .dlg label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
.box label.row { flex-direction: row; font-weight: 400; }
textarea { font: inherit; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.dlg { border: none; border-radius: 14px; padding: 22px; max-width: 520px; width: calc(100% - 32px); background: var(--card); color: var(--ink); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.dlg::backdrop { background: rgba(15, 23, 42, .55); }
.dlg h2 { margin-top: 0; }
.dlg label { margin: 10px 0; }
.dlg textarea { width: 100%; }
.mini { font-size: 12px; color: var(--muted); }
.meter { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 4px; width: 110px; }
.meter span { display: block; height: 100%; background: var(--brand); }
details.log { margin-top: 6px; font-size: 12px; }
td .row { gap: 6px; }
.btn-link { display: inline-block; padding: 9px 14px; font-weight: 600; }
progress.meter { display: block; width: 110px; height: 6px; border: none; border-radius: 99px; overflow: hidden; margin-top: 4px; background: var(--line); }
progress.meter::-webkit-progress-bar { background: var(--line); } progress.meter::-webkit-progress-value { background: var(--brand); } progress.meter::-moz-progress-bar { background: var(--brand); }
