/* =====================================================================
   Kube-Commander UI
   Helvetica Neue (UI, system font) + JetBrains Mono (code, self-hosted).
   Deep navy sidebar, indigo primary, gold accent, soft layered surfaces.
   ===================================================================== */

/* ---------------- Fonts (self-hosted, no external request) ---------------- */
@font-face {
    font-family: "JetBrains Mono";
    font-style: normal; font-weight: 100 800; font-display: swap;
    src: url("../vendor/fonts/jetbrains-mono-latin-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
    font-family: "JetBrains Mono";
    font-style: normal; font-weight: 100 800; font-display: swap;
    src: url("../vendor/fonts/jetbrains-mono-latin-ext-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------------- Design tokens ---------------- */
:root {
    --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
    --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "Cascadia Code", Consolas, "Liberation Mono", monospace;

    --bg: #f4f5fa;
    --surface: #ffffff;
    --surface-2: #f8f9fc;
    --surface-3: #f1f3f9;
    --border: #e5e8f1;
    --border-strong: #d4d9e6;

    --ink: #0f172a;
    --ink-2: #334155;
    --muted: #6b7489;
    --faint: #98a1b5;

    --primary: #4f46e5;
    --primary-600: #4338ca;
    --primary-700: #3730a3;
    --primary-50: #eef0ff;
    --primary-100: #e0e3ff;
    --ring: rgba(79, 70, 229, .18);
    /* Primary buttons (background) */
    --btn-primary: #1b6dc6;
    --btn-primary-top: #2a7fd9;
    --btn-primary-hover: #155aa6;

    --gold: #c8963d;
    --gold-soft: #91d2fb;   /* light accent text (was #f6dc96) */
    --accent-bg: #0e3866;   /* accent background (was #f6dc96) */

    --success: #059669;  --success-50: #e7f8f1;  --success-700: #047857;
    --danger: #e11d48;   --danger-50: #fdecf0;   --danger-700: #be123c;
    --warning: #d97706;  --warning-50: #fdf3e2;  --warning-700: #92400e;
    --info: #0284c7;     --info-50: #e6f4fb;     --info-700: #075985;

    --nav-bg: #15171a;
    --nav-bg-2: #15171a;
    --nav-text: #a9b3cf;
    --nav-text-strong: #ffffff;
    --nav-hover: rgba(255, 255, 255, .06);
    --nav-active: rgba(129, 140, 248, .16);
    --nav-line: rgba(255, 255, 255, .07);

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --shadow-xs: 0 1px 2px rgba(15, 23, 42, .05);
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04), 0 2px 6px -2px rgba(15, 23, 42, .06);
    --shadow-md: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 32px -12px rgba(15, 23, 42, .16);
    --shadow-lg: 0 24px 64px -20px rgba(2, 6, 23, .35);

    --sidebar-w: 260px;
    --topbar-h: 64px;
    --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------------- Base ---------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }
body {
    font-family: var(--font-sans);
    font-size: 14.5px;
    line-height: 1.55;
    color: var(--ink-2);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, h4 { color: var(--ink); font-weight: 700; letter-spacing: -.015em; line-height: 1.25; }
h3 { font-size: 15px; margin: 18px 0 10px; }
strong, b { color: var(--ink); font-weight: 500; }
a { color: var(--primary); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--primary-700); }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }
code, kbd, pre, samp { font-family: var(--font-mono); }
code {
    font-size: .86em; padding: .12em .42em; border-radius: 6px;
    background: var(--surface-3); color: var(--primary-700); border: 1px solid var(--border);
}
.code-block code, .log-block code, pre code { background: none; border: 0; padding: 0; color: inherit; }
::selection { background: var(--primary-100); color: var(--ink); }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* Thin, quiet scrollbars */
* { scrollbar-width: thin; scrollbar-color: #cbd2e1 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd2e1; border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------------- App shell ---------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w);
    position: fixed; inset: 0 auto 0 0;
    display: flex; flex-direction: column;
    background: var(--nav-bg);
    color: var(--nav-text);
    overflow-y: auto;
    z-index: 1030;
    scrollbar-color: rgba(255, 255, 255, .15) transparent;
}
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); background-clip: content-box; }

.sidebar .brand {
    display: flex; align-items: center; gap: 10px;
    padding: 22px 18px 18px;
    color: var(--nav-text-strong);
    font-size: 16.5px; font-weight: 700; letter-spacing: -.01em;
    white-space: nowrap;
}
.sidebar .brand .brand-logo {
    width: 36px; height: 36px; flex: 0 0 36px; object-fit: contain;
    border-radius: 10px; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .55);
}
.sidebar .brand .brand-text { display: flex; flex-direction: column; gap: 3px; line-height: 1.15; min-width: 0; }
.sidebar .brand .brand-tag {
    font-size: 8.5px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase;
    color: var(--gold-soft); opacity: .85; overflow: hidden; text-overflow: ellipsis;
}

.sidebar .user-panel {
    display: flex; align-items: center; gap: 12px;
    margin: 4px 14px 8px; padding: 12px;
    border: 1px solid var(--nav-line); border-radius: var(--radius);
    background: rgba(255, 255, 255, .03);
}
.sidebar .user-panel .avatar {
    width: 38px; height: 38px; flex: 0 0 38px; border-radius: 11px;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; text-transform: uppercase; color: var(--gold-soft);
    background: var(--accent-bg);
}
.sidebar .user-panel .info { min-width: 0; line-height: 1.25; }
.sidebar .user-panel .info .name { color: var(--nav-text-strong); font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.sidebar .user-panel .info .role { font-size: 11.5px; color: var(--nav-text); }
.role-pill {
    display: inline-block; margin-top: 3px; padding: 1px 8px; border-radius: 999px;
    font-size: 10.5px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
    color: var(--gold-soft); background: var(--accent-bg); border: 1px solid rgba(145, 210, 251, .25);
}

.nav { list-style: none; margin: 6px 0; padding: 0 12px; flex: 1; }
.nav .nav-header {
    padding: 18px 12px 8px;
    font-size: 10.5px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase;
    color: rgba(169, 179, 207, .55);
}
.nav a {
    position: relative;
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; margin-bottom: 2px;
    border-radius: 10px;
    color: var(--nav-text); font-weight: 550;
    transition: background .15s var(--ease), color .15s var(--ease);
}
.nav a i { width: 18px; text-align: center; font-size: 14.5px; opacity: .85; }
.nav a:hover { background: var(--nav-hover); color: var(--nav-text-strong); }
.nav a.active { background: var(--nav-active); color: var(--nav-text-strong); }
.nav a.active i { color: #a5b4fc; opacity: 1; }
.nav a.active::before {
    content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--gold-soft);
}

.sidebar .sidebar-footer { padding: 14px 12px 18px; border-top: 1px solid var(--nav-line); }
.sidebar .sidebar-footer form { margin: 0; }
/* Logout: same type, colour and icon treatment as the menu links, inside a framed button. */
.nav-logout {
    display: flex; align-items: center; gap: 12px; width: 100%;
    padding: 10px 12px; margin: 0;
    border: 1px solid var(--nav-line); border-radius: 10px;
    background: rgba(255, 255, 255, .03);
    color: var(--nav-text); font-family: var(--font-sans); font-size: 14.5px; font-weight: 550; line-height: 1.55;
    text-align: left; cursor: pointer;
    transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.nav-logout i { width: 18px; text-align: center; font-size: 14.5px; opacity: .85; }
.nav-logout:hover { background: var(--nav-hover); color: var(--nav-text-strong); border-color: rgba(255, 255, 255, .14); }
.nav-logout:hover i { color: #fda4af; opacity: 1; }
.nav-logout:focus-visible { outline: 2px solid #a5b4fc; outline-offset: 2px; }

.main { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
    height: var(--topbar-h);
    position: sticky; top: 0; z-index: 1020;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 28px;
    background: var(--nav-bg);   /* same colour as the menu bar */
    border-bottom: 1px solid var(--nav-line);
}
.topbar .page-title { font-size: 16px; font-weight: 700; margin: 0; color: var(--nav-text-strong); }
.topbar .topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar .user-chip {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 12px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--ink-2); font-weight: 500; font-size: 13px;
}
.topbar .user-chip i { color: var(--primary); }

.content { padding: 28px; flex: 1; width: 100%; max-width: 1600px; }
.content-header { margin-bottom: 22px; }
.content-header h1 {
    font-size: 24px; font-weight: 700; margin: 0 0 6px;
    display: flex; align-items: center; gap: 12px;
}
.content-header h1 > i {
    width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 17px;
    color: var(--primary); background: var(--primary-50); border: 1px solid var(--primary-100);
}
.breadcrumb { color: var(--muted); font-size: 13px; }
.breadcrumb a { color: var(--ink-2); font-weight: 500; }
.breadcrumb a:hover { color: var(--primary); }

/* ---------------- Cards ---------------- */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    margin-bottom: 22px;
    overflow: hidden;
}
.card-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    font-weight: 500; color: var(--ink);
}
.card-title { margin: 0; font-size: 15px; font-weight: 500; color: var(--ink); display: inline-flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.card-title > i { color: var(--primary); }
.card-body { padding: 20px; }
.card-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

/* ---------------- Stat cards ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px; margin-bottom: 22px; }
.stat-card {
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 16px;
    padding: 18px 20px;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
    transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.stat-card::after {
    content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px;
    border-radius: 50%; background: radial-gradient(circle, rgba(79, 70, 229, .07), transparent 70%);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-icon {
    width: 48px; height: 48px; flex: 0 0 48px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.stat-body { min-width: 0; }
.stat-value { font-size: 26px; font-weight: 700; line-height: 1.15; color: var(--ink); letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-label { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

.spinner {
    display: inline-block; width: 18px; height: 18px; vertical-align: middle;
    border: 2.5px solid var(--primary-100); border-top-color: var(--primary);
    border-radius: 50%; animation: kc-spin .7s linear infinite;
}
@keyframes kc-spin { to { transform: rotate(360deg); } }

/* ---------------- Tables ---------------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th, .table td { padding: 13px 18px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th {
    background: var(--surface-2);
    font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted); white-space: nowrap;
}
.table tbody tr { transition: background .12s var(--ease); }
.table tbody tr:hover { background: #fafbff; }
.table tbody tr:last-child td { border-bottom: 0; }
.table td strong { font-weight: 500; }

/* ---------------- Badges ---------------- */
.badge {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 10px; border-radius: 999px;
    font-size: 11.5px; font-weight: 500; line-height: 1.5; white-space: nowrap;
    border: 1px solid transparent;
}
.badge i { font-size: 10.5px; }
.badge-success { background: var(--success-50); color: var(--success-700); border-color: #c4ecdb; }
.badge-danger { background: var(--danger-50); color: var(--danger-700); border-color: #f8c9d4; }
.badge-warning { background: var(--warning-50); color: var(--warning-700); border-color: #f5dcaf; }
.badge-info { background: var(--info-50); color: var(--info-700); border-color: #c3e3f3; }
.badge-secondary { background: var(--surface-3); color: #4b5568; border-color: var(--border); }
.badge-running, .badge-primary { background: var(--primary-50); color: var(--primary-700); border-color: var(--primary-100); }

/* ---------------- Buttons ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 16px;
    border-radius: 10px; border: 1px solid transparent;
    font-family: inherit; font-size: 13.5px; font-weight: 500; line-height: 1.2;
    cursor: pointer; white-space: nowrap; text-decoration: none;
    background: var(--surface-3); color: var(--ink);
    transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease), transform .1s var(--ease), color .15s var(--ease);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:hover { color: var(--ink); }
.btn-primary {
    color: #fff;
    background: linear-gradient(180deg, var(--btn-primary-top), var(--btn-primary));
    box-shadow: 0 1px 2px rgba(15, 23, 42, .12), inset 0 1px 0 rgba(255, 255, 255, .18), 0 6px 16px -8px rgba(27, 109, 198, .6);
}
.btn-primary:hover { color: #fff; background: linear-gradient(180deg, var(--btn-primary), var(--btn-primary-hover)); }
.btn-success {
    color: #fff; background: linear-gradient(180deg, #10a876, var(--success));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 6px 16px -8px rgba(5, 150, 105, .6);
}
.btn-success:hover { color: #fff; background: var(--success-700); }
.btn-danger { color: #fff; background: linear-gradient(180deg, #f43f5e, var(--danger)); }
.btn-danger:hover { color: #fff; background: var(--danger-700); }
.btn-info { color: #fff; background: linear-gradient(180deg, #0ea5e9, var(--info)); }
.btn-info:hover { color: #fff; background: var(--info-700); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--ink-2); box-shadow: var(--shadow-xs); }
.btn-outline:hover { background: var(--surface-2); border-color: #c3c9da; color: var(--ink); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; gap: 6px; }
.btn-block { display: flex; width: 100%; }
.btn-icon { width: 32px; height: 32px; padding: 0; gap: 0; }
.btn-primary.btn-icon { background: linear-gradient(180deg, #3b82f6, #2563eb); box-shadow: 0 6px 14px -8px rgba(37, 99, 235, .7); }
.btn-primary.btn-icon:hover { background: #1d4ed8; }
.account-username { font-family: var(--font-mono); font-size: 12px; color: var(--ink-2); }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 18px; }
.form-group label, label.form-label { display: block; margin-bottom: 7px; font-size: 13px; font-weight: 500; color: var(--ink); }
.form-control {
    width: 100%; padding: 10px 13px;
    font-family: inherit; font-size: 14px; color: var(--ink);
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
    box-shadow: var(--shadow-xs);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.form-control::placeholder { color: var(--faint); }
.form-control:hover { border-color: #c3c9da; }
.form-control:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.form-control:disabled { background: var(--surface-2); color: var(--muted); }
select.form-control {
    appearance: none; -webkit-appearance: none; padding-right: 36px; 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='%236b7489' 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 13px center;
}
input[type="file"].form-control { padding: 7px 10px; }
input[type="file"]::file-selector-button {
    margin-right: 10px; padding: 5px 11px; border: 1px solid var(--border-strong); border-radius: 8px;
    background: var(--surface-2); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--primary); width: 16px; height: 16px; vertical-align: -3px; }
.form-text { font-size: 12.5px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.form-row { display: flex; gap: 18px; flex-wrap: wrap; }
.form-row .form-group { flex: 1; min-width: 200px; }

/* Search box (search_box() helper) */
.search-box { position: relative; display: inline-flex; align-items: center; }
.search-box .search-icon { position: absolute; left: 12px; font-size: 12.5px; color: var(--faint); pointer-events: none; }
.search-box .form-control { padding: 8px 32px 8px 34px; font-size: 13px; width: 260px; border-radius: 999px; }
.search-box .form-control::-webkit-search-cancel-button { display: none; }
.search-box .search-clear {
    position: absolute; right: 6px; display: none;
    border: 0; background: transparent; cursor: pointer; color: var(--muted);
    font-size: 16px; line-height: 1; padding: 3px 7px; border-radius: 999px;
}
.search-box .search-clear:hover { color: var(--ink); background: var(--surface-3); }
.search-box.has-value .search-clear { display: inline-flex; }

/* Radio cards */
.radio-card {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 12px 16px; min-width: 170px; cursor: pointer;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
    font-weight: 500; color: var(--ink);
    transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.radio-card:hover { border-color: var(--primary); }
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-50); box-shadow: 0 0 0 4px var(--ring); }

/* ---------------- Alerts ---------------- */
.alert {
    position: relative;
    padding: 13px 16px 13px 18px; margin-bottom: 18px;
    border-radius: var(--radius); border: 1px solid transparent;
    font-size: 13.5px; line-height: 1.55;
}
.alert::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: currentColor; opacity: .55; }
.alert > i:first-child { margin-right: 6px; }
.alert-success { background: var(--success-50); border-color: #c4ecdb; color: var(--success-700); }
.alert-danger { background: var(--danger-50); border-color: #f8c9d4; color: var(--danger-700); }
.alert-info { background: var(--info-50); border-color: #c3e3f3; color: var(--info-700); }
.alert-warning { background: var(--warning-50); border-color: #f5dcaf; color: var(--warning-700); }
.alert strong { color: inherit; }
.alert code { background: rgba(255, 255, 255, .6); }

/* ---------------- Pagination ---------------- */
.pagination {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
    padding: 14px 18px; border-top: 1px solid var(--border);
    font-size: 13px; color: var(--muted); background: var(--surface);
}
.page-controls { display: flex; align-items: center; gap: 8px; }
.page-numbers { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.page-numbers .page-num { min-width: 34px; }

/* ---------------- Lists (files, configs, templates) ---------------- */
.conf-list { list-style: none; margin: 0; padding: 0; }
.conf-list li { display: flex; align-items: center; border-bottom: 1px solid var(--border); }
.conf-list li:last-child { border-bottom: 0; }
.conf-list li .conf-link, .conf-list li > div { flex: 1; min-width: 0; }
.conf-link {
    display: flex; align-items: center; gap: 11px;
    padding: 11px 10px; border-radius: 9px;
    color: var(--ink); font-weight: 550;
    transition: background .12s var(--ease), color .12s var(--ease);
}
.conf-link:hover { background: var(--surface-2); color: var(--primary); }
.conf-link i { color: var(--primary); width: 18px; text-align: center; opacity: .9; }
.conf-link .fa-folder, .conf-link .fa-folder-open { color: #d9a441; }

/* ---------------- Code, editors, logs, terminal ---------------- */
.code-block {
    position: relative; overflow: auto; max-height: 520px;
    padding: 16px 18px; border-radius: var(--radius);
    background: #0d1222; color: #d6deeb; border: 1px solid #1c2440;
    font-family: var(--font-mono); font-size: 12.8px; line-height: 1.65; white-space: pre;
    font-variant-ligatures: none;
}
.log-block { background: #0b0f1d; color: #c9d1d9; }
.console-editor {
    width: 100%; min-height: 420px; resize: vertical; tab-size: 4;
    padding: 16px 18px; border-radius: var(--radius);
    background: #0d1222; color: #e2e8f5; border: 1px solid #1c2440;
    font-family: var(--font-mono); font-size: 13px; line-height: 1.65;
    caret-color: var(--gold-soft);
}
.console-editor:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
.tpl-content {
    font-family: var(--font-mono); font-size: 12.8px; line-height: 1.6;
    white-space: pre; tab-size: 4; resize: vertical; min-height: 220px;
}
.terminal {
    display: flex; flex-direction: column; cursor: text;
    min-height: 480px; max-height: 70vh; padding: 16px;
    background: #0b0f1d; color: #c9d1d9; border: 1px solid #1c2440; border-radius: var(--radius);
    font-family: var(--font-mono); font-size: 13px; line-height: 1.6;
}
.terminal-output { flex: 1; overflow-y: auto; white-space: pre-wrap; word-break: break-word; }
.terminal-output > div { padding: 1px 0; }
.terminal-echo { color: #8ab4ff; }
.terminal-error { color: #ff8a8a; }
.terminal-hint { color: #7d8799; font-style: italic; }
.terminal-input-line { display: flex; align-items: center; gap: 8px; border-top: 1px solid #1c2440; padding-top: 10px; margin-top: 10px; }
.terminal-prompt { color: #7ee2a8; white-space: nowrap; }
.terminal-input { flex: 1; background: transparent; border: 0; outline: 0; color: #e2e8f5; font: inherit; }
.terminal-input::placeholder { color: #4d5875; }
.terminal-input:disabled { opacity: .6; }

kbd {
    display: inline-block; padding: 1px 6px; border-radius: 6px;
    background: var(--surface); border: 1px solid var(--border-strong); border-bottom-width: 2px;
    font-size: 11.5px; color: var(--ink);
}
details > summary { cursor: pointer; list-style: revert; }
details > summary:hover { color: var(--primary); }

/* ---------------- Modals ---------------- */
.modal-overlay {
    position: fixed; inset: 0; z-index: 1050;
    display: flex; align-items: center; justify-content: center; padding: 20px;
    background: rgba(9, 13, 30, .55);
    backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
    animation: kc-fade .15s var(--ease);
}
.modal {
    width: 100%; max-width: 660px; max-height: 88vh;
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border); border-radius: 18px;
    box-shadow: var(--shadow-lg);
    animation: kc-rise .18s var(--ease);
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 16px 20px; border-bottom: 1px solid var(--border);
    font-weight: 500; color: var(--ink);
}
.modal-close {
    width: 32px; height: 32px; border: 0; border-radius: 9px; cursor: pointer;
    background: transparent; color: var(--muted); font-size: 22px; line-height: 1;
}
.modal-close:hover { background: var(--surface-3); color: var(--ink); }
.modal-body { padding: 20px; overflow: auto; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 18px 18px; }
@keyframes kc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes kc-rise { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

/* Confirm / prompt / alert dialogs (KC.confirm, data-confirm, ...) */
.kc-dialog { z-index: 1080; }
.kc-dialog.closing { opacity: 0; transition: opacity .12s var(--ease); }
.modal.modal-sm { max-width: 440px; }
.dialog-body { display: flex; gap: 16px; align-items: flex-start; padding: 22px 22px 18px; }
.dialog-icon {
    width: 44px; height: 44px; flex: 0 0 44px; border-radius: 13px;
    display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
    color: var(--primary); background: var(--primary-50); border: 1px solid var(--primary-100);
}
.dialog-danger .dialog-icon { color: var(--danger); background: var(--danger-50); border-color: #f8c9d4; }
.dialog-warning .dialog-icon { color: var(--warning); background: var(--warning-50); border-color: #f5dcaf; }
.dialog-success .dialog-icon { color: var(--success); background: var(--success-50); border-color: #c4ecdb; }
.dialog-info .dialog-icon { color: var(--info); background: var(--info-50); border-color: #c3e3f3; }
.dialog-text { flex: 1; min-width: 0; }
.dialog-title { margin: 2px 0 6px; font-size: 16.5px; font-weight: 700; color: var(--ink); }
.dialog-message { margin: 0 0 4px; color: var(--ink-2); font-size: 13.8px; white-space: pre-line; overflow-wrap: anywhere; }
.dialog-text .form-label { margin-top: 12px; }
.dialog-error { color: var(--danger-700); }
body.modal-open { overflow: hidden; }

/* Wide tables scroll inside their card (wrapper added by app.js). */
.table-scroll { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll > .table { min-width: 100%; }

/* Roboman pipeline configuration (Deployment) */
.pipe-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 18px; }
.pipe-section-title {
    margin: 6px 0 12px; padding-bottom: 8px; border-bottom: 1px dashed var(--border);
    font-size: 11px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.pipe-section-title .badge, .pipe-section-title code { text-transform: none; letter-spacing: 0; }
.pipe-check { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; font-weight: 500; color: var(--ink); cursor: pointer; }
.pipe-xml { min-height: 360px; font-size: 12.5px; }
.kv-list { margin: 0; padding: 0; list-style: none; }
.kv-list li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.kv-list li:last-child { border-bottom: 0; }
.kv-list li > span:first-child { min-width: 120px; color: var(--muted); }
.kv-list li code { overflow-wrap: anywhere; }
/* Deployment file manager: drag & drop move, rename */
.fm-item { cursor: grab; transition: background .12s var(--ease), opacity .12s var(--ease); }
.fm-item:active { cursor: grabbing; }
.fm-item .d-flex { width: 100%; gap: 4px; }
.fm-grip { color: var(--faint); font-size: 12px; padding: 0 2px 0 4px; }
.fm-item:hover .fm-grip { color: var(--muted); }
.fm-actions { display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.fm-btn { width: 30px; height: 30px; padding: 0; border-color: transparent; background: transparent; box-shadow: none; color: var(--muted); }
.fm-btn:hover { background: var(--surface-3); border-color: var(--border); color: var(--ink); }
.fm-dragging { opacity: .45; }
.fm-over, .conf-list li.fm-over { background: var(--primary-50); box-shadow: inset 0 0 0 2px var(--primary); border-radius: 9px; }
.fm-crumbs a.fm-over { padding: 2px 6px; }
.fm-move-btn { display: none; }
@media (hover: none), (max-width: 768px) {
    .fm-move-btn { display: inline-flex; }
    .fm-hint, .fm-grip { display: none; }
}
.hook-item { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 10px; background: var(--surface); }
.hook-item > summary { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 11px 14px; font-weight: 500; }
.hook-item[open] > summary { border-bottom: 1px solid var(--border); background: var(--surface-2); border-radius: var(--radius) var(--radius) 0 0; }
.hook-item .hook-url { overflow-wrap: anywhere; max-width: 100%; }
.hook-body { padding: 14px; }

/* ---------------- Templates ---------------- */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.tpl-group { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.tpl-group-title {
    padding: 11px 15px; background: var(--surface-2); border-bottom: 1px solid var(--border);
    font-size: 11.5px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--muted);
}
.tpl-group ul { margin: 0; padding: 4px; }
.tpl-view { width: 100%; text-align: left; border: 0; background: transparent; cursor: pointer; font: inherit; }
.tpl-eye, .tpl-del { margin-left: auto; color: var(--faint); }

/* ---------------- Monitoring shortcuts ---------------- */
.monitor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.monitor-card {
    position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm); transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s var(--ease);
}
.monitor-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary-100); }
.monitor-btn { display: flex; align-items: center; gap: 12px; color: var(--ink); font-weight: 500; font-size: 15px; }
.monitor-btn i {
    width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--primary); background: var(--primary-50); font-size: 15px;
}
.monitor-btn:hover { color: var(--primary); }
.monitor-actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------------- Preference: theme ---------------- */
.theme-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.theme-option { align-items: flex-start; min-width: 0; }
.theme-option input { margin-top: 3px; flex: 0 0 auto; }
.theme-swatches { display: inline-flex; flex: 0 0 auto; border-radius: 8px; overflow: hidden; border: 1px solid var(--border-strong); }
.theme-swatches span { width: 14px; height: 30px; }
.theme-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.theme-name { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); }
.theme-desc { font-size: 12.5px; font-weight: 400; color: var(--muted); line-height: 1.45; }

/* ---------------- Preference: branding ---------------- */
.branding-preview { flex: 1; min-width: 220px; }
.branding-preview-box {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
    height: 130px; margin-bottom: 4px;
    border: 1px dashed var(--border-strong); border-radius: var(--radius);
    background:
        linear-gradient(45deg, var(--surface-3) 25%, transparent 25%, transparent 75%, var(--surface-3) 75%),
        linear-gradient(45deg, var(--surface-3) 25%, transparent 25%, transparent 75%, var(--surface-3) 75%);
    background-size: 16px 16px; background-position: 0 0, 8px 8px; background-color: var(--surface);
}
.branding-label { font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.branding-logo-img { max-width: 96px; max-height: 64px; object-fit: contain; }
.branding-favicon-img { width: 48px; height: 48px; object-fit: contain; }

/* ---------------- Auth (login, forced password, errors) ---------------- */
.auth-wrap {
    min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
    background:
        radial-gradient(60% 50% at 15% 10%, rgba(99, 102, 241, .35), transparent 60%),
        radial-gradient(50% 40% at 90% 90%, rgba(200, 150, 61, .22), transparent 60%),
        linear-gradient(160deg, #141c40, #0b1022 60%);
}
.auth-card { width: 100%; max-width: 420px; }
.auth-logo {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    margin-bottom: 22px; text-align: center;
    color: #fff; font-size: 22px; font-weight: 700; letter-spacing: -.01em;
}
.auth-logo img { width: 64px; height: 64px; border-radius: 18px; box-shadow: 0 16px 40px -12px rgba(0, 0, 0, .6); }
.auth-logo small { display: block; font-size: 11px; font-weight: 500; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-soft); opacity: .85; }
.auth-card .card { border: 1px solid rgba(255, 255, 255, .5); box-shadow: var(--shadow-lg); }
.auth-card .card-header { justify-content: center; }
.auth-wrap .error-code { font-size: 72px; font-weight: 700; margin: 0; color: #fff; letter-spacing: -.04em; line-height: 1; }
.auth-wrap .error-text { color: rgba(255, 255, 255, .7); margin: 10px 0 22px; }

/* ---------------- Sign-in page (views/auth/login.php) ----------------
   One task per screen, Google-style: a wide card with the title on the left
   and the form on the right (stacked on phones), outlined fields with
   floating labels, actions bottom-right. Colours come from the theme tokens. */
body.gsi-page { background: var(--bg); }
.gsi {
    min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 24px 16px;
}
.gsi-card {
    width: 100%; max-width: 1040px;
    display: grid; grid-template-columns: 1fr 1fr; gap: 24px 48px;
    padding: 36px;
    background: var(--surface); border-radius: 28px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}
.gsi-logo { width: 48px; height: 48px; object-fit: contain; border-radius: 12px; display: block; margin-bottom: 20px; }
.gsi-intro h1 {
    margin: 0 0 12px; color: var(--ink);
    font-family: var(--font-head, var(--font-display, var(--font-sans)));
    font-size: 36px; font-weight: 400; letter-spacing: 0; line-height: 1.22;
}
.gsi-lead { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.5; }
.gsi-ip {
    display: inline-flex; align-items: center; gap: 8px; margin: 24px 0 0;
    padding: 4px 12px 4px 10px; border-radius: 999px; border: 1px solid var(--border);
    color: var(--muted); font-size: 12.5px;
}
.gsi-ip i { color: var(--success); }
.gsi-ip.is-blocked i { color: var(--danger); }
.gsi-body { min-width: 0; padding-top: 4px; }

/* Single sign-on button: outlined, provider icon left */
.gsi-sso {
    display: flex; align-items: center; justify-content: center; gap: 12px;
    width: 100%; min-height: 48px; padding: 10px 20px;
    border: 1px solid var(--border-strong); border-radius: 999px;
    background: var(--surface); color: var(--ink);
    font-size: 15px; font-weight: 500; text-decoration: none;
    transition: background .15s ease, border-color .15s ease;
}
.gsi-sso:hover { background: var(--surface-2); border-color: var(--faint); color: var(--ink); text-decoration: none; }
.gsi-sso i { color: #fc6d26; font-size: 19px; }
.gsi-or {
    display: flex; align-items: center; gap: 12px; margin: 22px 0 20px;
    color: var(--muted); font-size: 13px;
}
.gsi-or::before, .gsi-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Outlined text field with a floating label */
.gsi-field { position: relative; margin-bottom: 18px; }
.gsi-field input {
    display: block; width: 100%; height: 56px; padding: 16px 15px;
    font: inherit; font-size: 16px; color: var(--ink);
    background: transparent; border: 1px solid var(--border-strong); border-radius: 4px;
    outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.gsi-field input:hover { border-color: var(--ink-2); }
.gsi-field input:focus { border-color: var(--primary); box-shadow: inset 0 0 0 1px var(--primary); }
.gsi-field label {
    position: absolute; left: 11px; top: 28px; transform: translateY(-50%);
    padding: 0 5px; max-width: calc(100% - 22px);
    background: var(--surface); color: var(--muted);
    font-size: 16px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    pointer-events: none; transition: top .15s ease, font-size .15s ease, color .15s ease;
}
.gsi-field input:focus + label,
.gsi-field input:not(:placeholder-shown) + label { top: 0; font-size: 12px; }
.gsi-field input:focus + label { color: var(--primary); }
.gsi-field input:user-invalid:not(:focus) { border-color: var(--danger); }
.gsi-help { margin: 6px 0 0 16px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.gsi-help-block { margin: -8px 0 12px 16px; }
.gsi-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.gsi-check { display: inline-flex; align-items: center; gap: 10px; margin: 0 0 18px 2px; color: var(--ink-2); font-size: 14px; cursor: pointer; }
.gsi-check input { width: 18px; height: 18px; margin: 0; accent-color: var(--primary); }

/* Cap widget, styled from the theme tokens */
.gsi-captcha { margin: 0 0 20px; }
.gsi-captcha cap-widget {
    --cap-background: var(--surface);
    --cap-border-color: var(--border-strong);
    --cap-border-radius: 8px;
    --cap-color: var(--ink);
    --cap-font: var(--font-sans);
    --cap-checkbox-border: 1px solid var(--faint);
    --cap-checkbox-background: var(--surface-2);
    --cap-spinner-color: var(--primary);
    --cap-spinner-background-color: var(--border);
}

.gsi-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 8px; }
.gsi-link {
    display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; margin-right: auto; margin-left: -12px;
    border-radius: 999px; color: var(--primary); font-size: 14px; font-weight: 500; text-decoration: none;
}
.gsi-link:hover { background: var(--primary-50); color: var(--primary); text-decoration: none; }
.gsi-submit { min-height: 40px; padding: 8px 24px; border-radius: 999px; font-size: 14px; }

.gsi-alert { margin: 0 0 18px; padding: 12px 16px; border-radius: 8px; font-size: 14px; line-height: 1.45; }
.gsi-alert-success { background: var(--success-50); color: var(--success-700); }
.gsi-alert-danger { background: var(--danger-50); color: var(--danger-700); }
.gsi-alert-warning { background: var(--warning-50); color: var(--warning-700); }
.gsi-alert-info { background: var(--info-50); color: var(--info-700); }
.gsi-text, .gsi-note { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.5; }
.gsi-note { margin-top: 20px; color: var(--muted); font-size: 12.5px; }

.gsi-foot {
    width: 100%; max-width: 1040px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px 24px;
    padding: 16px 24px 0; color: var(--muted); font-size: 12px;
}
.gsi-foot a { color: var(--muted); text-decoration: underline; }
.gsi-foot-links { margin-left: auto; }

@media (max-width: 840px) {
    .gsi { justify-content: flex-start; padding: 0; }
    .gsi-card { grid-template-columns: 1fr; gap: 24px; padding: 32px 24px; border-radius: 0; box-shadow: none; min-height: 0; }
    body.gsi-page { background: var(--surface); }
    .gsi-intro h1 { font-size: 28px; }
    .gsi-ip { margin-top: 16px; }
    .gsi-foot { padding: 8px 24px 24px; }
    .gsi-foot-links { margin-left: 0; }
}
@media (max-width: 400px) {
    .gsi-row { grid-template-columns: 1fr; }
}

/* ---------------- Accounts & notifications ---------------- */
.user-avatar {
    width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; object-fit: cover;
    border: 1px solid var(--border); background: var(--surface-3);
}
.user-avatar-initial {
    display: inline-flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 13px; color: var(--primary-700); background: var(--primary-50); border-color: var(--primary-100);
}
.chip-avatar { width: 22px; height: 22px; border-radius: 7px; object-fit: cover; }
.topbar .user-chip { padding-left: 6px; }
.topbar .user-chip:has(i) { padding-left: 12px; }

.nav-badge {
    margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: var(--gold-soft); background: var(--accent-bg); box-shadow: inset 0 0 0 1px rgba(145, 210, 251, .3);
}
.notify { position: relative; }
.notify-btn {
    position: relative; width: 38px; height: 38px; border-radius: 11px; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-2); font-size: 15px;
    transition: background .15s var(--ease), color .15s var(--ease);
}
.notify-btn:hover { background: var(--primary-50); color: var(--primary); }
.notify-count {
    position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 10.5px; font-weight: 700; color: #fff; background: var(--danger); border: 2px solid #fff;
}
.notify-panel {
    position: absolute; right: 0; top: calc(100% + 10px); width: 340px; z-index: 1040;
    background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-lg);
    overflow: hidden; animation: kc-rise .15s var(--ease);
}
.notify-head { padding: 12px 16px; font-size: 12px; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.notify-item { display: flex; gap: 12px; align-items: center; padding: 11px 16px; color: var(--ink); border-bottom: 1px solid var(--border); }
.notify-item:hover { background: var(--surface-2); color: var(--ink); }
.notify-item i { color: var(--warning); }
.notify-item small { display: block; color: var(--muted); font-size: 11.5px; }
.notify-empty { padding: 18px 16px; color: var(--muted); font-size: 13px; text-align: center; }
.notify-empty i { color: var(--success); }
.notify-foot { display: block; padding: 11px 16px; font-size: 12.5px; font-weight: 500; text-align: center; }

/* ---------------- Utilities ---------------- */
.hidden { display: none !important; }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.small { font-size: 12.5px; }
.mt-0 { margin-top: 0; } .mt-2 { margin-top: 10px; } .mt-3 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 6px; } .mb-2 { margin-bottom: 10px; } .mb-3 { margin-bottom: 16px; }
.p-2 { padding: 10px; }
.d-flex { display: flex; } .align-center { align-items: center; } .justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 10px; } .gap-3 { gap: 16px; }

/* ---------------- User Guide ---------------- */
.topbar-help { text-decoration: none; }
.guide-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 22px; align-items: start; }
.guide-toc {
    position: sticky; top: calc(var(--topbar-h, 64px) + 18px);
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg, 14px);
    padding: 12px; box-shadow: var(--shadow-sm, none); max-height: calc(100vh - var(--topbar-h, 64px) - 36px); overflow: auto;
}
.guide-toc ul { list-style: none; margin: 10px 0; padding: 0; }
.guide-toc li a {
    display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px;
    color: var(--ink-2); font-size: 13.5px; font-weight: 500;
}
.guide-toc li a i { width: 18px; text-align: center; color: var(--muted); font-size: 13px; }
.guide-toc li a:hover { background: var(--surface-2); color: var(--ink); }
.guide-toc li a.active { background: var(--primary-50); color: var(--primary-700); }
.guide-toc li a.active i { color: var(--primary); }
.guide-search { position: relative; }
.guide-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 13px; }
.guide-search .form-control { padding-left: 34px; }
.guide-content { min-width: 0; }
.guide-section { margin-bottom: 18px; scroll-margin-top: calc(var(--topbar-h, 64px) + 16px); }
.guide-section .card-body { line-height: 1.65; }
.guide-section .card-body > p:first-child { margin-top: 0; }
.guide-section .card-title .badge { margin-left: 6px; text-transform: none; }
.guide-h { font-size: 14.5px; font-weight: 700; margin: 20px 0 8px; color: var(--ink); }
.guide-list, .guide-steps { margin: 0 0 12px; padding-left: 20px; }
.guide-list li, .guide-steps li { margin-bottom: 6px; }
.guide-list .guide-list { margin: 6px 0 0; }
.guide-steps { counter-reset: gstep; list-style: none; padding-left: 0; }
.guide-steps > li { counter-increment: gstep; position: relative; padding-left: 36px; min-height: 26px; }
.guide-steps > li::before {
    content: counter(gstep); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary-50); color: var(--primary-700); border: 1px solid var(--primary-100); font-size: 12px; font-weight: 700;
}
.guide-note {
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 10px 14px; font-size: 13px; color: var(--ink-2);
}
.guide-note > i { color: var(--primary); margin-right: 6px; }
.guide-key {
    display: inline-flex; align-items: center; justify-content: center; min-width: 22px; padding: 1px 6px;
    border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; background: var(--surface);
    font-family: var(--font-mono, monospace); font-size: 11.5px; color: var(--ink-2); line-height: 1.5;
}
.guide-access th { width: 170px; white-space: nowrap; vertical-align: top; }
.guide-access td .badge { margin: 0 2px 4px 0; }
.guide-table { margin-bottom: 12px; }
.guide-faq { margin: 0; }
.guide-faq dt { font-weight: 500; color: var(--ink); margin-top: 14px; }
.guide-faq dt:first-child { margin-top: 0; }
.guide-faq dd { margin: 4px 0 0; color: var(--ink-2); }
.guide-contact { border-color: var(--primary-100); }
.guide-contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.guide-contact-item {
    display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--radius);
    border: 1px solid var(--border); background: var(--surface); color: var(--ink); min-width: 0;
}
a.guide-contact-item:hover { border-color: var(--primary-100); background: var(--primary-50); color: var(--ink); }
.guide-contact-item > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.guide-contact-item small { color: var(--muted); font-size: 11.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; }
.guide-contact-item strong { overflow-wrap: anywhere; }
.guide-contact-item em { font-style: normal; color: var(--muted); font-size: 12px; }
.guide-contact-icon {
    flex: 0 0 40px; width: 40px; height: 40px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary-50); color: var(--primary); font-size: 16px;
}
.guide-contact-icon.guide-wa { background: #e7f8ee; color: #1f9d55; font-size: 19px; }
.guide-pre { white-space: pre-line; }
.guide-admins { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.guide-admin { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); min-width: 0; }
.guide-admin .avatar {
    flex: 0 0 34px; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    background: var(--primary-50); color: var(--primary-700); font-weight: 700;
}
.guide-admin-text { display: flex; flex-direction: column; min-width: 0; font-size: 13px; }
.guide-admin-text a, .guide-admin-text small { overflow-wrap: anywhere; }
.guide-help-btn { margin-top: 4px; }
@media (max-width: 992px) {
    .guide-layout { grid-template-columns: 1fr; gap: 14px; }
    .guide-toc { position: static; max-height: none; }
    .guide-toc ul { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0 0; padding-bottom: 4px; scrollbar-width: thin; }
    .guide-toc li a { white-space: nowrap; border: 1px solid var(--border); padding: 6px 10px; font-size: 12.5px; }
    .guide-help-btn { display: none; }
}
@media (max-width: 768px) {
    .guide-access th { width: auto; white-space: normal; }
    .guide-section .card-header { flex-wrap: wrap; }
    .topbar-help { width: 34px; height: 34px; }
}

/* ---------------- Reverse proxy configuration form ---------------- */
.step-no {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; margin-right: 6px; border-radius: 7px;
    background: var(--primary-50); color: var(--primary-700); font-size: 12px; font-weight: 700;
}
.req { color: var(--danger-700); }
.mono, textarea.mono { font-family: var(--font-mono); font-size: 13px; }
.form-control.is-invalid { border-color: var(--danger-700); box-shadow: 0 0 0 3px var(--danger-50); }
.field-error { color: var(--danger-700); font-size: 12.5px; margin-top: 6px; font-weight: 500; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13.5px; cursor: pointer; }
.gap-3 { gap: 16px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.site-meta { display: flex; flex-wrap: wrap; gap: 10px 28px; align-items: center; }
.site-meta > div { display: flex; flex-direction: column; gap: 4px; }
.site-status.status-error { border-color: #f8c9d4; }
.site-status.status-active { border-color: #c4ecdb; }
.ssl-choice .radio-card { flex: 1 1 210px; }
@media (max-width: 768px) {
    .form-actions .btn { flex: 1 1 auto; justify-content: center; }
    .ssl-choice .radio-card { flex-basis: 100%; }
    .form-row .form-group[style*="max-width"] { max-width: 100% !important; }
}

/* ---------------- Integrations / access requests ---------------- */
.empty-state { text-align: center; padding: 34px 20px; color: var(--muted, #64748b); }
.empty-state > i { font-size: 30px; opacity: .45; margin-bottom: 10px; display: block; }
.empty-state p { margin: 0 0 4px; }
.btn-group-wrap { display: inline-flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.btn-group-wrap form { margin: 0; }
.via { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: #475569; }
.via i { opacity: .7; }
.request-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.request-bar .btn { white-space: nowrap; }
.req-card { border-left: 4px solid var(--warning-700, #b45309); }
.req-item { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-start; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.req-item:last-child { border-bottom: 0; }
.req-item .req-what { flex: 1 1 280px; min-width: 0; }
.req-item .req-what small { display: block; color: #64748b; margin-top: 2px; }
.req-item .req-msg { margin-top: 6px; font-size: 13px; background: #f8fafc; border-radius: 8px; padding: 6px 10px; white-space: pre-wrap; word-break: break-word; }
.req-item .req-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.req-item .req-actions input[type="text"] { width: 200px; }
.req-list { margin: 6px 0 0; padding-left: 4px; list-style: none; font-size: 13px; max-height: 180px; overflow: auto; }
.req-list li { padding: 2px 0; }
.req-projects { max-height: 320px; overflow: auto; border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; margin: 0; }
.notify-tag { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; color: #64748b; }
.int-checks { margin-top: 6px; max-width: 340px; }
.int-checks summary { cursor: pointer; color: #475569; }
.int-checks ul { list-style: none; margin: 6px 0 0; padding: 0; }
.int-checks li { display: flex; gap: 8px; font-size: 12.5px; padding: 4px 0; line-height: 1.4; }
.int-checks li i { margin-top: 2px; }
.int-checks .chk-ok i { color: #059669; }
.int-checks .chk-warn i { color: #d97706; }
.int-checks .chk-fail i { color: #dc2626; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.tabs a { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--border); font-size: 13px; font-weight: 500; color: inherit; text-decoration: none; background: #fff; }
.tabs a.active { background: var(--primary-50); border-color: var(--primary); color: var(--primary-700); }
@media (max-width: 768px) {
    .req-item .req-actions { width: 100%; }
    .req-item .req-actions input[type="text"] { flex: 1 1 100%; width: auto; }
    .btn-group-wrap { justify-content: flex-start; }
}

/* ---------------- Responsive ---------------- */
.sidebar-toggle { display: inline-flex; }
@media (max-width: 1200px) {
    /* Side-by-side columns (inline flex/min-width in the views) stack earlier. */
    .form-row > .card, .form-row > div:not(.form-group) { min-width: min(100%, 340px) !important; }
}
@media (max-width: 992px) {
    .content { padding: 20px; }
    .topbar { padding: 0 18px; }
    /* Drawer navigation from tablet width down. */
    .sidebar { transform: translateX(-100%); transition: transform .22s var(--ease); box-shadow: var(--shadow-lg); width: min(84vw, var(--sidebar-w)); }
    .sidebar.open { transform: none; }
    body.sidebar-open::after {
        content: ""; position: fixed; inset: 0; z-index: 1025;
        background: rgba(9, 13, 30, .5); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
        animation: kc-fade .15s var(--ease);
    }
    body.sidebar-open { overflow: hidden; }
    .main { margin-left: 0; }
}
@media (max-width: 768px) {
    body { font-size: 14px; }
    .content { padding: 16px 14px 28px; }
    .topbar { padding: 0 12px; --topbar-h: 58px; height: 58px; }
    .topbar .page-title { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
    .topbar .topbar-right { gap: 8px; }
    .topbar .user-chip { padding: 4px; }
    .topbar .user-chip:has(i) { padding: 6px 9px; }
    .topbar .user-chip-name { display: none; }
    .notify-panel { position: fixed; left: 12px; right: 12px; top: 64px; width: auto; }

    .content-header { margin-bottom: 16px; }
    .content-header h1 { font-size: 19px; gap: 10px; overflow-wrap: anywhere; }
    .content-header h1 > i { width: 34px; height: 34px; flex-basis: 34px; font-size: 14px; border-radius: 10px; }
    .breadcrumb { overflow-wrap: anywhere; }

    .card { margin-bottom: 16px; border-radius: var(--radius); }
    .card-header { flex-wrap: wrap; padding: 13px 14px; }
    .card-body { padding: 14px; }
    .card-tools { width: 100%; justify-content: flex-start; }
    .search-box, .search-box .form-control { width: 100%; min-width: 0; }

    /* Every multi-column row becomes a single column. */
    .form-row { flex-direction: column; gap: 0; }
    .form-row > * { min-width: 0 !important; max-width: 100% !important; flex: 1 1 auto !important; width: 100%; }
    .form-row .form-group { min-width: 0; }
    form.d-flex, .form-group.d-flex { flex-wrap: wrap; }
    form.d-flex > .form-control, .form-group.d-flex > .form-control { flex: 1 1 160px; max-width: 100% !important; }

    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
    .stat-card { padding: 14px; gap: 12px; }
    .stat-icon { width: 38px; height: 38px; flex-basis: 38px; font-size: 15px; border-radius: 11px; }
    .stat-value { font-size: 20px; }

    .table th, .table td { padding: 10px 12px; }
    .table td { font-size: 13.5px; }
    .table-scroll > .table { min-width: 560px; }
    .card-body { overflow-x: auto; }

    .btn { padding: 9px 14px; }
    .btn-sm { padding: 7px 11px; }
    .form-control { font-size: 16px; } /* no iOS zoom on focus */
    .search-box .form-control { font-size: 16px; }

    .code-block, .console-editor, .terminal { font-size: 12px; }
    .console-editor { min-height: 300px; }
    .terminal { min-height: 360px; }

    .modal-overlay { padding: 12px; align-items: flex-end; }
    .modal { max-height: 92vh; border-radius: 16px; }
    .modal-footer { border-radius: 0 0 16px 16px; flex-wrap: wrap; }
    .modal-footer .btn { flex: 1 1 auto; }
    .dialog-body { padding: 18px 16px 14px; gap: 12px; }

    .tpl-grid, .monitor-grid { grid-template-columns: 1fr; }
    .pagination { justify-content: center; }
    .pagination .page-info { width: 100%; text-align: center; }
    .auth-wrap { padding: 16px; }
}
@media (max-width: 420px) {
    .stat-grid { grid-template-columns: 1fr; }
    .topbar .page-title { max-width: 38vw; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
/* Brand-coloured logos (GitLab / Jenkins / GitHub / Gitea / Git) and coloured action icons */
i.fab.fa-gitlab { color: #fc6d26; }
i.fab.fa-jenkins { color: #d33833; }
i.fab.fa-github { color: #181717; }
i.fab.fa-git-alt { color: #f05032; }
i.fas.fa-mug-hot { color: #609926; }
.via i.fa-gitlab, .via i.fa-jenkins, .via i.fa-github, .via i.fa-git-alt, .via i.fa-mug-hot { opacity: 1; }
i.fas.ic-console { color: #7c3aed; }
i.fas.ic-restart { color: #2563eb; }
i.fas.ic-start { color: #16a34a; }
i.fas.ic-stop { color: #dc2626; }
/* Web terminal (Environment > Console) */
.term-card .card-body.term-body { padding: 0; background: #0d0f12; border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }
.term-screen { height: calc(100vh - 290px); min-height: 320px; padding: 8px 4px 4px 10px; }
.term-screen .xterm { height: 100%; }
.term-status { font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.term-status.is-ok { color: var(--success); }
.term-status.is-ok i { font-size: 8px; }
.term-status.is-error { color: var(--danger); max-width: 520px; }
.term-keys { display: none; gap: 6px; padding: 8px 10px; background: #15171a; border-top: 1px solid #23262b; overflow-x: auto; }
.term-keys button { flex: 0 0 auto; min-width: 44px; height: 34px; padding: 0 10px; border-radius: 8px; border: 1px solid #343840; background: #23262b; color: #e6e6e6; font: 500 12.5px var(--font-sans); }
.term-keys button.active { background: var(--btn-primary); border-color: var(--btn-primary); }
.term-card.term-full { position: fixed; inset: 0; z-index: 2000; margin: 0; border-radius: 0; display: flex; flex-direction: column; }
.term-card.term-full .term-body { flex: 1; display: flex; flex-direction: column; border-radius: 0; }
.term-card.term-full .term-screen { flex: 1; height: auto; }
body.term-full-open { overflow: hidden; }
@media (max-width: 900px), (pointer: coarse) {
    .term-keys { display: flex; }
    .term-screen { height: calc(100vh - 330px); }
}
/* Tooltip of icon-only buttons ([data-tip], app.js) */
.kc-tip { position: fixed; z-index: 3000; pointer-events: none; padding: 5px 9px; border-radius: 6px; background: #15171a; color: #fff; font-size: 12px; font-weight: 500; line-height: 1.3; white-space: nowrap; box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .45); }
.kc-tip::after { content: ""; position: absolute; left: 50%; top: 100%; margin-left: -5px; border: 5px solid transparent; border-top-color: #15171a; }
.kc-tip.below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #15171a; }
/* Row actions: one-line icon toolbar (Environment lists) */
.act-group {
    display: inline-flex; align-items: center; gap: 2px; padding: 3px;
    border-radius: 12px; background: var(--surface); border: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 6px 16px -10px rgba(15, 23, 42, .25);
    white-space: nowrap; vertical-align: middle;
}
.act-group form { display: contents; }
.act {
    width: 32px; height: 30px; padding: 0; border: 0; border-radius: 9px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; color: var(--ink-2); font-size: 13.5px; text-decoration: none; cursor: pointer;
    transition: background .15s var(--ease), transform .15s var(--ease), box-shadow .15s var(--ease);
}
.act:hover { transform: translateY(-1px); box-shadow: 0 4px 10px -6px rgba(15, 23, 42, .35); }
.act:active { transform: none; }
.act:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.act-open i { color: var(--primary); }       .act-open:hover { background: var(--primary-50); }
.act-console i { color: #7c3aed; }           .act-console:hover { background: #f3effe; }
.act-test i { color: #059669; }              .act-test:hover { background: #e7f8f1; }
.act-logs i { color: #0284c7; }              .act-logs:hover { background: #e6f4fb; }
.act-restart i { color: #2563eb; }           .act-restart:hover { background: #eaf1fe; }
.act-danger i { color: #dc2626; }            .act-danger:hover { background: #fdecee; }
.act.is-disabled { opacity: .35; pointer-events: none; }
td .act-group + .act-group { margin-left: 6px; }
/* Environment list: type filter + version */
.env-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.env-filter { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-xs); flex-wrap: wrap; }
.env-chip { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font: 500 13px var(--font-sans); cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease); }
.env-chip:hover { background: var(--surface-3); color: var(--ink); }
/* Selected chip = selected menu item (same layered colours as .nav a.active). */
.env-chip.active { background: linear-gradient(var(--nav-active), var(--nav-active)), var(--nav-bg); color: var(--nav-text-strong); box-shadow: 0 4px 12px -6px rgba(21, 23, 26, .6); }
.env-chip.active i { color: #a5b4fc; }
.env-chip-count { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; background: var(--surface-3); color: var(--muted); }
.env-chip.active .env-chip-count { background: var(--accent-bg); color: var(--gold-soft); }
.env-version { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border); color: var(--ink-2); white-space: nowrap; font-family: var(--font-mono); font-size: 11.5px; }
.env-version i { color: var(--muted); }
/* Signed-in user, top right: avatar from the GitLab sign-in, name, role (plain text, no pill) */
.user-card {
    position: relative; display: inline-flex; align-items: center; gap: 11px;
    margin-left: 4px; padding: 5px 10px 5px 18px; border-radius: 12px;
    max-width: 290px; cursor: default; transition: background .15s var(--ease);
}
.user-card::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 1px; background: var(--border); }
.user-card:hover { background: var(--surface-2); }
.user-card-avatar {
    position: relative; width: 36px; height: 36px; flex: 0 0 36px; border-radius: 11px; overflow: hidden;
    background: linear-gradient(145deg, #1a4b80, var(--accent-bg));
    box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px rgba(14, 56, 102, .22), 0 6px 14px -8px rgba(14, 56, 102, .7);
}
.user-card-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.user-card-initial { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--gold-soft); font-weight: 700; font-size: 14.5px; }
.user-card-text { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; min-width: 0; line-height: 1.1; }
.user-card-name { color: var(--ink); font-weight: 500; font-size: 13.5px; letter-spacing: -.005em; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-card-role { color: #b8bfca; font-size: 10.5px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; }
@media (max-width: 700px) {
    .user-card { padding: 3px 3px 3px 12px; margin-left: 0; }
    .user-card-text { display: none; }
}

/* Rows-per-page picker of the pager */
.page-size { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 0 auto; color: var(--muted); font-size: 12.5px; }
.page-size select {
    height: 32px; padding: 0 28px 0 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface);
    color: var(--ink); font: 500 13px var(--font-sans); cursor: pointer; appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position: calc(100% - 14px) 13px, calc(100% - 9px) 13px; background-size: 5px 5px; background-repeat: no-repeat;
}
.page-size select:focus { outline: 2px solid var(--primary); outline-offset: 1px; }

/* Dark top bar (matches the menu bar): buttons and user card on #15171a */
.topbar .notify-btn { background: rgba(255, 255, 255, .05); border-color: var(--nav-line); color: var(--nav-text); }
.topbar .notify-btn:hover { background: var(--nav-active); color: var(--nav-text-strong); }
.topbar .notify-count { border-color: var(--nav-bg); }
.topbar .user-card::before { background: var(--nav-line); }
.topbar .user-card:hover { background: var(--nav-hover); }
.topbar .user-card-name { color: var(--nav-text-strong); }
.topbar .user-card-avatar { box-shadow: 0 0 0 2px var(--nav-bg), 0 0 0 3px rgba(145, 210, 251, .28), 0 6px 14px -8px rgba(0, 0, 0, .8); }
.topbar .sidebar-toggle i { transition: transform .2s var(--ease); }

/* Show / hide the menu bar on wide screens (remembered per browser) */
@media (min-width: 1201px) {
    .sidebar { transition: transform .22s var(--ease); }
    .main { transition: margin-left .22s var(--ease); }
    body.sidebar-collapsed .sidebar { transform: translateX(-100%); }
    body.sidebar-collapsed .main { margin-left: 0; }
}
/* Activity Log */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.log-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.log-filter-menu select { min-width: 190px; height: 38px; }
.log-filter-search { position: relative; flex: 1 1 320px; }
.log-filter-search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--faint); font-size: 13px; }
.log-filter-search input { padding-left: 34px; height: 38px; }
.log-table td { vertical-align: top; }
.log-time strong { display: block; color: var(--ink); font-variant-numeric: tabular-nums; }
.log-time span { color: var(--muted); font-size: 12.5px; font-family: var(--font-mono); }
.log-menu { display: inline-block; padding: 2px 9px; border-radius: 6px; background: var(--surface-3); border: 1px solid var(--border); font-size: 12px; color: var(--ink-2); white-space: nowrap; }
.log-target { display: inline-block; margin-left: 4px; padding: 0 6px; border-radius: 5px; background: var(--primary-50); color: var(--primary-700); font-size: 12.5px; }
.log-summary { margin-top: 3px; color: var(--ink-2); font-size: 13px; }
.log-changes dl { margin: 0; display: grid; gap: 2px; }
.log-changes dl > div { display: flex; gap: 6px; font-size: 12.5px; line-height: 1.45; min-width: 0; }
.log-changes dt { color: var(--muted); flex: 0 0 auto; }
.log-changes dt::after { content: ":"; }
.log-changes dd { margin: 0; color: var(--ink); font-family: var(--font-mono); font-size: 12px; word-break: break-word; }
.log-changes details summary { cursor: pointer; color: var(--primary); font-size: 12px; margin-top: 2px; }
@media (max-width: 700px) {
    .log-filter-menu, .log-filter-menu select { width: 100%; }
}

/* Slash preset cards */
.preset-choice { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.preset-card { align-items: flex-start; }
.preset-card > span { display: flex; flex-direction: column; gap: 4px; }
.preset-card small { color: var(--muted); font-size: 12.5px; line-height: 1.45; font-weight: 400; }

/* Notices from administrators (top of every page, 3 days) */
.admin-notice { display: flex; align-items: flex-start; gap: 12px; }
.admin-notice > .fa-bullhorn { margin-top: 3px; }
.admin-notice-text { flex: 1; min-width: 0; }
.admin-notice-text small { display: block; margin-top: 4px; opacity: .8; }
.admin-notice-close { border: 0; background: transparent; color: inherit; font-size: 20px; line-height: 1; cursor: pointer; padding: 0 4px; opacity: .7; }
.admin-notice-close:hover { opacity: 1; }

/* Groups: dissolve form inside the table */
details.dissolve > summary { list-style: none; display: inline-flex; cursor: pointer; }
details.dissolve > summary::-webkit-details-marker { display: none; }
.dissolve-form { margin-top: 8px; text-align: left; min-width: 260px; }