:root {
    color-scheme: dark;
    --bg: #0d1426;
    --surface: #1d2b52;
    --surface-alt: #12203a;
    --panel: #1c2a4a;
    --panel-border: #31456e;
    --accent: #71a7ff;
    --accent-strong: #f1a548;
    --text: #f4f7fb;
    --muted: #a6b4d0;
    --danger: #ff7b72;
    --ok: #57cc99;
    --warn: #ffd166;
    --shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
}

body {
    font-family: "Segoe UI Variable Text", "Aptos", sans-serif;
    color: var(--text);
}

.login-shell {
    min-height: 100vh;
    padding: 0;
    background: #223564;
}

.login-split {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.login-panel {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 56px;
}

.login-panel-brand {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.login-panel-inner {
    width: min(100%, 360px);
    display: grid;
    gap: 18px;
}

.login-brand {
    color: #f7f9fd;
    display: inline-flex;
    max-width: 124px;
}

.login-brand svg {
    width: 100%;
    height: auto;
    display: block;
}

.login-copy {
    display: grid;
    gap: 10px;
}

.login-copy h1,
.login-form-copy h2 {
    margin: 0;
    font-size: 2.15rem;
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.login-copy p,
.login-form-copy p {
    margin: 0;
    max-width: 34ch;
    color: rgba(236, 242, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.45;
}

.login-panel-form {
    gap: 16px;
}

.login-form-copy h2 {
    font-size: 1.95rem;
}

.login-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 38px;
    padding: 0 18px;
    border-radius: 4px;
    background: #080c15;
    border: 1px solid rgba(0, 0, 0, 0.55);
    color: #ffffff;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 700;
    transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.login-button:hover {
    transform: translateY(-1px);
    background: #0d1320;
}

.login-button-mark {
    width: 10px;
    height: 10px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1px;
}

.login-button-mark span {
    display: block;
    width: 100%;
    height: 100%;
}

.login-button-mark-red {
    background: #f25022;
}

.login-button-mark-green {
    background: #7fba00;
}

.login-button-mark-blue {
    background: #00a4ef;
}

.login-button-mark-yellow {
    background: #ffb900;
}

.app-frame {
    min-height: 100vh;
    background: linear-gradient(180deg, #0b1325 0%, #0f182d 100%);
}

.app-topbar {
    height: 54px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #213563;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-brand {
    color: #f7f9fd;
    display: inline-flex;
    align-items: center;
}

.app-brand svg {
    display: block;
    width: 208px;
    max-width: min(208px, 42vw);
    height: auto;
}

.app-topbar-right {
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-menu-shell {
    position: relative;
}

.app-user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 0 4px rgba(113, 167, 255, 0.12);
}

.app-menu-trigger {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    min-height: 40px;
    padding: 0 8px 0 0;
    background: transparent;
    border: 0;
    color: var(--text);
    cursor: pointer;
}

.app-menu-icon {
    width: 18px;
    display: grid;
    gap: 3px;
}

.app-menu-icon span {
    display: block;
    height: 2px;
    border-radius: 999px;
    background: #dbe7ff;
}

.app-menu-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: min(320px, calc(100vw - 24px));
    background: #1b294b;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
    overflow: hidden;
    z-index: 10;
}

.app-menu-user-card,
.app-menu-nav,
.app-menu-actions {
    padding: 18px 20px;
}

.app-menu-user-card,
.app-menu-nav {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.app-menu-user-card {
    display: flex;
    align-items: center;
    gap: 14px;
}

.app-menu-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.app-menu-user-meta {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.app-menu-user-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #f5f8ff;
}

.app-menu-user-email {
    color: var(--muted);
    font-size: 0.92rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-menu-nav,
.app-menu-actions {
    display: grid;
    gap: 6px;
}

.app-menu-link {
    display: flex;
    align-items: center;
    min-height: 40px;
    padding: 0 10px;
    border-radius: 8px;
    color: #eef3ff;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 120ms ease, color 120ms ease;
}

.app-menu-link:hover,
.app-menu-link.active {
    background: #283453;
    color: #ffffff;
}

.app-menu-logout {
    color: #f2f6ff;
}

.app-nav {
    background: #1a2748;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.app-nav-inner {
    width: min(1180px, calc(100vw - 32px));
    margin: 0 auto;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 0 0 4px;
}

.app-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 12px;
    border-radius: 999px;
    color: #ecf2ff;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    background: #171e2f;
    transition: background-color 120ms ease, color 120ms ease;
}

.app-nav-link:hover,
.app-nav-link.active {
    background: #30476f;
    color: #ffffff;
}

.app-user-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #355796, #243c68);
    color: #f7f9fd;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
}

.app-content {
    padding: 14px 0 36px;
}

.page-shell {
    color: var(--text);
}

.landing {
    width: min(1180px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 32px 0;
    display: grid;
    gap: 20px;
}

.worker-page {
    width: min(1180px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 32px 0;
    display: grid;
    gap: 20px;
}

.hangfire-page {
    width: min(1280px, calc(100vw - 32px));
    margin: 0 auto;
    padding: 32px 0;
    display: grid;
    gap: 20px;
}

.hero,
.tile,
.info-panel,
.panel-shell,
.content-section,
.panel {
    background: var(--panel);
    border: 1px solid var(--panel-border);
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.hero {
    padding: 20px;
    display: grid;
    gap: 14px;
}

.content-section {
    padding: 20px;
    display: grid;
    gap: 18px;
}

.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
}

.section-note {
    color: var(--muted);
    font-size: 0.92rem;
}

.hero-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: start;
    flex-wrap: wrap;
}

h1,
h2,
h3,
p,
span,
th,
td {
    color: inherit;
}

h1 {
    margin: 0;
    font-size: clamp(1.9rem, 4vw, 2.5rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.subhead {
    margin: 0;
    color: var(--muted);
    max-width: 64ch;
    font-size: 1rem;
}

.worker-page .subhead,
.hangfire-page .subhead {
    margin-top: 8px;
    max-width: 64ch;
    font-size: 1rem;
}

.hero-links,
.controls {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

.hero-links a,
.controls a,
.controls button,
.hangfire-page .panel > a,
.hangfire-page .hero-links a,
.worker-page .hero-links a,
.page-shell button {
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    padding: 10px 16px;
    text-decoration: none;
    font: inherit;
    cursor: pointer;
    transition: transform 120ms ease, background-color 120ms ease, border-color 120ms ease;
}

.hero-links a:hover,
.controls a:hover,
.hangfire-page .panel > a:hover,
.hangfire-page .hero-links a:hover,
.worker-page .hero-links a:hover,
.page-shell button:hover {
    transform: translateY(-1px);
}

.page-shell button.primary {
    background: linear-gradient(135deg, rgba(78, 205, 196, 0.22), rgba(87, 204, 153, 0.3));
    border-color: rgba(78, 205, 196, 0.34);
}

.page-shell button.warning {
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.18), rgba(244, 162, 97, 0.24));
    border-color: rgba(255, 209, 102, 0.34);
}

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
}

.dashboard-tile,
.tile {
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 16px;
    padding: 18px 22px;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    min-height: 168px;
    background: #1d2b52;
    border: 1px solid #334a78;
    transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.dashboard-tile:hover,
.tile:hover {
    transform: translateY(-2px);
    border-color: #4b69a6;
    background: #23345f;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.18);
}

.tile-label,
.tile-kicker {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #7db2ff;
}

.tile-body {
    display: grid;
    gap: 10px;
    align-content: start;
}

.tile h2,
.tile h3,
.dashboard-tile h2,
.dashboard-tile h3 {
    margin: 0;
    font-size: 1.9rem;
    letter-spacing: -0.03em;
}

.tile p,
.dashboard-tile p,
.info-panel,
.small {
    color: var(--muted);
}

.tile p {
    margin: 0;
    line-height: 1.5;
}

.tile-link,
.tile-meta {
    color: var(--accent-strong);
    font-size: 0.92rem;
    font-weight: 600;
}

.info-panel,
.panel {
    padding: 20px 24px;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
}

.stat-card {
    padding: 18px;
    border-radius: 8px;
    background: #1d2b52;
    border: 1px solid #334a78;
}

.stat-label,
.meta-label {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.stat-value {
    display: block;
    margin-top: 10px;
    font-size: 1.5rem;
    font-weight: 650;
    word-break: break-word;
}

.layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
}

.panel h2 {
    margin: 0 0 14px;
    font-size: 1.35rem;
    letter-spacing: -0.02em;
}

.operators-table-wrap {
    overflow-x: auto;
}

.operators-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
}

.operators-table th,
.operators-table td {
    text-align: left;
    padding: 12px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    vertical-align: top;
}

.operators-table th {
    color: var(--muted);
    font-size: 0.8rem;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.05);
}

.badge::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
}

.tone-ok {
    color: var(--ok);
}

.tone-warn {
    color: var(--warn);
}

.tone-danger {
    color: var(--danger);
}

.tone-muted {
    color: var(--muted);
}

.tone-accent {
    color: var(--accent);
}

.meta-list {
    display: grid;
    gap: 12px;
}

.meta-row {
    display: grid;
    gap: 6px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.meta-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.empty {
    padding: 16px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
}

.hangfire-frame {
    width: 100%;
    min-height: 900px;
    border: 1px solid #334a78;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.18);
}

@media (max-width: 920px) {
    .app-nav {
        display: none;
    }

    .landing,
    .worker-page,
    .hangfire-page {
        width: min(100vw - 20px, 1280px);
        padding: 18px 0 24px;
    }

    .app-topbar {
        padding: 0 14px;
    }

    .app-brand {
        max-width: 180px;
    }

    .app-user-name {
        max-width: 140px;
    }

    .login-split {
        grid-template-columns: 1fr;
    }

    .login-panel {
        min-height: 50vh;
        padding: 32px 24px;
    }

    .login-panel-brand {
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .login-panel-inner {
        width: min(100%, 420px);
    }

    .login-brand {
        max-width: 124px;
    }

    .login-copy h1,
    .login-form-copy h2 {
        font-size: 1.8rem;
    }

    .app-brand svg {
        width: 100%;
    }

    .layout {
        grid-template-columns: 1fr;
    }

    .operators-table-wrap {
        display: block;
        overflow-x: auto;
    }

    .app-menu-dropdown {
        width: min(320px, calc(100vw - 20px));
        right: -6px;
    }
}