/* ============================================================================
   IT Infrastructure Manager — application stylesheet

   Self-contained. No Bootstrap, no framework, no build step, no CDN — which
   matters because this runs on isolated management networks.

   It implements the subset of Bootstrap 3 class names the views already use
   (grid, navbar, panels, tables, forms, alerts, labels), so markup did not have
   to change, plus the application's own components (stat tiles, meters, the
   change-log diff, the filter bar).

   Colour is not eyeballed. Every ink below was measured for WCAG contrast
   against its own surface:

     light surface #fcfcfb        dark surface #1a1a19
       link       #1c5cab  6.46     #5598e7  5.83
       good       #006300  7.35     #0ca30c  5.19
       warning    #8a5a00  5.77     #fab219  9.49
       serious    #a8431a  5.87     #ec835a  6.60
       critical   #b0272a  6.45     #e66767  5.39
       secondary  #52514e  7.73     #c3c2b7  9.72

   The saturated status fills (#fab219 at 1.79:1, #ec835a at 2.57:1) are used as
   FILL ONLY — meter bars, badge backgrounds, tile edges — never as text, and
   always beside a written label, so state never depends on colour alone.
   ========================================================================= */

:root {
    color-scheme: light;

    --surface:            #fcfcfb;   /* cards, tables, menus */
    --plane:              #f4f4f1;   /* page background behind the surfaces */
    --surface-sunken:     #efeeea;   /* table headers, filter bar */
    --surface-hover:      #f6f6f3;

    --ink:                #0b0b0b;
    --ink-secondary:      #52514e;
    --ink-muted:          #898781;

    --line:               #e1e0d9;   /* hairline */
    --line-strong:        #c9c8c0;

    --accent:             #1c5cab;   /* link + primary action text */
    --accent-fill:        #2a78d6;
    --accent-fill-hover:  #256abf;
    --accent-wash:        #eaf2fd;
    --accent-track:       #cde2fb;

    --good:               #0ca30c;
    --good-ink:           #006300;
    --good-wash:          #e8f6e8;

    --warning:            #fab219;
    --warning-ink:        #8a5a00;
    --warning-wash:       #fdf3dd;

    --serious:            #ec835a;
    --serious-ink:        #a8431a;

    --critical:           #d03b3b;
    --critical-ink:       #b0272a;
    --critical-wash:      #fbeceb;

    --topbar:             #22221f;
    --topbar-ink:         #edece6;
    --topbar-ink-muted:   #a3a199;
    --topbar-hover:       #33332e;

    --radius:             3px;
    --radius-lg:          4px;
    --shadow-menu:        0 4px 14px rgba(11, 11, 11, 0.14);

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
    :root:where(:not([data-theme="light"])) {
        color-scheme: dark;

        --surface:            #1a1a19;
        --plane:              #0d0d0d;
        --surface-sunken:     #232320;
        --surface-hover:      #25251f;

        --ink:                #ffffff;
        --ink-secondary:      #c3c2b7;
        --ink-muted:          #898781;

        --line:               #2c2c2a;
        --line-strong:        #3d3d39;

        --accent:             #5598e7;
        --accent-fill:        #3987e5;
        --accent-fill-hover:  #5598e7;
        --accent-wash:        #16243a;
        --accent-track:       #184f95;

        --good-ink:           #0ca30c;
        --good-wash:          #10240f;

        --warning-ink:        #fab219;
        --warning-wash:       #2e2411;

        --serious-ink:        #ec835a;

        --critical-ink:       #e66767;
        --critical-wash:      #2c1514;

        --topbar:             #101010;
        --topbar-ink:         #edece6;
        --topbar-hover:       #232320;

        --shadow-menu:        0 4px 14px rgba(0, 0, 0, 0.6);
    }
}

/* ============================================================ base */

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    padding-top: 46px;              /* fixed top bar */
    background: var(--plane);
    color: var(--ink);
    font-family: var(--font);
    font-size: 13px;
    line-height: 1.5;
}

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

h1, h2, h3, h4, h5 {
    margin: 0 0 8px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--ink);
}
h1 { font-size: 22px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; margin-top: 22px; }
h4 { font-size: 13px; }

p { margin: 0 0 10px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
pre {
    font-family: var(--mono);
    font-size: 12px;
    background: var(--surface-sunken);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px 12px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}
code { font-family: var(--mono); font-size: 12px; }

:focus-visible {
    outline: 2px solid var(--accent-fill);
    outline-offset: 1px;
}

/* ============================================================ layout */

.container-fluid { padding: 0 18px; width: 100%; }

.main-container {
    padding: 0 18px;
    max-width: 1900px;
    margin: 0 auto;
    min-height: calc(100vh - 106px);
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
}
.row > [class*="col-"] { padding: 0 8px; width: 100%; }

.col-md-1  { flex: 0 0 8.3333%;  max-width: 8.3333%; }
.col-md-2  { flex: 0 0 16.6667%; max-width: 16.6667%; }
.col-md-3  { flex: 0 0 25%;      max-width: 25%; }
.col-md-4  { flex: 0 0 33.3333%; max-width: 33.3333%; }
.col-md-5  { flex: 0 0 41.6667%; max-width: 41.6667%; }
.col-md-6  { flex: 0 0 50%;      max-width: 50%; }
.col-md-7  { flex: 0 0 58.3333%; max-width: 58.3333%; }
.col-md-8  { flex: 0 0 66.6667%; max-width: 66.6667%; }
.col-md-9  { flex: 0 0 75%;      max-width: 75%; }
.col-md-10 { flex: 0 0 83.3333%; max-width: 83.3333%; }
.col-md-11 { flex: 0 0 91.6667%; max-width: 91.6667%; }
.col-md-12 { flex: 0 0 100%;     max-width: 100%; }

@media (max-width: 1200px) {
    .col-md-2 { flex: 0 0 25%; max-width: 25%; }
    .col-md-3 { flex: 0 0 33.3333%; max-width: 33.3333%; }
}
@media (max-width: 992px) {
    .row > [class*="col-md-"] { flex: 0 0 100%; max-width: 100%; }
    .col-sm-4 { flex: 0 0 50%; max-width: 50%; }
    .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
}
@media (max-width: 640px) {
    .row > [class*="col-"] { flex: 0 0 100%; max-width: 100%; }
}

.pull-left  { float: left; }
.pull-right { float: right; }
.clearfix::after { content: ""; display: table; clear: both; }

.text-right  { text-align: right; }
.text-center { text-align: center; }
.text-muted  { color: var(--ink-muted); }
.text-nowrap { white-space: nowrap; }
.small, small { font-size: 11.5px; }

.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;
}

/* ============================================================ top bar */

.navbar {
    background: var(--topbar);
    color: var(--topbar-ink);
    border-bottom: 1px solid rgba(0, 0, 0, 0.5);
}
.navbar-fixed-top {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 900;
}
.navbar .container-fluid {
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 46px;
    max-width: 1900px;
    margin: 0 auto;
}

.navbar-header { display: flex; align-items: center; }

.navbar-brand {
    color: #fff;
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.2px;
    padding: 0 16px 0 0;
    white-space: nowrap;
}
.navbar-brand:hover { color: #fff; text-decoration: none; }

.navbar-collapse { display: flex; flex: 1; align-items: center; gap: 4px; }

.navbar-nav {
    list-style: none;
    display: flex;
    margin: 0; padding: 0;
    align-items: center;
}
.navbar-nav > li { position: relative; }

.navbar-nav > li > a,
.navbar-nav > li > .dropdown-toggle {
    display: block;
    padding: 13px 11px;
    color: var(--topbar-ink);
    font-size: 12.5px;
    white-space: nowrap;
    cursor: pointer;
}
.navbar-nav > li > a:hover,
.navbar-nav > li.open > .dropdown-toggle {
    background: var(--topbar-hover);
    color: #fff;
    text-decoration: none;
}

.navbar-right { margin-left: auto; }
.navbar-left  { margin-right: 0; }

.caret {
    display: inline-block;
    width: 0; height: 0;
    margin-left: 5px;
    vertical-align: middle;
    border-top: 4px solid currentColor;
    border-right: 4px solid transparent;
    border-left: 4px solid transparent;
    opacity: 0.65;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%; left: 0;
    min-width: 232px;
    margin: 0; padding: 5px 0;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-menu);
    z-index: 950;
}
.navbar-right .dropdown-menu { left: auto; right: 0; }
.open > .dropdown-menu { display: block; }

.dropdown-menu > li > a,
.dropdown-menu > li > form > button {
    display: block;
    width: 100%;
    padding: 6px 16px;
    color: var(--ink);
    font-size: 12.5px;
    text-align: left;
    background: none;
    border: 0;
    cursor: pointer;
}
.dropdown-menu > li > a:hover,
.dropdown-menu > li > form > button:hover {
    background: var(--accent-wash);
    color: var(--accent);
    text-decoration: none;
}
.dropdown-menu .divider {
    height: 1px;
    margin: 5px 0;
    background: var(--line);
}

.navbar-logout {
    font-family: inherit;
    font-size: 12.5px;
    color: var(--ink);
    padding: 6px 16px;
}

.navbar-form { margin: 0 0 0 8px; }
.navbar-form .form-control {
    width: 250px;
    height: 28px;
    background: rgba(255, 255, 255, 0.09);
    border-color: transparent;
    color: #fff;
    font-size: 12px;
}
.navbar-form .form-control::placeholder { color: var(--topbar-ink-muted); }
.navbar-form .form-control:focus {
    background: #fff;
    color: var(--ink);
    border-color: var(--accent-fill);
}

.navbar-toggle { display: none; }

@media (max-width: 992px) {
    .navbar-toggle {
        display: block;
        margin-left: auto;
        padding: 7px 9px;
        background: none;
        border: 1px solid #4a4a44;
        border-radius: var(--radius);
        cursor: pointer;
    }
    .icon-bar {
        display: block;
        width: 18px; height: 2px;
        margin: 3px 0;
        background: var(--topbar-ink);
        border-radius: 1px;
    }
    .navbar .container-fluid { flex-wrap: wrap; }
    .navbar-collapse {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        border-top: 1px solid #35352f;
        padding-bottom: 8px;
        max-height: 78vh;
        overflow-y: auto;
    }
    .navbar-collapse.in { display: flex; }
    .navbar-nav { flex-direction: column; align-items: stretch; }
    .dropdown-menu {
        position: static;
        border: 0;
        box-shadow: none;
        background: transparent;
        padding-left: 14px;
    }
    .dropdown-menu > li > a { color: var(--topbar-ink); }
    .navbar-right { margin-left: 0; }
    .navbar-form .form-control { width: 100%; }
}

/* ============================================================ page header */

.page-header {
    margin: 16px 0 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}
.page-header h2 { margin: 0; font-size: 19px; letter-spacing: -0.1px; }
.page-header .badge { vertical-align: 3px; margin-left: 6px; }

.page-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.page-actions .btn { margin: 0; }
.page-actions form { margin: 0; }
/* Inputs in the header are sized to content, not stretched to the container. */
.page-actions .form-control { width: auto; min-width: 168px; height: 28px; }

/* ============================================================ buttons */

.btn {
    display: inline-block;
    padding: 5px 12px;
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 500;
    line-height: 1.5;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--surface-hover); border-color: var(--ink-muted); text-decoration: none; color: var(--ink); }
.btn:active { transform: translateY(0.5px); }

.btn-primary {
    background: var(--accent-fill);
    border-color: var(--accent-fill);
    color: #fff;
}
.btn-primary:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-hover); color: #fff; }

.btn-danger { background: var(--critical); border-color: var(--critical); color: #fff; }
.btn-danger:hover { background: #b0272a; border-color: #b0272a; color: #fff; }

.btn-warning { background: var(--warning); border-color: #e29d0d; color: #3a2600; }
.btn-warning:hover { background: #e7a412; color: #3a2600; }

.btn-link {
    background: none;
    border-color: transparent;
    color: var(--accent);
    padding: 5px 8px;
}
.btn-link:hover { background: none; border-color: transparent; text-decoration: underline; }

.btn-xs { padding: 2px 7px; font-size: 11.5px; }
.btn-sm { padding: 3px 9px; font-size: 12px; }
.btn-block { display: block; width: 100%; text-align: center; }

.btn[disabled], .btn.disabled { opacity: 0.5; cursor: not-allowed; }

/* ============================================================ forms */

fieldset {
    margin: 0 0 18px;
    padding: 0;
    border: 0;
    border-top: 1px solid var(--line);
}
fieldset > legend {
    padding: 0 8px 0 0;
    margin: 0 0 12px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ink-secondary);
}

.form-group { margin-bottom: 12px; }

.control-label,
.checkbox > label {
    display: block;
    margin-bottom: 3px;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-secondary);
}

.form-control {
    display: block;
    width: 100%;
    height: 30px;
    padding: 4px 9px;
    font-family: inherit;
    font-size: 12.5px;
    color: var(--ink);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
}
textarea.form-control { height: auto; min-height: 62px; line-height: 1.5; }
select.form-control { padding: 3px 6px; }

.form-control:hover { border-color: var(--ink-muted); }
.form-control:focus {
    border-color: var(--accent-fill);
    box-shadow: 0 0 0 3px var(--accent-wash);
    outline: none;
}
.form-control[readonly] { background: var(--surface-sunken); color: var(--ink-secondary); }

.form-control.input-invalid,
.input-validation-error {
    border-color: var(--critical);
    background: var(--critical-wash);
}

.checkbox { margin: 20px 0 12px; }
.checkbox > label,
.checkbox-inline {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    cursor: pointer;
}
.checkbox-inline { display: inline-flex; margin-right: 14px; font-size: 12px; }
.checkbox input[type="checkbox"],
.checkbox-inline input[type="checkbox"] {
    width: 14px; height: 14px;
    margin: 0;
    accent-color: var(--accent-fill);
    cursor: pointer;
}

.help-block {
    margin: 4px 0 0;
    font-size: 11.5px;
    color: var(--ink-muted);
}

.field-validation-error,
.text-danger {
    display: block;
    margin-top: 3px;
    font-size: 11.5px;
    font-weight: 500;
    color: var(--critical-ink);
}

.form-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.form-inline .form-group { margin: 0; display: flex; align-items: center; gap: 6px; }
.form-inline .control-label { margin: 0; white-space: nowrap; }

.form-actions {
    margin: 20px 0 34px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 8px;
    align-items: center;
}
.form-actions .pull-right { margin-left: auto; float: none; }

.filter-bar {
    margin-bottom: 14px;
    padding: 9px 11px;
    background: var(--surface-sunken);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}
.filter-bar .form-control { min-width: 190px; height: 28px; }

/* ============================================================ tables */

.table-responsive {
    width: 100%;
    overflow-x: auto;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.table {
    width: 100%;
    margin: 0;
    border-collapse: collapse;
    font-size: 12.5px;
    background: var(--surface);
}
.table > thead > tr > th {
    /* Deliberately not position:sticky. .table-responsive sets overflow-x:auto,
       which makes it the containing block for sticky, so the header anchors to
       the scroll box instead of the viewport and paints over the first row.
       Lists are paginated (50 rows by default), so the header stays reachable. */
    padding: 8px 10px;
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ink-secondary);
    background: var(--surface-sunken);
    border-bottom: 1px solid var(--line-strong);
    white-space: nowrap;
}
.table > tbody > tr > td {
    padding: 7px 10px;
    border-top: 1px solid var(--line);
    vertical-align: top;
}
.table > tbody > tr > td.text-right,
.table > thead > tr > th.text-right { text-align: right; font-variant-numeric: tabular-nums; }

.table-condensed > tbody > tr > td { padding: 5px 10px; }
.table-condensed > thead > tr > th { padding: 6px 10px; }

.table-striped > tbody > tr:nth-child(even) > td { background: rgba(137, 135, 129, 0.05); }
.table-hover > tbody > tr:hover > td { background: var(--accent-wash); }

.table > tbody > tr.danger  > td { background: var(--critical-wash); }
.table > tbody > tr.warning > td { background: var(--warning-wash); }

.table[data-sortable] > thead > tr > th { cursor: pointer; user-select: none; }
.table[data-sortable] > thead > tr > th:hover { color: var(--accent); }

td.row-actions, th.row-actions {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}
td.row-actions .btn { margin-left: 3px; }

/* ============================================================ panels */

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    margin-bottom: 16px;
    overflow: hidden;
}
.panel-heading {
    padding: 9px 13px;
    background: var(--surface-sunken);
    border-bottom: 1px solid var(--line);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: var(--ink-secondary);
}
.panel-body { padding: 13px; }
.panel-footer {
    padding: 8px 13px;
    background: var(--surface-sunken);
    border-top: 1px solid var(--line);
    font-size: 12px;
}
.panel .table { border: 0; }
.panel .table-responsive { border: 0; border-radius: 0; }

.dashboard-panel { margin-bottom: 16px; }

/* ============================================================ details */

.details-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 16px 18px 4px;
}
.details-panel fieldset:last-of-type { margin-bottom: 8px; }

.dl-horizontal { margin: 0 0 4px; }
.dl-horizontal dt {
    float: left;
    clear: left;
    width: 218px;
    padding: 4px 12px 4px 0;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ink-muted);
    text-align: left;
    white-space: normal;
}
.dl-horizontal dd {
    margin-left: 218px;
    padding: 4px 0;
    min-height: 22px;
    border-bottom: 1px solid var(--line);
    word-break: break-word;
}
.dl-horizontal::after { content: ""; display: table; clear: both; }

@media (max-width: 640px) {
    .dl-horizontal dt { float: none; width: auto; padding-bottom: 0; }
    .dl-horizontal dd { margin-left: 0; }
}

/* ============================================================ stat tiles */

.stat-tile {
    display: block;
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent-fill);
    border-radius: var(--radius-lg);
    padding: 11px 14px;
    margin-bottom: 14px;
    color: inherit;
    text-decoration: none;
    transition: border-color .12s ease, box-shadow .12s ease;
}
a.stat-tile:hover {
    text-decoration: none;
    color: inherit;
    box-shadow: 0 1px 6px rgba(11, 11, 11, 0.09);
    border-color: var(--line-strong);
}

/* Label first, value second: the tile reads as a sentence, not a mystery number. */
.stat-tile .stat-label {
    display: block;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin-bottom: 3px;
}
/* Proportional figures: tabular-nums makes large numbers look loose. */
.stat-tile .stat-value {
    display: block;
    font-size: 27px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.6px;
    color: var(--ink);
}
.stat-tile .stat-sub {
    display: block;
    margin-top: 3px;
    font-size: 11.5px;
    color: var(--ink-muted);
}

.stat-tile.tile-ok     { border-left-color: var(--good); }
.stat-tile.tile-warn   { border-left-color: var(--warning); }
.stat-tile.tile-danger { border-left-color: var(--critical); }
.stat-tile.tile-muted  { border-left-color: var(--line-strong); }

.stat-tile.tile-danger .stat-value { color: var(--critical-ink); }
.stat-tile.tile-warn   .stat-value { color: var(--warning-ink); }

/* ============================================================ meters */

.meter {
    position: relative;
    height: 8px;
    min-width: 90px;
    background: var(--accent-track);      /* track = lighter step of the fill ramp */
    border-radius: 999px;
    overflow: hidden;
}
.meter > span {
    display: block;
    height: 100%;
    background: var(--accent-fill);
    border-radius: 999px;
}
.meter.warning { background: var(--warning-wash); }
.meter.warning > span { background: var(--warning); }
.meter.danger { background: var(--critical-wash); }
.meter.danger > span { background: var(--critical); }

.meter-label {
    font-size: 11px;
    color: var(--ink-secondary);
    font-variant-numeric: tabular-nums;
}

/* ============================================================ status text

   Always rendered next to the written state ("Healthy", "Overdue"), never as a
   bare colour swatch — the saturated fills do not carry meaning on their own. */

.health-ok, .health-Healthy {
    color: var(--good-ink);
    font-weight: 600;
}
.health-warn, .health-Late {
    color: var(--warning-ink);
    font-weight: 600;
}
.health-danger,
.health-Overdue,
.health-Lastrunfailed,
.health-Neversucceeded {
    color: var(--critical-ink);
    font-weight: 600;
}
.health-Disabled { color: var(--ink-muted); }

/* ============================================================ alerts */

.alert {
    position: relative;
    padding: 10px 34px 10px 13px;
    margin-bottom: 14px;
    border: 1px solid transparent;
    border-left-width: 3px;
    border-radius: var(--radius-lg);
    font-size: 12.5px;
}
.alert strong { font-weight: 600; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }

.alert-success { background: var(--good-wash);     border-color: var(--line); border-left-color: var(--good);     color: var(--ink); }
.alert-info    { background: var(--accent-wash);   border-color: var(--line); border-left-color: var(--accent-fill); color: var(--ink); }
.alert-warning { background: var(--warning-wash);  border-color: var(--line); border-left-color: var(--warning);  color: var(--ink); }
.alert-danger  { background: var(--critical-wash); border-color: var(--line); border-left-color: var(--critical); color: var(--ink); }

.close {
    position: absolute;
    top: 6px; right: 9px;
    padding: 0 4px;
    font-size: 18px;
    line-height: 1;
    color: var(--ink-muted);
    background: none;
    border: 0;
    cursor: pointer;
}
.close:hover { color: var(--ink); }

/* ============================================================ labels */

.label {
    display: inline-block;
    padding: 2px 7px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    line-height: 1.5;
    border-radius: 999px;
    white-space: nowrap;
}
.label-default { background: var(--surface-sunken); color: var(--ink-secondary); border: 1px solid var(--line-strong); }
.label-warning { background: var(--warning);  color: #3a2600; }
.label-danger  { background: var(--critical); color: #fff; }

.badge {
    display: inline-block;
    min-width: 20px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    text-align: center;
    color: var(--ink-secondary);
    background: var(--surface-sunken);
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    font-variant-numeric: tabular-nums;
}

/* ============================================================ change log */

.change-history td { font-size: 12px; }
.change-history .old-value {
    color: var(--critical-ink);
    text-decoration: line-through;
    text-decoration-thickness: 1px;
}
.change-history .new-value { color: var(--good-ink); font-weight: 600; }
.change-history .arrow { color: var(--ink-muted); padding: 0 4px; }

/* ============================================================ pagination */

.pager-bar { margin: 12px 0 30px; }

.pagination {
    display: inline-flex;
    list-style: none;
    margin: 0; padding: 0;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
}
.pagination > li + li { border-left: 1px solid var(--line); }
.pagination > li > a {
    display: block;
    padding: 5px 11px;
    font-size: 12px;
    color: var(--accent);
}
.pagination > li > a:hover { background: var(--accent-wash); text-decoration: none; }
.pagination > li.disabled > a {
    color: var(--ink-muted);
    pointer-events: none;
    background: var(--surface-sunken);
}
.pagination-sm > li > a { padding: 3px 9px; font-size: 11.5px; }

/* ============================================================ misc */

.app-footer {
    margin-top: 26px;
    padding: 9px 0;
    border-top: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink-muted);
    font-size: 11.5px;
}
.app-footer .container-fluid { max-width: 1900px; margin: 0 auto; }

.login-panel { max-width: 372px; margin: 7vh auto 0; }
.login-panel .panel-heading { font-size: 13px; text-align: center; }
.login-panel .panel-body { padding: 18px; }
.login-panel .form-group { margin-bottom: 14px; }

.import-issues { max-height: 340px; overflow-y: auto; border-radius: var(--radius-lg); }

/* ============================================================ print */

@media print {
    body { padding-top: 0; background: #fff; font-size: 11px; }
    .navbar, .app-footer, .filter-bar, .page-actions, .row-actions, .pager-bar { display: none !important; }
    .table-responsive, .panel, .details-panel, .stat-tile { border-color: #999; break-inside: avoid; }
    a { color: #000; text-decoration: none; }
}
