/* Graficadora — one stylesheet, no frameworks. Desktop first (1080p), readable and calm. */

:root {
    --bg: #f4f6f9;
    --surface: #ffffff;
    --fg: #1d2330;
    --muted: #5f6b7d;
    --border: #d8dee8;
    --accent: #0b5cad;
    --accent-dark: #084a8c;
    --ok-bg: #e6f4ea;
    --ok-fg: #1e6b34;
    --error-bg: #fdecea;
    --error-fg: #a1261b;
    --info-bg: #e8f1fb;
    --info-fg: #0b4a8b;
    --radius: 6px;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.45;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--fg);
}

a {
    color: var(--accent);
}

h1 {
    font-size: 1.5rem;
    margin: 0 0 1rem;
}

h2 {
    font-size: 1.15rem;
    margin: 2rem 0 0.75rem;
}

/* ---- Login host: a centred card ---- */

.card-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 8vh 1rem 2rem;
}

.card {
    width: 100%;
    max-width: 24rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgb(0 0 0 / 0.05);
}

.card .brand {
    color: var(--accent);
    font-weight: 700;
    letter-spacing: 0.02em;
    margin-bottom: 0.25rem;
}

.aside {
    margin-top: 1.5rem;
    color: var(--muted);
}

/* ---- App host: top bar + content ---- */

.topbar {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0 1.5rem;
    height: 3.25rem;
    background: var(--accent);
    color: #fff;
}

.topbar a {
    color: #fff;
    text-decoration: none;
}

.topbar .brand {
    font-weight: 700;
    font-size: 1.1rem;
}

.topbar .residencia {
    opacity: 0.85;
}

.topbar nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.topbar nav a:hover,
.topbar button.link:hover {
    text-decoration: underline;
}

.topbar button.link {
    color: #fff;
}

.badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0 0.45rem;
    border-radius: 999px;
    background: #ffb020;
    color: #1d2330;
    font-size: 0.8rem;
    font-weight: 700;
}

.content {
    max-width: 72rem;
    margin: 0 auto;
    padding: 1.75rem 1.5rem 3rem;
}

/* ---- Forms ---- */

form.stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

form.narrow {
    max-width: 24rem;
}

form.inline {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    margin: 0 0.4rem 0 0;
}

label {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-weight: 600;
}

input,
select {
    font: inherit;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: #fff;
    font-weight: 400;
}

input:focus,
select:focus,
button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

button {
    font: inherit;
    cursor: pointer;
    padding: 0.5rem 0.9rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--fg);
}

button:hover {
    border-color: var(--accent);
}

button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

button.primary:hover {
    background: var(--accent-dark);
}

button.small {
    padding: 0.25rem 0.6rem;
    font-size: 0.9rem;
}

button.link {
    background: none;
    border: none;
    padding: 0;
}

/* ---- Messages (colour plus wording, never colour alone) ---- */

.msg {
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius);
    border-left: 4px solid currentColor;
}

.msg.ok {
    background: var(--ok-bg);
    color: var(--ok-fg);
}

.msg.error {
    background: var(--error-bg);
    color: var(--error-fg);
}

.msg.info {
    background: var(--info-bg);
    color: var(--info-fg);
}

.muted {
    color: var(--muted);
}

.secret code {
    font-size: 1.6rem;
    padding: 0.4rem 0.8rem;
    background: var(--surface);
    border: 1px dashed var(--accent);
    border-radius: var(--radius);
    letter-spacing: 0.05em;
}

/* ---- Tables ---- */

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

th,
td {
    text-align: left;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

th {
    font-size: 0.85rem;
    color: var(--muted);
    font-weight: 600;
    background: #f9fafc;
}

td.actions {
    white-space: nowrap;
}

.tag {
    margin-left: 0.4rem;
    padding: 0 0.4rem;
    border-radius: 4px;
    background: var(--info-bg);
    color: var(--info-fg);
    font-size: 0.8rem;
}

.status::before {
    margin-right: 0.3rem;
}

.status.ok {
    color: var(--ok-fg);
}

.status.ok::before {
    content: "●";
}

.status.off {
    color: var(--muted);
}

.status.off::before {
    content: "○";
}
