:root {
    --paper: #f6f1e8;
    --ink: #1d1a16;
    --muted: #7a7268;
    --line: #e8dfd0;
    --card: #fffcf7;
    --card-2: #f4eee4;
    --shadow: 0 10px 28px rgba(55, 38, 18, 0.05);
    --ok: #2a7a55;
    --warn: #9a6a1c;
    --bad: #b0452b;
    --copper: #c0653a;
    --font: Manrope, "Segoe UI", sans-serif;
    color-scheme: light;
}

[data-theme="dark"] {
    --paper: #12110f;
    --ink: #f5f0e7;
    --muted: #b0a79a;
    --line: #2c2923;
    --card: #1b1915;
    --card-2: #24211c;
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.32);
    --ok: #8dcead;
    --warn: #e2c07a;
    --bad: #f0a090;
    --copper: #e08a68;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--font);
    font-weight: 500;
    letter-spacing: -0.01em;
}

body {
    background:
        radial-gradient(900px 420px at 8% -10%, rgba(192, 101, 58, 0.16), transparent 58%),
        radial-gradient(700px 380px at 92% 0%, rgba(45, 110, 120, 0.10), transparent 55%),
        radial-gradient(600px 360px at 50% 110%, rgba(49, 120, 82, 0.08), transparent 50%),
        var(--paper);
}

a { color: inherit; }

button, input, select {
    font: inherit;
    color: inherit;
}

.top {
    max-width: 1180px;
    margin: 0 auto;
    padding: 22px 24px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.top-brand {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.top-brand a {
    font-weight: 800;
    font-size: 26px;
    letter-spacing: -0.05em;
    text-decoration: none;
}

.top-brand span {
    color: var(--copper);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.who {
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.text-link {
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, var(--copper));
    padding-bottom: 1px;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--card) 88%, #fff);
    cursor: pointer;
}

.ico-sun { display: none; }
.ico-moon { display: inline; }
[data-theme="dark"] .ico-sun { display: inline; }
[data-theme="dark"] .ico-moon { display: none; }

.wrap {
    max-width: 1180px;
    margin: 0 auto;
    padding: 28px 24px 64px;
}

.hero {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-end;
    margin-bottom: 22px;
}

.kicker {
    margin: 0 0 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

h1 {
    margin: 0;
    font-weight: 800;
    font-size: clamp(34px, 5vw, 52px);
    letter-spacing: -0.05em;
    line-height: 0.95;
}

.lede {
    margin: 10px 0 0;
    max-width: 46ch;
    color: var(--muted);
    line-height: 1.45;
    font-weight: 500;
}

.ghost {
    display: inline-flex;
    align-items: center;
    height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: color-mix(in srgb, var(--card) 92%, #fff);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.ghost:hover {
    background: color-mix(in srgb, var(--copper) 10%, var(--card));
    border-color: color-mix(in srgb, var(--copper) 28%, var(--line));
}

.grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.sys {
    --tint: color-mix(in srgb, var(--hue) 9%, var(--card));
    --edge: color-mix(in srgb, var(--hue) 18%, var(--line));
    background:
        linear-gradient(160deg, color-mix(in srgb, var(--hue) 12%, transparent), transparent 42%),
        var(--tint);
    border: 1px solid var(--edge);
    border-radius: 22px;
    padding: 16px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 280px;
    position: relative;
    overflow: hidden;
    transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.sys::before {
    content: "";
    position: absolute;
    inset: 0 auto auto 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--hue), color-mix(in srgb, var(--hue) 20%, transparent));
    opacity: 0.7;
}

.sys:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 34px color-mix(in srgb, var(--hue) 14%, rgba(55, 38, 18, 0.08));
    border-color: color-mix(in srgb, var(--hue) 34%, var(--line));
}

.sys-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.sys-title {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    min-width: 0;
}

.mark {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    display: grid;
    place-items: center;
    background: color-mix(in srgb, var(--hue) 16%, #fff);
    color: var(--hue);
    border: 1px solid color-mix(in srgb, var(--hue) 18%, transparent);
    flex: none;
}

.mark .ico {
    width: 22px;
    height: 22px;
    display: block;
}

[data-theme="dark"] .mark {
    background: color-mix(in srgb, var(--hue) 22%, var(--card));
}

.sys h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.045em;
    line-height: 1.05;
}

.sys .detalle {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
}

.live {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ok);
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ok) 10%, transparent);
    flex: none;
}

.live::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent);
}

.live.off {
    color: var(--bad);
    background: color-mix(in srgb, var(--bad) 10%, transparent);
}

.live.old {
    color: var(--warn);
    background: color-mix(in srgb, var(--warn) 10%, transparent);
}

.headline {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1 1 auto;
    justify-content: center;
    min-height: 0;
}

.headline .label {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.headline .valor {
    margin: 0;
    font-weight: 800;
    font-size: clamp(28px, 3.2vw, 42px);
    letter-spacing: -0.055em;
    line-height: 0.95;
    color: color-mix(in srgb, var(--hue) 42%, var(--ink));
    word-break: break-word;
}

.nota {
    margin: 0;
    line-height: 1.35;
    font-size: 13px;
    font-weight: 500;
    color: color-mix(in srgb, var(--ink) 72%, var(--muted));
}

.stats {
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.stats div {
    background: color-mix(in srgb, var(--hue) 8%, #fff);
    border: 1px solid color-mix(in srgb, var(--hue) 10%, transparent);
    border-radius: 14px;
    padding: 10px 10px 9px;
    min-width: 0;
}

[data-theme="dark"] .stats div {
    background: color-mix(in srgb, var(--hue) 14%, var(--card));
}

.stats dt {
    margin: 0;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stats dd {
    margin: 5px 0 0;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.enter {
    margin-top: auto;
    padding-top: 2px;
}

.enter button, .btn {
    appearance: none;
    border: 0;
    background: color-mix(in srgb, var(--hue) 78%, #1a1713);
    color: #fffaf4;
    height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: -0.01em;
    transition: transform 0.12s ease, filter 0.12s ease;
}

[data-theme="dark"] .enter button,
[data-theme="dark"] .btn {
    background: color-mix(in srgb, var(--hue) 55%, #f4efe6);
    color: #171512;
}

.enter button:hover, .btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.card {
    width: min(440px, 100%);
    background: color-mix(in srgb, var(--card) 94%, #fff);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 28px 26px 24px;
    box-shadow: var(--shadow);
}

.card h1 {
    font-size: 36px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 14px;
}

.field span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.field input, .field select {
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--paper);
    padding: 0 12px;
    font-weight: 600;
}

.card .btn, .stack .btn {
    width: 100%;
    margin-top: 18px;
    --hue: var(--copper);
}

.error {
    background: color-mix(in srgb, var(--bad) 12%, var(--card));
    color: var(--bad);
    border-radius: 12px;
    padding: 10px 12px;
    margin-top: 12px;
    font-weight: 600;
}

.okmsg {
    background: color-mix(in srgb, var(--ok) 12%, var(--card));
    color: var(--ok);
    border-radius: 12px;
    padding: 10px 12px;
    margin: 0 0 14px;
    font-weight: 600;
}

.team {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 18px;
    align-items: start;
}

.person {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    font-weight: 700;
}

.person small {
    color: var(--muted);
    display: block;
    font-weight: 500;
}

.access {
    display: grid;
    grid-template-columns: 1fr 120px;
    gap: 8px 12px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}

.access label {
    display: flex;
    gap: 8px;
    align-items: center;
    font-weight: 600;
}

.access input[type="number"] {
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--paper);
    padding: 0 8px;
    width: 100%;
    font-weight: 700;
}

.hint {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    font-weight: 500;
}

body:has(.board) {
    height: 100dvh;
    overflow: hidden;
}

body:has(.board) .top {
    max-width: none;
    padding: 10px 16px 0;
}

body:has(.board) .top-brand a { font-size: 22px; }

.board {
    max-width: none;
    height: calc(100dvh - 52px);
    padding: 8px 16px 12px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.board .hero {
    margin: 0 0 8px;
    align-items: center;
}

.board .kicker {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
}

.board .ghost {
    height: 32px;
    font-size: 12px;
}

.board .grid {
    flex: 1;
    min-height: 0;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.board .sys {
    min-height: 0;
    padding: 12px;
    border-radius: 18px;
    gap: 8px;
}

.board .mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
}

.board .mark .ico {
    width: 20px;
    height: 20px;
}

.board .sys h2 { font-size: 20px; }

.board .sys .detalle {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.board .live {
    font-size: 9px;
    padding: 4px 7px;
}

.board .headline .label { font-size: 10px; }

.board .headline .valor {
    font-size: clamp(22px, 2.1vw, 34px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.board .nota {
    font-size: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.board .stats { gap: 6px; }

.board .stats div {
    padding: 7px 8px;
    border-radius: 11px;
}

.board .stats dt { font-size: 9px; }

.board .stats dd { font-size: 14px; }

.board .enter button {
    width: 100%;
    height: 34px;
    font-size: 12px;
}

@media (max-height: 820px) {
    .board .sys .detalle { display: none; }
    .board .nota { -webkit-line-clamp: 1; font-size: 11px; }
    .board .headline .valor { font-size: clamp(20px, 1.9vw, 28px); }
    .board .stats div { padding: 5px 6px; }
    .board .enter button { height: 30px; }
}

@media (max-width: 1180px) {
    body:has(.board) {
        height: auto;
        overflow: auto;
    }
    .board { height: auto; }
    .board .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-rows: none;
    }
}

@media (max-width: 860px) {
    .team { grid-template-columns: 1fr; }
    .hero { flex-direction: column; align-items: flex-start; }
    .who { display: none; }
    .stats { grid-template-columns: 1fr; }
    body:has(.board) {
        height: auto;
        overflow: auto;
    }
    .board {
        height: auto;
        padding-bottom: 24px;
    }
    .board .grid {
        grid-template-columns: 1fr;
        grid-template-rows: none;
    }
    .board .stats { grid-template-columns: repeat(3, 1fr); }
}
