:root {
    --bg: #0b1020;
    --sidebar: #0c1222;
    --surface: #11182a;
    --surface-2: #151e32;
    --surface-3: #1a2439;
    --border: #25314a;
    --border-soft: #1d2940;

    --text: #edf2fb;
    --muted: #8f9db4;
    --muted-2: #67758e;

    --accent: #5f86ff;
    --accent-hover: #7799ff;
    --accent-soft: rgba(95, 134, 255, .12);

    --green: #42d392;
    --green-soft: rgba(66, 211, 146, .12);

    --amber: #f6bd60;
    --amber-soft: rgba(246, 189, 96, .12);

    --red: #ff6b7a;
    --red-soft: rgba(255, 107, 122, .12);

    --blue: #62a8ff;
    --blue-soft: rgba(98, 168, 255, .12);

    --radius: 14px;
    --radius-sm: 9px;

    --shadow:
        0 18px 50px rgba(0, 0, 0, .25);
}


* {
    box-sizing: border-box;
}


html,
body {
    margin: 0;
    min-height: 100%;
}


body {
    background:
        radial-gradient(
            circle at top right,
            rgba(95, 134, 255, .08),
            transparent 35%
        ),
        var(--bg);

    color: var(--text);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    font-size: 14px;
    line-height: 1.5;
}


a {
    color: inherit;
    text-decoration: none;
}


button,
input,
textarea,
select {
    font: inherit;
}


button {
    cursor: pointer;
}


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


.sidebar {
    width: 260px;
    position: fixed;
    inset: 0 auto 0 0;

    display: flex;
    flex-direction: column;

    padding: 24px 18px;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, .018),
            transparent 30%
        ),
        var(--sidebar);

    border-right: 1px solid var(--border-soft);
}


.brand {
    display: flex;
    gap: 12px;
    align-items: center;

    padding: 0 7px 25px;
}


.brand-mark {
    width: 42px;
    height: 42px;

    flex: 0 0 42px;

    display: grid;
    place-items: center;

    border-radius: 12px;

    background:
        linear-gradient(
            135deg,
            #6388ff,
            #4768d8
        );

    color: white;

    font-size: 13px;
    font-weight: 800;
    letter-spacing: .5px;

    box-shadow:
        0 10px 24px rgba(76, 109, 224, .28);
}


.brand-mark.small {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    border-radius: 9px;
    font-size: 10px;
}


.brand-name {
    font-size: 16px;
    font-weight: 750;
    letter-spacing: -.2px;
}


.brand-subtitle {
    margin-top: 2px;
    color: var(--muted-2);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .65px;
}


.nav {
    display: flex;
    flex-direction: column;
    gap: 5px;
}


.nav a {
    display: flex;
    align-items: center;
    gap: 12px;

    height: 46px;
    padding: 0 13px;

    color: var(--muted);

    border-radius: 10px;

    transition:
        background .15s ease,
        color .15s ease;
}


.nav a:hover {
    color: var(--text);
    background: rgba(255, 255, 255, .035);
}


.nav a.active {
    color: #fff;
    background: var(--accent-soft);
}


.nav-symbol {
    width: 21px;
    text-align: center;
    font-size: 17px;
}


.sidebar-footer {
    margin-top: auto;

    padding-top: 18px;

    border-top: 1px solid var(--border-soft);
}


.user-line {
    display: flex;
    gap: 10px;
    align-items: center;
}


.user-line strong,
.user-line span {
    display: block;
}


.user-line strong {
    font-size: 13px;
}


.user-line span {
    color: var(--muted-2);
    font-size: 11px;
}


.avatar {
    width: 34px;
    height: 34px;

    display: grid;
    place-items: center;

    border-radius: 50%;

    background: var(--surface-3);

    color: var(--accent-hover);
    font-weight: 800;
}


.link-button {
    border: 0;
    background: transparent;

    margin: 10px 0 0 44px;
    padding: 0;

    color: var(--muted-2);
    font-size: 11px;
}


.link-button:hover {
    color: var(--text);
}


.main {
    margin-left: 260px;
    width: calc(100% - 260px);
    min-height: 100vh;
}


.mobile-header {
    display: none;
}


.content {
    width: 100%;
    max-width: 1500px;

    padding: 42px 48px 70px;
    margin: 0 auto;
}


.page-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 30px;

    margin-bottom: 30px;
}


.page-heading h1 {
    margin: 5px 0 6px;

    font-size: 32px;
    line-height: 1.15;
    letter-spacing: -1px;
}


.page-heading p {
    margin: 0;
    color: var(--muted);
    max-width: 670px;
}


.eyebrow {
    color: var(--accent-hover);

    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.35px;
}


.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;

    padding: 0 17px;

    border-radius: 9px;
    border: 1px solid transparent;

    font-weight: 700;
    font-size: 13px;

    transition:
        transform .1s ease,
        background .15s ease;
}


.button:hover {
    transform: translateY(-1px);
}


.button-primary {
    background: var(--accent);
    color: white;
}


.button-primary:hover {
    background: var(--accent-hover);
}


.button-danger {
    color: var(--red);
    border-color: rgba(255, 107, 122, .2);
    background: var(--red-soft);
}


.button-full {
    width: 100%;
}


.metric-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;

    margin-bottom: 38px;
}


.metric-card {
    padding: 21px;

    border: 1px solid var(--border-soft);
    border-radius: var(--radius);

    background:
        linear-gradient(
            145deg,
            rgba(255, 255, 255, .025),
            transparent 60%
        ),
        var(--surface);

    box-shadow:
        0 10px 35px rgba(0, 0, 0, .08);
}


.metric-card span,
.metric-card small {
    display: block;
}


.metric-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}


.metric-card strong {
    display: block;

    margin: 7px 0 3px;

    font-size: 28px;
    letter-spacing: -.5px;
}


.metric-card small {
    color: var(--muted-2);
}


.section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;

    margin-bottom: 12px;
}


.section-heading h2,
.panel-heading h2 {
    margin: 0;

    font-size: 16px;
    letter-spacing: -.25px;
}


.section-heading p,
.panel-heading p {
    margin: 4px 0 0;

    color: var(--muted-2);
    font-size: 12px;
}


.section-heading a {
    color: var(--accent-hover);
    font-size: 12px;
}


.worker-list,
.record-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
}


.worker-card {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 77px;

    padding: 15px 18px;

    border: 1px solid var(--border-soft);
    border-radius: 12px;

    background: var(--surface);

    transition:
        background .15s ease,
        border-color .15s ease;
}


.worker-card:hover {
    background: var(--surface-2);
    border-color: var(--border);
}


.worker-main {
    display: flex;
    align-items: center;
    gap: 13px;

    min-width: 0;
}


.worker-name {
    display: block;
    font-size: 14px;
}


.worker-main p {
    margin: 4px 0 0;

    color: var(--muted);
    font-size: 12px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.worker-status {
    display: flex;
    align-items: center;
    gap: 15px;
}


.arrow {
    color: var(--muted-2);
}


.status-dot {
    width: 9px;
    height: 9px;

    flex: 0 0 9px;

    border-radius: 50%;

    background: var(--muted);
}


.status-pill {
    display: inline-flex;
    align-items: center;

    min-height: 26px;

    padding: 0 9px;

    border-radius: 999px;

    font-size: 10px;
    font-weight: 800;
    letter-spacing: .15px;
}


.status-busy {
    color: var(--blue);
    background: var(--blue-soft);
}


.status-dot.status-busy {
    background: var(--blue);
}


.status-action-needed {
    color: var(--amber);
    background: var(--amber-soft);
}


.status-dot.status-action-needed {
    background: var(--amber);
}


.status-complete {
    color: var(--green);
    background: var(--green-soft);
}


.status-dot.status-complete {
    background: var(--green);
}


.status-error {
    color: var(--red);
    background: var(--red-soft);
}


.status-dot.status-error {
    background: var(--red);
}


.empty-state {
    min-height: 280px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 30px;

    text-align: center;

    border: 1px dashed var(--border);
    border-radius: var(--radius);

    background: rgba(255, 255, 255, .012);
}


.empty-icon {
    font-size: 30px;
    color: var(--accent-hover);
}


.empty-state h3 {
    margin: 10px 0 4px;
}


.empty-state p {
    margin: 0 0 18px;
    color: var(--muted);
}


.empty-small {
    padding: 30px;

    color: var(--muted);

    text-align: center;

    border: 1px dashed var(--border);
    border-radius: 10px;
}


.two-column {
    display: grid;
    grid-template-columns: minmax(300px, .82fr) minmax(360px, 1.18fr);
    gap: 20px;
    align-items: start;
}


.two-column.wide-left {
    grid-template-columns: minmax(380px, 1fr) minmax(380px, 1fr);
}


.panel {
    padding: 22px;

    border: 1px solid var(--border-soft);
    border-radius: var(--radius);

    background: var(--surface);

    box-shadow:
        0 12px 38px rgba(0, 0, 0, .08);
}


.panel.compact {
    padding: 18px;
}


.panel-heading {
    margin-bottom: 20px;
}


.form-stack {
    display: flex;
    flex-direction: column;
    gap: 15px;
}


.form-stack label {
    display: flex;
    flex-direction: column;
    gap: 7px;

    color: #bcc7d9;

    font-size: 11px;
    font-weight: 700;
}


.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}


.form-row .small-field {
    grid-template-columns: 130px;
}


input,
textarea,
select {
    width: 100%;

    padding: 10px 11px;

    border: 1px solid var(--border);
    border-radius: 8px;

    outline: none;

    color: var(--text);
    background: #0d1424;

    transition:
        border-color .15s ease,
        box-shadow .15s ease;
}


input {
    min-height: 42px;
}


textarea {
    resize: vertical;
}


select {
    min-height: 42px;
}


input:focus,
textarea:focus,
select:focus {
    border-color: var(--accent);

    box-shadow:
        0 0 0 3px rgba(95, 134, 255, .10);
}


input::placeholder,
textarea::placeholder {
    color: #526078;
}


.record-card {
    display: block;

    padding: 16px;

    border: 1px solid var(--border-soft);
    border-radius: 11px;

    background: rgba(255, 255, 255, .014);
}


.record-card.clickable {
    transition:
        background .15s ease,
        border-color .15s ease;
}


.record-card.clickable:hover {
    background: var(--surface-2);
    border-color: var(--border);
}


.record-top {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;

    margin-bottom: 14px;
}


.record-top strong,
.record-top .muted {
    display: block;
}


.record-top strong {
    margin-bottom: 2px;
}


.muted {
    color: var(--muted-2);
    font-size: 11px;
}


.record-detail {
    display: flex;
    justify-content: space-between;
    gap: 15px;

    padding: 8px 0;

    border-top: 1px solid var(--border-soft);

    font-size: 11px;
}


.record-detail span {
    color: var(--muted-2);
}


.record-detail strong {
    max-width: 68%;
    text-align: right;

    overflow-wrap: anywhere;
}


.record-notes {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 11px;
}


.baseline-policy {
    margin-top: 12px;
    padding: 11px;

    border-radius: 8px;

    background: #0d1424;

    color: var(--muted);
    font-size: 11px;
}


.danger-link {
    margin-top: 12px;
    padding: 0;

    border: 0;
    background: none;

    color: var(--red);
    font-size: 11px;
}


.settings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}


.notice {
    margin-top: 14px;
    padding: 12px;

    border: 1px solid var(--border-soft);
    border-radius: 8px;

    background: #0d1424;

    color: var(--muted);
    font-size: 11px;
}


.back-link {
    display: block;
    margin-bottom: 15px;

    color: var(--muted);
    font-size: 12px;
}


.back-link:hover {
    color: var(--text);
}


.inline-status {
    display: flex;
    align-items: center;
    gap: 9px;

    margin-top: 12px;
}


.worker-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 20px;
    align-items: start;
}


.conversation-panel {
    overflow: hidden;

    border: 1px solid var(--border-soft);
    border-radius: var(--radius);

    background: var(--surface);
}


.conversation-header {
    min-height: 66px;

    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 15px 19px;

    border-bottom: 1px solid var(--border-soft);
}


.conversation-header strong,
.conversation-header span {
    display: block;
}


.conversation-header span {
    margin-top: 2px;

    color: var(--muted-2);
    font-size: 11px;
}


.version-badge {
    padding: 4px 7px;
    border-radius: 6px;

    background: var(--accent-soft);

    color: var(--accent-hover) !important;

    font-size: 9px !important;
    font-weight: 800;
}


.conversation {
    min-height: 430px;
    max-height: 620px;

    overflow-y: auto;

    padding: 20px;
}


.message {
    max-width: 84%;

    margin-bottom: 17px;
}


.message-user {
    margin-left: auto;
}


.message-label {
    margin-bottom: 5px;

    color: var(--muted-2);

    font-size: 9px;
    font-weight: 800;
    letter-spacing: .8px;
}


.message-user .message-label {
    text-align: right;
}


.message-body {
    padding: 12px 14px;

    border: 1px solid var(--border-soft);
    border-radius: 10px;

    background: var(--surface-2);

    color: #dce4f2;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}


.message-user .message-body {
    background: var(--accent-soft);
    border-color: rgba(95, 134, 255, .22);
}


.message-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;

    padding: 15px;

    border-top: 1px solid var(--border-soft);
}


.message-form textarea {
    min-height: 70px;
}


.worker-sidebar {
    display: flex;
    flex-direction: column;
    gap: 15px;
}


.action-sequence {
    display: flex;
    flex-direction: column;
    gap: 10px;

    color: var(--muted);
    font-size: 12px;
}


.action-sequence div {
    display: flex;
    gap: 9px;
    align-items: center;
}


.sequence-wait {
    color: var(--muted-2);
}


.login-body {
    min-height: 100vh;

    display: grid;
    place-items: center;

    padding: 30px;

    background:
        radial-gradient(
            circle at 20% 20%,
            rgba(95, 134, 255, .10),
            transparent 30%
        ),
        radial-gradient(
            circle at 80% 75%,
            rgba(95, 134, 255, .07),
            transparent 30%
        ),
        #090e1b;
}


.login-wrapper {
    width: 100%;
    max-width: 430px;
}


.login-brand {
    margin-bottom: 25px;
    text-align: center;
}


.login-logo {
    width: 50px;
    height: 50px;
    margin: 0 auto 14px;
}


.login-brand h1 {
    margin: 0;
    font-size: 25px;
    letter-spacing: -.6px;
}


.login-brand p {
    margin: 4px 0 0;

    color: var(--muted-2);

    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .7px;
}


.login-card {
    padding: 27px;

    border: 1px solid var(--border);
    border-radius: 16px;

    background: rgba(17, 24, 42, .92);

    box-shadow: var(--shadow);
}


.login-heading {
    margin-bottom: 22px;
}


.login-heading h2 {
    margin: 5px 0 5px;

    font-size: 21px;
}


.login-heading p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}


.login-foot {
    margin-top: 18px;

    text-align: center;

    color: var(--muted-2);
    font-size: 10px;
}


.alert {
    margin-bottom: 16px;
    padding: 11px 12px;

    border-radius: 8px;

    font-size: 11px;
}


.alert-error {
    color: var(--red);
    background: var(--red-soft);
    border: 1px solid rgba(255, 107, 122, .2);
}


@media (max-width: 1100px) {

    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .two-column,
    .two-column.wide-left {
        grid-template-columns: 1fr;
    }

    .settings-grid {
        grid-template-columns: 1fr;
    }

    .worker-layout {
        grid-template-columns: 1fr;
    }

    .worker-sidebar {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

}


@media (max-width: 760px) {

    .sidebar {
        display: none;
    }

    .main {
        width: 100%;
        margin-left: 0;
    }

    .mobile-header {
        display: block;

        position: sticky;
        top: 0;
        z-index: 20;

        padding: 12px 15px;

        background: rgba(11, 16, 32, .94);

        border-bottom: 1px solid var(--border-soft);

        backdrop-filter: blur(12px);
    }

    .mobile-brand {
        display: flex;
        align-items: center;
        gap: 9px;

        font-size: 14px;
        font-weight: 750;
    }

    .mobile-nav {
        display: flex;
        gap: 18px;

        margin-top: 11px;

        overflow-x: auto;

        color: var(--muted);

        font-size: 11px;
    }

    .content {
        padding: 25px 15px 50px;
    }

    .page-heading {
        align-items: flex-start;
        flex-direction: column;

        margin-bottom: 22px;
    }

    .page-heading h1 {
        font-size: 27px;
    }

    .metric-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .metric-card {
        padding: 16px;
    }

    .metric-card strong {
        font-size: 24px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .worker-card {
        gap: 13px;
        align-items: flex-start;
    }

    .worker-main p {
        white-space: normal;
    }

    .worker-status .arrow {
        display: none;
    }

    .worker-sidebar {
        display: flex;
    }

    .message {
        max-width: 95%;
    }

    .message-form {
        grid-template-columns: 1fr;
    }

    .message-form .button {
        width: 100%;
    }

    .login-body {
        padding: 18px;
    }

}
