/* =========================================================================
   Flexcon License Server — Cockpit design language
   Token architecture adopted from odoo_starface_integration "Cockpit-Finale".
   One deviation: --chrome is the Flexcon navy (#141e32), not Odoo-mauve.
   ========================================================================= */

/* Brand wordmark font only — nowhere else. */
@font-face {
    font-family: "Glacial Indifference";
    src: url("/static/fonts/GlacialIndifference-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: "Glacial Indifference";
    src: url("/static/fonts/GlacialIndifference-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ============ TOKENS — light ============ */
:root {
    --desk: #eef0f4;
    --card: #ffffff;
    --card2: #f7f8fa;
    --line: #e3e6ec;
    --ink: #1f2430;
    --mut: #69707f;
    --faint: #9aa1b0;

    /* App chrome — Flexcon navy (brand deviation from cockpit mauve) */
    --chrome: #141e32;
    --chrome-fg: #ffffff;
    --nav-bg: #141e32;

    /* Intent accents (cockpit) */
    --ai: #5457c9;  --ai-bg: #eef0fc;  --ai-line: #c7cbf2;   /* indigo / info-strong */
    --sal: #a3611c; --sal-bg: #fdf4e7; --sal-line: #ecd3ae;  /* amber / warning / pending */
    --sup: #1f5fae; --sup-bg: #ecf3fc; --sup-line: #c4d9f2;  /* instrument blue / info */
    --ok: #1d7a3f;  --ok-bg: #e9f6ee;  --ok-line: #b7e2c6;
    --danger: #c23934; --danger-bg: #fbeceb; --danger-line: #efc4c2;

    --shadow: 0 10px 30px rgba(31, 36, 48, .14), 0 2px 8px rgba(31, 36, 48, .08);
    --r: 12px;
    --r-s: 8px;

    /* -- legacy --flx-* aliases: still referenced by inline template styles -- */
    --flx-space-xs: 0.25rem;
    --flx-space-sm: 0.5rem;
    --flx-space-md: 1rem;
    --flx-space-lg: 1.5rem;
    --flx-space-xl: 2rem;
    --flx-font-mono: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", ui-monospace, monospace;
    --flx-warning: var(--sal);
    --flx-text: var(--ink);

    color-scheme: light;
    font-size: 15px;
}

/* ============ TOKENS — dark ============ */
html.dark {
    --desk: #14161c;
    --card: #1d2028;
    --card2: #232732;
    --line: #323847;
    --ink: #e8eaf1;
    --mut: #9aa3b5;
    --faint: #6b7383;

    /* Lightened navy so primary buttons stay legible on dark cards */
    --chrome: #3f5c96;
    --chrome-fg: #ffffff;
    --nav-bg: #1a2438;

    --ai: #8b8ef0;  --ai-bg: #262a45;  --ai-line: #3d4270;
    --sal: #e0a458; --sal-bg: #332a1c; --sal-line: #5c4a2b;
    --sup: #6ea8e8; --sup-bg: #1c2a3d; --sup-line: #2e4666;
    --ok: #5cc98a;  --ok-bg: #1c3327;  --ok-line: #2c5540;
    --danger: #e06661; --danger-bg: #3a1f1e; --danger-line: #5c3230;

    --shadow: 0 12px 34px rgba(0, 0, 0, .5), 0 2px 8px rgba(0, 0, 0, .35);

    color-scheme: dark;
}

/* ============ Reset / base ============ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
*::-webkit-scrollbar-track { background: transparent; }

html, body { min-height: 100%; }

body {
    font: 400 1rem/1.45 -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
    color: var(--ink);
    background: var(--desk);
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background .25s, color .25s;
}

:focus-visible {
    outline: 2px solid var(--ai);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ============ Typography ============ */
h1, h2, h3, h4, h5, h6 {
    color: var(--ink);
    font-weight: 600;
    line-height: 1.25;
}
h1 { font-size: 1.7rem; letter-spacing: -0.01em; margin-bottom: 1rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: 0.95rem; }
h5 { font-size: 0.9rem; }
h6 { font-size: 0.82rem; }

p { line-height: 1.55; }

a {
    color: var(--sup);
    text-decoration: none;
    transition: color .15s;
}
a:hover { color: var(--ai); text-decoration: underline; }

strong, b { font-weight: 600; color: inherit; }

hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: 1.25rem 0;
}

ul, ol { padding-left: 1.25rem; }

code, pre {
    font-family: var(--flx-font-mono);
    font-variant-ligatures: none;
}
code {
    font-size: 0.85em;
    background: var(--card2);
    border: 1px solid var(--line);
    border-radius: 4px;
    padding: 0.05em 0.35em;
}
pre {
    background: var(--card2);
    border: 1px solid var(--line);
    border-radius: var(--r-s);
    padding: 0.85rem 1rem;
    overflow-x: auto;
    font-size: 0.82rem;
    line-height: 1.5;
}
pre code { background: none; border: 0; padding: 0; font-size: inherit; }

/* Uppercase faint section/field labels */
label {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    color: var(--mut);
    font-weight: 500;
    margin-bottom: 0.35rem;
}

/* ============ Tables ============ */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
thead th {
    text-align: left;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s; }
tbody tr:hover { background: var(--card2); }
/* Numbers, ids, versions, dates -> tabular */
td, .timer, .chip b, .stat-card h3 { font-variant-numeric: tabular-nums; }

/* ============ Forms ============ */
input[type="text"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="email"],
textarea,
select {
    width: 100%;
    font: inherit;
    font-size: 0.9rem;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r-s);
    padding: 0.5rem 0.7rem;
    transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--ai);
    box-shadow: 0 0 0 3px var(--ai-bg);
}
input[type="checkbox"], input[type="radio"] {
    width: auto;
    accent-color: var(--chrome);
    vertical-align: middle;
}
select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2369707f' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.6rem center;
    padding-right: 1.9rem;
    appearance: none;
    -webkit-appearance: none;
}
fieldset { border: 1px solid var(--line); border-radius: var(--r-s); padding: 0.9rem; }
form label + input,
form label + textarea,
form label + select { margin-bottom: 0.9rem; }

details {
    border: 1px solid var(--line);
    border-radius: var(--r-s);
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.9rem;
    background: var(--card2);
}
details summary {
    cursor: pointer;
    font-size: 0.82rem;
    color: var(--mut);
    list-style-position: inside;
}
details summary:hover { color: var(--ink); }
details[open] summary { margin-bottom: 0.6rem; }

/* ============ Buttons ============ */
button {
    font: inherit;
    color: inherit;
    background: none;
    border: 0;
    cursor: pointer;
}

.btn-primary,
button[type="submit"]:not([class*="btn-"]) {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.2;
    padding: 0.55rem 1.1rem;
    border-radius: var(--r-s);
    border: 1px solid var(--chrome);
    background: var(--chrome);
    color: var(--chrome-fg);
    transition: filter .15s, background .15s, border-color .15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn-primary:hover,
button[type="submit"]:not([class*="btn-"]):hover {
    filter: brightness(1.12);
    color: var(--chrome-fg);
    text-decoration: none;
}
.btn-primary:active,
button[type="submit"]:not([class*="btn-"]):active { filter: brightness(0.95); }
.btn-primary:disabled,
button[type="submit"]:not([class*="btn-"]):disabled,
.btn-primary[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
    filter: none;
}
a.btn-primary { color: var(--chrome-fg); }
a.btn-primary:hover { color: var(--chrome-fg); }

/* Quiet / secondary / outline buttons */
.btn-outline,
.btn-secondary,
a.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.86rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--r-s);
    border: 1px solid var(--line);
    background: var(--card2);
    color: var(--ink);
    transition: border-color .15s, color .15s, background .15s;
    text-decoration: none;
    white-space: nowrap;
}
.btn-outline:hover,
.btn-secondary:hover,
a.btn-outline:hover {
    border-color: var(--faint);
    color: var(--ink);
    text-decoration: none;
}

.btn-sm, a.btn-sm {
    font-size: 0.78rem;
    padding: 0.32rem 0.7rem;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.86rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: var(--r-s);
    border: 1px solid var(--danger);
    background: var(--danger);
    color: #fff;
    transition: filter .15s;
}
.btn-danger:hover { filter: brightness(1.08); color: #fff; }

/* ============ Layout ============ */
.container, .container-fluid {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 1.25rem;
}
.container-fluid { max-width: none; }

main.container {
    flex: 1;
    padding-top: 1.75rem;
    padding-bottom: 3rem;
}
main.container:has(.login-wrapper) {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============ Navbar (app chrome) ============ */
nav {
    background: var(--nav-bg);
    color: #fff;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 0 1.5rem;
    height: 56px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .25);
    position: sticky;
    top: 0;
    z-index: 40;
}
nav .nav-brand {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
    text-decoration: none;
    flex: none;
}
nav .nav-brand:hover { text-decoration: none; }
nav .nav-brand .brand-name {
    font-family: "Glacial Indifference", -apple-system, "Segoe UI", sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: #fff;
    letter-spacing: 0.01em;
}
nav .nav-brand .brand-sub {
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .55);
}
nav ul {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    padding: 0;
    margin: 0;
    flex: 1;
}
nav ul li { display: flex; }
nav ul li a {
    display: block;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, .72);
    padding: 0.4rem 0.7rem;
    border-radius: var(--r-s);
    transition: background .15s, color .15s;
}
nav ul li a:hover {
    color: #fff;
    background: rgba(255, 255, 255, .1);
    text-decoration: none;
}
nav ul li a.active {
    color: #fff;
    background: rgba(255, 255, 255, .16);
    font-weight: 600;
}
nav ul li a.nav-logout { color: rgba(255, 255, 255, .55); margin-left: 0.25rem; }
nav ul li a.nav-logout:hover { color: #fff; background: rgba(255, 255, 255, .1); }

.theme-toggle {
    flex: none;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: var(--r-s);
    color: rgba(255, 255, 255, .8);
    background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .12);
    transition: background .15s, color .15s;
    margin-left: auto;
}
nav ul + .theme-toggle { margin-left: 0; }
.theme-toggle:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
html.dark .theme-toggle .icon-sun { display: block; }
html.dark .theme-toggle .icon-moon { display: none; }

/* ============ Cards ============ */
.card,
.card-gradient {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    padding: 1.1rem 1.25rem;
    margin-bottom: 1rem;
}
.card > h3:first-child,
.card-gradient > h3:first-child { margin-bottom: 0.75rem; }
.card table { margin: -0.2rem 0; }
.card table td:first-child { width: 190px; white-space: nowrap; }

/* ============ Sections ============ */
.section { margin-bottom: 1.75rem; }
.section > h2 {
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
    margin-bottom: 0.7rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--line);
}

/* ============ Stat cards (overview) ============ */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.75rem;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    padding: 1.1rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.stat-card h3 {
    font-size: 2.1rem;
    font-weight: 600;
    line-height: 1;
    color: var(--ink);
}
.stat-card p {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 500;
}
.stat-card .stat-zero { color: var(--faint); }
.stat-card.stat-cyan.stat-has-value h3 { color: var(--ok); }
.stat-card.stat-amber.stat-has-value h3 { color: var(--sal); }
.stat-card.stat-red.stat-has-value h3 { color: var(--danger); }

/* ============ Badges / pills ============ */
.badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.3;
    padding: 0.12rem 0.6rem;
    border-radius: 99px;
    border: 1px solid transparent;
    white-space: nowrap;
    text-transform: capitalize;
}
/* license states: active->ok, revoked/expired->danger, pending->sal */
.badge-active,
.badge-resolved,
.badge-ready { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.badge-revoked,
.badge-expired,
.badge-missing { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.badge-new,
.badge-pending,
.badge-mismatch { background: var(--sal-bg); color: var(--sal); border-color: var(--sal-line); }
.badge-acknowledged { background: var(--sup-bg); color: var(--sup); border-color: var(--sup-line); }
.badge-unknown,
.badge-muted { background: var(--card2); color: var(--mut); border-color: var(--line); }

/* ============ Filter bar ============ */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 1rem;
}
.filter-bar .search-input { flex: 1; min-width: 180px; }
.filter-bar select { width: auto; min-width: 150px; }
.filter-bar input[type="date"],
.filter-bar input[type="number"] { width: auto; }

/* ============ Tables (scroll wrapper) ============ */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow);
}
.table-responsive > table { min-width: 560px; }
.table-responsive thead th { padding-top: 0.7rem; padding-bottom: 0.7rem; }
.table-responsive th:first-child, .table-responsive td:first-child { padding-left: 1rem; }
.table-responsive th:last-child, .table-responsive td:last-child { padding-right: 1rem; }

/* ============ Detail helpers ============ */
.key-truncated,
.beacon-detail {
    font-family: var(--flx-font-mono);
    font-size: 0.82rem;
    color: var(--mut);
    word-break: break-all;
}
.credentials-json {
    max-height: 320px;
    overflow: auto;
    margin: 0;
}
.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.action-buttons button,
.action-buttons form { display: inline-flex; }

/* Environment flags */
.env-flag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-right: 0.75rem;
    font-size: 0.82rem;
    white-space: nowrap;
}
.env-flag-ok { color: var(--ok); font-weight: 600; }
.env-flag-no { color: var(--danger); font-weight: 600; }
.env-instance-label { color: var(--mut); font-size: 0.85rem; margin-bottom: 0.6rem; }

/* Dependency guide */
.dep-install-line { margin-top: 0.35rem; font-size: 0.8rem; color: var(--mut); }
.dep-guide { }
.dep-guide h3 { margin-bottom: 0.6rem; }
.dep-guide h4 { margin-bottom: 0.4rem; color: var(--ink); }
.dep-requirements {
    font-size: 0.8rem;
    white-space: pre;
    color: var(--sal);
}
.dep-guide-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
    margin-top: 0.75rem;
}
.dep-steps { padding-left: 1.1rem; }
.dep-steps li { font-size: 0.85rem; line-height: 1.5; margin-bottom: 0.5rem; color: var(--mut); }
.dep-steps li code, .dep-steps li strong { color: var(--ink); }
.dep-python-note { font-size: 0.85rem; line-height: 1.5; }

/* ============ Audit timeline ============ */
.audit-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.audit-entry {
    padding: 0.7rem 0;
    border-bottom: 1px solid var(--line);
}
.audit-entry:last-child { border-bottom: 0; }
.audit-timestamp {
    font-family: var(--flx-font-mono);
    font-size: 0.75rem;
    color: var(--faint);
    font-variant-numeric: tabular-nums;
}
.audit-details {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 0.9rem;
    margin-top: 0.3rem;
    font-size: 0.83rem;
}
.audit-detail-item { color: var(--mut); }
.audit-detail-item strong { color: var(--ink); }

/* ============ Alerts / flash strips (cockpit .consent style) ============ */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.7rem 0.9rem;
    border-radius: var(--r-s);
    font-size: 0.86rem;
    line-height: 1.45;
    margin-bottom: 1rem;
    border: 1px solid var(--line);
}
.alert::before {
    flex: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
    margin-top: 0.05rem;
}
.alert-error {
    color: var(--ink);
    background: linear-gradient(to right, var(--danger-bg), var(--card2));
    border-color: var(--danger-line);
}
.alert-error::before { content: "!"; background: var(--danger); }
.alert-warning {
    color: var(--ink);
    background: linear-gradient(to right, var(--sal-bg), var(--card2));
    border-color: var(--sal-line);
}
.alert-warning::before { content: "!"; background: var(--sal); }
.alert-success {
    color: var(--ink);
    background: linear-gradient(to right, var(--ok-bg), var(--card2));
    border-color: var(--ok-line);
}
.alert-success::before { content: "\2713"; background: var(--ok); }

/* ============ Login ============ */
.login-wrapper {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}
.login-container { width: 100%; }
.login-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    padding: 2rem 1.75rem;
}
.login-brand {
    text-align: center;
    margin-bottom: 1.5rem;
}
.login-brand .brand-name {
    display: block;
    font-family: "Glacial Indifference", -apple-system, "Segoe UI", sans-serif;
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--ink);
}
.login-brand .brand-sub {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--faint);
    margin-top: 0.1rem;
}
.login-brand .brand-divider {
    width: 44px;
    height: 3px;
    border-radius: 2px;
    background: var(--chrome);
    margin: 0.9rem auto 0;
}
.login-card label { margin-top: 0.9rem; }
.login-card label:first-of-type { margin-top: 0; }
.login-card input { margin-bottom: 0; }
.login-card details { margin-top: 1rem; }
.login-card button[type="submit"] { width: 100%; margin-top: 1.25rem; }

/* ============ Utilities ============ */
.text-muted { color: var(--mut); }
.text-gradient {
    color: var(--chrome);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
html.dark .text-gradient { color: var(--sup); }

.mt-1 { margin-top: var(--flx-space-md); }
.mt-2 { margin-top: var(--flx-space-xl); }
.mb-1 { margin-bottom: var(--flx-space-md); }
.mb-2 { margin-bottom: var(--flx-space-xl); }

.flex { display: flex; gap: 0.75rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.flex-center { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }

.required { color: var(--danger); font-weight: 600; }

small.text-muted { display: inline-block; margin-top: 0.3rem; font-size: 0.78rem; }

/* ============ Empty states ============ */
.empty-state {
    text-align: center;
    padding: 1.75rem 1rem;
    color: var(--mut);
}
.empty-state-icon {
    font-size: 1.75rem;
    color: var(--faint);
    margin-bottom: 0.4rem;
    line-height: 1;
}
.empty-state p { font-size: 0.88rem; }
.empty-state .btn-primary { margin-top: 0.9rem; }

/* ============ htmx ============ */
.htmx-indicator { opacity: 0; transition: opacity .2s; }
.htmx-request .htmx-indicator,
.htmx-request.htmx-indicator { opacity: 1; }

/* ============ Footer ============ */
footer {
    border-top: 1px solid var(--line);
    padding: 1.1rem 1.5rem;
    text-align: center;
    font-size: 0.78rem;
    color: var(--faint);
    background: var(--card);
}

/* ============ Responsive ============ */
@media (max-width: 768px) {
    nav {
        flex-wrap: wrap;
        height: auto;
        padding: 0.6rem 1rem;
        gap: 0.75rem;
    }
    nav ul { flex-wrap: wrap; gap: 0.15rem; order: 3; flex-basis: 100%; }
    .theme-toggle { margin-left: auto; }
    main.container { padding-top: 1.25rem; }
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .card table td:first-child { width: auto; }
}
@media (max-width: 480px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .container { padding: 0 1rem; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
