:root {
    --font-ui: "Segoe UI", system-ui, sans-serif;
    --bg-app: #f3f2f1;
    --bg-shell: #ffffff;
    --bg-sidebar: #faf9f8;
    --bg-subtle: #f8f8f8;
    --bg-hover: #edebe9;
    --line: #edebe9;
    --line-strong: #d2d0ce;
    --text: #201f1e;
    --muted: #605e5c;
    --muted-2: #8a8886;
    --brand: #0f6cbd;
    --brand-strong: #115ea3;
    --brand-soft: #deecf9;
    --success-bg: #dff6dd;
    --success-text: #0b6a0b;
    --error-bg: #fde7e9;
    --error-text: #a80000;
    --shadow-card: 0 1.6px 3.6px rgba(0, 0, 0, 0.08), 0 0.3px 0.9px rgba(0, 0, 0, 0.06);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

html, body {
    margin: 0;
    min-height: 100%;
    font-family: var(--font-ui);
    background: var(--bg-app);
    color: var(--text);
    font-size: 14px;
    line-height: 1.4;
}

body {
    min-height: 100vh;
}

#app {
    min-height: 100vh;
}

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

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

input[type="checkbox"] {
    accent-color: var(--brand);
}

.app-icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.app-icon svg {
    width: 100%;
    height: 100%;
}

.shell {
    display: grid;
    grid-template-columns: 264px minmax(0, 1fr);
    min-height: 100vh;
    transition: grid-template-columns 220ms ease;
}

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

.shell-collapsed {
    grid-template-columns: 76px minmax(0, 1fr);
}

.rail {
    background: var(--bg-sidebar);
    border-right: 1px solid var(--line);
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.rail-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    min-width: 0;
}

.brand-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    display: block;
}

.brand-copy strong,
.brand-copy span {
    display: block;
}

.brand-copy strong {
    font-size: 0.92rem;
    font-weight: 600;
}

.brand-copy span,
.rail-section-title {
    color: var(--muted);
    font-size: 0.75rem;
}

.rail-nav,
.rail-section {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.rail-link,
.rail-subtle-link {
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.rail-link {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
}

.rail-link:hover,
.rail-subtle-link:hover {
    background: var(--bg-hover);
}

.rail-link.active {
    background: var(--brand-soft);
    color: var(--brand-strong);
    font-weight: 600;
}

.rail-link.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    bottom: 8px;
    width: 3px;
    border-radius: 999px;
    background: var(--brand);
}

.rail-subtle-link {
    color: var(--muted);
    font-size: 0.85rem;
}

.rail-toggle {
    width: 36px;
    height: 36px;
    padding: 0;
    flex: 0 0 auto;
}

.shell-collapsed .brand {
    justify-content: center;
    padding: 4px 0 0;
}

.shell-collapsed .rail-link,
.shell-collapsed .rail-subtle-link {
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: 0 auto;
    padding: 0;
    border-radius: 12px;
}

.shell-collapsed .rail-label,
.shell-collapsed .brand-copy,
.shell-collapsed .rail-section {
    display: none;
}

.shell-collapsed .rail {
    padding: 14px 8px;
    gap: 16px;
}

.shell-collapsed .rail-top {
    flex-direction: column;
    justify-content: flex-start;
    gap: 10px;
}

.shell-collapsed .rail-nav {
    gap: 8px;
}

.shell-collapsed .rail-link.active::before {
    left: 50%;
    top: auto;
    bottom: -5px;
    width: 16px;
    height: 3px;
    transform: translateX(-50%);
}

.shell-collapsed .rail-toggle {
    width: 32px;
    height: 32px;
    border-radius: 10px;
}

.shell-collapsed .brand-logo {
    width: 40px;
    height: 40px;
}

.shell-collapsed .nav-icon {
    width: 18px;
    height: 18px;
}

.workspace {
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.route-content-shell {
    min-width: 0;
    flex: 1 1 auto;
}

.route-content-stage {
    min-width: 0;
    min-height: 100%;
    animation: route-content-enter 180ms cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.global-bar {
    height: 48px;
    background: var(--bg-shell);
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 20px;
}

.global-bar-left,
.global-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.global-search {
    width: min(520px, 48vw);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    height: 32px;
    background: var(--bg-subtle);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
}

.global-search input {
    border: 0;
    background: transparent;
    width: 100%;
    outline: none;
}

.global-search-icon {
    color: var(--muted-2);
}

.chrome-button {
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    background: var(--bg-shell);
    border-radius: 50%;
    color: var(--muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.profile-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px;
    border-radius: var(--radius-md);
}

.profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #dbeafe;
    color: var(--brand-strong);
    display: grid;
    place-items: center;
    font-size: 0.78rem;
    font-weight: 700;
}

.profile-copy strong,
.profile-copy span {
    display: block;
}

.profile-copy strong {
    font-size: 0.84rem;
    font-weight: 600;
}

.profile-copy span {
    font-size: 0.75rem;
    color: var(--muted);
}

.assignment-command-bar {
    align-items: end;
    flex-wrap: wrap;
}

.field-group.compact {
    min-width: 220px;
}

.field-group.compact.narrow {
    min-width: 140px;
    max-width: 180px;
}

.assignment-workspace {
    grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
}

.assignment-operator-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.assignment-operator-card {
    border: 1px solid var(--line);
    background: var(--bg-shell);
    border-radius: var(--radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.assignment-operator-card.selected {
    border-color: var(--brand);
    background: var(--brand-soft);
    box-shadow: inset 0 0 0 1px rgba(15, 108, 189, 0.12);
}

.assignment-card-head {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.assignment-card-head span,
.assignment-substats,
.assignment-substats span {
    color: var(--muted);
    font-size: 0.78rem;
}

.assignment-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.assignment-kpis span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    margin-bottom: 3px;
}

.assignment-kpis strong {
    font-size: 0.92rem;
}

.assignment-substats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.assignment-table-head,
.assignment-table-row {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr) minmax(0, 0.75fr) minmax(320px, 1.1fr);
}

.assignment-table-row.locked {
    opacity: 0.72;
}

.assignment-actions {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto;
    gap: 8px;
    align-items: center;
    min-width: 0;
    width: 100%;
}

.assignment-actions .field {
    width: 100%;
    min-width: 0;
    max-width: none;
}

.assignment-actions .ghost.small {
    justify-self: end;
    white-space: nowrap;
}

.jobs-table-head,
.jobs-table-row {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 0.7fr) minmax(0, 1fr);
}

.job-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
}

.job-status.queued {
    background: #eef2ff;
    color: #374151;
}

.job-status.retry {
    background: #fff4ce;
    color: #8a6700;
}

.job-status.processing {
    background: #deecf9;
    color: #115ea3;
}

.job-status.done {
    background: #dff6dd;
    color: #0b6a0b;
}

.job-status.failed {
    background: #fde7e9;
    color: #a80000;
}

@media (max-width: 980px) {
    .assignment-workspace {
        grid-template-columns: 1fr;
    }

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

    .assignment-table-head,
    .assignment-table-row {
        grid-template-columns: 1fr;
    }

    .assignment-actions {
        grid-template-columns: 1fr;
    }

    .assignment-actions .field {
        max-width: none;
    }

    .assignment-actions .ghost.small {
        width: 100%;
        justify-self: stretch;
    }
}

.ghost,
.solid,
.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    padding: 7px 12px;
    font-size: 0.8125rem;
    cursor: pointer;
}

.ghost {
    background: white;
    border-color: var(--line-strong);
    color: var(--text);
}

.ghost:hover {
    background: var(--bg-subtle);
}

.ghost.small {
    padding: 6px 10px;
}

.icon-button {
    gap: 8px;
}

.nav-icon {
    color: var(--muted);
}

.rail-link.active .nav-icon,
.rail-subtle-link:hover .nav-icon,
.rail-link:hover .nav-icon {
    color: currentColor;
}

.solid,
.auth-submit {
    background: var(--brand);
    color: white;
}

.solid:hover,
.auth-submit:hover {
    background: var(--brand-strong);
}

.solid:disabled,
.auth-submit:disabled,
.solid[disabled],
.auth-submit[disabled] {
    background: #c8c6c4;
    border-color: #c8c6c4;
    color: #605e5c;
    cursor: not-allowed;
    box-shadow: none;
    pointer-events: none;
}

.page-loading,
.auth-guard {
    min-height: calc(100vh - 56px);
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-scene {
    position: relative;
    overflow: hidden;
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(18, 117, 188, 0.12), transparent 34%),
        radial-gradient(circle at top right, rgba(31, 176, 135, 0.1), transparent 26%),
        linear-gradient(180deg, #f7fbff 0%, #f3f5f8 58%, #eef2f6 100%);
    animation: scene-fade-in 420ms ease-out;
}

.login-backdrop-shape {
    position: absolute;
    border-radius: 999px;
    filter: blur(2px);
    pointer-events: none;
    animation: backdrop-drift 700ms ease-out both;
}

.login-backdrop-shape-blue {
    width: 320px;
    height: 320px;
    left: -92px;
    top: -84px;
    background: radial-gradient(circle, rgba(18, 117, 188, 0.18) 0%, rgba(18, 117, 188, 0.06) 58%, transparent 74%);
}

.login-backdrop-shape-green {
    width: 280px;
    height: 280px;
    right: -48px;
    top: 42px;
    background: radial-gradient(circle, rgba(31, 176, 135, 0.14) 0%, rgba(31, 176, 135, 0.04) 60%, transparent 76%);
}

.loader-card,
.auth-card,
.panel {
    background: var(--bg-shell);
    box-shadow: var(--shadow-card);
}

.auth-card,
.loader-card {
    width: min(100%, 420px);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--line);
}

.login-card {
    position: relative;
    width: min(100%, 460px);
    padding: 28px 28px 22px;
    border-radius: 18px;
    border-color: rgba(15, 108, 189, 0.12);
    box-shadow:
        0 20px 60px rgba(15, 23, 42, 0.08),
        0 2px 6px rgba(15, 23, 42, 0.06);
    transform-origin: center top;
    animation: card-rise-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.auth-card.compact {
    width: min(100%, 360px);
}

.boot-shell {
    position: relative;
    min-height: 100vh;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 32px;
    background:
        radial-gradient(circle at top left, rgba(15, 108, 189, 0.16), transparent 30%),
        radial-gradient(circle at right 18%, rgba(80, 181, 152, 0.14), transparent 24%),
        linear-gradient(180deg, #f8fbff 0%, #f2f5f9 55%, #ecf1f6 100%);
}

.boot-orb {
    position: absolute;
    border-radius: 999px;
    filter: blur(6px);
    pointer-events: none;
}

.boot-orb-left {
    width: 280px;
    height: 280px;
    left: -72px;
    top: -36px;
    background: radial-gradient(circle, rgba(15, 108, 189, 0.18) 0%, rgba(15, 108, 189, 0.04) 62%, transparent 76%);
}

.boot-orb-right {
    width: 240px;
    height: 240px;
    right: -44px;
    bottom: 32px;
    background: radial-gradient(circle, rgba(38, 123, 191, 0.12) 0%, rgba(38, 123, 191, 0.03) 58%, transparent 74%);
}

.boot-card {
    width: min(100%, 460px);
    display: grid;
    gap: 18px;
    padding: 28px 30px;
    border: 1px solid rgba(15, 108, 189, 0.12);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.88);
    box-shadow:
        0 24px 60px rgba(15, 23, 42, 0.08),
        0 2px 8px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(10px);
    animation: card-rise-in 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.boot-brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.boot-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    border-radius: 14px;
    background: linear-gradient(180deg, rgba(15, 108, 189, 0.08), rgba(15, 108, 189, 0.03));
    padding: 8px;
}

.boot-brand-copy {
    display: grid;
    gap: 3px;
}

.boot-brand-copy strong {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.boot-brand-copy span,
.boot-status small {
    color: var(--muted);
}

.boot-progress,
.startup-progress {
    position: relative;
    overflow: hidden;
    height: 4px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(15, 108, 189, 0.12), rgba(15, 108, 189, 0.03));
}

.boot-progress-bar,
.startup-progress span {
    position: absolute;
    inset: 0;
    width: 38%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0f6cbd 0%, #2899f5 56%, #76b7ff 100%);
    animation: boot-progress-slide 1.35s ease-in-out infinite;
}

.boot-status {
    display: grid;
    gap: 4px;
}

.boot-status span {
    font-weight: 600;
    color: #1f2937;
}

.startup-card {
    display: grid;
    gap: 14px;
    padding: 28px;
    border-radius: 18px;
    border-color: rgba(15, 108, 189, 0.12);
    box-shadow:
        0 18px 40px rgba(15, 23, 42, 0.08),
        0 2px 6px rgba(15, 23, 42, 0.05);
}

.startup-card strong {
    font-size: 1.05rem;
    font-weight: 600;
}

.startup-card span {
    color: var(--muted);
}

.startup-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-width: 78px;
    height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(15, 108, 189, 0.08);
    color: var(--brand-strong);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

@keyframes scene-fade-in {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

@keyframes backdrop-drift {
    0% {
        opacity: 0;
        transform: translateY(18px) scale(0.96);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes card-rise-in {
    0% {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }

    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes boot-progress-slide {
    0% {
        transform: translateX(-130%);
    }

    100% {
        transform: translateX(320%);
    }
}

.login-brand,
.login-card form,
.login-footer {
    opacity: 0;
    animation: content-fade-in 320ms ease-out forwards;
}

.login-brand {
    animation-delay: 90ms;
}

.login-card form {
    animation-delay: 160ms;
}

.login-footer {
    animation-delay: 220ms;
}

@keyframes content-fade-in {
    0% {
        opacity: 0;
        transform: translateY(8px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes route-content-enter {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-scene,
    .login-backdrop-shape,
    .login-card,
    .boot-card,
    .login-brand,
    .login-card form,
    .login-footer,
    .route-content-stage,
    .boot-progress-bar,
    .startup-progress span {
        animation: none;
    }

    .login-brand,
    .login-card form,
    .login-footer {
        opacity: 1;
    }
}

.login-brand {
    display: grid;
    gap: 14px;
    margin-bottom: 18px;
}

.login-brand-logo {
    width: min(220px, 52%);
    height: auto;
    display: block;
}

.login-submit {
    width: 100%;
    min-height: 38px;
    margin-top: 8px;
    background: #1275bc;
}

.login-submit:hover {
    background: #0f63a0;
}

.login-footer {
    display: grid;
    gap: 6px;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid rgba(96, 94, 92, 0.12);
}

.login-caption {
    font-size: 0.75rem;
    color: #6b7280;
}

.auth-copy,
.login-hint,
.hero-copy,
.panel-header span,
.detail-card small,
.metric-label,
.data-row span,
.field-group label,
.eyebrow {
    color: var(--muted);
}

.dashboard,
.module-page {
    padding: 18px 22px 24px;
}

.page-head {
    margin-bottom: 12px;
}

.eyebrow {
    margin: 0 0 4px;
    font-size: 0.74rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-weight: 600;
}

h1,
h2,
p {
    margin: 0;
}

h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

h1:focus {
    outline: none;
}

h2 {
    font-size: 0.9375rem;
    font-weight: 600;
}

.hero-copy {
    margin-top: 8px;
    max-width: 720px;
    line-height: 1.45;
    font-size: 0.86rem;
}

.command-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 0 14px;
}

.report-filters {
    flex-wrap: wrap;
}

.filter-box {
    min-width: 180px;
}

.filter-box label {
    display: block;
    font-size: 0.72rem;
    color: var(--muted);
    margin-bottom: 4px;
}

.metrics {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.metric-card {
    border-radius: var(--radius-md);
    border: 1px solid var(--line);
    padding: 14px;
    background: var(--bg-shell);
}

.metric-card strong {
    display: block;
    margin-top: 6px;
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--text);
}

.metric-card.metric-cases {
    background: #f4f6f8;
    border-color: #dde3e8;
}

.metric-card.metric-calls {
    background: #eaf3ff;
    border-color: #c9defa;
}

.metric-card.metric-contacted {
    background: #e6f6f4;
    border-color: #b9e6df;
}

.metric-card.metric-promises {
    background: #fff5db;
    border-color: #f3d7a3;
}

.metric-card.metric-broken-promises {
    background: #fde7e9;
    border-color: #f3c7cd;
}

.metric-card.metric-debt {
    background: #f9ebe7;
    border-color: #e9c5ba;
}

.metric-card.metric-credit {
    background: #f7f0e8;
    border-color: #e7d8c2;
}

.metric-card.metric-average-debt {
    background: #f7f3ef;
    border-color: #e2d8cf;
}

.metric-card.metric-severe-past-due {
    background: #fff1d6;
    border-color: #f0cf8f;
}

.metric-card.metric-overdue-installments {
    background: #f6efe8;
    border-color: #e4d3c2;
}

.workspace-grid {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr) 300px;
    gap: 16px;
}

.module-workspace-list-detail {
    grid-template-columns: minmax(0, 1.7fr) minmax(340px, 0.95fr);
    align-items: start;
}

.module-workspace-single {
    grid-template-columns: minmax(0, 1fr);
}

.module-workspace-single > .grid-panel.wide:only-child,
.module-workspace-list-detail > .grid-panel.wide:only-child {
    grid-column: 1 / -1;
}

.reports-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
    gap: 16px;
}

.reports-main-stack {
    display: grid;
    gap: 16px;
    min-width: 0;
}

.grid-panel.wide {
    min-width: 0;
}

.side-stack,
.form-pane,
.detail-pane {
    align-self: start;
}

.dashboard-grid {
    grid-template-columns: minmax(0, 1fr) 320px;
}

.reports-panel,
.reports-wide {
    min-width: 0;
    align-self: start;
}

.reports-sidebar-stack {
    display: grid;
    gap: 16px;
    align-self: start;
    min-width: 0;
}

.reports-full {
    grid-column: 1 / -1;
}

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

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 14px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 14px;
}

.detail-card {
    border: 1px solid var(--line);
    background: var(--bg-subtle);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-bottom: 10px;
}

.phone-highlight-card {
    background: #eaf3ff;
    border-color: #c9defa;
}

.phone-highlight-number {
    display: block;
    font-size: 1.35rem;
    line-height: 1.2;
    letter-spacing: 0.01em;
    color: var(--brand-strong);
}

.credit-context-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.credit-context-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: white;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.credit-context-item span,
.credit-context-item small {
    color: var(--muted);
    font-size: 0.75rem;
}

.credit-context-item strong {
    font-size: 0.92rem;
    color: var(--text);
}

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

.toolbar-button {
    border: 1px solid var(--line-strong);
    background: white;
    color: var(--muted);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 0.75rem;
}

.toolbar-button.disabled,
.toolbar-button:disabled {
    color: var(--muted-2);
    background: var(--bg-subtle);
    cursor: not-allowed;
}

.toolbar-spacer {
    flex: 1 1 auto;
}

.side-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(32, 31, 30, 0.18);
    z-index: 30;
}

.side-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(560px, calc(100vw - 48px));
    border-radius: 0;
    border-left: 1px solid var(--line);
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
    background: var(--bg-shell);
    box-shadow: -12px 0 32px rgba(0, 0, 0, 0.12);
    z-index: 40;
    overflow-y: auto;
    padding: 18px 18px 28px;
    animation: slide-in-drawer 500ms ease-out;
}

@keyframes slide-in-drawer {
    from {
        opacity: 0;
        transform: translateX(28px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toolbar-button.active {
    background: var(--brand-soft);
    border-color: #b8d7f2;
    color: var(--brand-strong);
    font-weight: 600;
}

button.danger,
.danger {
    border: 1px solid transparent;
    background: transparent;
    color: #d13438;
}

button.danger:hover,
.danger:hover {
    background: #fde7e9;
    border-color: #f1b7bb;
    color: #a4262c;
}

.action-cell {
    align-items: flex-end;
    justify-content: center;
}

.user-action-button {
    min-width: 124px;
    border-radius: 999px;
    padding: 7px 14px;
}

.detail-label {
    display: block;
    font-size: 0.69rem;
    color: var(--muted);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chips label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.76rem;
    color: var(--muted);
}

.chips span,
.status-pill {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-strong);
    padding: 3px 9px;
    font-size: 0.71rem;
    font-weight: 600;
}

.promise-status-pill.pending {
    background: #fff4ce;
    color: #8a5a00;
}

.promise-status-pill.confirmed {
    background: #dff6dd;
    color: #0b6a0b;
}

.promise-status-pill.broken {
    background: #fde7e9;
    color: #a80000;
}

.collection-status-pill.new {
    background: #e8f5e9;
    color: #2e7d32;
}

.collection-status-pill.pending-contact {
    background: #eceff1;
    color: #455a64;
}

.collection-status-pill.contacted {
    background: #e3f2fd;
    color: #1565c0;
}

.collection-status-pill.promise-pending {
    background: #fff3e0;
    color: #ef6c00;
}

.collection-status-pill.promise-broken {
    background: #fde7e9;
    color: #c62828;
}

.collection-status-pill.closed-paid {
    background: #e0f2f1;
    color: #00796b;
}

.status-text {
    font-weight: 700;
}

.status-text.new {
    color: #2e7d32;
}

.status-text.pending-contact {
    color: #455a64;
}

.status-text.contacted {
    color: #1565c0;
}

.status-text.promise-pending {
    color: #ef6c00;
}

.status-text.promise-broken {
    color: #c62828;
}

.status-text.closed-paid {
    color: #00796b;
}

.field-group {
    margin-bottom: 12px;
}

.field-group label {
    display: block;
    font-size: 0.74rem;
    margin-bottom: 5px;
}

.field {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background: white;
    min-height: 34px;
    padding: 7px 10px;
    color: var(--text);
    font-size: 0.8125rem;
    line-height: 1.25;
}

.field-checkbox {
    width: auto;
    min-height: auto;
}

.section-action {
    margin-top: 16px;
}

.section-action-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 16px;
}

.settings-spacing {
    margin-top: 12px;
}

.checkbox-inline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.field:focus {
    outline: 2px solid rgba(15, 108, 189, 0.22);
    border-color: var(--brand);
}

select.field {
    padding-right: 30px;
}

.textarea {
    min-height: 92px;
    resize: vertical;
}

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

.field-span {
    grid-column: 1 / -1;
}

.data-table {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.data-table-head,
.data-row {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.9fr);
    gap: 16px;
    align-items: center;
    padding: 12px 16px;
}

.campaign-table-head,
.campaign-table-row,
.promises-table-head,
.promises-table-row {
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 0.9fr);
}

.users-table-head,
.users-table-row {
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 0.75fr) minmax(120px, 0.8fr);
}

.settings-event-head,
.settings-event-row {
    grid-template-columns: minmax(0, 1.5fr) 120px;
}

.compact-table .data-row,
.compact-table .data-table-head {
    padding-top: 10px;
    padding-bottom: 10px;
}

.data-table-head {
    background: var(--bg-subtle);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--muted);
    border-bottom: 1px solid var(--line);
    text-transform: uppercase;
}

.data-row {
    background: white;
    border-bottom: 1px solid var(--line);
    width: 100%;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    text-align: left;
    cursor: pointer;
    padding-top: 10px;
    padding-bottom: 10px;
}

.data-row:last-child {
    border-bottom: 0;
}

.data-row:hover {
    background: #fafafa;
}

.report-table .data-row {
    cursor: default;
}

.report-table .data-row:hover {
    background: white;
}

.report-table .data-row:nth-child(even) {
    background: #fbfbfb;
}

.report-table .data-row:nth-child(even):hover {
    background: #f6f6f6;
}

.data-row.selected {
    background: #f5f9fd;
    box-shadow: inset 3px 0 0 var(--brand);
}

.data-main {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.data-main strong {
    min-width: 0;
    font-size: 0.84rem;
    font-weight: 600;
}

.data-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #f0f6fc;
    color: var(--brand-strong);
    display: grid;
    place-items: center;
    font-size: 0.74rem;
    font-weight: 700;
}

.data-stack {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 0.8rem;
}

.data-stack.right {
    align-items: flex-start;
}

.data-stack small,
.detail-card small,
.panel-header span,
.metric-label,
.login-hint,
.auth-copy {
    font-size: 0.75rem;
}

.reports-grid,
.reports-table-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 16px;
}

.reports-grid {
    grid-template-columns: minmax(0, 1.5fr) 340px;
}

.reports-table-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.report-side-stack {
    display: grid;
    gap: 16px;
    align-self: start;
}

.trend-chart {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 12px;
    align-items: end;
    min-height: 230px;
    padding: 12px 4px 0;
}

.trend-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.trend-bars {
    width: 100%;
    max-width: 56px;
    height: 170px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    padding: 0 6px;
    border-bottom: 1px solid var(--line);
}

.trend-bar {
    width: 12px;
    min-height: 8px;
    border-radius: 999px 999px 4px 4px;
}

.trend-bar.total,
.legend-dot.total {
    background: var(--brand);
}

.trend-bar.contact,
.legend-dot.contact {
    background: #148564;
}

.trend-bar.conversion,
.legend-dot.conversion {
    background: #d83b01;
}

.trend-caption {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 0.74rem;
    color: var(--muted);
}

.chart-legend {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 14px;
    color: var(--muted);
    font-size: 0.75rem;
}

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

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.report-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.report-bar-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.report-bar-copy {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    font-size: 0.8rem;
}

.report-bar-copy strong {
    font-size: 0.82rem;
}

.report-bar-copy span {
    color: var(--muted);
}

.report-bar-track {
    height: 10px;
    border-radius: 999px;
    background: #e6f0f8;
    overflow: hidden;
}

.report-bar-track.neutral {
    background: #ecebe9;
}

.report-bar-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #0f6cbd, #3a96dd);
}

.report-bar-fill.neutral {
    background: linear-gradient(90deg, #605e5c, #8a8886);
}

.report-table-head,
.report-table-row {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.static-row {
    cursor: default;
}

.static-row:hover {
    background: white;
}

.report-chip-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

.report-chip-card {
    margin-bottom: 0;
}

.media-card,
.transcript-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.call-audio-player {
    width: 100%;
    max-width: 100%;
}

.transcript-summary,
.transcript-body,
.transcript-segment p {
    margin: 0;
    color: var(--text);
    font-size: 0.78rem;
    line-height: 1.45;
}

.transcript-body {
    max-height: 180px;
    overflow: auto;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: white;
    white-space: pre-wrap;
}

.transcript-segments,
.timeline-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.transcript-segment,
.timeline-item {
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: white;
    padding: 8px 10px;
}

.transcript-segment strong,
.timeline-item strong {
    display: block;
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.transcript-segment span,
.timeline-item span {
    display: block;
    color: var(--muted);
    font-size: 0.72rem;
    margin-bottom: 6px;
}

.success-text,
.error-text {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    border: 1px solid transparent;
}

.success-text {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: #b7dfb0;
}

.error-text {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: #f1b7bd;
}

.report-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.chart-shell {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 12px;
    background: linear-gradient(180deg, #fbfdff 0%, #f6f9fc 100%);
}

.chart-shell-grid {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.chart-y-axis {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    color: var(--muted);
    font-size: 0.72rem;
    padding-top: 6px;
    padding-bottom: 30px;
}

.chart-main {
    min-width: 0;
}

.trend-chart {
    width: 100%;
    height: 220px;
    display: block;
}

.chart-grid-line {
    stroke: #dfe7ef;
    stroke-width: 1;
}

.chart-line {
    fill: none;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.calls-line {
    stroke: #0f6cbd;
}

.contacts-line {
    stroke: #2f7d32;
}

.promises-line {
    stroke: #d97706;
}

.chart-legend,
.chart-axis-labels,
.mini-bar-head,
.mini-bar-meta {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chart-legend,
.chart-axis-labels {
    justify-content: space-between;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.74rem;
}

.chart-axis-labels-condensed {
    gap: 8px;
    overflow: hidden;
}

.chart-axis-labels-condensed span {
    flex: 1 1 0;
    min-width: 0;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.activity-summary-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--bg-subtle);
    padding: 12px;
}

.activity-summary-card strong {
    display: block;
    margin-top: 6px;
    font-size: 1.05rem;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.calls-line-dot {
    background: #0f6cbd;
}

.contacts-line-dot {
    background: #2f7d32;
}

.promises-line-dot {
    background: #d97706;
}

.mini-bars {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mini-bar-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    padding: 12px;
    background: var(--bg-subtle);
}

.selectable-card {
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.selectable-card.selected {
    background: #f5f9fd;
    box-shadow: inset 3px 0 0 var(--brand);
}

.mini-bar-head,
.mini-bar-meta {
    justify-content: space-between;
    font-size: 0.75rem;
}

.ranked-title {
    display: grid;
    gap: 4px;
}

.rank-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.detail-badges {
    margin-top: 8px;
}

.workflow-progress {
    margin-top: 12px;
    display: grid;
    gap: 8px;
}

.progress-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--muted);
}

.progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #dce8f6;
    overflow: hidden;
}

.progress-track.muted {
    background: #ebe6f8;
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0f6cbd 0%, #6fb1e5 100%);
    transition: width 220ms ease;
}

.progress-fill.muted-fill {
    background: linear-gradient(90deg, #8b5cf6 0%, #c084fc 100%);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.rank-badge.debt {
    background: #e8f0fb;
    color: #0f5ea8;
}

.rank-badge.promise {
    background: #fff2df;
    color: #b86400;
}

.rank-badge.rate,
.rank-badge.coverage {
    background: #e9f7ed;
    color: #256b34;
}

.mini-bar-head strong {
    font-size: 0.82rem;
}

.mini-bar-meta {
    color: var(--muted);
    margin-top: 8px;
}

.mini-bar-track {
    margin-top: 10px;
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: #e8eef5;
    overflow: hidden;
}

.mini-bar-track.neutral {
    background: #edf0f3;
}

.mini-bar-track.emphasis {
    background: #fde8d1;
}

.mini-bar-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0f6cbd 0%, #67a7de 100%);
}

.mini-bar-fill.neutral-fill {
    background: linear-gradient(90deg, #7a8796 0%, #aeb8c2 100%);
}

.mini-bar-fill.emphasis-fill {
    background: linear-gradient(90deg, #d97706 0%, #f1b15f 100%);
}

.report-detail-card {
    margin-top: 12px;
}

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

.donut-card {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, #fcfdff 0%, #f5f9fd 100%);
    padding: 16px;
}

.donut-chart {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    position: relative;
}

.donut-chart::after {
    content: "";
    position: absolute;
    inset: 16px;
    border-radius: 50%;
    background: white;
    box-shadow: inset 0 0 0 1px #edf2f7;
}

.donut-chart.managed {
    filter: hue-rotate(135deg) saturate(0.9);
}

.donut-copy {
    display: grid;
    gap: 4px;
}

.donut-copy strong {
    font-size: 1.35rem;
    line-height: 1;
}

.donut-copy span {
    font-size: 0.82rem;
    font-weight: 700;
}

.donut-copy small {
    color: var(--muted);
    font-size: 0.74rem;
}

.credit-breakdown-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.breakdown-title {
    margin: 0 0 8px;
    font-size: 0.82rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.table-empty-state {
    padding: 18px 16px;
    color: var(--muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--line);
    background: white;
}

.promise-inline-filters {
    padding-top: 0;
}

#blazor-error-ui {
    display: none;
}

@media (max-width: 1180px) {
    .shell {
        grid-template-columns: 1fr;
    }

    .rail {
        border-right: 0;
        border-bottom: 1px solid var(--line);
    }

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

    .module-workspace-list-detail,
    .module-workspace-single {
        grid-template-columns: 1fr;
    }

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

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

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

    .report-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .credit-donut-grid,
    .credit-breakdown-grid {
        grid-template-columns: 1fr;
    }

    .reports-full {
        grid-column: auto;
    }
}

@media (max-width: 760px) {
    .boot-shell {
        padding: 20px;
    }

    .boot-card {
        padding: 22px 20px;
        border-radius: 18px;
    }

    .boot-brand {
        align-items: flex-start;
    }

    .boot-logo {
        width: 48px;
        height: 48px;
    }

    .global-bar {
        height: auto;
        padding: 12px 16px;
        flex-direction: column;
        align-items: stretch;
    }

    .global-search {
        width: 100%;
    }

    .global-bar-right {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .dashboard,
    .module-page {
        padding: 16px;
    }

    .command-bar {
        flex-wrap: wrap;
    }

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

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

    .donut-card {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .form-grid,
    .data-table-head,
    .data-row {
        grid-template-columns: 1fr;
    }

    .chart-legend,
    .chart-axis-labels,
    .mini-bar-head,
    .mini-bar-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    .chart-shell-grid {
        grid-template-columns: 1fr;
    }

    .chart-y-axis {
        min-height: auto;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 0;
    }
}
