/* Root variables */
:root {
    color-scheme: light;
    --brand: #c8102e;
    --brand-dark: #a90e28;
    --navy: #1a1f25;
    --navy-soft: #262c33;
    --navy-raised: #333941;
    --surface: #ffffff;
    --canvas: #f3f5f7;
    --text: #151d2a;
    --muted: #63707d;
    --border: #e1e5e9;
    --success: #166534;
    --success-bg: #dcfce7;
    --warning: #92400e;
    --warning-bg: #fef3c7;
    --error: #b91c1c;
    --error-bg: #fee2e2;
    --radius: 10px;
    --shadow: 0 8px 24px rgba(25, 39, 55, 0.045), 0 1px 2px rgba(25, 39, 55, 0.04);
    --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* Base / global */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; }
body {
    margin: 0;
    background: var(--canvas);
    color: var(--text);
    font-family: "Segoe UI Variable Text", "Aptos", "Segoe UI", -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.5;
    font-optical-sizing: auto;
    text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: 0.58; }
a { color: #1555a0; }
:focus-visible { outline: 2px solid #a42d3b; outline-offset: 2px; }
/* Login */
.login-view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow: hidden;
    background:
        radial-gradient(circle at 12% 18%, rgba(0, 120, 212, 0.1), transparent 32%),
        radial-gradient(circle at 88% 84%, rgba(215, 25, 32, 0.08), transparent 28%),
        #e7ebef;
}
.login-shell {
    display: flex;
    width: min(2172px, 100%);
    height: min(941px, calc(100vh - 48px));
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 18px;
    background: #dfe3e2;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.16);
}
.login-visual {
    flex: 1 1 auto;
    min-width: 0;
    background: #dfe3e2 url("./assets/401-login-background.png") center / auto 100% no-repeat;
}
.login-panel {
    position: relative;
    display: flex;
    flex: 0 0 500px;
    min-width: 500px;
    align-items: center;
    justify-content: center;
    padding: 56px 50px;
    background:
        radial-gradient(circle at 100% 0, rgba(0, 120, 212, 0.14), transparent 34%),
        radial-gradient(circle at 0 100%, rgba(215, 25, 32, 0.07), transparent 30%),
        rgba(247, 249, 252, 0.8);
    box-shadow: -18px 0 52px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(24px) saturate(128%);
    -webkit-backdrop-filter: blur(24px) saturate(128%);
}
.login-panel::before {
    position: absolute;
    z-index: 0;
    top: 0;
    bottom: 0;
    left: -96px;
    width: 96px;
    background: linear-gradient(to right, rgba(247, 249, 252, 0), rgba(247, 249, 252, 0.38) 48%, rgba(247, 249, 252, 0.8));
    content: "";
    pointer-events: none;
}
.login-panel::after {
    position: absolute;
    z-index: 0;
    inset: 0;
    background-image:
        linear-gradient(rgba(71, 85, 105, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(71, 85, 105, 0.04) 1px, transparent 1px);
    background-size: 32px 32px;
    content: "";
    pointer-events: none;
    mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 82%);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, 0.55) 45%, transparent 82%);
}
.login-card {
    position: relative;
    z-index: 1;
    width: min(400px, 100%);
    color: #162033;
}
.login-heading {
    margin: 0;
    color: #101828;
    font-family: "Segoe UI Variable Display", Aptos, "Segoe UI", Arial, sans-serif;
    font-size: clamp(36px, 2.2vw, 42px);
    font-weight: 730;
    line-height: 1.04;
    letter-spacing: -0.045em;
}
.login-subtitle {
    margin: 18px 0 36px;
    color: #4f6074;
    font-size: 16px;
    line-height: 1.5;
}
.login-button {
    position: relative;
    display: grid;
    grid-template-columns: 22px 1fr 20px;
    align-items: center;
    width: 100%;
    min-height: 56px;
    padding: 0 17px;
    border: 1px solid rgba(96, 109, 128, 0.42);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.09);
    color: #182230;
    font-weight: 650;
    letter-spacing: -0.01em;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.login-button:hover {
    border-color: #0078d4;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 6px 18px rgba(0, 120, 212, 0.15);
    transform: translateY(-1px);
}
.login-button:focus-visible { outline-color: rgba(0, 120, 212, 0.55); }
.login-button:active { transform: translateY(0); }
.microsoft-mark { display: grid; width: 18px; height: 18px; grid-template-columns: repeat(2, 1fr); gap: 2px; }
.microsoft-mark span:nth-child(1) { background: #f25022; }
.microsoft-mark span:nth-child(2) { background: #7fba00; }
.microsoft-mark span:nth-child(3) { background: #00a4ef; }
.microsoft-mark span:nth-child(4) { background: #ffb900; }
.login-button-arrow { width: 19px; fill: none; stroke: #667085; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.login-notice { min-height: 20px; margin: 14px 0 0; color: var(--error); font-size: 0.82rem; line-height: 1.45; }
.login-notice:empty { display: none; }
.login-system-label {
    position: absolute;
    z-index: 1;
    right: 50px;
    bottom: 34px;
    left: 50px;
    margin: 0;
    padding-top: 18px;
    border-top: 1px solid #dfe4ea;
    color: #667085;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
@media (max-width: 1672px) {
    .login-view { padding: 20px; }
    .login-shell { position: relative; height: min(941px, calc(100vh - 40px)); align-items: center; justify-content: flex-end; }
    .login-visual { position: absolute; inset: 0; max-width: none; background-size: cover; opacity: 0.94; }
    .login-panel {
        flex: 0 0 auto;
        width: min(440px, calc(100vw - 80px));
        min-width: 0;
        min-height: 380px;
        margin: 32px;
        padding: 44px 38px;
        border: 1px solid rgba(255, 255, 255, 0.72);
        border-radius: 18px;
        background: radial-gradient(circle at 100% 0, rgba(0, 120, 212, 0.13), transparent 38%), rgba(247, 249, 252, 0.84);
        box-shadow: 0 20px 60px rgba(15, 23, 42, 0.17);
        transform: translateY(clamp(72px, 10vh, 96px));
        backdrop-filter: blur(16px) saturate(115%);
        -webkit-backdrop-filter: blur(16px) saturate(115%);
    }
    .login-panel::before { display: none; }
    .login-system-label { right: 38px; bottom: 24px; left: 38px; }
}
@media (max-width: 760px) {
    .login-view { padding: 12px; }
    .login-shell { height: calc(100vh - 24px); justify-content: center; }
    .login-panel {
        width: calc(100% - 32px);
        min-height: auto;
        margin: 16px;
        padding: 34px 26px;
        background: radial-gradient(circle at 100% 0, rgba(0, 120, 212, 0.11), transparent 42%), rgba(247, 249, 252, 0.9);
        transform: none;
    }
    .login-heading { font-size: 32px; }
    .login-system-label { right: 26px; bottom: 18px; left: 26px; }
}

/* Application shell */
.app-view { display: flex; min-height: 100vh; }
.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { display: block; width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.application { min-width: 0; flex: 1; }

/* Sidebar */
.sidebar { position: sticky; top: 0; width: 252px; height: 100vh; flex: 0 0 252px; display: flex; flex-direction: column; overflow: hidden; background: var(--navy); color: #f8fafc; }
.sidebar::before { position: absolute; right: 0; bottom: 0; left: 0; height: 38%; background: linear-gradient(145deg, transparent 39%, rgba(144,158,174,0.07) 40% 41%, transparent 42%), repeating-linear-gradient(90deg, transparent 0 29px, rgba(144,158,174,0.045) 30px 31px), linear-gradient(to bottom, transparent, #303942); opacity: 0.7; content: ''; pointer-events: none; }
.sidebar > * { position: relative; z-index: 1; }
.sidebar-brand { display: grid; gap: 18px; padding: 27px 24px 28px; font-size: 0.9rem; font-weight: 650; letter-spacing: -0.01em; }
.sidebar-brand img { display: block; width: 182px; max-width: 100%; height: auto; }
.sidebar-brand small { display: block; margin-top: 3px; color: #a8b2bc; font-size: 0.72rem; font-weight: 450; letter-spacing: 0.01em; }
.side-nav { display: grid; align-content: start; gap: 4px; padding: 4px 12px 20px; }
.side-nav a { display: flex; align-items: center; gap: 17px; min-height: 47px; border-radius: 8px; padding: 10px 14px; color: #d9e0e7; font-size: 0.87rem; font-weight: 540; text-decoration: none; transition: background 150ms var(--ease), color 150ms var(--ease); }
.side-nav a .icon { width: 21px; height: 21px; }
.side-nav a:hover { color: #fff; background: rgba(255,255,255,0.075); }
.side-nav a[aria-current="page"] { color: #fff; background: linear-gradient(90deg, rgba(200,16,46,0.28), rgba(255,255,255,0.08)); box-shadow: inset 3px 0 0 var(--brand); font-weight: 650; }
.side-nav a[aria-current="page"] .icon { color: #f04b60; }
.side-nav a:focus-visible { outline-color: #fff; outline-offset: -3px; }
.sidebar-footer { display: flex; align-items: center; gap: 10px; margin-top: auto; padding: 19px 23px 23px; border-top: 1px solid rgba(255,255,255,0.09); color: #c0c8d0; font-size: 0.73rem; font-weight: 550; }
.production-dot { flex: 0 0 auto; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #c1c9d0; }

/* Topbar */
.topbar { min-height: 58px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px clamp(28px, 3vw, 42px); border-bottom: 1px solid var(--border); background: var(--surface); }
.topbar-context { color: #566477; font-size: 0.75rem; font-weight: 500; }
.topbar-context span { margin: 0 8px; color: #a8b1b9; }
.topbar-context strong { color: #263448; font-weight: 650; }
.header-auth { display: flex; align-items: center; gap: 12px; min-width: 0; }
.user-avatar { flex: 0 0 auto; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #1c2530; color: #fff; font-size: 0.69rem; font-weight: 700; }
.signed-in-user { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.84rem; font-weight: 600; }
.sign-out-button { margin-left: 7px; }

/* Main content */
.main-content { width: 100%; min-width: 0; max-width: 1600px; margin: 0 auto; padding: 28px clamp(28px, 3vw, 42px) 64px; }
.page-heading { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 130px; margin: -28px calc(-1 * clamp(28px, 3vw, 42px)) 22px; padding: 27px clamp(28px, 3vw, 42px); overflow: hidden; background: radial-gradient(circle at 73% 12%, rgba(180,190,202,0.2) 0 2px, transparent 3px), radial-gradient(ellipse at 74% 23%, rgba(215,222,229,0.38), transparent 40%), linear-gradient(110deg, #fafbfc, #f4f6f8); background-size: 48px 48px, auto, auto; }
.page-heading > * { position: relative; z-index: 1; }
.page-eyebrow { margin: 0 0 5px; color: #ac0e29; font-size: 0.67rem; font-weight: 760; letter-spacing: 0.11em; text-transform: uppercase; }
.page-heading h1 { margin: 0; font-family: "Segoe UI Variable Display", "Segoe UI", sans-serif; font-size: clamp(2rem, 2.65vw, 2.75rem); font-weight: 730; line-height: 1.13; letter-spacing: -0.045em; }
.page-description { margin: 7px 0 0; color: #596b83; font-size: 0.88rem; }
.heading-tagline { display: grid; gap: 2px; min-width: 155px; padding: 12px 0 12px 27px; border-left: 1px solid var(--brand); color: #41516a; font-size: 0.67rem; font-weight: 660; letter-spacing: 0.23em; line-height: 1.3; text-transform: uppercase; }
.heading-tagline::after { display: block; width: 37px; height: 2px; margin-top: 11px; background: var(--brand); content: ''; }

/* Buttons and notices */
.button { min-height: 38px; border: 1px solid transparent; border-radius: 7px; padding: 8px 14px; font-size: 0.82rem; font-weight: 620; line-height: 1.3; transition: background 150ms var(--ease), border-color 150ms var(--ease); }
.button-primary { background: var(--brand); color: #fff; }
.button-primary:hover:not(:disabled) { background: var(--brand-dark); }
.button-secondary { border-color: #d5dbe0; background: #fff; color: #3d4955; }
.button-secondary:hover:not(:disabled) { border-color: #b8c2cb; background: #f6f7f8; }
.button-danger { color: #a92935; }
.button-danger:hover:not(:disabled) { border-color: #eac5c8; background: #fff7f7; }
.button:active:not(:disabled) { filter: brightness(0.95); }
#notice { margin: 0; }
#notice:empty { display: none; }
#notice:not(:empty) { margin: 0 0 20px; border-radius: 8px; padding: 11px 14px; font-size: 0.84rem; }
#notice.status { border: 1px solid #bbebcd; background: #effbf3; color: var(--success); }
#notice.error { border: 1px solid #fecaca; background: #fef2f2; color: var(--error); }
.error { color: var(--error); font-size: 0.85rem; font-weight: 600; }

/* Dashboard */
.dashboard-layout { display: grid; gap: 16px; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.card, .overview-panel, .quick-panel { min-width: 0; border: 1px solid #e7eaee; border-radius: 11px; background: var(--surface); box-shadow: var(--shadow); }
.card { display: flex; align-items: center; gap: 15px; min-height: 126px; padding: 18px; }
.card-icon, .panel-icon { display: grid; place-items: center; flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%; background: #fae9ec; color: var(--brand); }
.card-icon .icon { width: 23px; height: 23px; stroke-width: 2.1; }
.card-copy { min-width: 0; }
.card h2 { margin: 0 0 6px; font-size: 0.79rem; font-weight: 700; }
.card strong { display: block; color: var(--text); font-size: 2rem; font-weight: 730; line-height: 1; letter-spacing: -0.05em; }
.card p { margin: 6px 0 0; color: #63748b; font-size: 0.72rem; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2.1fr) minmax(310px, 1fr); align-items: stretch; gap: 14px; }
.overview-panel, .quick-panel { padding: 18px; }
.overview-panel { display: flex; flex-direction: column; justify-content: space-between; }
.panel-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 17px; }
.panel-icon { width: 44px; height: 44px; }
.panel-icon .icon { width: 22px; height: 22px; }
.panel-heading h2 { margin: 0; font-size: 1.06rem; font-weight: 720; letter-spacing: -0.025em; }
.panel-heading p { margin: 3px 0 0; color: #63748b; font-size: 0.77rem; }
.overview-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.overview-stat { display: flex; align-items: center; gap: 9px; min-width: 0; min-height: 104px; border: 1px solid #e7ebef; border-radius: 8px; padding: 11px; }
.stat-icon { display: grid; place-items: center; flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; background: #edf1f5; color: #46576c; }
.stat-icon .icon { width: 17px; height: 17px; }
.stat-copy { min-width: 0; }
.stat-label { display: block; color: #344459; font-size: 0.7rem; font-weight: 700; line-height: 1.25; }
.stat-copy strong { display: block; margin-top: 7px; font-size: 1.56rem; font-weight: 730; line-height: 1; }
.stat-copy small { display: block; margin-top: 3px; color: #6b7b91; font-size: 0.68rem; }
.stat-ring { --ring-color: #138360; position: relative; display: grid; place-items: center; flex: 0 0 auto; width: 55px; height: 55px; margin-left: auto; border-radius: 50%; background: conic-gradient(var(--ring-color) var(--ring-progress), #e9edf1 0); color: #263347; font-size: 0.71rem; font-weight: 750; }
.stat-ring::before { position: absolute; inset: 6px; border-radius: 50%; background: #fff; content: ''; }
.stat-ring span { position: relative; }
.stat-disabled .stat-icon { background: #fae9ec; color: var(--brand); }
.stat-disabled .stat-ring { --ring-color: var(--brand); }
.configuration-note { display: flex; align-items: center; gap: 10px; min-height: 52px; margin-top: 13px; border-radius: 7px; padding: 10px 13px; background: #f8f2f3; color: #713c47; font-size: 0.77rem; }
.configuration-note .icon { width: 17px; height: 17px; color: var(--brand); }
.configuration-note a { margin-left: auto; color: #a50d27; font-weight: 700; white-space: nowrap; text-decoration: none; }
.configuration-note a:hover { text-decoration: underline; }
.configuration-note.configuration-clear { background: #edf7f1; color: #166340; }
.configuration-clear .icon, .configuration-clear a { color: #166340; }
.configuration-note.configuration-unknown { background: #f1f3f5; color: #526173; }
.configuration-unknown .icon, .configuration-unknown a { color: #526173; }
.quick-links { display: grid; gap: 8px; }
.quick-action { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; border: 1px solid #dbe2e9; border-radius: 7px; padding: 9px 13px; background: #fff; color: #25364c; font-size: 0.79rem; font-weight: 650; text-align: left; text-decoration: none; transition: border-color 150ms var(--ease), background 150ms var(--ease), color 150ms var(--ease); }
.quick-action:hover { border-color: #aebac7; background: #f8fafb; }
.quick-action .icon { width: 19px; height: 19px; }
.quick-action .icon:last-child { width: 15px; height: 15px; margin-left: auto; }
.quick-action.quick-primary { border-color: var(--brand); background: var(--brand); color: #fff; }
.quick-action.quick-primary:hover { background: var(--brand-dark); }

/* Toolbar and forms */
#toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin: 0 0 16px; }
#toolbar .button-primary { margin-left: auto; }
#toolbar span { color: var(--muted); font-size: 0.8rem; }
input, select, textarea { min-height: 38px; max-width: 100%; border: 1px solid #ccd4db; border-radius: 7px; padding: 8px 11px; background: #fff; color: var(--text); }
input, select, textarea { font-weight: 400; }
textarea { min-height: 92px; resize: vertical; }
input::placeholder { color: #718096; }
input:hover, select:hover, textarea:hover { border-color: #94a3b8; }
input:focus, select:focus, textarea:focus { border-color: #697c91; }
input[type="checkbox"] { accent-color: var(--brand); }
.search-field { position: relative; min-width: 260px; }
.search-field .icon { position: absolute; top: 50%; left: 12px; width: 16px; height: 16px; color: #718097; transform: translateY(-50%); pointer-events: none; }
#search { min-width: 260px; padding-left: 38px; }
#fields { display: grid; gap: 15px; }
#fields label, #ipForm label { display: grid; gap: 6px; color: #3e4a56; font-size: 0.81rem; font-weight: 650; }
#fields .checkbox-field { display: flex; align-items: center; flex-direction: row-reverse; justify-content: flex-end; gap: 10px; }
#fields input[type="checkbox"] { justify-self: start; width: 20px; height: 20px; }
.hint { color: var(--muted); font-size: 0.84rem; }

/* Tables */
.list-panel { overflow: hidden; border: 1px solid #e3e8ed; border-radius: 10px; background: #fff; box-shadow: var(--shadow); }
.list-panel-heading { display: flex; align-items: center; gap: 12px; min-height: 73px; padding: 14px 17px; }
.list-panel-heading .panel-icon { width: 39px; height: 39px; }
.list-panel-heading .panel-icon .icon { width: 20px; height: 20px; }
.list-panel-heading h2 { margin: 0; font-size: 0.95rem; font-weight: 720; }
.list-panel-heading p { margin: 2px 0 0; color: #6c7a8d; font-size: 0.73rem; }
.list-panel .table-wrap { border: 0; border-top: 1px solid #e7ebef; border-radius: 0; box-shadow: none; }
.table-wrap { width: 100%; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: var(--surface); font-size: 0.81rem; }
#results table { min-width: 940px; }
#results table.is-empty { min-width: 0; }
#results .data-table-sites { min-width: 720px; }
#results .data-table-printers { min-width: 1100px; }
#results .data-table-clients { min-width: 850px; }
th, td { padding: 11px 15px; border-bottom: 1px solid #edf0f2; text-align: left; vertical-align: middle; }
th { background: #f8f9fa; color: #64717e; font-size: 0.69rem; font-weight: 700; letter-spacing: 0.035em; text-transform: uppercase; white-space: nowrap; }
td { max-width: 340px; overflow-wrap: anywhere; }
tbody tr:hover { background: #fafbfc; }
tbody tr:last-child td { border-bottom: 0; }
td a { color: #283a4f; font-weight: 650; text-decoration: none; }
td a:hover { text-decoration: underline; }
.data-table td:first-child { font-weight: 610; }
.data-table-printers td:nth-child(-n+5) { white-space: nowrap; }
.data-table-printers td:nth-child(3), .data-table-clients td:nth-child(4), .data-table-drivers td:nth-child(4), .data-table-logs td:first-child, #ipResults td:first-child { font-family: Consolas, "Cascadia Code", monospace; font-size: 0.77rem; }
.data-table td:last-child { min-width: 115px; }
.data-table-printers td:last-child, .data-table-sites td:last-child { min-width: 175px; }
.empty-cell { padding: 0; }
.data-table td.empty-cell { font-family: inherit; font-size: inherit; font-weight: normal; }
#ipResults td.empty-cell { padding: 24px 15px; color: var(--muted); font-family: inherit; font-size: 0.8rem; font-weight: normal; text-align: center; }
.empty-state { padding: 42px 24px; text-align: center; }
.empty-state strong { display: block; font-size: 0.88rem; font-weight: 650; }
.empty-state p { margin: 5px 0 0; color: var(--muted); font-size: 0.8rem; }
.loading-state { display: flex; align-items: center; gap: 11px; min-height: 135px; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; background: #fff; color: var(--muted); font-size: 0.84rem; }
.loading-spinner { width: 17px; height: 17px; border: 2px solid #d9dfe4; border-top-color: var(--brand); border-radius: 50%; animation: spin 800ms linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Badges and actions */
.badge, .result-label { display: inline-flex; align-items: center; gap: 6px; border-radius: 6px; padding: 3px 7px; font-size: 0.7rem; font-weight: 650; white-space: nowrap; }
.badge::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.badge-enabled { background: #eaf5ed; color: var(--success); }
.badge-disabled { background: #f1f2f3; color: #58636e; }
.result-success { background: #eaf5ed; color: var(--success); }
.result-warning { background: var(--warning-bg); color: var(--warning); }
.result-error { background: #fceced; color: var(--error); }
.result-neutral { background: #f1f2f3; color: #485663; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.actions .button { min-height: 30px; padding: 5px 9px; white-space: nowrap; font-size: 0.72rem; }

/* Dialogs */
dialog { width: min(580px, calc(100% - 32px)); max-height: min(90vh, 850px); overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; padding: 27px; background: var(--surface); color: var(--text); box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22); }
dialog::backdrop { background: rgba(19, 25, 31, 0.62); }
dialog[open] { animation: enter 180ms var(--ease) both; }
dialog h2 { margin: 0 0 20px; font-size: 1.19rem; font-weight: 680; letter-spacing: -0.025em; }
dialog .hint { margin-top: -8px; }
.form-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin-top: 23px; padding-top: 17px; border-top: 1px solid var(--border); }
#editDialog .form-actions { position: sticky; z-index: 1; bottom: -27px; margin-right: -27px; margin-left: -27px; padding: 17px 27px 0; background: var(--surface); }
#formError:empty, #ipError:empty { display: none; }
#ipForm { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
#ipForm label { flex: 1 1 230px; }
#ipForm input { width: 100%; }
#ipResults .table-wrap { margin-top: 16px; box-shadow: none; }

/* Motion */
#results > * { animation: enter 160ms var(--ease) both; }
@keyframes enter {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive rules */
@media (max-width: 1050px) {
    .sidebar { width: 205px; flex-basis: 205px; }
    .sidebar-brand { padding-inline: 19px; }
    .side-nav { padding-inline: 9px; }
    .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1250px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .app-view { display: block; }
    .sidebar { position: static; width: 100%; height: auto; display: block; }
    .sidebar::before { display: none; }
    .sidebar-brand { display: flex; align-items: center; gap: 16px; padding: 15px 20px; }
    .sidebar-brand img { width: 125px; }
    .sidebar-brand small { display: none; }
    .side-nav { display: flex; overflow-x: auto; gap: 3px; padding: 8px 12px 12px; }
    .side-nav::-webkit-scrollbar { height: 5px; }
    .side-nav::-webkit-scrollbar-thumb { border-radius: 5px; background: #68727f; }
    .side-nav a { flex: 0 0 auto; gap: 7px; min-height: 38px; padding: 8px 11px; }
    .side-nav a .icon { width: 17px; height: 17px; }
    .sidebar-footer { display: none; }
    .topbar { padding: 12px 20px; }
    .topbar-context { display: none; }
    .main-content { padding: 24px 20px; }
    .page-heading { min-height: 120px; margin: -24px -20px 22px; padding: 24px 20px; }
    .heading-tagline { display: none; }
    .overview-stats { grid-template-columns: 1fr; }
    .overview-stat { min-height: 76px; }
}
@media (max-width: 500px) {
    .header-auth { width: 100%; }
    .signed-in-user { flex: 1; }
    .cards { grid-template-columns: 1fr 1fr; gap: 9px; }
    .card { display: block; padding: 15px; }
    .card-icon { width: 38px; height: 38px; margin-bottom: 10px; }
    .card-icon .icon { width: 19px; height: 19px; }
    .card strong { font-size: 1.5rem; }
    .page-heading h1 { font-size: 2rem; }
    .configuration-note { align-items: flex-start; flex-wrap: wrap; }
    .configuration-note a { margin-left: 27px; }
    .search-field, #search { width: 100%; }
    #toolbar .button-primary { margin-left: 0; }
    dialog { padding: 20px; }
    #editDialog .form-actions { bottom: -20px; margin-right: -20px; margin-left: -20px; padding-right: 20px; padding-left: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}
