:root {
    --brand-dark: #173965;
    --brand-accent: #245486;
    --brand-yellow: #ffe40a;
    --brand-yellow-soft: #fff6c4;
    --page-bg: #eaf1f8;
    --surface: #ffffff;
    --surface-soft: #f4f8fd;
    --text-main: #10233f;
    --text-soft: #6f7f96;
    --line-soft: rgba(23, 57, 101, 0.13);
    --shadow-soft: 0 14px 44px rgba(23, 57, 101, 0.08);
    --success: #047857;
    --success-bg: #d1fae5;
    --danger: #b91c1c;
    --danger-bg: #fee2e2;
    --warning: #b7791f;
    --warning-bg: #fff4c4;
    font-family: "Segoe UI", Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--text-main);
    background:
        radial-gradient(circle at top right, rgba(255, 228, 10, 0.18), transparent 34rem),
        linear-gradient(135deg, #f8fbff 0%, var(--page-bg) 100%);
}

a {
    color: inherit;
}

.hq-page-shell {
    width: min(1440px, calc(100% - 1.6rem));
    margin: 0 auto;
    padding: 0.85rem 0 2rem;
}

.hq-dashboard-header {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(23, 57, 101, 0.12);
    border-radius: 18px;
    background:
        radial-gradient(circle at right center, rgba(255, 228, 10, 0.18), transparent 26rem),
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 255, 0.94));
    box-shadow: var(--shadow-soft);
}

.hq-dashboard-header::after {
    content: "";
    position: absolute;
    right: -6rem;
    top: -7rem;
    width: 18rem;
    height: 18rem;
    border-radius: 50%;
    background: rgba(255, 228, 10, 0.12);
    pointer-events: none;
}

.hq-main-header-bar {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(10rem, 1fr) minmax(18rem, auto) minmax(10rem, 1fr);
    gap: 1rem;
    align-items: center;
    padding: 1rem 1.15rem 0.85rem;
}

.hq-brand-slot {
    display: flex;
    align-items: center;
    min-width: 0;
}

.hq-logo {
    width: auto;
    max-width: 148px;
    max-height: 44px;
    object-fit: contain;
    object-position: left center;
}

.hq-title-slot {
    min-width: 0;
    text-align: center;
}

.hq-eyebrow {
    margin: 0 0 0.24rem;
    color: var(--brand-dark);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.hq-title-slot h1,
.hq-login-brand h1 {
    margin: 0;
    color: var(--brand-dark);
    font-size: clamp(1.65rem, 3vw, 2.2rem);
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.hq-subtitle {
    margin: 0.22rem 0 0;
    color: var(--text-soft);
    font-size: 0.9rem;
    line-height: 1.35;
}

.hq-actions-slot,
.topbar-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.hq-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.15rem;
    padding: 0.46rem 0.78rem;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 900;
    text-decoration: none;
    transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.hq-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 9px 18px rgba(23, 57, 101, 0.13);
}

.hq-button-primary {
    background: linear-gradient(135deg, var(--brand-dark), var(--brand-accent));
    color: #ffffff;
}

.hq-button-light {
    border-color: rgba(23, 57, 101, 0.14);
    background: rgba(255, 255, 255, 0.94);
    color: var(--brand-dark);
}

.hq-button-small {
    min-height: 1.82rem;
    padding: 0.34rem 0.58rem;
    font-size: 0.74rem;
}

.hq-status-strip {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 0.72rem;
    flex-wrap: wrap;
    padding: 0.62rem 1.15rem 0.82rem;
    border-top: 1px solid rgba(23, 57, 101, 0.08);
    color: var(--text-soft);
    font-size: 0.82rem;
}

.hq-status-item {
    display: inline-flex;
    align-items: baseline;
    gap: 0.34rem;
}

.hq-status-item span {
    font-weight: 700;
}

.hq-status-item strong {
    color: var(--brand-dark);
    font-weight: 900;
}

.hq-separator {
    color: rgba(23, 57, 101, 0.26);
}

.hq-content-section {
    margin-top: 0.82rem;
    border: 1px solid rgba(23, 57, 101, 0.11);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 10px 32px rgba(23, 57, 101, 0.06);
    overflow: hidden;
}

.hq-section-heading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.78rem 0.95rem;
    border-bottom: 1px solid rgba(23, 57, 101, 0.08);
}

.hq-section-heading h2 {
    margin: 0;
    color: var(--brand-dark);
    font-size: 1.08rem;
    line-height: 1.15;
}

.hq-section-heading p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.82rem;
    line-height: 1.35;
    text-align: right;
}

.hq-section-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.hq-section-actions form {
    margin: 0;
}

.hq-flash-message {
    margin: 0.72rem 0.72rem 0;
    border: 1px solid rgba(0, 128, 96, 0.18);
    border-radius: 12px;
    background: rgba(214, 245, 235, 0.82);
    color: #0f6b4f;
    font-size: 0.82rem;
    font-weight: 800;
    padding: 0.62rem 0.75rem;
}

.hq-customer-grid,
.hq-printer-list,
.hq-agent-list {
    display: grid;
    gap: 0.55rem;
    padding: 0.72rem;
}

.hq-customer-card,
.hq-printer-row,
.hq-agent-row {
    border: 1px solid rgba(23, 57, 101, 0.1);
    border-left: 3px solid rgba(23, 57, 101, 0.22);
    border-radius: 13px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(248, 251, 255, 0.96));
    box-shadow: 0 6px 18px rgba(23, 57, 101, 0.045);
}

.hq-customer-card {
    display: grid;
    grid-template-columns: minmax(16rem, 1fr) minmax(26rem, 1.1fr);
    gap: 0.8rem;
    align-items: center;
    padding: 0.82rem;
    text-decoration: none;
}

.hq-customer-card:hover,
.hq-printer-row:hover,
.hq-agent-row:hover {
    border-color: rgba(23, 57, 101, 0.19);
    border-left-color: var(--brand-yellow);
}

.hq-customer-main h3 {
    margin: 0.35rem 0 0.18rem;
    color: var(--brand-dark);
    font-size: 1.02rem;
    line-height: 1.18;
}

.hq-customer-main p {
    margin: 0.14rem 0 0;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 700;
}

.hq-customer-address {
    font-weight: 500 !important;
}

.hq-customer-metrics {
    display: grid;
    grid-template-columns: 6.2rem 6.2rem 7.4rem minmax(10rem, 0.8fr) minmax(12rem, 1fr);
    gap: 0.44rem;
}

.hq-metric-card,
.hq-analytics-highlights > div {
    min-width: 0;
    border-radius: 10px;
    background: var(--surface-soft);
    padding: 0.48rem 0.58rem;
}

.hq-metric-card span,
.hq-analytics-highlights span,
.hq-detail-list span {
    display: block;
    color: var(--text-soft);
    font-size: 0.64rem;
    font-weight: 900;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.hq-metric-card strong,
.hq-analytics-highlights strong {
    display: block;
    margin-top: 0.16rem;
    color: var(--brand-dark);
    font-size: 1rem;
    font-weight: 900;
    line-height: 1.12;
    overflow-wrap: anywhere;
}

.hq-metric-card small {
    display: block;
    margin-top: 0.12rem;
    color: var(--text-soft);
    font-size: 0.68rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.hq-metric-wide strong {
    font-size: 0.82rem;
}

.hq-source-badge {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: 999px;
    padding: 0.15rem 0.44rem;
    background: rgba(23, 57, 101, 0.08);
    color: var(--brand-dark);
    font-size: 0.64rem;
    font-weight: 900;
}

.hq-printer-row {
    padding: 0.72rem 0.82rem;
}

.hq-printer-row-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.7rem;
    padding-bottom: 0.42rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(23, 57, 101, 0.07);
}

.hq-printer-title h3 {
    margin: 0;
    color: var(--brand-dark);
    font-size: 1.02rem;
    line-height: 1.18;
}

.hq-printer-title p {
    margin: 0.18rem 0 0;
    color: var(--text-soft);
    font-size: 0.78rem;
    font-weight: 700;
}

.hq-printer-badges {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.3rem;
    flex-wrap: wrap;
}

.hq-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.34rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    padding: 0.16rem 0.45rem;
    font-size: 0.68rem;
    font-weight: 900;
}

.hq-status-badge.online {
    color: var(--success);
    background: var(--success-bg);
}

.hq-status-badge.offline {
    color: var(--danger);
    background: var(--danger-bg);
}

.hq-status-badge.stale {
    color: var(--warning);
    background: var(--warning-bg);
}

.hq-inline-stale {
    margin-top: 0.22rem;
}

.hq-status-dot {
    width: 0.46rem;
    height: 0.46rem;
    border-radius: 50%;
    background: currentColor;
}

.hq-printer-row-body {
    display: grid;
    grid-template-columns: minmax(15rem, 1fr) minmax(17rem, 1.05fr) minmax(17rem, 1fr);
    gap: 0.55rem;
}

.hq-printer-section {
    min-width: 0;
    border: 1px solid rgba(23, 57, 101, 0.07);
    border-radius: 11px;
    background: rgba(255, 255, 255, 0.74);
    padding: 0.52rem;
}

.hq-printer-section h4 {
    margin: 0 0 0.38rem;
    color: var(--text-soft);
    font-size: 0.66rem;
    font-weight: 900;
    letter-spacing: 0.055em;
    text-transform: uppercase;
}

.hq-detail-list {
    display: grid;
    gap: 0.18rem;
}

.hq-detail-list > div {
    display: grid;
    grid-template-columns: minmax(5.8rem, 0.62fr) minmax(0, 1fr);
    gap: 0.42rem;
    align-items: baseline;
    border-radius: 7px;
    background: #f2f6fb;
    padding: 0.24rem 0.36rem;
}

.hq-detail-list-compact > div {
    padding-block: 0.2rem;
}

.hq-detail-list strong {
    min-width: 0;
    color: var(--brand-dark);
    font-size: 0.8rem;
    font-weight: 900;
    text-align: right;
    overflow-wrap: anywhere;
}

.hq-replacement-list {
    margin: 0.36rem 0 0.42rem;
}

.hq-replacement-list > div,
.hq-detail-list > .hq-replacement-row {
    background: #f8fafc;
}

.hq-replacement-list span,
.hq-detail-list > .hq-replacement-row span {
    color: var(--text-soft);
}

.hq-replacement-list strong,
.hq-detail-list > .hq-replacement-row strong {
    color: #53657f;
    font-size: 0.74rem;
}

.hq-toner-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.28rem;
    margin-bottom: 0.42rem;
}

.hq-toner-grid span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    border-radius: 999px;
    padding: 0.18rem 0.46rem;
    font-size: 0.72rem;
    font-weight: 900;
}

.hq-toner-grid .black {
    background: #e7edf5;
    color: #1d314f;
}

.hq-toner-grid .cyan {
    background: #d6f6ff;
    color: #03677f;
}

.hq-toner-grid .magenta {
    background: #fde7f4;
    color: #a21caf;
}

.hq-toner-grid .yellow {
    background: var(--brand-yellow-soft);
    color: #946200;
}

.hq-analytics-highlights {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem;
    margin-bottom: 0.42rem;
}

.hq-analytics-highlights strong {
    font-size: 1.28rem;
    letter-spacing: -0.025em;
}

.hq-agent-row {
    display: grid;
    grid-template-columns: minmax(18rem, 1fr) repeat(5, minmax(8.5rem, 0.55fr));
    gap: 0.56rem;
    align-items: center;
    padding: 0.72rem 0.82rem;
}

.hq-agent-row strong {
    display: block;
    margin-top: 0.24rem;
    color: var(--brand-dark);
    font-size: 0.95rem;
}

.hq-agent-row p {
    margin: 0.15rem 0 0;
    color: var(--text-soft);
    font-size: 0.76rem;
}

.hq-agent-error {
    color: var(--danger) !important;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.hq-empty-state {
    margin: 0.72rem;
    border: 1px dashed rgba(23, 57, 101, 0.18);
    border-radius: 12px;
    background: #fbfdff;
    color: var(--text-soft);
    padding: 1rem;
    font-size: 0.9rem;
}

.hq-login-body {
    display: grid;
    place-items: center;
    padding: 1rem;
}

.hq-login-shell {
    display: grid;
    grid-template-columns: minmax(22rem, 0.86fr) minmax(22rem, 1fr);
    width: min(980px, 100%);
    border: 1px solid rgba(23, 57, 101, 0.12);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 22px 70px rgba(23, 57, 101, 0.13);
    overflow: hidden;
}

.hq-login-panel {
    padding: 1.35rem;
}

.hq-login-brand {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.1rem;
}

.hq-login-logo {
    width: 128px;
    max-height: 42px;
    object-fit: contain;
    object-position: left center;
}

.hq-login-aside {
    display: grid;
    align-content: center;
    min-height: 360px;
    padding: 2rem;
    background:
        radial-gradient(circle at top right, rgba(255, 228, 10, 0.35), transparent 18rem),
        linear-gradient(135deg, var(--brand-dark), var(--brand-accent));
    color: #ffffff;
}

.hq-login-aside h2 {
    margin: 0;
    font-size: 2rem;
    line-height: 1.08;
    letter-spacing: -0.04em;
}

.hq-login-aside p {
    margin: 1rem 0 0;
    color: rgba(255, 255, 255, 0.84);
    line-height: 1.6;
}

.hq-form {
    display: grid;
    gap: 0.82rem;
}

.hq-form label {
    display: grid;
    gap: 0.32rem;
    color: var(--text-soft);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.045em;
    text-transform: uppercase;
}

.hq-form input {
    width: 100%;
    border: 1px solid rgba(23, 57, 101, 0.14);
    border-radius: 10px;
    background: #ffffff;
    color: var(--text-main);
    font: inherit;
    padding: 0.66rem 0.75rem;
    outline: none;
}

.hq-form input:focus {
    border-color: rgba(255, 228, 10, 0.85);
    box-shadow: 0 0 0 3px rgba(255, 228, 10, 0.22);
}

.hq-form button {
    border: 0;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--brand-dark), var(--brand-accent));
    color: #ffffff;
    cursor: pointer;
    font-weight: 900;
    padding: 0.74rem 1rem;
}

.hq-alert-error {
    margin-bottom: 0.9rem;
    border-radius: 10px;
    background: var(--danger-bg);
    color: var(--danger);
    padding: 0.72rem 0.8rem;
    font-size: 0.86rem;
    font-weight: 800;
}

@media (max-width: 1050px) {
    .hq-main-header-bar,
    .hq-printer-row-body,
    .hq-agent-row,
    .hq-customer-card,
    .hq-customer-metrics,
    .hq-login-shell {
        grid-template-columns: 1fr;
    }

    .hq-title-slot {
        text-align: left;
    }

    .hq-actions-slot {
        justify-content: flex-start;
    }

    .hq-section-heading {
        display: grid;
    }

    .hq-section-heading p {
        text-align: left;
    }

    .hq-login-aside {
        min-height: auto;
    }
}

@media (max-width: 640px) {
    .hq-page-shell {
        width: min(100% - 0.8rem, 1440px);
        padding-top: 0.45rem;
    }

    .hq-main-header-bar,
    .hq-status-strip,
    .hq-section-heading,
    .hq-customer-grid,
    .hq-printer-list,
    .hq-agent-list {
        padding-left: 0.68rem;
        padding-right: 0.68rem;
    }

    .hq-logo {
        max-width: 118px;
    }

    .hq-status-strip {
        gap: 0.42rem;
    }

    .hq-detail-list > div {
        grid-template-columns: 1fr;
        gap: 0.12rem;
    }

    .hq-detail-list strong {
        text-align: left;
    }

    .hq-analytics-highlights {
        grid-template-columns: 1fr;
    }

    .hq-login-brand {
        align-items: flex-start;
        flex-direction: column;
    }
}
