:root {
    color-scheme: dark;
    --bg: #020507;
    --bg-2: #061016;
    --panel: rgba(10, 16, 20, .92);
    --panel-strong: rgba(13, 21, 26, .98);
    --line: rgba(130, 150, 160, .18);
    --line-strong: rgba(170, 190, 200, .28);
    --text: #eef3f6;
    --muted: #8d9aa3;
    --soft: #b8c3ca;
    --red: #ee2525;
    --red-dark: #8d1010;
    --green: #25d866;
    --blue: #2587ff;
    --amber: #ffb22e;
    --violet: #8d5bff;
    --shadow: 0 24px 80px rgba(0, 0, 0, .5);
    --sidebar: 296px;
    --topbar: 84px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    background: radial-gradient(circle at 14% 80%, rgba(238, 37, 37, .11), transparent 34%),
        radial-gradient(circle at 86% 76%, rgba(37, 135, 255, .12), transparent 35%),
        linear-gradient(180deg, #020507 0%, #061016 100%);
    color: var(--text);
    font-size: 14px;
}

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

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

button {
    color: inherit;
}

svg {
    flex: 0 0 auto;
}

.network-field {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.login-body {
    min-height: 100vh;
    overflow: hidden;
}

.login-body::before,
.app-body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .85), rgba(0, 0, 0, .18));
    pointer-events: none;
}

.login-shell {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(360px, 1fr) minmax(420px, 560px) 170px;
    gap: 48px;
    align-items: center;
    min-height: 100vh;
    padding: 54px 60px;
}

.corner-frame {
    position: fixed;
    z-index: 20;
    inset: 28px;
    pointer-events: none;
}

.corner-frame i {
    position: absolute;
    display: block;
    width: 28px;
    height: 28px;
    border-color: rgba(255, 255, 255, .78);
    font-style: normal;
}

.corner-frame i:nth-child(1) {
    left: 0;
    top: 0;
    border-left: 2px solid;
    border-top: 2px solid;
}

.corner-frame i:nth-child(2) {
    right: 0;
    top: 0;
    border-right: 2px solid;
    border-top: 2px solid;
}

.corner-frame i:nth-child(3) {
    left: 0;
    bottom: 0;
    border-left: 2px solid;
    border-bottom: 2px solid;
}

.corner-frame i:nth-child(4) {
    right: 0;
    bottom: 0;
    border-right: 2px solid;
    border-bottom: 2px solid;
}

.system-chip {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    color: var(--muted);
    text-transform: uppercase;
    font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.system-chip span,
.online-pill i,
.system-card i,
.health-row small::before {
    display: inline-block;
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--green);
    box-shadow: 0 0 18px rgba(37, 216, 102, .7);
}

.health-row small::before {
    content: "";
}

.login-intel {
    position: relative;
    min-height: 620px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 280px;
}

.brand-word {
    position: relative;
    display: inline-flex;
    gap: .58em;
    align-items: center;
    color: #fff;
    line-height: 1;
    white-space: nowrap;
}

.brand-word span {
    display: inline-block;
}

.brand-word i {
    position: absolute;
    right: .17em;
    top: -.24em;
    width: .44em;
    height: .06em;
    background: var(--red);
    border-radius: 999px;
}

.login-brand .brand-word {
    font-size: 64px;
    font-weight: 300;
}

.login-brand p {
    margin: 28px 0 0;
    color: var(--soft);
    text-transform: uppercase;
    font: 13px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.signal-list {
    display: grid;
    gap: 24px;
    margin-top: 84px;
    max-width: 520px;
}

.signal-list div {
    display: grid;
    grid-template-columns: 48px 1fr;
    gap: 20px;
    align-items: center;
}

.signal-list b {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid rgba(238, 37, 37, .32);
    color: var(--red);
    background: rgba(238, 37, 37, .08);
}

.signal-list div:nth-child(2) b {
    color: var(--green);
    background: rgba(37, 216, 102, .08);
    border-color: rgba(37, 216, 102, .32);
}

.signal-list div:nth-child(3) b {
    color: var(--blue);
    background: rgba(37, 135, 255, .08);
    border-color: rgba(37, 135, 255, .32);
}

.signal-list strong {
    display: block;
    margin-bottom: 8px;
    font-size: 16px;
}

.signal-list small,
.terminal-lines {
    color: var(--muted);
}

.terminal-lines {
    margin-top: 14px;
    font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
    text-transform: uppercase;
}

.terminal-lines p {
    margin: 10px 0;
}

.terminal-lines span {
    color: var(--green);
}

.login-panel {
    display: grid;
    justify-items: center;
}

.auth-card {
    width: min(100%, 560px);
    padding: 54px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(12, 18, 23, .92), rgba(5, 9, 12, .95));
    box-shadow: var(--shadow);
}

.auth-card h1 {
    margin: 0 0 12px;
    text-align: center;
    font-size: 28px;
    font-weight: 500;
}

.auth-card > p {
    margin: 0 0 42px;
    text-align: center;
    color: var(--muted);
    font-size: 16px;
}

.auth-card label,
.modal-card label,
.dispatch-panel label {
    display: grid;
    gap: 10px;
    color: var(--text);
    font-weight: 600;
}

.input-wrap,
.global-search,
.panel-search,
.auth-card input,
.auth-card select,
.modal-card input,
.modal-card select,
.dispatch-panel input,
.dispatch-panel select,
.dispatch-panel textarea {
    border: 1px solid var(--line);
    background: rgba(8, 14, 18, .82);
    color: var(--text);
}

.input-wrap {
    display: grid;
    grid-template-columns: 24px 1fr 36px;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 0 14px;
    border-radius: 7px;
}

.input-wrap input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
}

.auth-card label + label {
    margin-top: 24px;
}

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin: 22px 0 34px;
    color: var(--muted);
}

.form-row a,
.panel header a,
.page-title nav span:last-child,
.command-panel a,
.placeholder-grid a {
    color: var(--blue);
}

.checkbox-line {
    display: inline-flex !important;
    grid-template-columns: none !important;
    align-items: center;
    gap: 10px !important;
    color: var(--muted) !important;
    font-weight: 500 !important;
}

.checkbox-line input {
    position: absolute;
    opacity: 0;
}

.checkbox-line span {
    display: inline-grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
}

.checkbox-line span::after,
input[type="checkbox"]::after {
    color: var(--red);
    content: "×";
    font-size: 21px;
    font-weight: 800;
    line-height: 1;
    opacity: 0;
    transform: scale(.65);
    transition: opacity .14s ease, transform .14s ease;
}

.checkbox-line input:checked + span {
    background: rgba(238, 37, 37, .1);
    border-color: var(--red);
}

.checkbox-line input:checked + span::after,
input[type="checkbox"]:checked::after {
    opacity: 1;
    transform: scale(1);
}

.checkbox-line input:focus-visible + span,
input[type="checkbox"]:focus-visible {
    outline: 2px solid rgba(37, 135, 255, .7);
    outline-offset: 2px;
}

input[type="checkbox"] {
    appearance: none;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1px solid var(--line-strong);
    border-radius: 4px;
    background: rgba(8, 14, 18, .82);
    cursor: pointer;
}

input[type="checkbox"]:checked {
    border-color: var(--red);
    background: rgba(238, 37, 37, .1);
}

.primary-button,
.ghost-button,
.select-button,
.icon-button,
.add-card-button,
.tab,
.command-grid button,
.console-link {
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(10, 16, 20, .86);
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.primary-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 0 22px;
    border-color: rgba(238, 37, 37, .65);
    background: linear-gradient(180deg, #b01616, #801010);
    color: #fff;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 16px 34px rgba(138, 15, 15, .26);
}

.primary-button:hover,
.ghost-button:hover,
.select-button:hover,
.icon-button:hover,
.add-card-button:hover,
.command-grid button:hover,
.console-link:hover {
    border-color: var(--line-strong);
    transform: translateY(-1px);
}

.primary-button.compact {
    min-height: 42px;
    padding: 0 18px;
}

.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-height: 50px;
    padding: 0 18px;
    color: var(--soft);
}

.ghost-button.full {
    width: 100%;
}

.or-line {
    position: relative;
    display: grid;
    place-items: center;
    margin: 30px 0;
    color: var(--muted);
}

.or-line::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--line);
}

.or-line span {
    position: relative;
    padding: 0 22px;
    background: #070c10;
}

.auth-card footer {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin-top: 24px;
    color: var(--muted);
}

.auth-card footer span {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.auth-card footer i {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--green);
}

.form-error {
    margin-bottom: 22px;
    padding: 12px 14px;
    border: 1px solid rgba(238, 37, 37, .42);
    border-radius: 7px;
    background: rgba(238, 37, 37, .1);
    color: #ffb7b7;
}

.login-rail {
    align-self: start;
    margin-top: 18px;
    color: var(--muted);
    text-transform: uppercase;
    font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.login-rail span {
    display: block;
    margin-bottom: 26px;
    color: var(--soft);
}

.login-rail dt {
    margin-top: 22px;
}

.login-rail dd {
    margin: 6px 0 0;
    color: var(--text);
}

.app-body {
    min-height: 100vh;
    overflow-x: hidden;
}

.sidebar {
    position: fixed;
    z-index: 10;
    inset: 0 auto 0 0;
    width: var(--sidebar);
    overflow-x: hidden;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: rgba(2, 7, 10, .94);
    backdrop-filter: blur(18px);
}

.sidebar-brand {
    height: var(--topbar);
    display: flex;
    align-items: center;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
}

.sidebar-brand .brand-word {
    font-size: 30px;
    font-weight: 300;
}

.nav-group {
    display: grid;
    gap: 6px;
    padding: 22px 18px 0;
}

.nav-group > span {
    margin: 0 12px 8px;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 12px;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 18px;
    min-height: 48px;
    padding: 0 18px;
    border: 1px solid transparent;
    border-radius: 7px;
    color: var(--soft);
}

.nav-link svg {
    color: var(--text);
}

.nav-link.active {
    border-color: rgba(238, 37, 37, .62);
    background: linear-gradient(90deg, rgba(169, 18, 18, .78), rgba(91, 11, 11, .38));
    color: #fff;
}

.nav-link.active::after {
    content: "";
    position: absolute;
    right: 0;
    top: 8px;
    bottom: 8px;
    width: 2px;
    background: var(--red);
}

.system-card {
    position: relative;
    min-height: 214px;
    margin: auto 18px 20px;
    padding: 22px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(13, 22, 27, .82), rgba(6, 11, 14, .92));
}

.system-card h3 {
    margin: 0 0 22px;
    color: var(--muted);
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 600;
}

.system-card p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 22px;
    font-weight: 700;
}

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

.system-card small span {
    display: inline-block;
    width: 4px;
    height: 4px;
    margin: 0 8px;
    border-radius: 999px;
    background: var(--red);
}

.mini-network {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 84px;
}

.collapse-button {
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 0 34px;
    border: 0;
    border-top: 1px solid var(--line);
    background: transparent;
    color: var(--soft);
    cursor: pointer;
}

.app-main {
    min-height: 100vh;
    margin-left: var(--sidebar);
}

.topbar {
    position: sticky;
    z-index: 9;
    top: 0;
    height: var(--topbar);
    display: grid;
    grid-template-columns: auto minmax(300px, 680px) 1fr;
    align-items: center;
    gap: 22px;
    padding: 0 22px 0 32px;
    border-bottom: 1px solid var(--line);
    background: rgba(3, 8, 11, .86);
    backdrop-filter: blur(18px);
}

.global-search,
.panel-search {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 7px;
}

.global-search input,
.panel-search input {
    width: 100%;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
}

kbd {
    min-width: 34px;
    padding: 5px 8px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.top-actions {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-button {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    color: var(--soft);
}

.notification-button span {
    position: absolute;
    top: -7px;
    right: -6px;
    display: grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.online-pill {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(8, 14, 18, .82);
    font-weight: 700;
}

.user-pill {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    background: radial-gradient(circle at 35% 28%, #fff, #9daab2 48%, #101820 50%);
    color: #111820;
    font-weight: 900;
}

.user-pill b {
    display: grid;
    gap: 3px;
}

.user-pill small {
    color: var(--muted);
    font-weight: 500;
}

.content-frame {
    padding: 24px 30px 32px;
}

.page-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.page-title h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
}

.page-title nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
    color: var(--muted);
    font-size: 13px;
}

.page-title nav span + span::before {
    content: ">";
    margin-right: 12px;
    color: #56636c;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(190px, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}

.metric-card {
    position: relative;
    min-height: 148px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(13, 22, 27, .92), rgba(6, 11, 14, .94));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}

.metric-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 16% 18%, var(--tone-glow, rgba(238, 37, 37, .16)), transparent 32%);
    pointer-events: none;
}

.metric-card.tone-red {
    --tone-glow: rgba(238, 37, 37, .2);
}

.metric-card.tone-green {
    --tone-glow: rgba(37, 216, 102, .16);
}

.metric-card.tone-blue {
    --tone-glow: rgba(37, 135, 255, .18);
}

.metric-icon {
    position: absolute;
    left: 20px;
    top: 20px;
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border: 1px solid currentColor;
    border-radius: 17px;
    background: rgba(255, 255, 255, .03);
    color: var(--red);
}

.tone-green .metric-icon,
.tone-green .metric-delta {
    color: var(--green);
}

.tone-blue .metric-icon,
.tone-blue .metric-delta {
    color: var(--blue);
}

.metric-copy {
    position: relative;
    z-index: 1;
    margin-left: 96px;
    padding-top: 24px;
    padding-right: 84px;
}

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

.metric-copy span {
    font-weight: 700;
}

.metric-copy strong {
    display: block;
    margin: 6px 10px 6px 0;
    font-size: 30px;
    line-height: 1.08;
}

.metric-copy small {
    color: var(--soft);
}

.metric-delta {
    position: absolute;
    right: 20px;
    top: 57px;
    color: var(--green);
    font-weight: 800;
    min-width: 64px;
    text-align: right;
    white-space: nowrap;
}

.sparkline {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 16px;
    width: calc(100% - 36px);
    height: 42px;
}

.dashboard-grid,
.placeholder-grid {
    display: grid;
    grid-template-columns: 1.15fr .95fr .95fr;
    gap: 14px;
}

.panel {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(12, 20, 25, .92), rgba(6, 11, 14, .96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .03);
}

.panel header {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 18px;
    border-bottom: 1px solid var(--line);
}

.panel h2 {
    margin: 0;
    font-size: 15px;
}

.panel h2 span {
    margin-left: 8px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(255, 255, 255, .06);
    color: var(--muted);
    font-size: 12px;
}

.panel-wide {
    grid-column: span 1;
}

.area-chart {
    display: block;
    width: 100%;
    height: 238px;
    padding: 12px;
}

.select-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 36px;
    padding: 0 14px;
    color: var(--soft);
}

.health-list,
.workflow-list,
.log-list,
.group-list {
    display: grid;
    padding: 14px 18px;
}

.dashboard-events-list {
    display: grid;
    gap: 8px;
    padding: 14px 18px 18px;
}

.dashboard-event-row {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid rgba(var(--event-rgb), .24);
    border-left: 3px solid rgb(var(--event-rgb));
    border-radius: 5px;
    background: rgba(var(--event-rgb), .09);
    color: var(--text);
    text-decoration: none;
}

.dashboard-event-row:hover {
    border-color: rgba(var(--event-rgb), .55);
}

.dashboard-event-row time,
.dashboard-event-row > span {
    display: grid;
    align-content: start;
    gap: 3px;
    min-width: 0;
}

.dashboard-event-row time {
    color: var(--soft);
    font-size: 11px;
}

.dashboard-event-row time b {
    color: var(--text);
    font-size: 12px;
}

.dashboard-event-row > span strong {
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.3;
}

.dashboard-event-row > span small {
    color: var(--soft);
    font-size: 11px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.dashboard-events-empty {
    margin: 8px 0;
    color: var(--muted);
    font-size: 12px;
}

.health-row {
    display: grid;
    grid-template-columns: 24px 28px minmax(110px, 1fr) minmax(70px, 120px) 50px;
    gap: 12px;
    align-items: center;
    min-height: 42px;
}

.status-fan {
    position: relative;
    display: block;
    width: 22px;
    height: 22px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    color: var(--muted);
    font-style: normal;
    background: radial-gradient(circle, rgba(255, 255, 255, .14) 0 2px, transparent 3px);
}

.status-fan i {
    position: absolute;
    left: 9px;
    top: 2px;
    width: 4px;
    height: 8px;
    border-radius: 999px 999px 2px 2px;
    background: currentColor;
    transform-origin: 50% 9px;
}

.status-fan i:nth-child(2) {
    transform: rotate(90deg);
}

.status-fan i:nth-child(3) {
    transform: rotate(180deg);
}

.status-fan i:nth-child(4) {
    transform: rotate(270deg);
}

.fan-healthy,
.fan-running {
    color: var(--green);
    border-color: rgba(37, 216, 102, .32);
    box-shadow: 0 0 18px rgba(37, 216, 102, .18);
    animation: fan-spin 1.1s linear infinite;
}

.fan-degraded,
.fan-busy,
.fan-warning {
    color: var(--amber);
    border-color: rgba(255, 178, 46, .32);
    box-shadow: 0 0 18px rgba(255, 178, 46, .16);
}

.fan-failed,
.fan-blocked,
.fan-error {
    color: var(--red);
    border-color: rgba(238, 37, 37, .34);
}

@keyframes fan-spin {
    to {
        transform: rotate(360deg);
    }
}

.health-row span,
.workflow-row span,
.log-row span {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.health-row small,
.workflow-row small,
.log-row small {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.health-row small {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.health-row b {
    height: 7px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .07);
}

.health-row b i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #4ea75c, var(--green));
}

.health-row strong {
    justify-self: end;
    font-size: 12px;
}

.workflow-row {
    display: grid;
    grid-template-columns: 40px minmax(160px, 1fr) auto;
    gap: 12px;
    align-items: center;
    min-height: 58px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.workflow-row svg {
    color: var(--blue);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 68px;
    min-height: 26px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 6px;
    background: rgba(255, 255, 255, .06);
    color: var(--soft);
    font-size: 12px;
    font-weight: 700;
}

.status-running,
.status-healthy,
.status-completed,
.status-closed,
.status-info {
    background: rgba(37, 216, 102, .13);
    color: var(--green);
}

.status-queued,
.status-ready,
.status-review,
.status-in-progress {
    background: rgba(37, 135, 255, .13);
    color: var(--blue);
}

.status-degraded,
.status-busy,
.status-test,
.status-warning {
    background: rgba(255, 178, 46, .13);
    color: var(--amber);
}

.status-failed,
.status-blocked,
.status-error {
    background: rgba(238, 37, 37, .13);
    color: #ff6c6c;
}

.panel-table {
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 12px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
    text-align: left;
    vertical-align: middle;
}

th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
}

td {
    color: var(--soft);
}

td:first-child {
    color: var(--text);
}

td svg {
    margin-right: 8px;
    vertical-align: middle;
}

.log-list {
    gap: 0;
}

.log-row {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    min-height: 38px;
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.log-row i {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--blue);
}

.log-row.level-info i {
    background: var(--green);
}

.log-row.level-warning i {
    background: var(--amber);
}

.log-row.level-error i {
    background: var(--red);
}

.log-row time {
    color: var(--muted);
    font-size: 12px;
}

.log-list.compact .log-row {
    grid-template-columns: 64px 10px minmax(0, 1fr);
}

.model-panel {
    grid-column: span 1;
}

.model-usage {
    display: grid;
    grid-template-columns: 170px 1fr;
    gap: 18px;
    align-items: center;
    padding: 18px;
}

.donut-chart {
    width: 150px;
    height: 150px;
}

.model-usage ul {
    display: grid;
    gap: 12px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.model-usage li {
    display: grid;
    grid-template-columns: 12px minmax(80px, 1fr) auto;
    gap: 10px;
    color: var(--soft);
}

.model-usage li > i {
    width: 10px;
    height: 10px;
    margin-top: 4px;
    border-radius: 3px;
    background: var(--blue);
}

.model-usage li:nth-child(2) > i {
    background: var(--red);
}

.model-usage li:nth-child(3) > i {
    background: #0f56c9;
}

.model-usage li:nth-child(4) > i {
    background: var(--violet);
}

.model-usage li > span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.model-usage li strong {
    color: var(--text);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.model-usage li small {
    color: var(--muted);
    font-size: 11px;
}

.model-panel h3 {
    margin: 4px 18px 12px;
    color: #74baff;
    font-size: 15px;
}

.stacked-bar {
    display: flex;
    height: 18px;
    margin: 0 18px 14px;
    overflow: hidden;
    border-radius: 4px;
    background: rgba(255, 255, 255, .08);
}

.stacked-bar i:nth-child(1) {
    background: var(--blue);
}

.stacked-bar i:nth-child(2) {
    background: #cf202c;
}

.stacked-bar i:nth-child(3) {
    background: #0b54c8;
}

.stacked-bar i:nth-child(4) {
    background: #a5adb5;
}

.legend {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    padding: 0 18px 18px;
    color: var(--muted);
    font-size: 12px;
}

.legend b {
    color: var(--soft);
    font-weight: 700;
}

.model-snapshot,
.model-empty {
    margin: 0;
    padding: 0 18px 18px;
    color: var(--muted);
    font-size: 11px;
}

.agents-grid {
    display: grid;
    grid-template-columns: minmax(700px, 1.65fr) minmax(330px, .9fr);
    gap: 14px;
}

.fleet-panel {
    grid-row: span 2;
}

.fleet-panel header {
    flex-wrap: wrap;
    padding: 10px 18px;
}

.fleet-panel .panel-search {
    min-width: 260px;
    flex: 1;
}

.queue-meter {
    position: relative;
    display: inline-block;
    width: 58px;
    height: 16px;
    margin-right: 8px;
    vertical-align: middle;
    background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .08) 0 3px, transparent 3px 5px);
}

.queue-meter::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--queue);
    background: repeating-linear-gradient(90deg, var(--blue) 0 3px, transparent 3px 5px);
}

.danger-text {
    color: #ff5757;
}

.fleet-panel footer {
    padding: 18px;
    color: var(--muted);
}

.tool-panel,
.dispatch-panel {
    min-height: 270px;
}

.avatar-stack {
    display: inline-flex;
    margin-right: 8px;
}

.avatar-stack i {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    margin-right: -7px;
    border: 1px solid #0b1115;
    border-radius: 999px;
    background: linear-gradient(135deg, #f8f8f8, #b6c1c9);
    color: #101820;
    font-size: 10px;
    font-style: normal;
    font-weight: 900;
}

.dispatch-panel form {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.dispatch-panel textarea {
    min-height: 78px;
    resize: vertical;
}

.modal-card input,
.modal-card select,
.dispatch-panel input,
.dispatch-panel select,
.dispatch-panel textarea {
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border-radius: 6px;
    outline: 0;
}

.dispatch-panel textarea {
    padding-top: 10px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.tab {
    min-height: 34px;
    padding: 0 12px;
    border-color: transparent;
    color: var(--muted);
}

.tab.active {
    border-bottom-color: var(--red);
    color: var(--text);
}

.group-list {
    gap: 8px;
}

.group-list div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 34px;
}

.group-list span {
    display: flex;
    align-items: center;
    gap: 8px;
}

.group-list small {
    color: var(--muted);
}

.group-list b {
    color: var(--green);
    font-size: 12px;
}

.command-panel h2 {
    margin: 18px 18px 12px;
}

.command-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    padding: 0 18px 18px;
}

.command-grid.single {
    grid-template-columns: 1fr;
    padding-top: 18px;
}

.command-grid button,
.console-link {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 12px;
    align-items: center;
    min-height: 70px;
    padding: 12px;
    text-align: left;
}

.command-grid small,
.console-link small {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.workflow-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

.workflow-toolbar .panel-search {
    margin-left: auto;
    width: 260px;
}

.green-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--green);
}

.kanban-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(230px, 1fr));
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.kanban-column {
    min-height: 650px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(180deg, rgba(12, 20, 25, .92), rgba(6, 11, 14, .96));
}

.kanban-column.drag-over {
    border-color: rgba(37, 135, 255, .65);
    box-shadow: inset 0 0 0 1px rgba(37, 135, 255, .35);
}

.kanban-column header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 58px;
    padding: 0 14px;
}

.kanban-column h2 {
    margin: 0;
    font-size: 17px;
}

.kanban-column h2 span {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 26px;
    margin-left: 8px;
    border-radius: 7px;
    background: rgba(255, 255, 255, .08);
    color: var(--muted);
    font-size: 13px;
}

.kanban-dropzone {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 520px;
    padding: 0 12px 12px;
}

.task-card {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: linear-gradient(180deg, rgba(17, 27, 33, .92), rgba(8, 14, 18, .95));
    cursor: grab;
}

.task-card.dragging {
    opacity: .45;
}

.task-card header {
    min-height: 0;
    display: grid;
    grid-template-columns: 1fr 32px;
    gap: 8px;
    padding: 0;
}

.task-card h3 {
    margin: 0;
    font-size: 15px;
    line-height: 1.35;
}

.task-tags {
    display: flex;
    gap: 8px;
    margin: 10px 0 12px;
}

.tag,
.priority {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 800;
}

.tag-build,
.tag-research,
.tag-enhancement,
.tag-docs {
    background: rgba(37, 135, 255, .16);
    color: #74baff;
}

.tag-data {
    background: rgba(141, 91, 255, .18);
    color: #c2a8ff;
}

.tag-model {
    background: rgba(37, 216, 102, .14);
    color: var(--green);
}

.priority-high {
    background: rgba(238, 37, 37, .14);
    color: #ff7676;
}

.priority-medium {
    background: rgba(255, 178, 46, .14);
    color: var(--amber);
}

.priority-low {
    background: rgba(37, 216, 102, .14);
    color: var(--green);
}

.task-card p {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin: 0;
    color: var(--soft);
    font-size: 12px;
}

.task-card p span {
    margin-left: auto;
}

.progress-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
    margin-top: 12px;
    color: var(--soft);
    font-size: 12px;
}

.progress-row span {
    height: 4px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
}

.progress-row i {
    display: block;
    height: 100%;
    background: var(--blue);
}

.task-card footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    color: var(--muted);
}

.task-card footer strong {
    color: var(--red);
}

.task-card footer .done-mark {
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 999px;
    color: var(--green);
}

.add-card-button {
    width: calc(100% - 24px);
    min-height: 42px;
    margin: 0 12px 12px;
    color: var(--soft);
}

.kanban-summary {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) repeat(6, minmax(110px, auto));
    gap: 18px;
    align-items: center;
    min-height: 70px;
    margin-top: 12px;
    padding: 0 26px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.kanban-summary span {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--soft);
}

.kanban-summary i {
    width: 9px;
    height: 9px;
    border-radius: 999px;
}

.p-high {
    background: var(--red);
}

.p-medium {
    background: var(--amber);
}

.p-low {
    background: var(--green);
}

.kanban-summary b {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 12px;
}

.kanban-summary strong {
    color: var(--text);
    font-size: 18px;
}

.hr-mode-tabs {
    margin-bottom: 12px;
}

.hr-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.hr-toolbar .panel-search {
    width: min(360px, 100%);
}

.hr-kanban-board {
    display: grid;
    grid-template-columns: repeat(5, minmax(250px, 1fr));
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.hr-kanban-board[hidden] {
    display: none;
}

.hr-offers-panel[hidden] {
    display: none;
}

.hr-kanban-column {
    display: flex;
    min-height: 710px;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(8, 14, 18, .78);
}

.hr-kanban-column.drag-over {
    border-color: rgba(37, 135, 255, .65);
    box-shadow: inset 0 0 0 1px rgba(37, 135, 255, .35);
}

.hr-kanban-column > header {
    display: flex;
    align-items: center;
    min-height: 58px;
    padding: 0 14px;
    border-bottom: 1px solid var(--line);
}

.hr-kanban-column h2 {
    margin: 0;
    font-size: 14px;
}

.hr-kanban-column h2 span {
    display: inline-grid;
    min-width: 26px;
    height: 24px;
    place-items: center;
    margin-left: 7px;
    border-radius: 5px;
    background: rgba(255, 255, 255, .08);
    color: var(--muted);
    font-size: 12px;
}

.hr-kanban-dropzone {
    display: grid;
    align-content: start;
    flex: 1;
    gap: 8px;
    min-height: 584px;
    padding: 12px;
}

.hr-column-empty {
    margin: 0;
    padding: 18px 8px;
    color: var(--muted);
    font-size: 13px;
    text-align: center;
}

.hr-kanban-card {
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(17, 27, 33, .88);
    cursor: grab;
}

.hr-kanban-card.dragging {
    opacity: .45;
}

.hr-kanban-card > header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 30px;
    gap: 8px;
    align-items: start;
}

.hr-kanban-card h3,
.hr-kanban-card header p,
.hr-kanban-card h4,
.hr-kanban-card dl,
.hr-kanban-card .hr-cv-status,
.hr-card-description p {
    margin: 0;
}

.hr-kanban-card h3 {
    overflow-wrap: anywhere;
    font-size: 15px;
    line-height: 1.35;
}

.hr-kanban-card header p {
    margin-top: 3px;
    overflow-wrap: anywhere;
    color: var(--soft);
    font-size: 12px;
    line-height: 1.35;
}

.hr-kanban-card .icon-button {
    width: 30px;
    height: 30px;
    padding: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
}

.hr-kanban-card dl {
    margin-top: 12px;
}

.hr-kanban-card dl div {
    display: grid;
    gap: 3px;
}

.hr-kanban-card dt {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.hr-kanban-card dd {
    overflow-wrap: anywhere;
    color: var(--text);
    font-size: 12px;
    line-height: 1.4;
}

.hr-listing-link {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    margin-top: 11px;
    color: #74baff;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

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

.hr-listing-link.is-empty {
    color: var(--muted);
    font-weight: 500;
}

.hr-cv-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px !important;
    color: #ff8585;
    font-size: 12px;
    font-weight: 700;
}

.hr-cv-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.hr-cv-status.is-sent {
    color: var(--green);
}

.hr-card-description {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.hr-card-description h4 {
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

.hr-card-description p {
    margin-top: 5px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    color: var(--soft);
    font-size: 12px;
    line-height: 1.45;
}

.hr-file-list {
    display: grid;
    gap: 5px;
    margin: 12px 0 0;
    padding: 10px 0 0;
    border-top: 1px solid var(--line);
    list-style: none;
}

.hr-file-list a {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 6px;
    color: #74baff;
    font-size: 11px;
    text-decoration: none;
}

.hr-file-list a:hover {
    color: var(--text);
}

.hr-file-list svg {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.hr-file-list span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hr-offers-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.hr-offers-toolbar h2,
.hr-offers-toolbar p {
    margin: 0;
}

.hr-offers-toolbar h2 {
    font-size: 20px;
}

.hr-offers-toolbar p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.hr-offers-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(8, 14, 18, .72);
}

.hr-offers-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
}

.hr-offers-table th,
.hr-offers-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.hr-offers-table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.hr-offers-table tbody tr:last-child td {
    border-bottom: 0;
}

.hr-offers-table tbody tr:hover {
    background: rgba(255, 255, 255, .025);
}

.hr-offers-table td:nth-child(1) {
    width: 76px;
    white-space: nowrap;
}

.hr-offers-table td:nth-child(2) {
    min-width: 200px;
}

.hr-offers-table td:nth-child(3) {
    color: var(--soft);
    line-height: 1.45;
    white-space: pre-wrap;
}

.hr-offers-table code {
    color: var(--soft);
    font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.hr-offers-table .icon-button {
    width: 30px;
    height: 30px;
    padding: 0;
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
}

.hr-offers-empty {
    margin: 0;
    padding: 22px;
    color: var(--muted);
    font-size: 13px;
}

.projects-page {
    min-width: 0;
}

.projects-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
}

.projects-toolbar .panel-search {
    width: min(360px, 100%);
}

.projects-toolbar > div {
    display: flex;
    align-items: center;
    gap: 8px;
}

.projects-toolbar .icon-button {
    width: 38px;
    height: 38px;
}

.projects-error {
    margin: 0 0 12px;
}

.projects-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(8, 14, 18, .72);
}

.projects-table {
    width: 100%;
    min-width: 1460px;
    border-collapse: collapse;
}

.projects-table th,
.projects-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.projects-table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.projects-table tbody tr:last-child td {
    border-bottom: 0;
}

.projects-table tbody tr:hover {
    background: rgba(255, 255, 255, .025);
}

.projects-table td:first-child {
    width: 76px;
    white-space: nowrap;
}

.projects-table td:nth-child(2) {
    min-width: 180px;
}

.projects-table code {
    color: var(--soft);
    font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.project-description {
    min-width: 260px;
    max-width: 390px;
    color: var(--soft);
    line-height: 1.45;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.project-path {
    display: block;
    min-width: 190px;
    max-width: 260px;
    overflow-wrap: anywhere;
    white-space: normal;
}

.project-target {
    display: block;
    min-width: 130px;
    max-width: 220px;
    overflow-wrap: anywhere;
    color: var(--soft);
    font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
    line-height: 1.45;
}

.project-agents-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-width: 120px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.project-agents-status i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.project-agents-status.state-exists {
    color: var(--green);
}

.project-agents-status.state-missing,
.project-agents-status.state-unreadable,
.project-agents-status.state-invalid_file,
.project-agents-status.state-repository_unavailable {
    color: #ff8585;
}

.project-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.project-actions .icon-button {
    width: 32px;
    height: 32px;
    padding: 0;
}

.project-actions .project-delete-action {
    color: #ff8585;
}

.projects-empty {
    margin: 0;
    padding: 22px;
    color: var(--muted);
    font-size: 13px;
}

.project-modal {
    width: min(100%, 760px);
    max-height: calc(100vh - 48px);
    overflow: auto;
}

.project-modal textarea {
    min-height: 170px;
    resize: none;
}

.project-agents-modal {
    width: min(100%, 920px);
    max-height: calc(100vh - 48px);
    overflow: auto;
}

.project-agents-modal textarea {
    min-height: 460px;
    resize: vertical;
    font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.project-agents-path {
    margin: -6px 0 0;
    overflow-wrap: anywhere;
    color: var(--muted);
    font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.hr-item-modal textarea {
    min-height: 180px;
    resize: none;
}

.hr-item-modal {
    max-height: calc(100vh - 48px);
    overflow: auto;
}

.hr-item-modal small {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
}

.hr-modal-files {
    display: grid;
    gap: 8px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.hr-modal-files h3 {
    margin: 0;
    color: var(--soft);
    font-size: 12px;
}

.hr-modal-files .hr-file-list {
    margin: 0;
    padding: 0;
    border: 0;
}

.placeholder-grid {
    grid-template-columns: 1fr 420px;
}

.placeholder-grid .panel-wide,
.placeholder-grid .panel-table {
    grid-column: span 1;
}

.modal-backdrop {
    position: fixed;
    z-index: 30;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, .72);
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-card {
    width: min(100%, 520px);
    display: grid;
    gap: 16px;
    padding: 22px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.hr-offer-modal {
    width: min(100%, 720px);
    max-height: calc(100vh - 48px);
    overflow: auto;
}

.hr-offer-modal textarea {
    min-height: 320px;
    resize: none;
}

.modal-card header,
.modal-card footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.modal-card h2 {
    margin: 0;
}

.modal-card footer {
    justify-content: flex-end;
}

.calendar-page {
    min-width: 0;
}

.calendar-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.cashflow-balance-panel {
    margin-bottom: 14px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: linear-gradient(110deg, rgba(9, 25, 22, .9), rgba(7, 15, 21, .92));
}

.cashflow-tab-panel {
    min-width: 0;
}

.cashflow-mode-tabs {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin: 0 0 16px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(8, 14, 18, .8);
}

.cashflow-mode-tabs button {
    min-height: 36px;
    padding: 0 16px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
    font-weight: 700;
    cursor: pointer;
}

.cashflow-mode-tabs button.active {
    background: rgba(238, 37, 37, .2);
    color: var(--text);
}

.cashflow-balance-panel header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px 0;
}

.cashflow-balance-panel header p,
.cashflow-balance-panel h2 {
    margin: 0;
}

.cashflow-balance-panel header p {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.cashflow-balance-panel h2 {
    margin-top: 4px;
    font-size: 27px;
}

.cashflow-balance-stats {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 18px;
}

.cashflow-balance-stats span {
    display: grid;
    gap: 3px;
    color: var(--muted);
    font-size: 12px;
}

.cashflow-balance-stats b {
    color: var(--text);
    font-size: 14px;
}

.cashflow-balance-stats span:first-child b {
    color: var(--green);
}

.cashflow-balance-stats span:last-child b {
    color: #ff8585;
}

.cashflow-chart {
    display: block;
    width: 100%;
    height: 190px;
    padding: 10px 12px 0;
}

.cashflow-report-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(280px, .8fr);
    gap: 14px;
}

.cashflow-report-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.cashflow-report-table-panel {
    margin-top: 14px;
}

.cashflow-report-table-panel h2 {
    margin: 0;
}

.cashflow-report-table-wrap {
    overflow-x: auto;
}

.cashflow-report-table {
    width: 100%;
    min-width: 680px;
    border-collapse: collapse;
}

.cashflow-report-table th,
.cashflow-report-table td {
    padding: 11px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.cashflow-report-table th {
    padding-top: 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.cashflow-report-table th button {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}

.cashflow-report-table th button:hover,
.cashflow-report-table th button.active {
    color: var(--text);
}

.cashflow-report-table th button.active {
    text-decoration: underline;
    text-underline-offset: 4px;
}

.cashflow-report-table tbody tr:last-child td {
    border-bottom: 0;
}

.cashflow-report-table tbody tr:hover {
    background: rgba(255, 255, 255, .025);
}

.cashflow-report-table td > strong {
    font-size: 13px;
}

.cashflow-report-table code {
    color: var(--soft);
    font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.cashflow-report-date {
    display: grid;
    gap: 2px;
    white-space: nowrap;
}

.cashflow-report-date span {
    color: var(--text);
    font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.cashflow-report-date small {
    color: var(--muted);
    font: 11px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.cashflow-report-amount {
    font: 800 13px ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: nowrap;
}

.cashflow-report-amount.income {
    color: var(--green);
}

.cashflow-report-amount.outcome {
    color: #ff8585;
}

.cashflow-report-empty {
    margin: 0;
    padding: 22px 16px 8px;
    color: var(--muted);
    font-size: 13px;
}

.cashflow-analysis-panel header,
.cashflow-insights-panel header {
    align-items: flex-start;
}

.cashflow-analysis-panel header h2,
.cashflow-insights-panel header h2 {
    margin: 0;
}

.cashflow-analysis-panel header p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    text-transform: capitalize;
}

.cashflow-analysis-chart {
    display: block;
    width: 100%;
    height: 250px;
    padding: 0 12px 12px;
}

.cashflow-insights-panel {
    display: grid;
    align-content: start;
}

.cashflow-insights-panel dl {
    display: grid;
    gap: 1px;
    margin: 0;
    border-top: 1px solid var(--line);
}

.cashflow-insights-panel dl div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.cashflow-insights-panel dt {
    color: var(--muted);
    font-size: 13px;
}

.cashflow-insights-panel dd {
    margin: 0;
    font-weight: 800;
}

.cashflow-insights-panel .income {
    color: var(--green);
}

.cashflow-insights-panel .outcome {
    color: #ff8585;
}

.cashflow-insights-panel > p {
    margin: 16px 0 0;
    color: var(--soft);
    font-size: 13px;
    line-height: 1.5;
}

.cashflow-balances-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 14px;
}

.cashflow-balances-toolbar h2,
.cashflow-balances-toolbar p {
    margin: 0;
}

.cashflow-balances-toolbar h2 {
    font-size: 20px;
}

.cashflow-balances-toolbar p {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.cashflow-accounts-error {
    margin: 0 0 12px;
}

.cashflow-accounts-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(8, 14, 18, .72);
}

.cashflow-accounts-table {
    width: 100%;
    min-width: 840px;
    border-collapse: collapse;
}

.cashflow-accounts-table th,
.cashflow-accounts-table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.cashflow-accounts-table th {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.cashflow-accounts-table tbody tr:last-child td {
    border-bottom: 0;
}

.cashflow-accounts-table tfoot th,
.cashflow-accounts-table tfoot td {
    padding: 16px 12px;
    border-top: 1px solid var(--line-strong);
    border-bottom: 0;
    background: rgba(255, 255, 255, .045);
}

.cashflow-accounts-summary-row th {
    color: var(--text);
    font-size: 15px;
    font-weight: 800;
    text-align: right;
    text-transform: uppercase;
}

.cashflow-accounts-summary-row td {
    color: var(--text);
    font: 800 16px ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: nowrap;
}

.cashflow-accounts-summary-row [data-cashflow-accounts-balance-total] {
    color: var(--green);
}

.cashflow-accounts-summary-row [data-cashflow-accounts-credit-total] {
    color: #ff8585;
}

.cashflow-accounts-table tbody tr.is-new {
    background: rgba(37, 135, 255, .07);
}

.cashflow-accounts-table input {
    width: 100%;
    min-width: 0;
    padding: 8px 9px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: rgba(2, 7, 10, .62);
    color: var(--text);
}

.cashflow-accounts-table input:hover,
.cashflow-accounts-table input:focus {
    border-color: var(--line-strong);
    outline: 0;
}

.cashflow-accounts-table th:first-child,
.cashflow-accounts-table td:first-child {
    width: 76px;
    white-space: nowrap;
}

.cashflow-accounts-table td:nth-child(4),
.cashflow-accounts-table td:nth-child(5) {
    min-width: 145px;
}

.cashflow-accounts-table code {
    color: var(--soft);
    font: 12px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.cashflow-account-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 94px;
}

.cashflow-account-actions [data-delete-cashflow-account] {
    color: #ff8585;
}

.cashflow-accounts-empty {
    margin: 0;
    padding: 22px;
    color: var(--muted);
    font-size: 13px;
}

.cashflow-grid-month {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--line);
    background: rgba(5, 11, 14, .8);
}

.calendar-surface .cashflow-grid-month {
    border: 0;
}

.cashflow-day {
    min-height: 112px;
    min-width: 0;
    padding: 8px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: rgba(8, 14, 18, .44);
}

.cashflow-day:nth-child(7n) {
    border-right: 0;
}

.cashflow-day:nth-last-child(-n + 7) {
    border-bottom: 0;
}

.cashflow-day.is-outside-month {
    background: rgba(255, 255, 255, .018);
}

.cashflow-day.is-outside-month .calendar-date {
    color: #526069;
}

.cashflow-day.is-today .calendar-date {
    border-color: var(--red);
    background: rgba(238, 37, 37, .18);
    color: #fff;
}

.cashflow-day-entries {
    display: grid;
    align-content: start;
    gap: 5px;
    min-width: 0;
    margin-top: 8px;
}

.cashflow-entry {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: start;
    gap: 7px;
    width: 100%;
    min-width: 0;
    padding: 6px 7px;
    border: 1px solid transparent;
    border-left-width: 3px;
    border-radius: 4px;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.cashflow-entry:hover {
    border-color: rgba(255, 255, 255, .24);
}

.cashflow-entry time {
    color: var(--soft);
    font: 10px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.cashflow-entry > span {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.cashflow-entry strong,
.cashflow-entry small {
    overflow-wrap: anywhere;
}

.cashflow-entry strong {
    font-size: 11px;
    line-height: 1.3;
}

.cashflow-entry small {
    color: var(--soft);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.35;
}

.cashflow-entry b {
    font: 700 10px ui-monospace, SFMono-Regular, Menlo, monospace;
    white-space: nowrap;
}

/* W komórce miesiąca nazwa i opis muszą mieć całą szerokość dnia. */
.cashflow-day .cashflow-entry {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 3px 7px;
}

.cashflow-day .cashflow-entry time {
    grid-column: 1;
    grid-row: 1;
}

.cashflow-day .cashflow-entry b {
    grid-column: 2;
    grid-row: 1;
}

.cashflow-day .cashflow-entry > span {
    grid-column: 1 / -1;
    grid-row: 2;
}

.cashflow-income {
    border-left-color: var(--green);
    background: rgba(37, 216, 102, .11);
}

.cashflow-income b {
    color: var(--green);
}

.cashflow-outcome {
    border-left-color: var(--red);
    background: rgba(238, 37, 37, .11);
}

.cashflow-outcome b {
    color: #ff8585;
}

.cashflow-agenda-grid {
    display: grid;
    align-items: start;
    gap: 10px;
}

.cashflow-agenda-7 {
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.cashflow-agenda-1 {
    grid-template-columns: minmax(0, 1fr);
}

.cashflow-agenda-day {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(8, 14, 18, .72);
}

.cashflow-agenda-entries {
    display: grid;
    align-content: start;
    gap: 6px;
    min-height: 158px;
    padding: 10px;
}

.cashflow-empty-day {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.cashflow-totals-card {
    display: grid;
    gap: 7px;
    padding: 16px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--green);
    border-radius: 7px;
    background: rgba(8, 14, 18, .72);
}

.cashflow-totals-card p,
.cashflow-totals-card span {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.cashflow-totals-card p {
    font-weight: 800;
    text-transform: uppercase;
}

.cashflow-totals-card strong {
    font-size: 19px;
}

.cashflow-totals-card span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.cashflow-totals-card span b {
    color: var(--text);
}

.cashflow-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: var(--muted);
    font-size: 12px;
}

.cashflow-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.cashflow-legend i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.cashflow-income-dot {
    background: var(--green);
}

.cashflow-outcome-dot {
    background: var(--red);
}

.cashflow-entry-modal {
    width: min(100%, 620px);
}

.cashflow-type-toggle {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.cashflow-type-toggle legend {
    grid-column: 1 / -1;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 600;
}

.cashflow-type-toggle label {
    position: relative;
    display: block;
    cursor: pointer;
}

.cashflow-type-toggle input {
    position: absolute;
    opacity: 0;
}

.cashflow-type-toggle span {
    display: grid;
    place-items: center;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--muted);
    font-weight: 800;
}

.cashflow-type-toggle label:first-of-type input:checked + span {
    border-color: rgba(37, 216, 102, .7);
    background: rgba(37, 216, 102, .13);
    color: var(--green);
}

.cashflow-type-toggle label:last-of-type input:checked + span {
    border-color: rgba(238, 37, 37, .7);
    background: rgba(238, 37, 37, .13);
    color: #ff8585;
}

.cashflow-type-toggle input:focus-visible + span {
    outline: 2px solid rgba(37, 135, 255, .7);
    outline-offset: 2px;
}

.cashflow-entry-modal [data-cashflow-gross] {
    color: var(--green);
    font-weight: 800;
}

.cashflow-delete-button {
    margin-right: auto;
    border-color: rgba(238, 37, 37, .5);
    color: #ffb7b7;
}

.cashflow-delete-button[hidden] {
    display: none;
}

.calendar-workspace {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 272px;
    align-items: start;
    gap: 16px;
}

.calendar-surface {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(5, 11, 14, .8);
}

.calendar-inspector {
    display: grid;
    gap: 12px;
}

.calendar-inspector[hidden],
.calendar-weekdays[hidden] {
    display: none;
}

.calendar-today-card,
.calendar-upcoming-card {
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(8, 14, 18, .72);
}

.calendar-today-card {
    display: grid;
    gap: 5px;
    padding: 16px;
    border-left: 3px solid var(--red);
}

.calendar-today-card p,
.calendar-today-card span {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.calendar-today-card p {
    font-weight: 800;
    text-transform: uppercase;
}

.calendar-today-card strong {
    color: var(--text);
    font-size: 18px;
    text-transform: capitalize;
}

.calendar-upcoming-card header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
}

.calendar-upcoming-card h2 {
    margin: 0;
    font-size: 14px;
}

.calendar-upcoming-card > div {
    display: grid;
    gap: 7px;
    padding: 10px;
}

.calendar-navigation,
.calendar-actions,
.calendar-view-toggle,
.calendar-event-options,
.calendar-legend,
.recurrence-times {
    display: flex;
    align-items: center;
    gap: 10px;
}

.calendar-navigation h2 {
    min-width: 220px;
    margin: 0 0 0 8px;
    font-size: 20px;
    text-transform: capitalize;
}

.calendar-navigation .ghost-button {
    min-height: 38px;
    padding: 0 14px;
}

.calendar-view-toggle {
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(8, 14, 18, .8);
}

.calendar-view-toggle button {
    min-height: 34px;
    padding: 0 12px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.calendar-view-toggle button.active {
    background: rgba(238, 37, 37, .2);
    color: var(--text);
}

.calendar-weekdays {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--line);
    border-bottom: 0;
    background: rgba(9, 16, 20, .86);
}

.calendar-surface .calendar-weekdays {
    border: 0;
    border-bottom: 1px solid var(--line);
}

.calendar-weekdays span {
    padding: 12px 14px;
    border-right: 1px solid var(--line);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.calendar-weekdays span:last-child {
    border-right: 0;
}

.calendar-grid-month {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border: 1px solid var(--line);
    background: rgba(5, 11, 14, .8);
}

.calendar-surface .calendar-grid-month {
    border: 0;
}

.calendar-day {
    min-height: 112px;
    padding: 8px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background: rgba(8, 14, 18, .44);
}

.calendar-surface .calendar-day {
    min-height: 86px;
}

.calendar-day:nth-child(7n) {
    border-right: 0;
}

.calendar-day:nth-last-child(-n + 7) {
    border-bottom: 0;
}

.calendar-day.is-outside-month {
    background: rgba(255, 255, 255, .018);
}

.calendar-day.is-outside-month .calendar-date {
    color: #526069;
}

.calendar-day.is-today .calendar-date {
    border-color: var(--red);
    background: rgba(238, 37, 37, .18);
    color: #fff;
}

.calendar-date,
.calendar-agenda-heading {
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.calendar-date {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    margin-left: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    font-weight: 800;
}

.calendar-date:hover,
.calendar-agenda-heading:hover {
    color: #fff;
}

.calendar-day-events {
    display: grid;
    align-content: start;
    gap: 5px;
    margin-top: 8px;
    min-width: 0;
}

.calendar-day-events small {
    padding-left: 5px;
    color: var(--muted);
    font-size: 11px;
}

.calendar-event {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
    width: 100%;
    min-width: 0;
    padding: 5px 7px;
    overflow: hidden;
    border: 1px solid transparent;
    border-left-width: 3px;
    border-radius: 4px;
    color: var(--text);
    font-size: 11px;
    line-height: 1.3;
    text-align: left;
    cursor: pointer;
}

.calendar-event:hover {
    border-color: rgba(255, 255, 255, .25);
}

.calendar-event time {
    display: block;
    color: var(--soft);
    font: 10px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.calendar-event-content,
.calendar-upcoming-content {
    display: grid;
    gap: 2px;
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

.calendar-event-content strong,
.calendar-upcoming-content strong {
    font-weight: 800;
}

.calendar-event-content small,
.calendar-upcoming-content small {
    color: var(--soft);
    font-weight: 500;
    line-height: 1.35;
}

.calendar-event-content small {
    font-size: 11px;
}

.event-color-blue {
    --event-rgb: 37, 135, 255;
}

.event-color-red {
    --event-rgb: 238, 37, 37;
}

.event-color-green {
    --event-rgb: 37, 216, 102;
}

.event-color-amber {
    --event-rgb: 255, 178, 46;
}

.event-color-violet {
    --event-rgb: 141, 91, 255;
}

.calendar-event.event-color-blue,
.calendar-event.event-color-red,
.calendar-event.event-color-green,
.calendar-event.event-color-amber,
.calendar-event.event-color-violet {
    border-left-color: rgb(var(--event-rgb));
    background: rgba(var(--event-rgb), .15);
}

.calendar-agenda-grid {
    display: grid;
    align-items: start;
    gap: 10px;
}

.is-agenda-view .calendar-workspace {
    grid-template-columns: minmax(0, 1fr);
}

.is-agenda-view .calendar-surface {
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.calendar-agenda-7 {
    min-width: 0;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-agenda-1 {
    grid-template-columns: minmax(0, 1fr);
}

.calendar-agenda-day {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(8, 14, 18, .72);
}

.calendar-agenda-heading {
    width: 100%;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.calendar-agenda-heading strong {
    text-transform: capitalize;
}

.calendar-agenda-heading span {
    color: var(--muted);
    font-size: 12px;
}

.calendar-agenda-events {
    display: grid;
    align-content: start;
    gap: 6px;
    min-height: 158px;
    padding: 10px;
}

.calendar-empty-day {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
}

.calendar-day-focus {
    min-height: 0;
}

.calendar-all-day-events {
    display: grid;
    gap: 6px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
}

.calendar-day-timeline {
    display: grid;
}

.calendar-day-slot {
    display: grid;
    grid-template-columns: 68px minmax(0, 1fr);
    min-height: 48px;
    border-bottom: 1px solid rgba(130, 150, 160, .11);
}

.calendar-day-slot:last-child {
    border-bottom: 0;
}

.calendar-day-slot > time {
    padding: 12px 14px;
    color: var(--muted);
    font: 11px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.calendar-day-slot > div {
    display: grid;
    align-content: start;
    gap: 5px;
    padding: 5px 12px 5px 0;
    border-left: 1px solid rgba(130, 150, 160, .11);
}

.calendar-upcoming-event {
    display: grid;
    gap: 3px;
    width: 100%;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-left-width: 3px;
    border-radius: 4px;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}

.calendar-upcoming-event time {
    color: var(--soft);
    font: 10px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.calendar-upcoming-content {
    font-size: 12px;
}

.calendar-upcoming-content small {
    font-size: 11px;
}

.calendar-upcoming-event.event-color-blue,
.calendar-upcoming-event.event-color-red,
.calendar-upcoming-event.event-color-green,
.calendar-upcoming-event.event-color-amber,
.calendar-upcoming-event.event-color-violet {
    border-left-color: rgb(var(--event-rgb));
    background: rgba(var(--event-rgb), .1);
}

.calendar-empty-upcoming {
    margin: 0;
    padding: 8px 4px;
    color: var(--muted);
    font-size: 12px;
}

.calendar-hour {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr);
    min-height: 48px;
    border-bottom: 1px solid rgba(130, 150, 160, .11);
}

.calendar-hour:last-child {
    border-bottom: 0;
}

.calendar-hour > time {
    padding: 10px 8px;
    color: var(--muted);
    font: 11px ui-monospace, SFMono-Regular, Menlo, monospace;
}

.calendar-hour > div {
    display: grid;
    align-content: start;
    gap: 4px;
    padding: 5px 7px 5px 0;
    border-left: 1px solid rgba(130, 150, 160, .11);
}

.calendar-legend {
    flex-wrap: wrap;
    margin-top: 14px;
    color: var(--muted);
    font-size: 12px;
}

.calendar-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.calendar-legend i,
.calendar-color-picker i {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgb(var(--event-rgb));
}

.calendar-event-modal {
    width: min(100%, 720px);
    max-height: calc(100vh - 48px);
    overflow-y: auto;
}

.calendar-event-modal .form-error {
    margin: -2px 0 0;
}

.calendar-event-modal footer {
    flex-wrap: wrap;
}

.calendar-delete-button {
    margin-right: auto;
    border-color: rgba(238, 37, 37, .5);
    color: #ffb7b7;
}

.calendar-delete-button[hidden] {
    display: none;
}

.form-label-with-help {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.help-tooltip {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: help;
}

.help-tooltip svg {
    width: 15px;
    height: 15px;
}

.help-tooltip::after {
    position: absolute;
    z-index: 4;
    bottom: calc(100% + 8px);
    left: 50%;
    width: 250px;
    padding: 9px 10px;
    border: 1px solid var(--line-strong);
    border-radius: 5px;
    background: #071014;
    box-shadow: var(--shadow);
    color: var(--text);
    content: attr(data-tooltip);
    font-size: 12px;
    font-weight: 500;
    line-height: 1.45;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 4px);
    transition: opacity .14s ease, transform .14s ease;
    visibility: hidden;
}

.help-tooltip:hover,
.help-tooltip:focus-visible {
    color: var(--text);
}

.help-tooltip:hover::after,
.help-tooltip:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
    visibility: visible;
}

.calendar-event-modal textarea {
    width: 100%;
    min-height: 72px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 6px;
    outline: 0;
    resize: vertical;
    background: rgba(8, 14, 18, .82);
    color: var(--text);
}

.calendar-event-options {
    justify-content: space-between;
    flex-wrap: wrap;
}

.calendar-color-picker {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
}

.calendar-color-picker legend {
    margin-right: 4px;
    color: var(--soft);
    font-size: 12px;
    font-weight: 700;
}

.calendar-color-picker label {
    display: block;
    cursor: pointer;
}

.calendar-color-picker input {
    position: absolute;
    opacity: 0;
}

.calendar-color-picker i {
    width: 22px;
    height: 22px;
    border: 2px solid transparent;
}

.calendar-color-picker input:checked + i {
    border-color: #fff;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .15);
}

.recurrence-options {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(255, 255, 255, .025);
}

.recurrence-options > label small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 400;
}

.recurrence-weekdays,
.recurrence-times {
    display: grid;
    gap: 8px;
}

.recurrence-weekdays > span,
.recurrence-times > span {
    color: var(--soft);
    font-size: 12px;
    font-weight: 700;
}

.recurrence-weekdays > div,
.recurrence-times > div {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.recurrence-weekdays label {
    display: inline-flex !important;
    align-items: center;
    gap: 5px !important;
    padding: 6px 8px;
    border: 1px solid var(--line);
    border-radius: 5px;
    color: var(--soft) !important;
    font-size: 12px;
    font-weight: 600 !important;
}

.recurrence-weekdays input {
    width: auto;
    min-height: auto;
    accent-color: var(--red);
}

.recurrence-times {
    grid-template-columns: 1fr auto;
    align-items: end;
}

.recurrence-times > span {
    grid-column: 1 / -1;
}

.recurrence-time-row {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.recurrence-time-row .icon-button {
    width: 30px;
    height: 30px;
}

.is-collapsed .sidebar {
    width: 88px;
}

.is-collapsed .app-main {
    margin-left: 88px;
}

.is-collapsed .sidebar-brand,
.is-collapsed .nav-link,
.is-collapsed .collapse-button {
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.is-collapsed .brand-word span:not(:first-child),
.is-collapsed .brand-word i,
.is-collapsed .nav-link b,
.is-collapsed .nav-group > span,
.is-collapsed .system-card,
.is-collapsed .collapse-button span {
    display: none;
}

.is-collapsed .sidebar-brand .brand-word {
    gap: 0;
    font-size: 30px;
}

[data-search-row].is-hidden {
    display: none !important;
}

@media (max-width: 1440px) {
    .metrics-grid {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

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

    .model-panel,
    .panel-table {
        grid-column: span 1;
    }

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

@media (max-width: 1100px) {
    :root {
        --sidebar: 250px;
    }

    .login-shell {
        grid-template-columns: 1fr;
        overflow-y: auto;
        padding: 110px 24px 40px;
    }

    .login-intel {
        min-height: auto;
        padding-left: 0;
    }

    .login-rail {
        display: none;
    }

    .login-brand .brand-word {
        font-size: 46px;
    }

    .topbar {
        grid-template-columns: auto 1fr;
    }

    .top-actions {
        grid-column: 1 / -1;
        justify-self: stretch;
        justify-content: flex-end;
        padding-bottom: 10px;
    }

    .topbar {
        height: auto;
        min-height: var(--topbar);
        padding-top: 12px;
    }

    .dashboard-grid,
    .placeholder-grid {
        grid-template-columns: 1fr;
    }

    .kanban-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 14px;
    }

    .calendar-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .cashflow-balance-panel header {
        align-items: flex-start;
        flex-direction: column;
    }

    .cashflow-balance-stats {
        justify-content: flex-start;
    }

    .cashflow-report-grid {
        grid-template-columns: 1fr;
    }

    .calendar-actions {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 820px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform .22s ease;
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .app-main,
    .is-collapsed .app-main {
        margin-left: 0;
    }

    .content-frame {
        padding: 18px 14px 28px;
    }

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

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

    .global-search {
        min-width: 0;
    }

    .online-pill,
    .user-pill b,
    kbd {
        display: none;
    }

    .model-usage,
    .form-grid {
        grid-template-columns: 1fr;
    }

    .health-row {
        grid-template-columns: 24px 28px 1fr;
    }

    .health-row b,
    .health-row strong {
        grid-column: 3;
        justify-self: stretch;
    }

    .workflow-toolbar .panel-search {
        width: 100%;
        margin-left: 0;
    }

    .kanban-board {
        grid-template-columns: repeat(5, 270px);
    }

    .hr-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .projects-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .projects-toolbar .panel-search,
    .projects-toolbar .primary-button {
        width: 100%;
    }

    .projects-toolbar > div {
        width: 100%;
    }

    .projects-toolbar .icon-button {
        flex: 0 0 38px;
    }

    .hr-toolbar .panel-search,
    .hr-toolbar .primary-button {
        width: 100%;
    }

    .hr-kanban-board {
        grid-template-columns: repeat(5, 280px);
    }

    .hr-offers-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .hr-offers-toolbar .primary-button {
        width: 100%;
    }

    .panel-table,
    .fleet-panel {
        overflow-x: auto;
    }

    .calendar-navigation,
    .calendar-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    .calendar-navigation h2 {
        min-width: 0;
        flex: 1 1 180px;
        font-size: 17px;
    }

    .calendar-view-toggle {
        flex: 1 1 auto;
    }

    .calendar-view-toggle button {
        flex: 1;
    }

    .calendar-actions .primary-button {
        width: 100%;
    }

    .cashflow-mode-tabs {
        display: flex;
        width: 100%;
    }

    .cashflow-mode-tabs button {
        flex: 1;
        padding: 0 10px;
    }

    .cashflow-balances-toolbar {
        flex-direction: column;
    }

    .cashflow-balances-toolbar .primary-button {
        width: 100%;
    }

    .cashflow-report-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .cashflow-report-toolbar .cashflow-report-view-toggle,
    .cashflow-report-toolbar .primary-button {
        width: 100%;
    }

    .calendar-workspace {
        grid-template-columns: 1fr;
    }

    .calendar-surface,
    .is-agenda-view .calendar-surface {
        overflow-x: auto;
    }

    .calendar-weekdays,
    .calendar-grid-month,
    .cashflow-grid-month {
        min-width: 700px;
    }

    .calendar-agenda-7,
    .cashflow-agenda-7 {
        min-width: 910px;
    }

    .calendar-inspector {
        grid-template-columns: minmax(0, 1fr);
    }

    .calendar-event-options {
        align-items: flex-start;
        flex-direction: column;
    }

    .recurrence-times {
        grid-template-columns: 1fr;
    }

    .recurrence-times > span {
        grid-column: auto;
    }
}

/* Analysis discovery */
.analysis-page {
    display: grid;
    gap: 18px;
    min-width: 0;
}

.analysis-page > [data-analysis-panel] {
    min-width: 0;
    width: 100%;
}

.analysis-project-context {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 76px;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-left: 3px solid var(--red);
    border-radius: 7px;
    background: rgba(14, 20, 25, .7);
}

.analysis-project-identity { display: grid; min-width: 0; gap: 3px; margin-right: auto; }
.analysis-project-identity > span { color: var(--red); font-size: 10px; font-weight: 800; }
.analysis-project-identity > strong { overflow: hidden; color: var(--text); font-size: 15px; text-overflow: ellipsis; white-space: nowrap; }
.analysis-project-identity > small { overflow: hidden; color: var(--muted); font: 11px ui-monospace, SFMono-Regular, Menlo, monospace; text-overflow: ellipsis; white-space: nowrap; }
.analysis-project-context > label { display: grid; flex: 0 1 260px; gap: 5px; color: var(--muted); font-size: 10px; font-weight: 800; }
.analysis-project-context select { min-width: 190px; min-height: 36px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); font: inherit; font-size: 12px; }
.analysis-project-context.empty { border-left-color: #2587ff; }

.analysis-tabs {
    display: flex;
    align-items: center;
    gap: 3px;
    width: max-content;
    max-width: 100%;
    overflow-x: auto;
    border-bottom: 1px solid var(--line);
}

.analysis-tabs button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 14px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0;
    white-space: nowrap;
    cursor: pointer;
}

.analysis-tabs button svg { width: 17px; height: 17px; }
.analysis-tabs button.active { color: var(--text); border-bottom-color: var(--red); }

.analysis-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.analysis-toolbar .panel-search { flex: 1 1 300px; }
.analysis-toolbar > select,
.analysis-filter-menu > summary {
    min-height: 36px;
    padding: 0 11px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--panel);
    color: var(--text);
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.analysis-filter-menu { position: relative; flex: 0 0 auto; }
.analysis-filter-menu > summary { display: inline-flex; align-items: center; gap: 7px; list-style: none; }
.analysis-filter-menu > summary::-webkit-details-marker { display: none; }
.analysis-filter-menu > summary svg { width: 16px; height: 16px; }
.analysis-filter-menu > div {
    position: absolute;
    z-index: 8;
    right: 0;
    top: calc(100% + 7px);
    display: grid;
    grid-template-columns: repeat(2, minmax(160px, 1fr));
    gap: 10px;
    width: min(520px, 78vw);
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: #12191e;
    box-shadow: 0 16px 32px rgba(0, 0, 0, .3);
}

.analysis-filter-menu label,
.analysis-source-settings label,
.analysis-detail-section label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.analysis-filter-menu select { min-height: 32px; min-width: 0; }

.analysis-board {
    display: flex;
    gap: 12px;
    width: 100%;
    max-width: 100%;
    min-height: 510px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-color: var(--line) transparent;
}

.analysis-column {
    display: flex;
    flex-direction: column;
    flex: 0 0 270px;
    min-height: 490px;
    border: 1px solid var(--line);
    border-top: 2px solid #6f8290;
    border-radius: 7px;
    background: rgba(14, 20, 25, .66);
    transition: border-color .16s ease, min-width .16s ease;
}

.analysis-column[data-analysis-column="discovery"] { border-top-color: #2187ff; }
.analysis-column[data-analysis-column="synthesis"] { border-top-color: #d7a83a; }
.analysis-column[data-analysis-column="review"] { border-top-color: #cf5c36; }
.analysis-column[data-analysis-column="backlog"] { border-top-color: #25d866; }
.analysis-column[data-analysis-column="rejected"] { border-top-color: #ed5151; }
.analysis-column.is-decision { background: rgba(19, 25, 29, .92); }
.analysis-column.drag-over { border-color: #25d866; background: rgba(37, 216, 102, .06); }
.analysis-column.is-collapsed { flex-basis: 54px; min-height: 490px; }
.analysis-column.is-collapsed > header { justify-content: center; padding: 12px; }
.analysis-column.is-collapsed > header > div,
.analysis-column.is-collapsed .analysis-dropzone,
.analysis-column.is-collapsed .add-card-button { display: none; }
.analysis-column.is-collapsed > header .icon-button { transform: rotate(180deg); }

.analysis-column > header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    min-height: 62px;
    padding: 13px 12px 10px;
    border-bottom: 1px solid var(--line);
}

.analysis-column h2 { margin: 0; color: var(--text); font-size: 11px; line-height: 1.3; letter-spacing: 0; }
.analysis-column h2 + span { display: inline-flex; margin-top: 6px; color: var(--red); font-size: 12px; font-weight: 800; }
.analysis-column header small { display: block; min-height: 13px; margin-top: 3px; color: var(--muted); font-size: 10px; }
.analysis-column > header .icon-button { flex: 0 0 auto; width: 30px; height: 30px; }

.analysis-dropzone {
    display: grid;
    align-content: start;
    gap: 9px;
    min-height: 370px;
    padding: 10px;
}

.analysis-column-empty { margin: 15px 3px; color: var(--muted); font-size: 12px; text-align: center; }
.analysis-column .add-card-button { margin: auto 10px 10px; }

.analysis-card {
    display: grid;
    gap: 9px;
    width: 100%;
    padding: 12px;
    border: 1px solid rgba(129, 150, 163, .28);
    border-radius: 7px;
    background: #182127;
    color: var(--text);
    text-align: left;
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.analysis-card:hover { border-color: rgba(238, 37, 37, .72); box-shadow: 0 8px 16px rgba(0, 0, 0, .18); transform: translateY(-1px); }
.analysis-card.dragging { opacity: .48; transform: rotate(1deg); }
.analysis-card.request { border-left: 3px solid #2587ff; }
.analysis-card.requirement { border-left: 3px solid #d7a83a; }
.analysis-card.requirement.is-backlog { border-left-color: #25d866; }
.analysis-card.requirement.is-rejected { border-left-color: #ed5151; opacity: .82; }

.analysis-card > header,
.analysis-card-meta,
.analysis-card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.analysis-card code { color: #aab8c1; font-size: 10px; }
.analysis-card h3 { margin: 0; font-size: 13px; line-height: 1.36; letter-spacing: 0; }
.analysis-card p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.analysis-card-guidance { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.analysis-card-meta { flex-wrap: wrap; justify-content: flex-start; }

.analysis-chip,
.analysis-priority,
.analysis-card-footer span,
.analysis-source-status,
.analysis-auto-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 22px;
    padding: 2px 7px;
    border: 1px solid rgba(132, 151, 162, .25);
    border-radius: 5px;
    color: #cbd5da;
    font-size: 10px;
    font-weight: 800;
    line-height: 1.25;
}

.analysis-chip.mode { color: #8fc3ff; background: rgba(37, 135, 255, .1); }
.analysis-chip.type { color: #f0c56a; background: rgba(215, 168, 58, .09); }
.analysis-priority.Critical { color: #ff7b7b; border-color: rgba(237, 81, 81, .42); }
.analysis-priority.High { color: #ffbd6e; }
.analysis-priority.Low { color: #9aaab4; }
.analysis-card-footer { color: var(--muted); font-size: 10px; }
.analysis-card-footer .duplicate { color: #ffbc5f; }
.analysis-card-footer .external { color: #8fc3ff; }

.analysis-progress { display: grid; gap: 5px; }
.analysis-progress > div { display: flex; justify-content: space-between; color: #bdc9d0; font-size: 10px; }
.analysis-progress span { display: block; height: 5px; overflow: hidden; border-radius: 4px; background: rgba(156, 177, 188, .18); }
.analysis-progress i { display: block; height: 100%; border-radius: inherit; background: #2587ff; }
.analysis-operation { color: #8fc3ff !important; font-weight: 700; }

.analysis-summary { display: flex; flex-wrap: wrap; gap: 8px 17px; padding: 1px 2px; color: var(--muted); font-size: 11px; }
.analysis-summary strong { color: var(--text); }
.analysis-page-error { margin: 0; }

.analysis-sources-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 7px; background: rgba(14, 20, 25, .6); }
.analysis-sources-table { width: 100%; min-width: 1180px; border-collapse: collapse; }
.analysis-sources-table th,
.analysis-sources-table td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.analysis-sources-table th { color: var(--muted); font-size: 10px; font-weight: 800; }
.analysis-sources-table td { color: #d6dfe4; font-size: 12px; }
.analysis-sources-table tr:last-child td { border-bottom: 0; }
.analysis-source-name { display: grid; gap: 4px; min-width: 160px; }
.analysis-source-name strong { color: var(--text); font-size: 13px; }
.analysis-source-name small { color: var(--muted); line-height: 1.35; }
.analysis-source-location { display: block; max-width: 260px; overflow-wrap: anywhere; color: #9fceda; font-size: 11px; }
.analysis-source-actions { display: flex; gap: 5px; justify-content: flex-end; }
.analysis-source-actions .icon-button { width: 30px; height: 30px; }
.analysis-source-status i,
.analysis-auto-status i { width: 6px; height: 6px; border-radius: 50%; background: #8998a2; }
.analysis-source-status.active i,
.analysis-auto-status.yes i { background: #25d866; }
.analysis-source-status.inactive i,
.analysis-auto-status.no i { background: #ed5151; }
.analysis-source-status.limited i { background: #d7a83a; }
.analysis-source-status .test-label { color: var(--muted); font-weight: 600; }
.analysis-sources-empty { margin: 24px; color: var(--muted); text-align: center; }

.analysis-source-modal { width: min(800px, calc(100vw - 28px)); max-height: min(900px, calc(100vh - 28px)); overflow-y: auto; }
.analysis-request-modal { width: min(760px, calc(100vw - 28px)); max-height: min(900px, calc(100vh - 28px)); overflow-y: auto; }
.analysis-detail-modal { width: min(960px, calc(100vw - 28px)); max-height: min(900px, calc(100vh - 28px)); overflow-y: auto; }
.analysis-requirement-modal { width: min(1040px, calc(100vw - 28px)); max-height: min(900px, calc(100vh - 28px)); overflow-y: auto; }
.analysis-rejection-modal { width: min(580px, calc(100vw - 28px)); }
.analysis-source-modal textarea,
.analysis-request-modal textarea,
.analysis-requirement-modal textarea,
.analysis-rejection-modal textarea { resize: vertical; min-height: 74px; }
.analysis-source-modal select[multiple] { min-height: 126px; }

.analysis-source-switches { display: flex; flex-wrap: wrap; gap: 11px 18px; padding: 9px 0; }
.analysis-source-settings,
.analysis-mode-preview,
.analysis-detail-section,
.analysis-followup,
.analysis-split-control {
    display: grid;
    gap: 10px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: rgba(10, 15, 18, .34);
}

.analysis-source-settings h3,
.analysis-detail-section h3 { margin: 0; color: var(--text); font-size: 12px; }
.analysis-source-repository-settings,
.analysis-source-web-settings { display: grid; gap: 10px; }
.analysis-mode-preview { border-left: 3px solid #2587ff; }
.analysis-mode-preview span { color: var(--muted); font-size: 11px; font-weight: 700; }
.analysis-mode-preview strong { color: #8fc3ff; font-size: 13px; }
.analysis-mode-preview p { margin: 0; color: #c3cdd2; font-size: 12px; line-height: 1.45; }

.analysis-detail-modal header > div,
.analysis-requirement-modal header > div { display: grid; gap: 3px; }
.analysis-detail-modal header p,
.analysis-requirement-modal header p { margin: 0; color: #8fc3ff; font: 700 11px ui-monospace, SFMono-Regular, Menlo, monospace; }
.analysis-detail-content { display: grid; gap: 13px; }
.analysis-detail-content > section { display: grid; gap: 7px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.analysis-detail-content > section:last-child { padding-bottom: 0; border-bottom: 0; }
.analysis-detail-content h3 { margin: 0; color: var(--text); font-size: 12px; }
.analysis-detail-content p { margin: 0; color: #c7d1d6; font-size: 12px; line-height: 1.55; white-space: pre-wrap; }
.analysis-detail-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }
.analysis-detail-grid div { padding: 9px; border: 1px solid var(--line); border-radius: 5px; }
.analysis-detail-grid span { display: block; color: var(--muted); font-size: 10px; }
.analysis-detail-grid b { display: block; margin-top: 3px; color: var(--text); font-size: 12px; overflow-wrap: anywhere; }
.analysis-history-list,
.analysis-evidence-list { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.analysis-history-list li,
.analysis-evidence-list li { padding: 9px; border-left: 2px solid #4b6574; background: rgba(35, 46, 53, .34); color: #c8d1d6; font-size: 11px; line-height: 1.45; }
.analysis-history-list strong,
.analysis-evidence-list strong { color: var(--text); }
.analysis-evidence-list a { color: #8fc3ff; overflow-wrap: anywhere; }

.analysis-requirement-meta { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.analysis-requirement-meta label { min-width: 0; }
.analysis-requirement-modal .analysis-detail-section textarea { min-height: 94px; }
.analysis-duplicate-control { display: grid; gap: 8px; align-content: start; color: var(--text); font-size: 12px; font-weight: 700; }
.analysis-duplicate-control > input[type="checkbox"] { appearance: none; width: 16px; height: 16px; margin: 0; border: 1px solid var(--line); border-radius: 3px; background: #10171b; }
.analysis-duplicate-control > input[type="checkbox"]:checked { background: #d42d2d; border-color: #ee5151; }
.analysis-duplicate-control > input[type="checkbox"]:checked::after { content: 'X'; display: grid; place-items: center; height: 14px; color: white; font-size: 11px; font-weight: 900; }
.analysis-followup { grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.analysis-followup label { display: grid; gap: 5px; color: var(--muted); font-size: 11px; font-weight: 700; }
.analysis-split-control > div { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; }
.analysis-split-control > div label { display: grid; gap: 5px; min-width: 180px; color: var(--muted); font-size: 11px; font-weight: 700; }
.analysis-split-control > div select { min-height: 36px; }
.analysis-toast { position: fixed; z-index: 25; right: 24px; bottom: 24px; max-width: min(420px, calc(100vw - 48px)); padding: 12px 15px; border: 1px solid rgba(37, 216, 102, .5); border-radius: 6px; background: #16241e; color: #dcefe3; box-shadow: 0 12px 28px rgba(0, 0, 0, .28); font-size: 12px; line-height: 1.4; }
.analysis-toast.error { border-color: rgba(237, 81, 81, .65); background: #2b1719; color: #ffe1e1; }

@media (max-width: 1080px) {
    .analysis-toolbar { flex-wrap: wrap; }
    .analysis-toolbar .panel-search { min-width: 220px; }
    .analysis-column { flex-basis: 250px; }
    .analysis-requirement-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .analysis-project-context { align-items: stretch; flex-wrap: wrap; }
    .analysis-project-identity { flex-basis: 100%; }
    .analysis-project-context > label { flex: 1 1 180px; }
    .analysis-project-context select { width: 100%; min-width: 0; }
    .analysis-toolbar > select { flex: 1 1 150px; }
    .analysis-toolbar .primary-button { flex: 1 1 auto; }
    .analysis-filter-menu > div { right: auto; left: 0; grid-template-columns: 1fr; width: min(360px, calc(100vw - 30px)); max-height: 62vh; overflow-y: auto; }
    .analysis-detail-grid,
    .analysis-requirement-meta { grid-template-columns: 1fr; }
    .analysis-followup { grid-template-columns: 1fr; }
    .analysis-detail-modal footer,
    .analysis-requirement-modal footer { flex-wrap: wrap; }
    .analysis-detail-modal footer button,
    .analysis-requirement-modal footer button { flex: 1 1 auto; }
}
