/* Cuevo — core design system. Owned centrally; page-specific rules live in
   dashboard.css, button.css and operator.css. */

:root {
    --bg: #070a12;
    --bg-soft: #0e1421;
    --panel: #131b2b;
    --panel-2: #1a2436;
    --line: #253048;
    --text: #eef2fb;
    --muted: #93a1bd;
    --accent: #22d3ee;
    --accent-ink: #04222a;
    --danger: #f43f5e;
    --ok: #22c55e;
    --warn: #f59e0b;
    --radius: 14px;
    --radius-sm: 9px;
    --shadow: 0 18px 44px rgba(0, 0, 0, .45);
    --font: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background:
        radial-gradient(1100px 600px at 12% -12%, #16233c 0%, transparent 60%),
        radial-gradient(900px 500px at 100% 0%, #0f2c33 0%, transparent 55%),
        var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.55;
    min-height: 100vh;
    -webkit-text-size-adjust: 100%;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; letter-spacing: -.02em; }
h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); }
h3 { font-size: 1.08rem; }
p { margin: 0 0 1rem; }

.muted { color: var(--muted); }
.small { font-size: .875rem; }
.tiny { font-size: .78rem; }
.center { text-align: center; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.stack > * + * { margin-top: 1rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row-end { justify-content: flex-end; }
.spread { display: flex; gap: 1rem; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.hidden { display: none !important; }

/* ---------- chrome ---------- */

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .85rem clamp(1rem, 4vw, 2.5rem);
    border-bottom: 1px solid var(--line);
    background: rgba(7, 10, 18, .8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 20;
    flex-wrap: wrap;
}

.brand { display: flex; align-items: baseline; gap: .55rem; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-dot {
    width: 11px; height: 11px; border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px rgba(34, 211, 238, .16);
    align-self: center;
}
.brand-name { font-weight: 750; font-size: 1.16rem; letter-spacing: -.02em; }
.brand-tag { color: var(--muted); font-size: .78rem; }
@media (max-width: 640px) { .brand-tag { display: none; } }

.topnav { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.topnav .who { color: var(--muted); font-size: .82rem; }

.footer {
    padding: 2rem clamp(1rem, 4vw, 2.5rem);
    color: var(--muted);
    font-size: .82rem;
    border-top: 1px solid var(--line);
    margin-top: 3rem;
}
.footer p { margin: 0; }

.shell { max-width: 1080px; margin: 0 auto; padding: clamp(1.2rem, 4vw, 2.4rem); }
.shell-narrow { max-width: 460px; margin: 0 auto; padding: clamp(1.2rem, 5vw, 3rem) 1.2rem; }

/* ---------- surfaces ---------- */

.panel {
    background: linear-gradient(180deg, var(--panel) 0%, var(--panel-2) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(1.1rem, 3vw, 1.6rem);
    box-shadow: var(--shadow);
}
.panel + .panel { margin-top: 1.2rem; }
.panel-flat { background: var(--bg-soft); box-shadow: none; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { margin: 0; }

.eyebrow {
    text-transform: uppercase;
    letter-spacing: .16em;
    font-size: .68rem;
    font-weight: 700;
    color: var(--accent);
    margin: 0 0 .35rem;
}

/* ---------- forms ---------- */

label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin-bottom: .3rem; }

input[type=text], input[type=email], input[type=password], input[type=url],
input[type=number], select, textarea {
    width: 100%;
    padding: .68rem .8rem;
    background: #0a0f1a;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    font: inherit;
    font-size: .95rem;
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, .18);
}
input[type=file] { color: var(--muted); font-size: .85rem; }
input[type=color] {
    width: 100%; height: 42px; padding: 3px;
    background: #0a0f1a; border: 1px solid var(--line);
    border-radius: var(--radius-sm); cursor: pointer;
}
input[type=range] { width: 100%; accent-color: var(--accent); }
textarea { min-height: 80px; resize: vertical; }

.field { margin-bottom: .95rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }
.hint { color: var(--muted); font-size: .78rem; margin: .3rem 0 0; }

.check { display: flex; align-items: flex-start; gap: .55rem; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.check label { margin: 0; font-size: .9rem; color: var(--text); font-weight: 500; }

/* ---------- buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .68rem 1.1rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text);
    font: inherit;
    font-weight: 650;
    font-size: .92rem;
    cursor: pointer;
    transition: transform .06s ease, filter .15s ease, background .15s ease;
    text-align: center;
}
.btn:hover { filter: brightness(1.12); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.btn-sm { padding: .42rem .75rem; font-size: .82rem; }
.btn-lg { padding: .9rem 1.5rem; font-size: 1.02rem; }
.btn-icon { padding: .38rem .6rem; font-size: .9rem; line-height: 1; }

/* ---------- feedback ---------- */

.flash, .alert {
    border-radius: var(--radius-sm);
    padding: .7rem .9rem;
    margin-bottom: 1rem;
    font-size: .9rem;
    border: 1px solid var(--line);
    background: var(--panel-2);
}
.flash-ok, .alert-ok { border-color: rgba(34, 197, 94, .5); background: rgba(34, 197, 94, .12); color: #b6f3cd; }
.flash-err, .alert-err { border-color: rgba(244, 63, 94, .5); background: rgba(244, 63, 94, .12); color: #ffd0d8; }
.flash-warn, .alert-warn { border-color: rgba(245, 158, 11, .5); background: rgba(245, 158, 11, .12); color: #ffe4b3; }

.pill {
    display: inline-flex; align-items: center; gap: .35rem;
    padding: .18rem .6rem; border-radius: 999px;
    font-size: .72rem; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase;
    border: 1px solid var(--line); background: var(--panel-2); color: var(--muted);
}
.pill-live { border-color: rgba(34, 197, 94, .55); background: rgba(34, 197, 94, .14); color: #86efac; }
.pill-off { border-color: rgba(148, 163, 184, .4); color: var(--muted); }

/* ---------- shared bits ---------- */

.copyrow { display: flex; gap: .4rem; align-items: stretch; }
.copyrow input {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: .8rem;
}

.empty {
    text-align: center;
    padding: 2.4rem 1rem;
    color: var(--muted);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}

table { width: 100%; border-collapse: collapse; }
th, td { padding: .6rem .5rem; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 700; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
