﻿@import url("https://fonts.googleapis.com/css2?family=Open+Sans:wght@400;500;600;700&display=swap");

:root {
    --bg: #f5f2ec;
    --bg-2: #efe7db;
    --surface: #ffffff;
    --surface-2: #faf7f2;
    --text: #14110f;
    --text-muted: #6b5f55;
    --border: rgba(20, 17, 15, 0.12);
    --shadow: 0 18px 40px -24px rgba(20, 17, 15, 0.4);

    --primary: #0f766e;
    --primary-strong: #0b4f4a;
    --primary-soft: rgba(15, 118, 110, 0.12);
    --warning: #d97706;
    --destructive: #dc2626;
    --success: #16a34a;

    --chart-1: #0f766e;
    --chart-2: #2563eb;
    --chart-3: #f59e0b;
    --chart-4: #9333ea;
    --chart-5: #0ea5e9;

    --radius-lg: 18px;
    --radius-md: 12px;
    --radius-sm: 8px;
}

.week-date-picker {
    position: relative;
}

.week-date-picker__trigger {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    padding: 10px 12px;
    overflow: hidden;
    text-align: left;
}

.week-date-picker__trigger-copy {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    overflow: hidden;
}

.week-date-picker__value {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.week-date-picker__meta {
    font-size: 11px;
    color: rgba(100, 116, 139, 0.95);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.week-date-picker__trigger--empty .week-date-picker__value {
    color: rgba(100, 116, 139, 0.95);
}

.week-date-picker__icon {
    flex-shrink: 0;
    color: rgba(15, 23, 42, 0.7);
}

.week-date-picker__panel {
    position: absolute;
    top: 0;
    left: 0;
    width: min(360px, calc(100vw - 32px));
    min-width: 300px;
    z-index: 1305;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 24px 44px rgba(15, 23, 42, 0.18);
}

.week-date-picker__panel--measuring {
    visibility: hidden;
}

.week-date-picker__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.week-date-picker__toolbar-selects {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(92px, 0.8fr);
    gap: 8px;
}

.week-date-picker__direct-input {
    margin-bottom: 10px;
}

.week-date-picker__direct-input .input {
    width: 100%;
}

.week-date-picker__grid {
    display: grid;
    grid-template-columns: 46px repeat(7, minmax(0, 1fr));
    gap: 6px;
}

.week-date-picker__grid-head {
    font-size: 11px;
    font-weight: 700;
    color: rgba(71, 85, 105, 0.95);
    text-align: center;
    text-transform: uppercase;
}

.week-date-picker__grid-head--week {
    text-transform: none;
    color: #b91c1c;
}

.week-date-picker__week-label,
.week-date-picker__day {
    min-height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: rgba(248, 250, 252, 0.95);
}

.week-date-picker__week-label {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #b91c1c;
}

button.week-date-picker__week-label,
button.week-date-picker__day {
    cursor: pointer;
}

.week-date-picker__week-label--selected {
    border-color: rgba(25, 20, 105, 0.4);
    background: rgba(25, 20, 105, 0.08);
    color: #191469;
}

.week-date-picker__day {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: rgba(15, 23, 42, 0.9);
    transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.week-date-picker__day:hover:not(:disabled),
.week-date-picker__week-label:hover:not(:disabled) {
    border-color: rgba(25, 20, 105, 0.4);
    transform: translateY(-1px);
}

.week-date-picker__day--other-month {
    color: rgba(148, 163, 184, 0.95);
    background: rgba(248, 250, 252, 0.62);
}

.week-date-picker__day--today {
    border-color: rgba(245, 158, 11, 0.48);
    box-shadow: inset 0 0 0 1px rgba(245, 158, 11, 0.14);
}

.week-date-picker__day--selected {
    border-color: rgba(25, 20, 105, 0.4);
    background: rgba(25, 20, 105, 0.08);
    color: #191469;
}

.week-date-picker__day:disabled,
.week-date-picker__week-label:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
}

.week-date-picker__footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
}

@media (max-width: 640px) {
    .week-date-picker__panel {
        min-width: 0;
    }
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Open Sans", "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at top left, #ffffff 0%, var(--bg-2) 35%, var(--bg) 100%);
    min-height: 100%;
}

html:has(.app-main--chat),
body:has(.app-main--chat) {
    overflow: hidden;
}

body:has(.app-main--chat) .app-shell {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
}

body:has(.analysis-modal-backdrop),
body.analysis-modal-open {
    overflow: hidden;
}

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

.main-content {
    min-height: 100vh;
    padding-bottom: 48px;
    width: 100%;
}

.container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

.app-shell {
    --sidebar-expanded-width: 280px;
    --sidebar-collapsed-width: 68px;
    position: relative;
    min-height: 100vh;
    background: #fff;
}

.app-main {
    min-width: 0;
    padding: 0 20px 36px;
    overflow-x: hidden;
    transition: margin-left 0.22s ease;
}

.app-mobile-menu-toggle {
    display: none;
}

.mobile-workspace-bar {
    display: none;
}

.app-flow-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(4px);
}

.app-flow-overlay__panel {
    width: min(100%, 420px);
    padding: 22px 24px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 0 24px 48px rgba(15, 23, 42, 0.2);
    text-align: center;
}

.app-flow-overlay__spinner {
    width: 1.3rem;
    height: 1.3rem;
    margin-bottom: 14px;
    color: #0f766e;
}

.app-flow-overlay__title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
}

.app-flow-overlay__message {
    margin-top: 8px;
    font-size: 0.95rem;
    color: #475569;
}

.app-shell--sidebar-open .app-main {
    margin-left: var(--sidebar-expanded-width);
}

.app-shell--sidebar-closed .app-main {
    margin-left: var(--sidebar-collapsed-width);
}

.app-main--dashboard-home,
.app-main:has(.dashboard-home) {
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    padding: 0;
    overflow: hidden;
}

.app-main--dashboard-home .main-content,
.app-main--dashboard-home .container,
.app-main:has(.dashboard-home) .main-content,
.app-main:has(.dashboard-home) .container {
    height: 100%;
    min-height: 0;
}

.app-main--dashboard-home .main-content,
.app-main:has(.dashboard-home) .main-content {
    padding-top: 0;
    padding-bottom: 0;
}

.app-main--dashboard-home .container,
.app-main:has(.dashboard-home) .container {
    gap: 0;
    padding-top: 0;
}

.app-main--dashboard-home .toast-error,
.app-main:has(.dashboard-home) .toast-error {
    position: fixed;
    top: 12px;
    right: 18px;
    z-index: 1400;
    width: min(520px, calc(100vw - 36px));
    margin: 0;
}

.detail-area {
    padding: 4px 0 0;
}

.detail-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

.stack-6 {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.stack-4 {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.stack-3 {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.row {
    display: flex;
    gap: 16px;
}

.row-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.row-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.text-2xl {
    font-size: 28px;
    line-height: 1.2;
}

.text-sm {
    font-size: 15px;
}

.text-xs {
    font-size: 13px;
}

.font-semibold {
    font-weight: 600;
}

.text-muted {
    color: var(--text-muted);
}

.text-primary {
    color: var(--primary);
}

.text-warning {
    color: var(--warning);
}

.text-destructive {
    color: var(--destructive);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: #b91c1c;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--primary);
    color: #fff;
    font-family: "Open Sans", "Segoe UI", sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    box-shadow: 0 10px 20px -14px rgba(15, 118, 110, 0.7);
}

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

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: var(--primary);
}

.btn-success {
    background: var(--success);
    border-color: rgba(22, 163, 74, 0.45);
    box-shadow: 0 10px 20px -14px rgba(22, 163, 74, 0.7);
}

.btn-secondary {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: rgba(15, 118, 110, 0.35);
    box-shadow: none;
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border-color: rgba(15, 118, 110, 0.35);
    box-shadow: none;
}

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: transparent;
    box-shadow: none;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
}

.input-with-icon {
    position: relative;
    min-width: 280px;
    flex: 1;
}

.input-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input {
    width: 100%;
    padding: 10px 12px 10px 38px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: #fff;
    font-family: "Open Sans", "Segoe UI", sans-serif;
    font-size: 14px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field-label {
    font-size: 13px;
    color: var(--text-muted);
}

.alert-inline {
    padding: 10px 12px;
    border-radius: 10px;
    font-size: 13px;
}

.alert-inline--error {
    background: rgba(220, 38, 38, 0.08);
    color: var(--destructive);
    border: 1px solid rgba(220, 38, 38, 0.2);
}

.toast-error {
    position: sticky;
    top: 12px;
    z-index: 20;
    margin-bottom: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid rgba(220, 38, 38, 0.3);
    background: #fef2f2;
    color: #991b1b;
    box-shadow: var(--shadow);
}

.toast-floating {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1400;
    width: min(460px, calc(100vw - 24px));
}

.toast-floating__panel {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
    padding: 12px 14px;
}

.toast-floating__panel--success {
    border-color: rgba(37, 99, 235, 0.35);
    background: #eff6ff;
}

.toast-floating__panel--error {
    border-color: rgba(220, 38, 38, 0.35);
    background: #fef2f2;
}

.toast-floating__content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast-floating__message {
    font-size: 13px;
    line-height: 1.4;
}

.toast-floating__action {
    align-self: flex-start;
}

.order-intake-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
    align-items: stretch;
}

.smart-order-intake-card {
    border-color: rgba(15, 118, 110, 0.28);
    background: linear-gradient(120deg, rgba(240, 253, 250, 0.92), rgba(255, 255, 255, 0.96));
}

.smart-order-intake-card--compact {
    width: 100%;
    margin-right: 0;
}

.smart-order-intake-card--manual {
    border-color: rgba(37, 99, 235, 0.24);
    background: linear-gradient(120deg, rgba(239, 246, 255, 0.92), rgba(255, 255, 255, 0.96));
}

.smart-order-intake-card__content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.smart-order-intake-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.smart-order-intake-card__copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 260px;
    flex: 1;
}

.smart-order-intake-card__title {
    font-size: 20px;
    line-height: 1.2;
    font-weight: 700;
    color: var(--text);
}

.smart-order-intake-card__subtitle {
    font-size: 15px;
    line-height: 1.45;
    color: var(--text-muted);
}

.smart-order-intake-card__tracker {
    margin-top: 10px;
    border: 1px solid rgba(15, 118, 110, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.62);
}

.smart-order-intake-card__tracker-toggle {
    width: 100%;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    text-align: left;
}

.smart-order-intake-card__tracker-pill {
    min-width: 26px;
    height: 26px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    background: rgba(15, 118, 110, 0.12);
    color: #115e59;
    font-size: 12px;
}

.smart-order-intake-card__tracker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 10px 10px;
}

.smart-order-intake-card__tracker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.smart-order-intake-card__tracker-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.smart-order-intake-card__tracker-file {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.smart-order-intake-card__tracker-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.smart-order-intake-card__tracker-status-text {
    font-size: 12px;
    color: #64748b;
}

.smart-order-intake-card__tracker-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.smart-order-intake-card__tracker-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(241, 245, 249, 0.88);
    color: #334155;
}

.smart-order-intake-card__tracker-badge--running {
    border-color: rgba(37, 99, 235, 0.18);
    background: rgba(239, 246, 255, 0.95);
    color: #1d4ed8;
}

.smart-order-intake-card__tracker-badge--attention {
    border-color: rgba(217, 119, 6, 0.2);
    background: rgba(255, 247, 237, 0.95);
    color: #b45309;
}

.smart-order-intake-card__tracker-badge--success {
    border-color: rgba(22, 163, 74, 0.2);
    background: rgba(240, 253, 244, 0.95);
    color: #15803d;
}

.smart-order-intake-card__tracker-badge--error {
    border-color: rgba(220, 38, 38, 0.2);
    background: rgba(254, 242, 242, 0.95);
    color: #b91c1c;
}

.smart-order-intake-card__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.smart-order-intake-card__actions--manual {
    align-items: flex-start;
}

.smart-order-intake-card__upload-btn--disabled {
    opacity: 0.58;
    pointer-events: none;
}

.smart-order-intake-card__file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.smart-order-user-picker__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.smart-order-user-picker__option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(248, 250, 252, 0.75);
    cursor: pointer;
}

.smart-order-user-picker__option:hover {
    border-color: rgba(15, 118, 110, 0.35);
    background: rgba(240, 253, 250, 0.9);
}

.smart-order-user-picker__label {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 12px;
    line-height: 1.35;
    color: var(--text);
    word-break: break-word;
}

.smart-order-user-picker__checkbox {
    flex: 0 0 auto;
    margin: 0;
}

.document-tools-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 18px;
    align-items: stretch;
}

.document-tool-card {
    display: flex;
    min-height: 250px;
    height: 100%;
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.document-tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 24px 48px -34px rgba(15, 23, 42, 0.38);
}

.document-tool-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.document-tool-card__icon {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 18px 36px -28px rgba(15, 23, 42, 0.42);
}

.document-tool-card__icon .icon {
    font-size: 24px;
    line-height: 1;
}

.document-tool-card__copy {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.document-tool-card__eyebrow {
    font-size: 11px;
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.document-tool-card__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.document-tool-card__chip {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.document-tool-card__chips--plain .document-tool-card__chip {
    min-height: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    letter-spacing: 0.04em;
}

.document-tool-card__meta {
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-muted);
}

.document-tool-card__footer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
}

.document-tool-card__actions {
    display: flex;
    align-items: flex-start;
}

.document-tool-card__tracker {
    width: 100%;
}

.document-tool-card--details {
    border-color: rgba(14, 116, 144, 0.2);
    background: linear-gradient(150deg, rgba(240, 249, 255, 0.96), rgba(255, 255, 255, 0.98));
}

.document-tool-card--details .document-tool-card__icon {
    background: linear-gradient(145deg, rgba(14, 165, 233, 0.16), rgba(255, 255, 255, 0.94));
    color: #0369a1;
}

.document-tool-card--details .document-tool-card__eyebrow {
    color: #0c4a6e;
}

.document-tool-card--details .document-tool-card__chip {
    color: #075985;
}

.document-tool-card--invoice {
    border-color: rgba(217, 119, 6, 0.22);
    background: linear-gradient(150deg, rgba(255, 247, 237, 0.96), rgba(255, 255, 255, 0.98));
}

.document-tool-card--invoice .document-tool-card__icon {
    background: linear-gradient(145deg, rgba(251, 191, 36, 0.18), rgba(255, 255, 255, 0.94));
    color: #b45309;
}

.document-tool-card--invoice .document-tool-card__eyebrow {
    color: #9a3412;
}

.document-tool-card--invoice .document-tool-card__chip {
    color: #9a3412;
}

.document-tool-card--intake {
    border-color: rgba(15, 118, 110, 0.24);
    background: linear-gradient(150deg, rgba(240, 253, 250, 0.96), rgba(255, 255, 255, 0.98));
}

.document-tool-card--intake .document-tool-card__icon {
    background: linear-gradient(145deg, rgba(20, 184, 166, 0.16), rgba(255, 255, 255, 0.94));
    color: #0f766e;
}

.document-tool-card--intake .document-tool-card__eyebrow {
    color: #115e59;
}

.document-tool-card--intake .document-tool-card__chip {
    min-height: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #0f766e;
    letter-spacing: 0.04em;
}

.document-intake-sidecard {
    width: 100%;
}

.document-intake-sidecard__tracker {
    border: 1px solid rgba(15, 118, 110, 0.14);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.68);
}

.document-intake-sidecard__tracker-toggle {
    width: 100%;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    text-align: left;
}

.document-intake-sidecard__tracker-pill {
    min-width: 26px;
    height: 26px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    background: rgba(15, 118, 110, 0.12);
    color: #115e59;
    font-size: 12px;
}

.document-intake-sidecard__tracker-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 10px 10px;
}

.document-intake-sidecard__tracker-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

.document-intake-sidecard__tracker-main {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.document-intake-sidecard__tracker-file {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.document-intake-sidecard__tracker-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.document-intake-sidecard__tracker-status-text {
    font-size: 12px;
    color: #64748b;
}

.document-intake-sidecard__tracker-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.document-intake-sidecard__tracker-badge {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(241, 245, 249, 0.88);
    color: #334155;
}

.document-intake-sidecard__tracker-badge--running {
    border-color: rgba(37, 99, 235, 0.18);
    background: rgba(239, 246, 255, 0.95);
    color: #1d4ed8;
}

.document-intake-sidecard__tracker-badge--attention {
    border-color: rgba(217, 119, 6, 0.2);
    background: rgba(255, 247, 237, 0.95);
    color: #b45309;
}

.document-intake-sidecard__tracker-badge--success {
    border-color: rgba(22, 163, 74, 0.2);
    background: rgba(240, 253, 244, 0.95);
    color: #15803d;
}

.document-intake-sidecard__tracker-badge--error {
    border-color: rgba(220, 38, 38, 0.2);
    background: rgba(254, 242, 242, 0.95);
    color: #b91c1c;
}

.modal-backdrop,
.dashboard-workspace {
    --primary: #191469;
    --primary-strong: #0f0b50;
    --primary-soft: rgba(25, 20, 105, 0.1);
    --surface: #ffffff;
    --surface-2: #f8fafc;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: rgba(15, 23, 42, 0.2);
    --dashboard-surface-border: rgba(15, 23, 42, 0.2);
    --dashboard-surface-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
    --shadow: 0 24px 56px -24px rgba(15, 23, 42, 0.38);
}

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 18px;
    pointer-events: auto;
}

.modal-panel {
    position: relative;
    z-index: 1201;
    width: min(760px, 100%);
    max-height: calc(100vh - 36px);
    overflow: auto;
    pointer-events: auto;
}

.modal-panel.modal-panel--allow-popovers {
    overflow: visible;
}

.modal-backdrop .modal-panel.card {
    border: 1px solid rgba(25, 20, 105, 0.12);
    border-radius: 16px;
    background: #ffffff;
    color: var(--text);
    box-shadow: var(--shadow);
}

.modal-backdrop .modal-panel > .card-header {
    min-height: 64px;
    padding: 16px 18px;
    border-bottom: 1px solid #e2e8f0;
}

.modal-backdrop .modal-panel .card-title {
    color: var(--primary);
    font-weight: 700;
}

.modal-backdrop .modal-panel .field-label,
.modal-backdrop .modal-panel .text-muted {
    color: var(--text-muted);
}

.modal-backdrop .modal-panel .input {
    box-sizing: border-box;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    color: var(--text);
    box-shadow: none;
}

.modal-backdrop .modal-panel textarea.input {
    min-height: 92px;
    resize: vertical;
}

:where(.modal-backdrop, .dashboard-workspace) .btn {
    border: 1px solid transparent;
    border-radius: 12px;
    box-shadow: none;
    transform: none;
}

:where(.modal-backdrop, .dashboard-workspace) .btn:hover:not(:disabled) {
    border-color: transparent;
    box-shadow: none;
    transform: none;
}

:where(.modal-backdrop, .dashboard-workspace) .btn:focus,
:where(.modal-backdrop, .dashboard-workspace) .btn:focus-visible,
:where(.modal-backdrop, .dashboard-workspace) .btn:active {
    outline: none;
    border-color: transparent;
    box-shadow: none;
    transform: none;
}

:where(.modal-backdrop, .dashboard-workspace) .btn-primary,
:where(.modal-backdrop, .dashboard-workspace) .btn-secondary,
:where(.modal-backdrop, .dashboard-workspace) .btn-success {
    border-color: transparent;
    background: var(--primary);
    color: #ffffff;
}

:where(.modal-backdrop, .dashboard-workspace) .btn-primary:hover:not(:disabled),
:where(.modal-backdrop, .dashboard-workspace) .btn-secondary:hover:not(:disabled),
:where(.modal-backdrop, .dashboard-workspace) .btn-success:hover:not(:disabled),
:where(.modal-backdrop, .dashboard-workspace) .btn-primary:active,
:where(.modal-backdrop, .dashboard-workspace) .btn-secondary:active,
:where(.modal-backdrop, .dashboard-workspace) .btn-success:active {
    border-color: transparent;
    background: var(--primary-strong);
    color: #ffffff;
}

.modal-backdrop .modal-panel .btn-outline {
    border-color: rgba(25, 20, 105, 0.24);
    background: #ffffff;
    color: var(--primary);
}

.modal-backdrop .modal-panel .btn-outline:hover:not(:disabled) {
    border-color: rgba(25, 20, 105, 0.4);
    background: var(--primary-soft);
    color: var(--primary);
}

:where(.modal-backdrop, .dashboard-workspace) .btn-ghost {
    background: transparent;
    color: #475569;
}

:where(.modal-backdrop, .dashboard-workspace) .btn-ghost:hover:not(:disabled) {
    background: var(--primary-soft);
    color: var(--primary);
}

:where(.modal-backdrop, .dashboard-workspace) .input:focus,
:where(.modal-backdrop, .dashboard-workspace) .input:focus-visible,
.modal-backdrop .modal-panel select:focus,
.modal-backdrop .modal-panel textarea:focus {
    outline: none;
    border-color: rgba(25, 20, 105, 0.38);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

:where(.modal-backdrop, .dashboard-workspace) .btn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

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

.document-note-modal {
    width: min(640px, 100%);
}

.document-manual-split-modal {
    width: min(1040px, 100%);
}

.document-manual-split-modal__header {
    align-items: center;
    gap: 16px;
}

.document-manual-split-modal__header-copy {
    min-width: 0;
}

.document-manual-split-modal__header-subtitle {
    margin-top: 4px;
}

.document-manual-split-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(25, 20, 105, 0.08), rgba(255, 255, 255, 0.96));
}

.document-manual-split-summary__copy {
    font-size: 13px;
    line-height: 1.5;
    color: #334155;
}

.document-manual-split-summary__stats {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.document-manual-split-summary__pill {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.9);
    color: #334155;
    font-size: 12px;
    font-weight: 700;
}

.document-manual-split-summary__pill--accent {
    border-color: var(--border);
    background: var(--primary-soft);
    color: var(--primary);
}

.document-manual-split-list {
    display: grid;
    gap: 12px;
    max-height: 56vh;
    overflow: auto;
    padding-right: 4px;
}

.document-manual-split-row {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.9fr);
    gap: 18px;
    padding: 16px 18px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96));
    box-shadow: 0 16px 30px -28px rgba(15, 23, 42, 0.35);
}

.document-manual-split-row__main,
.document-manual-split-row__assignment {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.document-manual-split-row__eyebrow {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.document-manual-split-row__line-number {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.document-manual-split-row__code {
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.document-manual-split-row__description {
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}

.document-manual-split-row__notes {
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.document-manual-split-row__meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.document-manual-split-row__meta-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: #475569;
    font-size: 11px;
    font-weight: 700;
}

.document-manual-split-row__meta-pill--amount {
    color: #92400e;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.2);
}

.document-manual-split-row__field {
    margin-bottom: 0;
}

.document-manual-split-row__select {
    min-height: 44px;
    background: rgba(255, 255, 255, 0.98);
}

.document-manual-split-row__hint {
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
}

.document-manual-split-modal__footer {
    justify-content: flex-end;
    gap: 8px;
}

.document-intake-dropzone {
    position: relative;
    border: 1px dashed rgba(25, 20, 105, 0.3);
    border-radius: 12px;
    background: rgba(25, 20, 105, 0.04);
    padding: 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color .15s ease, background-color .15s ease;
}

.document-intake-dropzone--active {
    border-color: #191469;
    background: rgba(25, 20, 105, 0.08);
}

.document-intake-dropzone__input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.document-intake-dropzone__title {
    font-size: 13px;
    font-weight: 600;
    color: #191469;
}

.document-intake-files {
    margin-top: 10px;
    display: grid;
    gap: 6px;
}

.document-intake-files__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    padding: 6px 8px;
    background: rgba(255, 255, 255, 0.92);
}

.document-intake-files__name {
    font-size: 12px;
    color: #0f172a;
    word-break: break-all;
}

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

.stat-card {
    padding: 16px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.stat-card--primary {
    border-color: rgba(15, 118, 110, 0.25);
    background: rgba(15, 118, 110, 0.08);
}

.stat-card--destructive {
    border-color: rgba(220, 38, 38, 0.3);
    background: rgba(220, 38, 38, 0.08);
}

.stat-card--warning {
    border-color: rgba(217, 119, 6, 0.3);
    background: rgba(217, 119, 6, 0.08);
}

.stat-card--success {
    border-color: rgba(22, 163, 74, 0.3);
    background: rgba(22, 163, 74, 0.08);
}

.card {
    background: var(--surface);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.card-header {
    padding: 16px 18px 0;
}

.card-title {
    margin: 0;
    font-size: 16px;
}

.card-content {
    padding: 16px 18px 18px;
}

.supplies-entry-card {
    width: min(560px, 100%);
    padding: 0;
    text-align: left;
    cursor: pointer;
    color: inherit;
    font: inherit;
}

.supplies-entry-card:hover {
    border-color: var(--primary);
    box-shadow: 0 20px 40px -28px rgba(25, 20, 105, 0.32);
}

.supplies-entry-card:focus-visible {
    outline: 2px solid rgba(25, 20, 105, 0.38);
    outline-offset: 2px;
}

.supplies-document-selector {
    max-width: 460px;
}

.supplies-panel-backdrop {
    z-index: 1250;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(1px);
    padding: 18px;
}

.supplies-panel {
    width: min(1220px, 100%);
    max-height: calc(100vh - 36px);
    overflow: hidden;
}

.supplies-panel__content {
    overflow-y: auto;
    padding-right: 4px;
}

.supplies-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.supplies-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.supplies-summary-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.supplies-summary-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface-2);
    padding: 8px 10px;
}

.supplies-summary-item__value {
    font-size: 13px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.supplies-summary-item__value--editing {
    display: flex;
    align-items: center;
    min-height: 30px;
}

.supplies-inline-input {
    width: 100%;
    min-width: 0;
    border: 1px solid transparent;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.35);
    color: inherit;
    padding: 6px 8px;
    font: inherit;
    line-height: 1.35;
    box-shadow: none;
    transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.supplies-inline-input:hover {
    border-color: rgba(148, 163, 184, 0.45);
    background: rgba(255, 255, 255, 0.55);
}

.supplies-inline-input:focus {
    outline: none;
    border-color: rgba(37, 99, 235, 0.45);
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.supplies-inline-input--numeric {
    text-align: right;
}

.supplies-inline-input--date {
    min-width: 136px;
}

.supplies-table-scroll {
    max-height: min(58vh, 520px);
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: 12px;
}

.supplies-lines-table {
    margin: 0;
}

.supplies-lines-table th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.supplies-lines-table__numeric {
    text-align: right;
    white-space: nowrap;
}

.supplies-lines-table__actions {
    width: 56px;
    text-align: center;
    white-space: nowrap;
}

.supplies-lines-footer {
    display: flex;
    justify-content: flex-end;
}

.table-wrapper {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.table-wrapper--scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.archived-orders-section {
    width: 100%;
}

.archived-orders-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    font-weight: 600;
}

.archived-orders-toggle:hover {
    background: var(--surface-2);
}

.archived-orders-toggle__left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.archived-orders-toggle__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(25, 20, 105, 0.1);
    color: #191469;
    font-size: 12px;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.orders-table {
    min-width: 100%;
}

.order-list-table-wrapper {
    border-radius: var(--radius-md);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.order-list-table-wrapper .table th {
    background: #f8fafc;
}

.order-bulk-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.order-selection-cell {
    width: 42px;
    text-align: center;
}

.order-name-cell {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.order-tree-toggle,
.order-tree-spacer {
    width: 30px;
    height: 28px;
    flex: 0 0 30px;
}

.order-tree-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(15, 118, 110, 0.2);
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.08);
    color: var(--primary-strong);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.order-tree-toggle:hover {
    background: rgba(15, 118, 110, 0.16);
    border-color: rgba(15, 118, 110, 0.36);
    transform: translateY(-1px);
}

.order-tree-toggle .icon {
    font-size: 12px;
}

.table-row-child .order-name-cell {
    padding-left: 22px;
}

.table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--surface-2);
}

.table-header-with-action {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.table-header-create-btn {
    flex-shrink: 0;
}

.table-sort-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.table-sort-btn .icon {
    font-size: 13px;
    color: var(--text-muted);
}

.table-sort-btn--active,
.table-sort-btn:hover {
    color: var(--text);
}

.table-sort-btn--active .icon,
.table-sort-btn:hover .icon {
    color: var(--primary-strong);
}

.table td {
    padding: 12px 16px;
    border-top: 1px solid var(--border);
}

.table-actions-header,
.table-actions-cell {
    width: 94px;
    padding-left: 10px;
    padding-right: 10px;
    text-align: center;
}

.table-actions-cell__buttons {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.table-row-archive-btn {
    color: var(--text-muted);
}

.table-row-archive-btn:hover {
    background: rgba(15, 23, 42, 0.08);
    color: var(--text);
}

.table-row-unarchive-btn {
    color: var(--primary-strong);
}

.table-row-unarchive-btn:hover {
    background: rgba(15, 118, 110, 0.12);
    color: var(--primary-strong);
}

.table-row-delete-btn {
    color: var(--destructive);
}

.table-row-delete-btn:hover {
    background: rgba(220, 38, 38, 0.12);
    color: #991b1b;
}

.table tbody tr:hover {
    background: rgba(15, 118, 110, 0.05);
    cursor: pointer;
}

.table-row-alert {
    background: rgba(220, 38, 38, 0.06);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.badge-outline {
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.8);
    color: var(--text);
}

.badge--primary {
    color: var(--primary-strong);
    border-color: rgba(15, 118, 110, 0.4);
    background: rgba(15, 118, 110, 0.12);
}

.badge--destructive {
    color: #991b1b;
    border-color: rgba(220, 38, 38, 0.35);
    background: rgba(220, 38, 38, 0.12);
}

.badge--success {
    color: #166534;
    border-color: rgba(22, 163, 74, 0.35);
    background: rgba(22, 163, 74, 0.12);
}

.badge--warning {
    color: #92400e;
    border-color: rgba(217, 119, 6, 0.4);
    background: rgba(217, 119, 6, 0.12);
}

.badge--muted {
    color: var(--text-muted);
    border-color: rgba(107, 95, 85, 0.3);
    background: rgba(107, 95, 85, 0.08);
}

.invoice-payment-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.invoice-payment-summary__item {
    padding: 12px;
    border: 1px solid rgba(15, 118, 110, 0.12);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.95);
}

.invoice-payment-history {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.invoice-payment-history__item {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff;
}

.invoice-payment-trigger-btn {
    display: inline-flex;
    flex: 0 0 auto;
    width: auto;
    padding-inline: 10px;
    align-self: center;
    min-width: 0;
    gap: 0;
    white-space: nowrap;
}

.invoice-payment-header {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 14px;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid rgba(15, 118, 110, 0.12);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.95);
}

.invoice-payment-header__item {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
}

.invoice-payment-header__label {
    font-size: 12px;
    color: var(--text-muted);
}

.invoice-payment-header__value {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}

.invoice-payment-tabs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px;
    border: 1px solid rgba(15, 118, 110, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
}

.invoice-payment-tabs__tab {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.invoice-payment-tabs__tab--active {
    background: rgba(15, 118, 110, 0.12);
    color: var(--primary);
}

.invoice-payment-tabs__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
    color: inherit;
    font-size: 11px;
    line-height: 1;
}

.invoice-payment-form-row {
    display: grid;
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.invoice-payment-form-row--multiline {
    align-items: start;
}

.invoice-payment-form-row__label {
    margin: 0;
}

.invoice-payment-form-row__input {
    width: 100%;
}

@media (max-width: 720px) {
    .invoice-payment-form-row {
        grid-template-columns: 1fr;
        gap: 6px;
    }
}

.badge--chart-1 {
    color: #0f766e;
    border-color: rgba(15, 118, 110, 0.4);
    background: rgba(15, 118, 110, 0.12);
}

.badge--chart-2 {
    color: #1e3a8a;
    border-color: rgba(37, 99, 235, 0.3);
    background: rgba(37, 99, 235, 0.12);
}

.badge--chart-3 {
    color: #713f12;
    border-color: rgba(234, 179, 8, 0.3);
    background: rgba(234, 179, 8, 0.12);
}

.badge--chart-5 {
    color: #075985;
    border-color: rgba(14, 165, 233, 0.3);
    background: rgba(14, 165, 233, 0.12);
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    background: var(--text-muted);
}

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

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

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

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

.status-dot--muted {
    background: var(--text-muted);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    min-width: 180px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px;
    box-shadow: var(--shadow);
    z-index: 10;
}

.dropdown-item {
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border-radius: 8px;
    border: none;
    background: transparent;
    font-size: 13px;
    cursor: pointer;
}

.dropdown-item:hover {
    background: rgba(15, 118, 110, 0.08);
}

.alerts-banner {
    width: min(760px, 100%);
    max-width: 100%;
    margin-right: auto;
}

.order-alerts-panel {
    width: 100%;
    max-width: 100%;
    margin-right: 0;
}

.order-detail-scroll-card {
    --order-detail-scroll-card-min-height: 240px;
    --order-detail-scroll-card-max-height: 360px;
    display: flex;
    flex-direction: column;
}

.order-detail-scroll-card .card-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.order-detail-scroll-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    max-height: var(--order-detail-scroll-card-max-height);
    overflow-x: hidden;
    overflow-y: auto;
}

.order-detail-scroll-card__empty {
    display: flex;
    align-items: center;
    min-height: 100%;
}

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.dashboard-summary-grid__item {
    min-width: 0;
}

.dashboard-summary-grid__item .kpi-tile {
    width: 100%;
}

.ui-parent-tile[data-component-key="dashboard-orders-list"] {
    display: contents;
}

.ui-parent-tile[data-component-key="dashboard-orders-list"]::before,
.ui-parent-tile[data-component-key="dashboard-orders-list"]::after {
    display: none;
}

.dashboard-summary-grid__item--alerts .alerts-banner,
.dashboard-summary-grid__item--alerts .order-alerts-panel {
    width: 100%;
}

.dashboard-summary-grid__item--kpi .kpi-strip {
    flex-wrap: wrap;
    overflow: visible;
}

.dashboard-summary-grid__item--kpi .kpi-card {
    flex: 1 1 220px;
    min-width: 0;
}

.dashboard-home {
    --dashboard-surface-border: rgba(15, 23, 42, 0.20);
    --dashboard-surface-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
}

.dashboard-home-actions {
    --dashboard-accent: #191469;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.dashboard-home-actions__button {
    justify-content: center;
    min-height: 44px;
    border-radius: 12px;
    border-color: transparent;
    background: var(--dashboard-accent);
    color: #ffffff;
    box-shadow: none;
    gap: 10px;
    padding: 10px 14px;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    white-space: nowrap;
}

.dashboard-home-actions__button:hover:not(:disabled),
.dashboard-home-actions__button:focus,
.dashboard-home-actions__button:focus-visible,
.dashboard-home-actions__button:active {
    border-color: transparent;
    background: var(--dashboard-accent);
    color: #ffffff;
    box-shadow: none;
    outline: none;
}

.dashboard-home .btn:focus,
.dashboard-home .btn:active:focus {
    box-shadow: none;
}

@media (max-width: 768px) {
    .dashboard-home-actions {
        width: auto;
        max-width: 100%;
        grid-template-columns: repeat(2, max-content);
        justify-content: flex-start;
        gap: 10px;
    }

    .dashboard-home-actions__button {
        min-height: 34px;
        border-radius: 10px;
        gap: 6px;
        padding: 6px 8px;
        font-size: .85rem;
        line-height: 1.25;
    }
}

@media (max-width: 480px) {
    .dashboard-home-actions {
        display: flex;
        flex-wrap: wrap;
    }

    .dashboard-home-actions__button {
        flex: 0 1 auto;
    }
}

.dashboard-home__main .dashboard-home-panel {
    --dashboard-accent: #191469;
    --dashboard-accent-soft: rgba(25, 20, 105, 0.1);
    --dashboard-accent-border: rgba(25, 20, 105, 0.2);
    border: 1px solid var(--dashboard-surface-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--dashboard-surface-shadow);
    backdrop-filter: blur(18px);
    overflow: hidden;
}

.dashboard-home__main .dashboard-home-panel:has(.modal-backdrop) {
    backdrop-filter: none;
    overflow: visible;
}

.dashboard-home__main .dashboard-home-panel .card-header {
    padding: 14px;
}

.dashboard-home__main .dashboard-home-panel .alerts-banner__badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--dashboard-accent);
    color: #ffffff;
}

.dashboard-home__main .dashboard-home-panel .card-title,
.dashboard-home__main .dashboard-home-panel .alerts-banner__title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dashboard-accent);
    line-height: 1.5;
}

.dashboard-home__main .dashboard-home-panel .btn-ghost {
    border-radius: 6px;
    background: transparent;
    color: #666;
    box-shadow: none;
}

.dashboard-home__main .dashboard-home-panel .btn-ghost:hover:not(:disabled) {
    background: var(--dashboard-accent-soft);
    color: var(--dashboard-accent);
}

.dashboard-home__main .dashboard-home-panel .alert-strip {
    border-color: var(--dashboard-accent-border);
    border-radius: 12px;
    background: var(--dashboard-accent-soft);
}

.dashboard-home__main .dashboard-home-panel .alert-strip__icon {
    border-radius: 10px;
    background: var(--dashboard-accent);
    color: #ffffff;
}

.dashboard-home__main .dashboard-home-panel .alert-strip__title {
    font-size: 1rem;
    color: #1f2937;
    line-height: 1.5;
}

.dashboard-home__main .dashboard-home-panel .order-detail-scroll-card__empty,
.dashboard-home__main .dashboard-home-panel .alert-strip__description,
.dashboard-home__main .dashboard-home-panel .alert-strip__meta-item {
    font-size: 1rem;
    line-height: 1.5;
}

.dashboard-home__main .dashboard-home-panel .alert-strip__description,
.dashboard-home__main .dashboard-home-panel .alert-strip__meta-item {
    color: #4b5563;
}

.dashboard-home__main .dashboard-inbox-item {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.dashboard-home__main .dashboard-inbox-item:first-child {
    padding-top: 0;
}

.dashboard-home__main .dashboard-inbox-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.dashboard-home__main .dashboard-inbox-item__icon {
    width: 24px;
    height: 24px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(25, 20, 105, 0.08);
    color: var(--dashboard-accent);
    font-size: 16px;
}

.dashboard-home__main .dashboard-inbox-item__body {
    min-width: 0;
}

.dashboard-home__main .dashboard-inbox-item__title {
    color: #111827;
    font-size: .94rem;
    font-weight: 650;
    line-height: 1.35;
}

.dashboard-home__main .dashboard-inbox-item__description {
    margin-top: 3px;
    color: #4b5563;
    font-size: .88rem;
    line-height: 1.35;
}

.dashboard-home__main .dashboard-inbox-item__meta {
    margin-top: 5px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    color: #6b7280;
    font-size: .78rem;
    line-height: 1.3;
}

.dashboard-home__main .dashboard-inbox-item__actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.dashboard-home__main .dashboard-inbox-item__action {
    width: 30px;
    height: 30px;
    min-width: 30px;
}

.dashboard-home__main .dashboard-messages-panel,
.dashboard-home__main .dashboard-tasks-panel {
    --order-detail-scroll-card-max-height: 270px;
    border-radius: 10px;
    box-shadow: none;
}

.dashboard-home__main .dashboard-messages-panel .card-header,
.dashboard-home__main .dashboard-tasks-panel .card-header {
    padding: 13px 14px 11px;
}

.dashboard-home__main .dashboard-messages-panel .card-content,
.dashboard-home__main .dashboard-tasks-panel .card-content {
    padding: 2px 14px 12px;
}

.dashboard-home__main .dashboard-messages-panel .alerts-banner__badge,
.dashboard-home__main .dashboard-tasks-panel .alerts-banner__badge {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.dashboard-home__main .dashboard-messages-panel .alerts-banner__title,
.dashboard-home__main .dashboard-tasks-panel .alerts-banner__title {
    font-size: .96rem;
}

.dashboard-home__main .dashboard-messages-panel .dashboard-inbox-item,
.dashboard-home__main .dashboard-tasks-panel .dashboard-inbox-item {
    grid-template-columns: 26px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 10px 0;
}

.dashboard-home__main .dashboard-messages-panel .dashboard-inbox-item__icon,
.dashboard-home__main .dashboard-tasks-panel .dashboard-inbox-item__icon {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    font-size: 14px;
}

.dashboard-home__main .dashboard-messages-panel .dashboard-inbox-item__title,
.dashboard-home__main .dashboard-tasks-panel .dashboard-inbox-item__title {
    font-size: .86rem;
    line-height: 1.25;
}

.dashboard-home__main .dashboard-messages-panel .dashboard-inbox-item__description,
.dashboard-home__main .dashboard-tasks-panel .dashboard-inbox-item__description {
    display: -webkit-box;
    margin-top: 3px;
    overflow: hidden;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    font-size: .78rem;
    line-height: 1.25;
}

.dashboard-home__main .dashboard-messages-panel .dashboard-inbox-item__meta,
.dashboard-home__main .dashboard-tasks-panel .dashboard-inbox-item__meta {
    margin-top: 5px;
    font-size: .7rem;
}

.dashboard-home__main .dashboard-messages-panel .dashboard-inbox-item__action,
.dashboard-home__main .dashboard-tasks-panel .dashboard-inbox-item__action {
    width: 26px;
    height: 26px;
    min-width: 26px;
}

.dashboard-home {
    display: grid;
    grid-template-columns: minmax(360px, 0.92fr) minmax(0, 1.35fr);
    gap: 0;
    align-items: stretch;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    background: #fff;
}

.dashboard-home--detail,
.dashboard-home--orders {
    --sidebar-accent: #191469;
    --sidebar-accent-soft: rgba(25, 20, 105, 0.1);
    --sidebar-accent-border: rgba(25, 20, 105, 0.2);
    --sidebar-accent-strong-border: rgba(25, 20, 105, 0.38);
}

.dashboard-workspace {
    width: 100%;
    min-height: calc(100vh - 36px);
    padding-top: 20px;
    background: #fff;
}

.dashboard-workspace .card {
    border-color: var(--dashboard-surface-border);
    background: #fff;
    box-shadow: var(--dashboard-surface-shadow);
}

.dashboard-home__chat,
.dashboard-home__main {
    min-width: 0;
    min-height: 0;
}

.dashboard-home__chat {
    height: 100%;
    overflow: hidden;
}

.chat-workspace.chat-workspace--minimal {
    height: 100%;
    min-height: 0;
    padding: 0;
}

.chat-workspace--minimal .chat-workspace__conversation {
    width: 100%;
    margin: 0;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.dashboard-home__main {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 20px;
    height: 100%;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px;
}

.dashboard-home__main--detail,
.dashboard-home__main--orders {
    justify-content: flex-start;
    padding: 20px;
}

.dashboard-home__main--detail .detail-area {
    width: 100%;
    min-height: 0;
}

.dashboard-home__main--orders > * {
    width: 100%;
}

.app-main--dashboard-home:has(.dashboard-home--mobile-dashboard),
.app-main:has(.dashboard-home--mobile-dashboard) {
    height: auto;
    max-height: none;
    min-height: 100vh;
    overflow: visible;
}

.app-main--dashboard-home:has(.dashboard-home--mobile-dashboard) .main-content,
.app-main--dashboard-home:has(.dashboard-home--mobile-dashboard) .container,
.app-main:has(.dashboard-home--mobile-dashboard) .main-content,
.app-main:has(.dashboard-home--mobile-dashboard) .container {
    height: auto;
    min-height: 100vh;
}

.dashboard-home--mobile-dashboard {
    height: auto;
    min-height: 100vh;
    overflow: visible;
    align-items: start;
}

.dashboard-home--mobile-dashboard .dashboard-home__chat {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
}

.dashboard-home--mobile-dashboard .dashboard-home__main {
    height: auto;
    min-height: 100vh;
    overflow: visible;
}

.dashboard-home--detail .btn,
.dashboard-home--orders .btn,
.dashboard-home--orders .archived-orders-toggle,
.dashboard-home--orders .order-tree-toggle {
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    color: #4b5563;
    box-shadow: none;
    font-family: "Open Sans", "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 600;
    transform: none;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.dashboard-home--detail .btn:hover:not(:disabled),
.dashboard-home--orders .btn:hover:not(:disabled),
.dashboard-home--orders .archived-orders-toggle:hover,
.dashboard-home--orders .order-tree-toggle:hover {
    background: var(--sidebar-accent-soft);
    color: var(--sidebar-accent);
    border-color: transparent;
    transform: none;
}

.dashboard-home--detail .btn:focus,
.dashboard-home--detail .btn:focus-visible,
.dashboard-home--detail .btn:active,
.dashboard-home--orders .btn:focus,
.dashboard-home--orders .btn:focus-visible,
.dashboard-home--orders .btn:active,
.dashboard-home--orders .archived-orders-toggle:focus,
.dashboard-home--orders .archived-orders-toggle:focus-visible,
.dashboard-home--orders .archived-orders-toggle:active,
.dashboard-home--orders .order-tree-toggle:focus,
.dashboard-home--orders .order-tree-toggle:focus-visible,
.dashboard-home--orders .order-tree-toggle:active {
    outline: none;
    box-shadow: none;
    transform: none;
}

.dashboard-home--detail .btn-primary,
.dashboard-home--detail .btn-secondary,
.dashboard-home--orders .btn-primary,
.dashboard-home--orders .btn-secondary {
    background: var(--sidebar-accent);
    color: #ffffff;
    border-color: transparent;
}

.dashboard-home--detail .btn-primary:hover:not(:disabled),
.dashboard-home--detail .btn-secondary:hover:not(:disabled),
.dashboard-home--detail .btn-primary:focus-visible,
.dashboard-home--detail .btn-secondary:focus-visible,
.dashboard-home--detail .btn-primary:active,
.dashboard-home--detail .btn-secondary:active,
.dashboard-home--orders .btn-primary:hover:not(:disabled),
.dashboard-home--orders .btn-secondary:hover:not(:disabled),
.dashboard-home--orders .btn-primary:focus-visible,
.dashboard-home--orders .btn-secondary:focus-visible,
.dashboard-home--orders .btn-primary:active,
.dashboard-home--orders .btn-secondary:active {
    background: var(--sidebar-accent);
    color: #ffffff;
    border-color: transparent;
}

.dashboard-home--detail .btn-icon,
.dashboard-home--orders .btn-icon,
.dashboard-home--orders .order-tree-toggle {
    border-radius: 6px;
}

.dashboard-home--detail .text-danger,
.dashboard-home--orders .text-danger,
.dashboard-home--orders .table-row-delete-btn {
    color: #b91c1c;
}

.dashboard-home--detail .text-danger:hover:not(:disabled),
.dashboard-home--orders .text-danger:hover:not(:disabled),
.dashboard-home--orders .table-row-delete-btn:hover:not(:disabled) {
    background: #fef2f2;
    color: #991b1b;
}

.dashboard-home--orders .table-wrapper,
.dashboard-home--orders .archived-orders-toggle {
    border-color: var(--dashboard-surface-border);
    box-shadow: var(--dashboard-surface-shadow);
}

.chat-workspace--minimal .chat-panel__header {
    display: flex;
    padding: 10px 16px 8px;
    border-bottom: 0;
    background: #fff;
}

.chat-workspace--minimal .chat-panel__header-main {
    gap: 6px;
}

.chat-workspace--minimal .chat-panel__header-main > .font-semibold {
    display: none;
}

.chat-workspace--minimal .chat-panel__body {
    padding: 0 1rem 1rem;
    gap: 0;
    background: #fff;
}

.chat-workspace--minimal .chat-panel__messages {
    gap: 0.75rem;
    padding: 0 0.75rem 0 0;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.chat-workspace--minimal .chat-panel__messages::-webkit-scrollbar {
    width: 6px;
}

.chat-workspace--minimal .chat-panel__messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-workspace--minimal .chat-panel__messages::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}

.chat-workspace--minimal .chat-message {
    max-width: 85%;
}

.chat-workspace--minimal .chat-message__meta {
    display: none;
}

.chat-workspace--minimal .chat-message__bubble {
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    color: #333;
    font-family: "Open Sans", "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    word-break: break-word;
}

.chat-workspace--minimal .chat-message--user .chat-message__bubble {
    border-radius: 1rem;
    padding: .5rem .75rem;
    background: #0860E6;
    color: #fff;
}

.chat-workspace--minimal .chat-message--user {
    max-width: 85%;
    margin-left: auto;
}

.chat-workspace--minimal .chat-message--assistant {
    text-align: left;
}

.chat-workspace--minimal .chat-panel__suggestions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0.55rem 0 1.5rem;
}

.chat-workspace--minimal .chat-panel__composer .chat-panel__suggestions {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
}

.chat-workspace--minimal .chat-panel__suggestions .btn {
    min-height: 3.25rem;
    justify-content: flex-start;
    padding: 0.75rem 0.95rem;
    border: 1px solid #e2e6e9;
    border-radius: 1rem;
    background: #fff;
    color: #555;
    box-shadow: none;
    font-size: 0.9rem;
    line-height: 1.25;
    text-align: left;
    white-space: normal;
    overflow-wrap: anywhere;
}

.chat-workspace--minimal .chat-panel__composer .chat-panel__suggestions .btn {
    width: 100%;
    min-height: 2.75rem;
    border-color: rgba(40, 168, 210, 0.38);
    background: rgba(40, 168, 210, 0.12);
    color: #167ea0;
}

.chat-workspace--minimal .chat-panel__suggestions .btn:hover:not(:disabled) {
    background: #f6f8f9;
    border-color: #d3d9de;
    color: #333;
    transform: none;
}

.chat-workspace--minimal .chat-panel__composer .chat-panel__suggestions .btn:hover:not(:disabled) {
    border-color: rgba(40, 168, 210, 0.62);
    background: rgba(40, 168, 210, 0.18);
    color: #116b89;
}

.chat-workspace--minimal .chat-context-prompts {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.chat-workspace--minimal .chat-context-prompts__title,
.chat-workspace--minimal .chat-context-prompts__subtitle {
    color: #747b82;
    font-size: 0.9rem;
    font-weight: 400;
    text-align: center;
}

.chat-workspace--minimal .chat-context-prompts--composer .chat-context-prompts__title {
    color: #167ea0;
    text-align: left;
}

.chat-workspace--minimal .chat-context-prompts--composer .chat-context-prompts__subtitle {
    color: rgba(22, 126, 160, 0.78);
    text-align: left;
}

.chat-workspace--minimal .chat-panel__composer {
    position: relative;
    display: block;
    border-top: 0;
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    background: #fff;
}

.chat-workspace--minimal .chat-panel__composer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.35rem;
    margin-top: 0.5rem;
}

.chat-workspace--minimal .chat-panel__composer-actions .chat-voice-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
}

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

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

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

.alerts-banner__intro {
    display: flex;
    align-items: center;
    gap: 12px;
}

.alerts-banner__badge {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.12);
    color: var(--destructive);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
}

.alerts-banner__title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.alerts-banner__subtitle {
    margin-top: 3px;
    font-size: 13px;
    color: var(--text-muted);
}

.alerts-banner__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.alerts-banner__list,
.order-alerts-panel__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.alerts-banner__list {
    max-height: 320px;
    overflow-y: auto;
    padding-right: 4px;
}

.order-alerts-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.order-alerts-panel__scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.order-inefficiencies-board__table-shell {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.order-inefficiencies-board__scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
}

.order-inefficiencies-board .table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--surface);
}

.order-inefficiencies-board .table tbody tr:hover {
    cursor: default;
}

.order-inefficiencies-board .table tbody td {
    vertical-align: middle;
}

.order-inefficiencies-board__category-select {
    min-width: 180px;
    max-width: 220px;
    width: 100%;
}

.alert-strip {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 16px;
    border: 1px solid transparent;
}

.alert-strip__icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 32px;
}

.alert-strip__body {
    flex: 1;
    min-width: 0;
}

.alert-strip__title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
}

.alert-strip__description {
    margin-top: 4px;
    font-size: 14px;
    line-height: 1.4;
    color: rgba(15, 23, 42, 0.78);
}

.alert-strip__meta {
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.alert-strip__meta-item {
    font-size: 13px;
    color: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.48);
    background: rgba(255, 255, 255, 0.42);
    border-radius: 999px;
    padding: 3px 8px;
}

.alert-strip__actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.alert-strip__action {
    flex: 0 0 auto;
}

.alert-strip--success {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.28);
}

.alert-strip--success .alert-strip__icon {
    background: rgba(34, 197, 94, 0.18);
    color: var(--success);
}

.alert-strip--destructive {
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.26);
}

.alert-strip--destructive .alert-strip__icon {
    background: rgba(239, 68, 68, 0.16);
    color: var(--destructive);
}

.alert-strip--warning {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.3);
}

.alert-strip--warning .alert-strip__icon {
    background: rgba(245, 158, 11, 0.18);
    color: #b45309;
}

.alert-strip--primary {
    background: rgba(37, 99, 235, 0.1);
    border-color: rgba(37, 99, 235, 0.24);
}

.alert-strip--primary .alert-strip__icon {
    background: rgba(37, 99, 235, 0.14);
    color: var(--primary);
}

.note-card {
    padding: 18px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface);
}

.note-card--with-attachments {
    padding: 18px;
}

.note-source-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(100, 116, 139, 0.1);
    color: rgba(51, 65, 85, 0.88);
}

.note-card__layout {
    align-items: flex-start;
}

.note-card__body {
    flex: 1;
    min-width: 0;
}

.note-card__header {
    margin-bottom: 8px;
}

.note-source-icon .icon {
    font-size: 18px;
    line-height: 1;
}

.note-source-badge {
    flex: 0 0 auto;
    width: fit-content;
    max-width: 100%;
    align-self: flex-start;
}

.note-payment-badge {
    flex: 0 0 auto;
    width: fit-content;
    max-width: 100%;
    align-self: flex-start;
}

.note-source-icon.note-source--manual,
.note-source-badge.note-source--manual {
    color: #28A8D2;
    border-color: rgba(40, 168, 210, 0.38);
    background: rgba(40, 168, 210, 0.12);
}

.note-source-icon.note-source--mail,
.note-source-badge.note-source--mail {
    color: #1d4ed8;
    border-color: rgba(59, 130, 246, 0.36);
    background: rgba(219, 234, 254, 0.92);
}

.note-source-icon.note-source--whatsapp,
.note-source-badge.note-source--whatsapp {
    color: #15803d;
    border-color: rgba(34, 197, 94, 0.36);
    background: rgba(220, 252, 231, 0.92);
}

.note-source-icon.note-source--telegram,
.note-source-badge.note-source--telegram {
    color: #0284c7;
    border-color: rgba(14, 165, 233, 0.38);
    background: rgba(224, 242, 254, 0.94);
}

.note-source-icon.note-source--default,
.note-source-badge.note-source--default {
    color: var(--text-muted);
    border-color: rgba(148, 163, 184, 0.32);
    background: rgba(241, 245, 249, 0.92);
}

.note-source-icon.note-source--manual,
.note-source-icon.note-source--mail,
.note-source-icon.note-source--whatsapp,
.note-source-icon.note-source--telegram,
.note-source-icon.note-source--default {
    color: rgba(51, 65, 85, 0.88);
    border-color: rgba(148, 163, 184, 0.28);
    background: rgba(100, 116, 139, 0.1);
}

.note-attachment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: 12px;
    background: #fff;
}

.note-attachment-thumb {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    object-fit: cover;
    border: 1px solid var(--border);
}

.document-attachment-list {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.document-attachment-list--compact {
    margin-top: 8px;
    gap: 6px;
}

.note-attachment--mini {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0;
    border-radius: 10px;
    justify-content: center;
    gap: 0;
    overflow: hidden;
}

.note-attachment-thumb--mini {
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: none;
    object-fit: cover;
}

.note-attachment--mini .icon {
    font-size: 18px;
    line-height: 1;
}

.document-content-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.document-content-main {
    flex: 1;
    min-width: 0;
}

.document-inline-preview {
    width: clamp(216px, 30vw, 300px);
    min-width: 216px;
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    text-decoration: none;
    color: inherit;
    display: block;
    align-self: flex-start;
}

.document-inline-preview img,
.document-inline-preview__pdf {
    width: 100%;
    height: 136px;
    border: 0;
    display: block;
    object-fit: cover;
    object-position: top center;
    background: #fff;
}

.document-inline-preview__pdf {
    pointer-events: none;
}

.document-inline-preview__icon {
    width: 100%;
    height: 136px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    color: var(--text-muted);
}

.document-inline-preview__icon .icon {
    font-size: 30px;
}

@media (max-width: 768px) {
    .note-card__layout {
        gap: 10px;
    }

    .note-card__header {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 8px;
    }

    .document-content-row {
        flex-direction: column;
        gap: 10px;
    }

    .document-content-main {
        width: 100%;
    }

    .document-inline-preview {
        width: min(100%, 240px);
        min-width: 0;
        max-width: 100%;
    }

    .document-inline-preview img,
    .document-inline-preview__pdf,
    .document-inline-preview__icon {
        height: 118px;
    }
}

.attachments-slider {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.attachments-slider::-webkit-scrollbar {
    height: 8px;
}

.attachments-slider::-webkit-scrollbar-thumb {
    background: rgba(15, 118, 110, 0.3);
    border-radius: 999px;
}

.attachment-tile {
    flex: 0 0 232px;
    width: 232px;
    min-width: 232px;
    max-width: 232px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    scroll-snap-align: start;
}

.attachment-tile--disabled {
    cursor: default;
    opacity: 0.9;
}

.attachment-tile__preview {
    height: 140px;
    border-radius: 10px;
    border: 1px dashed var(--border);
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.attachment-tile__preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.attachment-tile__pdf-preview {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    pointer-events: none;
    background: #fff;
}

.attachment-tile__preview-icon {
    font-size: 34px;
    color: var(--text-muted);
}

.attachment-tile__name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-tile__phase {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.analysis-modal-backdrop {
    z-index: 1300;
    background: rgba(15, 23, 42, 0.58);
    backdrop-filter: blur(2px);
    padding: 4px;
    overflow: hidden;
    overscroll-behavior: contain;
}

.analysis-modal-panel {
    width: min(99.5vw, 1840px);
    height: calc(100vh - 8px);
    max-height: calc(100vh - 8px);
    padding: 8px;
    overflow: hidden;
    overscroll-behavior: contain;
}

.analysis-review {
    height: 100%;
    margin-top: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    padding: 0;
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
    gap: 12px;
}

.analysis-review__left,
.analysis-review__right {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    height: 100%;
}

.analysis-review__right {
    border-left: 1px solid var(--border);
    padding-left: 12px;
    padding-right: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.analysis-viewer {
    position: relative;
    width: 100%;
    min-height: 420px;
    height: auto;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: #f8fafc;
}

.analysis-viewer__frame,
.analysis-viewer__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.analysis-viewer__image {
    object-fit: contain;
}

.analysis-viewer--pdf .analysis-viewer__frame {
    pointer-events: none;
}

.analysis-viewer--pdf {
    flex: 0 0 auto;
    width: 100%;
}

.analysis-viewer__overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.analysis-page-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.analysis-page-nav--header {
    margin-right: 4px;
    gap: 8px;
}

.analysis-page-nav__label {
    min-width: 112px;
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
}

.analysis-polygon {
    fill: none !important;
    fill-opacity: 0 !important;
    stroke-width: 1.4px;
    stroke-linejoin: round;
    transition: stroke-width 0.12s ease, fill-opacity 0.12s ease, filter 0.12s ease;
}

.analysis-polygon--high {
    stroke: #16a34a;
    fill: none !important;
}

.analysis-polygon--medium {
    stroke: #d97706;
    fill: none !important;
}

.analysis-polygon--low {
    stroke: #dc2626;
    fill: none !important;
}

.analysis-polygon--active {
    stroke-width: 2.8px;
    fill-opacity: 1 !important;
    filter: drop-shadow(0 0 2px rgba(15, 23, 42, 0.35));
}

.analysis-polygon--high.analysis-polygon--active {
    fill: rgba(22, 163, 74, 0.2) !important;
}

.analysis-polygon--medium.analysis-polygon--active {
    fill: rgba(217, 119, 6, 0.2) !important;
}

.analysis-polygon--low.analysis-polygon--active {
    fill: rgba(220, 38, 38, 0.2) !important;
}

.analysis-polygon--active:not(.analysis-polygon--high):not(.analysis-polygon--medium):not(.analysis-polygon--low) {
    stroke: #0ea5e9;
    fill: rgba(14, 165, 233, 0.2) !important;
}

.analysis-fields {
    max-height: none;
    flex: 0 0 auto;
    overflow: visible;
    padding-right: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.analysis-section {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    padding: 10px 12px;
}

.analysis-section--lines {
    padding-bottom: 12px;
}

.analysis-section__title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.analysis-section__summary {
    list-style: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.analysis-section__summary::after {
    content: "▾";
    color: var(--text-muted);
    font-size: 11px;
    transition: transform 0.16s ease;
}

.analysis-section:not([open]) .analysis-section__summary::after {
    transform: rotate(-90deg);
}

.analysis-section__body {
    margin-top: 8px;
}

.analysis-node {
    padding: 10px 0;
    border-top: 1px solid var(--border);
}

.analysis-node:first-child {
    border-top: none;
    padding-top: 0;
}

.analysis-node__children {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 8px;
}

.analysis-boolean-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.analysis-boolean-toggle input {
    width: 15px;
    height: 15px;
}

.analysis-table-group {
    margin-top: 14px;
    border-top: 1px solid var(--border);
    padding-top: 12px;
}

.analysis-table-group__title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 8px;
}

.analysis-table-wrap {
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: auto;
    background: #fff;
}

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

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

.analysis-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f8fafc;
    font-size: 12px;
    font-weight: 700;
}

.analysis-table__index {
    width: 64px;
    min-width: 64px;
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
}

.analysis-table__rowheader {
    width: 160px;
    min-width: 160px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    vertical-align: middle;
}

.analysis-table__input {
    min-width: 120px;
    padding-left: 10px;
}

.analysis-table__input--multiline {
    min-width: 200px;
    resize: vertical;
}

.analysis-confidence {
    margin-left: 6px;
    font-size: 11px;
    font-weight: 700;
}

.analysis-confidence--high {
    color: #166534;
}

.analysis-confidence--medium {
    color: #92400e;
}

.analysis-confidence--low {
    color: #991b1b;
}

@media (max-width: 768px) {
    .toast-floating {
        right: 12px;
        bottom: 12px;
        width: calc(100vw - 24px);
    }

    .attachment-tile {
        flex-basis: 192px;
        width: 192px;
        min-width: 192px;
        max-width: 192px;
    }

    .attachment-tile__preview {
        height: 120px;
    }

    .analysis-review {
        grid-template-columns: 1fr;
    }

    .analysis-modal-panel {
        width: 100%;
        height: 100%;
        border-radius: 0;
        padding: 8px;
    }

    .analysis-review__right {
        border-left: none;
        border-top: 1px solid var(--border);
        padding-left: 0;
        padding-top: 10px;
    }

    .analysis-viewer {
        min-height: 300px;
    }

    .analysis-table {
        min-width: 560px;
    }
}

.timeline-bar {
    position: absolute;
    inset: 50% 0 auto 0;
    height: 2px;
    background: var(--border);
}

.timeline-fill {
    position: absolute;
    top: 50%;
    height: 8px;
    border-radius: 999px;
    transform: translateY(-50%);
}

.sidebar__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.52);
    z-index: 24;
    backdrop-filter: blur(2px);
}

.sidebar-user-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 24;
    background: transparent;
}

.sidebar {
    --sidebar-accent: #191469;
    --sidebar-accent-soft: rgba(25, 20, 105, 0.1);
    --sidebar-accent-border: rgba(25, 20, 105, 0.2);
    --sidebar-accent-strong-border: rgba(25, 20, 105, 0.38);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    height: 100dvh;
    min-height: 100vh;
    max-height: 100dvh;
    width: var(--sidebar-expanded-width);
    padding: 14px 12px;
    background: rgba(255, 255, 255, 0.92);
    color: #1f2937;
    border-right: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 14px 0 34px -30px rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(18px);
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 25;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -ms-overflow-style: none;
    scrollbar-width: none;
    transition: width 0.2s ease;
}

.sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar--closed {
    width: var(--sidebar-collapsed-width);
}

.sidebar--user-menu-open {
    overflow: visible;
}

.sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
    flex: 0 0 auto;
}

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

.sidebar__brand-icon {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
}

.sidebar__brand-logo {
    display: block;
    height: 32px;
    object-fit: contain;
    width: 32px;
}

.sidebar__brand-meta {
    display: flex;
    flex-direction: column;
    min-width: 0;
    line-height: 1.1;
}

.sidebar__brand-title {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sidebar__brand-subtitle {
    margin-top: 3px;
    font-size: 11px;
    color: #6b7280;
}

.sidebar__collapse-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: auto;
    border-radius: 6px;
    border: none;
    background: transparent;
    color: #666;
    box-shadow: none;
    appearance: none;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar__collapse-toggle:hover:not(:disabled) {
    background-color: var(--sidebar-accent-soft);
    color: var(--sidebar-accent);
}

.sidebar__collapse-toggle:focus,
.sidebar__collapse-toggle:focus-visible,
.sidebar__collapse-toggle:active {
    outline: none;
    box-shadow: none;
    border: none;
}

.sidebar__nav {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-x: hidden;
    overflow-y: hidden;
    -ms-overflow-style: none;
    padding-right: 2px;
    scrollbar-width: none;
}

.sidebar__nav::-webkit-scrollbar {
    display: none;
}

.sidebar__section-title {
    padding: 6px 12px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(17, 24, 39, 0.6);
}

.sidebar-chat-history {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 0 10px;
    margin: 6px 0 0;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    border-bottom: 0;
    overflow: hidden;
}

.sidebar-chat-history__title {
    padding: 0 12px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    color: rgba(17, 24, 39, 0.62);
}

.sidebar-chat-history__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 30px;
}

.sidebar-chat-history__new {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 28px;
    padding: 5px 8px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    background: rgba(249, 250, 251, 0.88);
    color: #4b5563;
    font-family: "Open Sans", "Segoe UI", sans-serif;
    font-size: 11px;
    font-weight: 700;
}

.sidebar-chat-history__new .icon {
    font-size: 13px;
}

.sidebar-chat-history__new:hover,
.sidebar-chat-history__new:focus-visible {
    background: var(--sidebar-accent-soft);
    border-color: var(--sidebar-accent-border);
    color: var(--sidebar-accent);
    outline: none;
}

.sidebar-chat-history__list {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-x: hidden;
    overflow-y: auto;
    padding-right: 2px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.sidebar-chat-history__list::-webkit-scrollbar {
    display: none;
}

.sidebar-chat-history__item {
    width: 100%;
    min-width: 0;
    display: block;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: transparent;
    color: #4b5563;
    text-align: left;
    font-family: "Open Sans", "Segoe UI", sans-serif;
}

.sidebar-chat-history__item:hover:not(:disabled) {
    background: var(--sidebar-accent-soft);
    color: var(--sidebar-accent);
}

.sidebar-chat-history__item--selected {
    background: rgba(25, 20, 105, 0.08);
    border-color: var(--sidebar-accent-border);
    color: var(--sidebar-accent);
}

.sidebar-chat-history__item-title {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    font-weight: 700;
}

.sidebar-chat-history__load-more {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    background: rgba(249, 250, 251, 0.88);
    color: #4b5563;
    font-family: "Open Sans", "Segoe UI", sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.sidebar-chat-history__load-more:hover:not(:disabled),
.sidebar-chat-history__load-more:focus-visible {
    background: var(--sidebar-accent-soft);
    border-color: var(--sidebar-accent-border);
    color: var(--sidebar-accent);
    outline: none;
}

.sidebar-chat-history__state {
    padding: 6px 12px;
    color: #6b7280;
    font-size: 11px;
    line-height: 1.3;
}

.sidebar-chat-history__state--error {
    color: #b91c1c;
}

.sidebar__footer {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    padding: 4px 0;
    border-top: 0;
}

.sidebar-button {
    width: 100%;
    min-height: 40px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: transparent;
    box-shadow: none;
    justify-content: flex-start;
    gap: 10px;
    padding: 9px 12px;
    color: #4b5563;
    font-family: "Open Sans", "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 600;
    transform: none;
    -webkit-tap-highlight-color: transparent;
}

.sidebar-button.btn-ghost {
    color: #4b5563;
}

.sidebar-button .icon {
    font-size: 16px;
}

.sidebar-button:hover:not(:disabled) {
    background: var(--sidebar-accent-soft);
    color: var(--sidebar-accent);
}

.sidebar-button.btn-secondary {
    background: var(--sidebar-accent);
    color: #ffffff;
    border-color: transparent;
}

.sidebar-button.btn-secondary .icon,
.sidebar-button.btn-secondary .sidebar-button__label {
    color: inherit;
}

.sidebar-button.btn-secondary:hover:not(:disabled),
.sidebar-button.btn-secondary:focus-visible,
.sidebar-button.btn-secondary:active {
    background: var(--sidebar-accent);
    color: #ffffff;
    border-color: transparent;
}

.sidebar-button.btn-secondary:hover:not(:disabled) .icon,
.sidebar-button.btn-secondary:hover:not(:disabled) .sidebar-button__label,
.sidebar-button.btn-secondary:focus-visible .icon,
.sidebar-button.btn-secondary:focus-visible .sidebar-button__label,
.sidebar-button.btn-secondary:active .icon,
.sidebar-button.btn-secondary:active .sidebar-button__label {
    color: inherit;
}

.sidebar-button.btn-secondary {
    box-shadow: none;
}

.sidebar-button:focus,
.sidebar-button:focus-visible,
.sidebar-button:active,
.sidebar-button:active:focus,
.sidebar-button:active:focus-visible,
.sidebar-user-card:focus,
.sidebar-user-card:focus-visible,
.sidebar-user-card:active,
.sidebar-user-card:active:focus,
.sidebar-user-card:active:focus-visible,
.sidebar .btn:focus,
.sidebar .btn:active:focus {
    outline: none !important;
    box-shadow: none !important;
}

.sidebar-button--logout {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.1);
}

.sidebar-button--logout:hover:not(:disabled) {
    background: #fef2f2;
    border-color: rgba(185, 28, 28, 0.22);
    color: #991b1b;
}

.sidebar-user-card {
    appearance: none;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 10px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    background: rgba(249, 250, 251, 0.92);
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.sidebar-user-card:hover,
.sidebar-user-card:focus-visible {
    background: var(--sidebar-accent-soft);
    border-color: rgba(40, 168, 210, 0.18);
}

.sidebar-user-card__avatar {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--sidebar-accent);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
}

.sidebar-user-card__content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-user-card__identity,
.sidebar-user-card__role {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-card__identity {
    color: var(--sidebar-accent);
    font-size: 13px;
    font-weight: 700;
}

.sidebar-user-card__role {
    color: #6b7280;
    font-size: 11px;
    font-weight: 600;
}

.sidebar-user-card__impersonation {
    color: #92400e;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-menu {
    position: relative;
}

.sidebar-user-dropdown,
.sidebar-user-submenu {
    position: absolute;
    z-index: 40;
    min-width: 220px;
    padding: 6px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.sidebar-user-dropdown {
    left: 0;
    right: 0;
    bottom: calc(100% + 8px);
}

.sidebar-user-submenu {
    left: 100%;
    bottom: 0;
    box-shadow: 14px 18px 36px rgba(15, 23, 42, 0.14);
}

.sidebar-user-dropdown__group {
    position: relative;
}

.sidebar-user-dropdown__item {
    appearance: none;
    width: 100%;
    min-height: 38px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #334155;
    font-family: "Open Sans", "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.sidebar-user-dropdown__item .icon {
    flex: 0 0 16px;
    width: 16px;
    color: #64748b;
    font-size: 15px;
}

.sidebar-user-dropdown__item:hover,
.sidebar-user-dropdown__item:focus-visible,
.sidebar-user-dropdown__item--active {
    background: var(--sidebar-accent-soft);
    color: var(--sidebar-accent);
    outline: none;
}

.sidebar-user-dropdown__item:hover .icon,
.sidebar-user-dropdown__item:focus-visible .icon,
.sidebar-user-dropdown__item--active .icon {
    color: var(--sidebar-accent);
}

.sidebar-user-dropdown__item:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.sidebar-user-dropdown__item-main {
    flex: 1 1 auto;
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.sidebar-user-dropdown__item--danger {
    color: #b91c1c;
}

.sidebar-user-dropdown__item--danger .icon {
    color: #b91c1c;
}

.sidebar-user-dropdown__item--danger:hover,
.sidebar-user-dropdown__item--danger:focus-visible {
    background: #fef2f2;
    color: #991b1b;
}

.sidebar-user-dropdown__item--danger:hover .icon,
.sidebar-user-dropdown__item--danger:focus-visible .icon {
    color: #991b1b;
}

.sidebar-button:focus-visible {
    outline: none;
    outline-offset: 1px;
}

.sidebar--closed .sidebar__brand-meta,
.sidebar--closed .sidebar-button__label,
.sidebar--closed .sidebar-chat-history,
.sidebar--closed .sidebar-user-card__impersonation,
.sidebar--closed .sidebar-user-card__content {
    display: none;
}

.sidebar--closed .sidebar__brand {
    display: none;
}

.sidebar--closed .sidebar__header {
    justify-content: center;
}

.sidebar--closed .sidebar-button {
    width: 40px;
    margin-inline: auto;
    justify-content: center;
    padding-left: 0;
    padding-right: 0;
}

.sidebar--closed .sidebar__collapse-toggle {
    margin-left: 0;
}

.sidebar--closed .sidebar__footer {
    border-top-color: transparent;
}

.sidebar--closed .sidebar-user-card {
    width: 40px;
    margin-inline: auto;
    padding: 4px 0;
    gap: 6px;
    border-color: transparent;
    background: transparent;
}

.sidebar--closed .sidebar-user-card__avatar {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
}

.sidebar--closed .sidebar-user-dropdown {
    left: calc(100% + 8px);
    right: auto;
    bottom: 0;
    width: 220px;
}

@media (max-width: 640px) {
    .sidebar-user-dropdown {
        left: 0;
        right: 0;
        max-width: calc(100vw - 32px);
    }

    .sidebar-user-submenu {
        position: static;
        min-width: 0;
        width: 100%;
        margin-top: 4px;
        box-shadow: none;
        border-color: rgba(15, 23, 42, 0.08);
        background: rgba(248, 250, 252, 0.9);
    }

    .sidebar-user-dropdown__item-main {
        width: 100%;
    }
}

.app-main--chat {
    padding: 0 14px 30px;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-workspace {
    width: 100%;
    margin-inline: 0;
    min-height: 0;
    height: 100%;
    max-height: none;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 0 0 8px;
}

.chat-workspace__conversation {
    min-height: 0;
    height: 100%;
    width: min(100%, 980px);
    margin-inline: auto;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    margin-bottom: 6px;
}

.chat-context-prompts {
    display: grid;
    gap: 10px;
    padding: 14px 16px;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 248, 237, 0.96), rgba(255, 255, 255, 0.98)),
        #fff;
}

.chat-context-prompts--composer {
    gap: 8px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.chat-context-prompts__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #8a3f16;
}

.chat-context-prompts__subtitle {
    font-size: 0.82rem;
    color: #7c8698;
}

.chat-context-prompts--composer .chat-context-prompts__title {
    color: #167ea0;
}

.chat-context-prompts--composer .chat-context-prompts__subtitle {
    color: rgba(22, 126, 160, 0.78);
}

.chat-workspace__pinboard {
    min-height: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-workspace__pinboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(37, 99, 235, 0.04));
}

.chat-workspace__pinboard-body {
    flex: 1;
    padding: 14px;
    overflow: auto;
}

.chat-workspace__pin-placeholder {
    min-height: 220px;
    border: 1px dashed rgba(20, 17, 15, 0.24);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-muted);
    background: var(--surface-2);
}

.chat-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(40, 168, 210, 0.14), rgba(40, 168, 210, 0.04));
    flex: 0 0 auto;
}

.chat-panel__header-main {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-mode-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    border: 1px solid rgba(20, 17, 15, 0.14);
    background: rgba(255, 255, 255, 0.7);
}

.chat-mode-toggle__btn {
    border: 0;
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    background: transparent;
}

.chat-mode-toggle__btn--active {
    color: #116b89;
    background: rgba(40, 168, 210, 0.18);
}

.chat-intake-box {
    border: 1px solid rgba(15, 118, 110, 0.22);
    border-radius: 12px;
    padding: 10px;
    background: rgba(15, 118, 110, 0.05);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-intake-box__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.chat-intake-box__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: var(--text-muted);
}

.chat-intake-box__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-intake-box__file-input {
    display: none;
}

.chat-intake-box__actions .disabled {
    pointer-events: none;
    opacity: 0.55;
}

.chat-intake-files {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-intake-files__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid rgba(20, 17, 15, 0.12);
    border-radius: 10px;
    padding: 6px 8px;
    background: #fff;
}

.chat-intake-files__name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
}

.chat-panel__body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    overflow: hidden;
    background: #fff;
}

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

.chat-panel__suggestions--composer,
.chat-context-prompts--composer .chat-panel__suggestions {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 6px;
}

.chat-panel__suggestions--composer .btn,
.chat-context-prompts--composer .chat-panel__suggestions .btn {
    justify-content: flex-start;
    width: 100%;
    min-height: 36px;
    border-color: rgba(40, 168, 210, 0.38);
    background: rgba(40, 168, 210, 0.1);
    color: #167ea0;
    text-align: left;
    white-space: normal;
}

.chat-panel__suggestions--composer .btn:hover:not(:disabled),
.chat-context-prompts--composer .chat-panel__suggestions .btn:hover:not(:disabled) {
    border-color: rgba(40, 168, 210, 0.62);
    background: rgba(40, 168, 210, 0.16);
    color: #116b89;
}

.chat-panel__messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding-right: 12px;
    scrollbar-gutter: stable;
}

.chat-welcome-empty {
    margin: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    max-width: min(100%, 420px);
    color: #0f172a;
}

.chat-welcome-empty__emoji {
    width: 86px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    border: 1px solid rgba(40, 168, 210, 0.24);
    background: rgba(40, 168, 210, 0.12);
    font-size: 32px;
    line-height: 1;
}

.chat-welcome-empty__message {
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.35;
    color: #0f172a;
}

.chat-message {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 92%;
}

.chat-message--assistant {
    align-self: flex-start;
}

.chat-message--user {
    align-self: flex-end;
    text-align: right;
}

.chat-message__meta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: var(--text-muted);
}

.chat-message__bubble {
    border-radius: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: var(--surface-2);
    font-family: "Open Sans", "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.5;
}

.chat-message__bubble--plain-text {
    white-space: pre-wrap;
}

.chat-message__bubble--markdown {
    white-space: normal;
}

.chat-message__bubble--loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    min-width: 52px;
    white-space: normal;
    color: var(--text-muted);
}

.chat-message__bubble--loading .spinner-border {
    width: 0.95rem;
    height: 0.95rem;
    border-width: 0.13em;
}

.chat-message__bubble code {
    font-family: "Fira Code", "Consolas", monospace;
    font-size: 12px;
    border-radius: 6px;
    padding: 1px 5px;
    background: rgba(20, 17, 15, 0.08);
}

.chat-message__audio {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 220px;
    max-width: min(360px, 72vw);
}

.chat-message__audio audio {
    width: 100%;
    height: 36px;
}

.chat-message__voice-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(15, 118, 110, 0.28);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    background: rgba(15, 118, 110, 0.12);
}

.chat-message__voice-status .spinner-border {
    width: 0.85rem;
    height: 0.85rem;
    border-width: 0.14em;
}

.chat-message--user .chat-message__bubble {
    background: rgba(15, 118, 110, 0.1);
    border-color: rgba(15, 118, 110, 0.3);
    text-align: left;
}

.chat-message__charts {
    margin-top: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    min-width: min(68vw, 860px);
}

.chart-card {
    border: 1px solid rgba(15, 118, 110, 0.18);
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    white-space: normal;
}

.chart-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(15, 118, 110, 0.03));
}

.chart-card__title-wrap {
    min-width: 0;
}

.chart-card__title {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.3;
    color: #0f172a;
}

.chart-card__subtitle {
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
}

.chart-card__actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.chart-card__body {
    padding: 10px;
}

.erpino-chart-host {
    width: 100%;
    min-height: 320px;
}

.chart-host__error {
    margin-top: 8px;
}

.pinned-dashboard {
    width: 100%;
    min-height: calc(100vh - 64px);
}

.pinned-dashboard__header {
    align-items: center;
}

.pinned-dashboard__body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pinned-dashboard__empty {
    border: 1px dashed rgba(20, 17, 15, 0.24);
    border-radius: 12px;
    padding: 16px;
    color: var(--text-muted);
    background: var(--surface-2);
}

.pinned-dashboard__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
    gap: 12px;
}

.chat-panel__composer {
    border-top: 1px solid var(--border);
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 0 auto;
}

.input-shell {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.chat-textbox {
    width: 100%;
    min-height: 3.25rem;
    max-height: 300px;
    padding: .75rem 3.5rem .75rem 1.2rem;
    border: none;
    border-radius: 1.625rem;
    outline: none;
    background: #f1f3f5;
    box-shadow: none;
    color: #1f2937;
    font-family: "Open Sans", "Segoe UI", sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    resize: none;
    overflow-y: auto;
    scrollbar-width: none;
    box-sizing: border-box;
    transition: background-color 0.2s ease;
}

.chat-textbox:focus {
    background: #eef1f3;
    box-shadow: none;
}

.send-insert-minimal {
    position: absolute;
    right: .5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.5rem;
    height: 2.5rem;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a1a1a;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.send-insert-minimal:hover:not(:disabled) {
    background: #000;
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.send-insert-minimal:disabled {
    background: #e9ecef;
    color: #a0a0a0;
    cursor: not-allowed;
    box-shadow: none;
    transform: translateY(-50%);
}

.send-insert-minimal .icon {
    font-size: 20px;
    line-height: 1;
}

.chat-voice-preview {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(15, 118, 110, 0.24);
    border-radius: 12px;
    padding: 8px 10px;
    background: rgba(15, 118, 110, 0.08);
    width: fit-content;
    max-width: min(460px, 100%);
}

.chat-voice-preview audio {
    height: 34px;
    width: min(260px, 100%);
}

.chat-voice-preview__label {
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    white-space: nowrap;
}

.chat-panel__composer-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 10px;
}

.chat-voice-timer {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(180, 35, 24, 0.3);
    border-radius: 999px;
    padding: 4px 9px;
    font-family: "Fira Code", "Consolas", monospace;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    color: #b42318;
    background: rgba(180, 35, 24, 0.1);
}

.chat-voice-transcribing {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 1px solid rgba(15, 118, 110, 0.35);
    border-radius: 999px;
    padding: 5px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #0f172a;
    background: rgba(15, 118, 110, 0.14);
}

.chat-voice-transcribing .spinner-border {
    width: 0.85rem;
    height: 0.85rem;
    border-width: 0.14em;
}

.chat-voice-btn {
    border: 1px solid var(--border);
}

.chat-voice-btn--recording {
    color: #b42318;
    border-color: rgba(180, 35, 24, 0.35);
    background: rgba(180, 35, 24, 0.12);
    animation: chat-voice-pulse 1.2s ease-in-out infinite;
}

@keyframes chat-voice-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(180, 35, 24, 0.3);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(180, 35, 24, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(180, 35, 24, 0);
    }
}

.rotate-180 {
    transform: rotate(180deg);
}

.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: linear-gradient(140deg, #fef3c7 0%, #f5f2ec 45%, #e2f3f1 100%);
}

.auth-card {
    width: min(420px, 100%);
    padding: 28px;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: var(--shadow);
    border: 1px solid rgba(20, 17, 15, 0.08);
}

.auth-header {
    margin-bottom: 20px;
}

.auth-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 6px;
}

@media (max-width: 960px) {
    .app-shell {
        --sidebar-expanded-width: min(320px, calc(100vw - 40px));
        --sidebar-collapsed-width: 56px;
        --mobile-workspace-bar-height: 65px;
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        min-height: 100dvh;
        max-height: 100dvh;
        overflow: hidden;
        background: #fff;
    }

    .app-shell:has(.dashboard-home--mobile-dashboard) {
        max-height: none;
        overflow: visible;
    }

    .app-shell--sidebar-open .app-main,
    .app-shell--sidebar-closed .app-main {
        margin-left: 0;
    }

    .app-main--dashboard-home,
    .app-main:has(.dashboard-home) {
        height: calc(100vh - var(--mobile-workspace-bar-height));
        height: calc(100dvh - var(--mobile-workspace-bar-height));
        max-height: calc(100dvh - var(--mobile-workspace-bar-height));
        overflow: hidden;
    }

    .app-main--dashboard-home:has(.dashboard-home--mobile-dashboard),
    .app-main:has(.dashboard-home--mobile-dashboard) {
        height: auto;
        max-height: none;
        min-height: calc(100vh - var(--mobile-workspace-bar-height));
        min-height: calc(100dvh - var(--mobile-workspace-bar-height));
        overflow: visible;
    }

    .app-main--dashboard-home .main-content,
    .app-main--dashboard-home .container,
    .app-main:has(.dashboard-home) .main-content,
    .app-main:has(.dashboard-home) .container {
        height: 100%;
        min-height: 0;
    }

    .app-main--dashboard-home:has(.dashboard-home--mobile-dashboard) .main-content,
    .app-main--dashboard-home:has(.dashboard-home--mobile-dashboard) .container,
    .app-main:has(.dashboard-home--mobile-dashboard) .main-content,
    .app-main:has(.dashboard-home--mobile-dashboard) .container {
        height: auto;
        min-height: 0;
    }

    .mobile-workspace-bar {
        position: sticky;
        top: 0;
        z-index: 27;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        width: 100%;
        padding: 12px;
        border-bottom: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

    .mobile-workspace-bar__action,
    .mobile-workspace-bar__switch {
        min-height: 40px;
    }

    .mobile-workspace-bar__action {
        width: 32px;
        min-width: 32px;
        min-height: 32px;
        height: 32px;
        justify-content: center;
        padding: 0;
        border-radius: 6px;
        border: none;
        background: transparent;
        color: #666;
        box-shadow: none;
        appearance: none;
        transition: background-color 0.2s, color 0.2s;
    }

    .mobile-workspace-bar__switch {
        min-height: 40px;
        border-radius: 12px;
        flex: 0 0 auto;
        margin-left: auto;
        justify-content: center;
        gap: 10px;
        border: 1px solid rgba(40, 168, 210, 0.34);
        background: rgba(40, 168, 210, 0.12);
        color: #167ea0;
    }

    .mobile-workspace-bar__action:focus,
    .mobile-workspace-bar__action:focus-visible,
    .mobile-workspace-bar__action:active,
    .mobile-workspace-bar__action:active:focus,
    .mobile-workspace-bar__action:active:focus-visible,
    .mobile-workspace-bar__switch:focus,
    .mobile-workspace-bar__switch:focus-visible,
    .mobile-workspace-bar__switch:active,
    .mobile-workspace-bar__switch:active:focus,
    .mobile-workspace-bar__switch:active:focus-visible {
        outline: none !important;
        box-shadow: none !important;
    }

    .mobile-workspace-bar__action:hover:not(:disabled) {
        background-color: rgba(40, 168, 210, 0.12);
        color: #167ea0;
    }

    .mobile-workspace-bar__switch:hover:not(:disabled) {
        border-color: rgba(40, 168, 210, 0.52);
        background: rgba(40, 168, 210, 0.18);
        color: #116b89;
    }

    .mobile-workspace-bar__switch span {
        font-size: 13px;
        font-weight: 700;
    }

    .app-main {
        flex: 1 1 auto;
        min-width: 0;
        min-height: 0;
        padding: 0 12px 24px;
        overflow: auto;
    }

    .app-main--chat {
        height: calc(100vh - var(--mobile-workspace-bar-height));
        height: calc(100dvh - var(--mobile-workspace-bar-height));
        max-height: calc(100dvh - var(--mobile-workspace-bar-height));
        padding-bottom: 0;
        overflow: hidden;
    }

    .dashboard-home {
        grid-template-columns: 1fr;
        height: 100%;
        min-height: 0;
        overflow: hidden;
    }

    .dashboard-home--mobile-dashboard {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .dashboard-home__chat {
        display: none;
    }

    .dashboard-home--mobile-chat .dashboard-home__chat {
        display: block;
    }

    .dashboard-home--mobile-chat .dashboard-home__main {
        display: none;
    }

    .dashboard-home__main {
        height: 100%;
        justify-content: flex-start;
        overflow-y: auto;
        padding: 0 12px 20px;
        gap: 12px;
    }

    .dashboard-home--mobile-dashboard .dashboard-home__main {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .dashboard-home--mobile-dashboard .dashboard-home-panel {
        border-radius: 10px;
        box-shadow: none;
        backdrop-filter: none;
    }

    .dashboard-home--mobile-dashboard .order-detail-scroll-card {
        --order-detail-scroll-card-max-height: 220px;
    }

    .dashboard-home--mobile-dashboard .dashboard-home-panel .card-header {
        padding: 10px 12px;
    }

    .dashboard-home--mobile-dashboard .dashboard-home-panel .card-content {
        padding: 0 12px 12px;
    }

    .dashboard-home--mobile-dashboard .dashboard-inbox-item {
        grid-template-columns: 24px minmax(0, 1fr) auto;
        gap: 8px;
        padding: 9px 0;
    }

    .dashboard-home--mobile-dashboard .dashboard-inbox-item__icon {
        width: 22px;
        height: 22px;
        border-radius: 7px;
        font-size: 14px;
    }

    .dashboard-home--mobile-dashboard .dashboard-inbox-item__title {
        font-size: .88rem;
        line-height: 1.3;
    }

    .dashboard-home--mobile-dashboard .dashboard-inbox-item__description {
        font-size: .8rem;
    }

    .dashboard-home--mobile-dashboard .dashboard-inbox-item__meta {
        font-size: .72rem;
    }

    .dashboard-home--mobile-dashboard .dashboard-inbox-item__action {
        width: 28px;
        height: 28px;
        min-width: 28px;
    }

    .dashboard-home__main--detail,
    .dashboard-home__main--orders {
        padding: 12px 12px 20px;
    }

    .chat-panel__header {
        padding: 10px 12px;
        align-items: flex-start;
    }

    .chat-panel__header-main {
        min-width: 0;
    }

    .chat-panel__body {
        padding: 12px 10px;
        overflow: hidden;
    }

    .chat-workspace {
        padding: 0;
    }

    .chat-context-prompts {
        gap: 8px;
        padding: 12px;
        border-radius: 14px;
    }

    .chat-panel__composer .chat-context-prompts--composer {
        padding: 0;
        border-radius: 0;
    }

    .chat-context-prompts__title {
        font-size: 0.9rem;
    }

    .chat-context-prompts__subtitle {
        font-size: 0.78rem;
    }

    .chat-context-prompts .chat-panel__suggestions {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .chat-panel__composer .chat-context-prompts .chat-panel__suggestions,
    .chat-panel__composer .chat-panel__suggestions--composer {
        flex-direction: column;
        overflow-x: visible;
        overflow-y: visible;
        padding-bottom: 0;
        scrollbar-width: auto;
    }

    .chat-context-prompts .chat-panel__suggestions > * {
        flex: 0 0 auto;
    }

    .chat-panel__composer .chat-context-prompts .chat-panel__suggestions > *,
    .chat-panel__composer .chat-panel__suggestions--composer > * {
        flex: 0 0 auto;
        width: 100%;
    }

    .chat-panel__messages {
        flex: 1;
        min-height: 0;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding-right: 10px;
        padding-bottom: 6px;
        scrollbar-gutter: stable;
    }

    .chat-panel__composer {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    }

    .chat-textbox {
        min-height: 56px;
        max-height: 28vh;
        resize: none;
    }

    .chat-panel__composer-actions {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .sidebar__overlay {
        display: block;
        z-index: 28;
    }

    .sidebar {
        width: var(--sidebar-expanded-width);
        height: 100svh;
        max-height: 100svh;
        padding-bottom: calc(14px + env(safe-area-inset-bottom));
        transform: translateX(calc(-1 * var(--sidebar-expanded-width)));
        transition: transform 0.2s ease;
        z-index: 29;
    }

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

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

    .chat-workspace {
        grid-template-columns: 1fr;
        min-height: 0;
        height: 100%;
        max-height: none;
        width: 100%;
        padding: 0 8px 8px;
    }

    .weekly-report-hero__header,
    .weekly-report-hero__footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .weekly-report-hero__toggle-state {
        align-self: stretch;
        justify-content: space-between;
        width: 100%;
    }

    .weekly-report-archive__header,
    .weekly-report-archive__footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .weekly-report-archive__selector,
    .weekly-report-archive__select {
        width: 100%;
    }

    .chat-message__charts {
        min-width: 0;
    }

    .chat-voice-preview {
        width: 100%;
    }

    .erpino-chart-host {
        min-height: 260px;
    }

    .pinned-dashboard__grid {
        grid-template-columns: 1fr;
    }
}

/* erpino-ui.css - aggiunte da appendere in fondo */

.dashboard-toolbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.dashboard-toolbar--table {
    align-items: flex-end;
    padding: 4px 2px 0;
}

.dashboard-toolbar__bulk-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.order-bulk-action-btn {
    box-shadow: none;
}

.order-bulk-action-btn:disabled {
    opacity: 0.42;
    cursor: not-allowed;
    transform: none;
}

.order-bulk-action-btn--merge {
    background: rgba(15, 118, 110, 0.12);
    border-color: rgba(15, 118, 110, 0.35);
    color: var(--primary-strong);
}

.order-bulk-action-btn--merge:hover:not(:disabled) {
    background: rgba(15, 118, 110, 0.2);
}

.order-bulk-action-btn--delete {
    background: rgba(220, 38, 38, 0.1);
    border-color: rgba(220, 38, 38, 0.28);
    color: #b91c1c;
}

.order-bulk-action-btn--delete:hover:not(:disabled) {
    background: rgba(220, 38, 38, 0.18);
}

.order-bulk-action-btn--archive {
    background: rgba(217, 119, 6, 0.12);
    border-color: rgba(217, 119, 6, 0.32);
    color: #92400e;
}

.order-bulk-action-btn--archive:hover:not(:disabled) {
    background: rgba(217, 119, 6, 0.2);
}

.dashboard-toolbar__category-filter {
    min-width: 220px;
}

.dashboard-toolbar__category-filter .input {
    padding-left: 12px;
}

.impersonation-picker-overlay {
    position: fixed;
    inset: 0;
    z-index: 45;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
}

.impersonation-picker {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 46;
    width: min(100vw - 32px, 680px);
    max-height: min(80vh, 760px);
    display: flex;
    flex-direction: column;
    transform: translate(-50%, -50%);
    border-radius: 24px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 28px 56px rgba(15, 23, 42, 0.24);
}

.impersonation-picker__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 14px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.impersonation-picker__eyebrow {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(3, 105, 161, 0.8);
}

.impersonation-picker__title {
    margin: 4px 0 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f172a;
}

.impersonation-picker__subtitle {
    margin-top: 6px;
    font-size: 0.92rem;
    color: #475569;
}

.impersonation-picker__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 24px 24px;
    overflow-y: auto;
}

.impersonation-picker__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.impersonation-picker__empty {
    padding: 20px 0;
    color: #64748b;
    text-align: center;
}

.impersonation-user-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.96) 0%, rgba(255, 255, 255, 1) 100%);
    text-align: left;
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.impersonation-user-row:hover:not(:disabled) {
    border-color: rgba(14, 116, 144, 0.34);
    box-shadow: 0 16px 28px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.impersonation-user-row:disabled {
    opacity: 0.7;
}

.impersonation-user-row__content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.impersonation-user-row__title {
    font-size: 0.96rem;
    font-weight: 700;
    color: #0f172a;
}

.impersonation-user-row__meta {
    font-size: 0.86rem;
    color: #64748b;
}

.impersonation-user-row__action {
    flex: 0 0 auto;
    font-size: 0.82rem;
    font-weight: 700;
    color: #0369a1;
}

.dashboard-legend {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    flex: 1 1 520px;
    min-width: min(100%, 520px);
}

.status-legend {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    padding: 6px 10px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.8);
}

.status-legend strong {
    margin-left: auto;
    font-size: 12px;
}

.status-legend--active {
    border-color: rgba(15, 118, 110, 0.3);
}

.status-legend--delay {
    border-color: rgba(220, 38, 38, 0.35);
}

.status-legend--alert {
    border-color: rgba(217, 119, 6, 0.35);
}

.status-legend--done {
    border-color: rgba(22, 163, 74, 0.35);
}

.order-summary-section {
    border-color: rgba(15, 118, 110, 0.18);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(251, 248, 241, 0.94) 100%);
}

.order-summary-list {
    display: grid;
    gap: 12px;
}

.order-hierarchy-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px;
    border: 1px solid rgba(14, 116, 144, .18);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(236, 254, 255, .86), rgba(240, 253, 250, .72));
}

.order-hierarchy-card__eyebrow {
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.order-hierarchy-card__title {
    color: var(--text);
    font-size: 14px;
    font-weight: 700;
}

.order-hierarchy-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.order-hierarchy-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(14, 116, 144, .14);
    border-radius: 12px;
    background: rgba(255, 255, 255, .74);
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.order-hierarchy-row:hover {
    border-color: rgba(14, 116, 144, .32);
    background: rgba(255, 255, 255, .92);
}

.order-summary-row {
    border: 1px solid rgba(20, 17, 15, 0.1);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 8px 20px -24px rgba(20, 17, 15, 0.52);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.order-summary-row--editing {
    border-color: rgba(15, 118, 110, 0.45);
    box-shadow: 0 12px 26px -24px rgba(15, 118, 110, 0.58);
    background: rgba(255, 255, 255, 1);
}

.order-summary-row__head {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: nowrap;
    gap: 6px;
}

.order-summary-row__label {
    font-size: 14px;
    color: var(--text);
    letter-spacing: 0.01em;
    font-weight: 700;
    line-height: 1.2;
}

.order-summary-row__edit-trigger {
    width: 24px;
    height: 24px;
    min-width: 24px;
    border-radius: 7px;
    border: 1px solid rgba(15, 118, 110, 0.2);
    background: rgba(15, 118, 110, 0.08);
    color: var(--primary-strong);
    flex-shrink: 0;
}

.order-summary-row__edit-trigger .icon {
    font-size: 13px;
}

.order-summary-row__edit-trigger:hover:not(:disabled) {
    border-color: rgba(15, 118, 110, 0.38);
    background: rgba(15, 118, 110, 0.14);
}

.order-summary-row__edit-trigger:disabled {
    opacity: 0.52;
}

.order-summary-row__value {
    border: 1px solid rgba(20, 17, 15, 0.08);
    border-radius: 10px;
    background: rgba(245, 242, 236, 0.54);
    padding: 10px 12px;
    font-size: 14.5px;
    color: var(--text);
    line-height: 1.45;
    font-weight: 400;
    word-break: break-word;
}

.order-summary-row__value--empty {
    color: var(--text-muted);
    font-style: italic;
    font-weight: 500;
}

.order-summary-row__editor {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-summary-row__editor .input {
    padding-left: 12px;
}

.order-summary-row__editor-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.order-summary-row__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.order-summary-row__actions .btn-icon {
    width: 32px;
    height: 32px;
}

.tile-board-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.tile-board-toolbar__title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tile-board-config {
    border: 1px dashed rgba(20, 17, 15, 0.2);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tile-board-config__title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    font-weight: 700;
}

.tile-board-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tile-board-chip {
    border: 1px solid rgba(15, 118, 110, 0.35);
    background: rgba(15, 118, 110, 0.1);
    color: var(--primary-strong);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}

.tile-shell-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    margin-bottom: 8px;
}

.tile-shell-btn {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    border: 1px solid rgba(20, 17, 15, 0.2);
    background: rgba(255, 255, 255, 0.9);
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.tile-shell-btn:hover:not(:disabled) {
    color: var(--primary);
    border-color: rgba(15, 118, 110, 0.45);
}

.tile-shell-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.tile-shell-btn--danger {
    color: #991b1b;
    border-color: rgba(220, 38, 38, 0.35);
    background: rgba(220, 38, 38, 0.08);
}

.tile-shell-btn--danger:hover:not(:disabled) {
    color: #7f1d1d;
    border-color: rgba(220, 38, 38, 0.45);
}

.kpi-strip {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding-bottom: 6px;
}

@media (max-width: 1120px) {
    .dashboard-summary-grid {
        grid-template-columns: 1fr;
    }
}

.weekly-report-hero {
    position: relative;
    overflow: hidden;
    border: 1px solid var(--dashboard-surface-border, rgba(15, 23, 42, 0.2));
    background: #fff;
    box-shadow: var(--dashboard-surface-shadow, 0 8px 20px rgba(15, 23, 42, 0.1));
}

.weekly-report-hero--empty,
.weekly-report-hero--loading {
    box-shadow: none;
}

.weekly-report-hero--error {
    border-color: rgba(185, 28, 28, 0.18);
    background: #fff;
}

.weekly-report-hero__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.weekly-report-hero__toggle {
    width: 100%;
    padding: 0;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.weekly-report-hero__toggle:hover .weekly-report-hero__title,
.weekly-report-hero__toggle:focus-visible .weekly-report-hero__title {
    color: #191469;
}

.weekly-report-hero__toggle:focus-visible {
    outline: none;
}

.weekly-report-hero__copy {
    display: grid;
    gap: 8px;
}

.weekly-report-hero__eyebrow {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #191469;
}

.weekly-report-hero__title {
    margin: 0;
    font-size: clamp(1.35rem, 2.2vw, 1.85rem);
    line-height: 1.15;
    color: #1f2937;
}

.weekly-report-hero__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.86rem;
    color: #6b7280;
}

.weekly-report-hero__toggle-state {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(25, 20, 105, 0.1);
    color: #191469;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.weekly-report-hero__toggle-state .icon {
    transition: transform 160ms ease;
}

.weekly-report-hero--expanded .weekly-report-hero__toggle-state .icon {
    transform: rotate(180deg);
}

.weekly-report-hero__body {
    padding: 4px 6px 4px 0;
    color: #243041;
    line-height: 1.7;
    max-height: 24rem;
    overflow: auto;
    scrollbar-gutter: stable;
}

.weekly-report-hero__footer {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding-top: 4px;
}

.weekly-report-hero__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.weekly-report-hero__footer-copy {
    display: grid;
    gap: 4px;
}

.weekly-report-hero__footer-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1f2937;
}

.weekly-report-archive {
    border: 1px solid var(--dashboard-surface-border, rgba(15, 23, 42, 0.2));
    background: #fff;
    box-shadow: var(--dashboard-surface-shadow, 0 8px 20px rgba(15, 23, 42, 0.1));
}

.weekly-report-archive__header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.weekly-report-archive__copy {
    display: grid;
    gap: 8px;
}

.weekly-report-archive__title {
    margin: 0;
    font-size: clamp(1.35rem, 2vw, 1.8rem);
    line-height: 1.15;
    color: #1f2937;
}

.weekly-report-archive__selector {
    display: grid;
    gap: 8px;
    min-width: min(100%, 360px);
}

.weekly-report-archive__select {
    min-width: min(100%, 360px);
    background: #fff;
    border-color: rgba(15, 23, 42, 0.2);
}

.weekly-report-archive__body {
    padding-top: 0;
}

.weekly-report-archive__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.86rem;
    color: #6b7280;
}

.weekly-report-archive__badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 700;
}

.weekly-report-archive__badge--job {
    background: rgba(25, 20, 105, 0.1);
    color: #191469;
}

.weekly-report-archive__badge--chat {
    background: rgba(25, 20, 105, 0.1);
    color: #191469;
}

.weekly-report-archive__text {
    padding: 4px 6px 4px 0;
    color: #243041;
    line-height: 1.7;
    min-height: 18rem;
}

.markdown-content {
    color: inherit;
}

.markdown-content > :first-child {
    margin-top: 0;
}

.markdown-content > :last-child {
    margin-bottom: 0;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
    margin: 0 0 12px;
    line-height: 1.2;
    color: #17212b;
}

.markdown-content h1 {
    font-size: 1.35rem;
}

.markdown-content h2 {
    font-size: 1.15rem;
}

.markdown-content h3 {
    font-size: 1rem;
}

.markdown-content p {
    margin: 0 0 12px;
}

.markdown-content ul,
.markdown-content ol {
    margin: 0 0 14px;
    padding-left: 20px;
}

.markdown-content li + li {
    margin-top: 6px;
}

.markdown-content hr {
    margin: 16px 0;
    border: 0;
    border-top: 1px solid rgba(23, 33, 43, 0.12);
}

.markdown-content strong {
    color: #17212b;
}

.markdown-content code {
    display: inline-block;
    padding: 0.08rem 0.38rem;
    border-radius: 8px;
    background: rgba(25, 20, 105, 0.1);
    color: #191469;
    font-size: 0.92em;
}

.markdown-content a {
    color: #191469;
    text-decoration: underline;
    text-decoration-color: rgba(25, 20, 105, 0.35);
    text-underline-offset: 0.18em;
}

.weekly-report-archive__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.kpi-card {
    flex: 0 0 240px;
    border-radius: 14px;
    border: 1px solid var(--dashboard-surface-border, var(--border));
    background: #fff;
    padding: 14px;
    box-shadow: var(--dashboard-surface-shadow, var(--shadow));
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kpi-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.kpi-value {
    font-size: 28px;
    line-height: 1.1;
    font-weight: 700;
    color: var(--text);
}

.kpi-loading {
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

.kpi-loading__spinner {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid rgba(15, 23, 42, 0.16);
    border-top-color: var(--text);
    animation: kpi-loading-spin 0.8s linear infinite;
    flex-shrink: 0;
}

.kpi-sub {
    font-size: 13px;
    color: var(--text-muted);
}

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

.kpi-kv-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kpi-kv-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.kpi-kv-label {
    font-size: 13px;
    color: var(--text-muted);
}

.kpi-kv-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.kpi-card--teal {
    border-color: rgba(15, 118, 110, 0.28);
    background: rgba(15, 118, 110, 0.08);
}

.kpi-card--blue {
    border-color: rgba(37, 99, 235, 0.28);
    background: rgba(37, 99, 235, 0.08);
}

.kpi-card--amber {
    border-color: rgba(217, 119, 6, 0.3);
    background: rgba(217, 119, 6, 0.1);
}

.kpi-card--indigo {
    border-color: rgba(79, 70, 229, 0.28);
    background: rgba(79, 70, 229, 0.09);
}

.kpi-card--red {
    border-color: rgba(220, 38, 38, 0.28);
    background: rgba(220, 38, 38, 0.09);
}

.kpi-card--green {
    border-color: rgba(22, 163, 74, 0.28);
    background: rgba(22, 163, 74, 0.09);
}

.kpi-card--rose {
    border-color: rgba(225, 29, 72, 0.3);
    background: rgba(225, 29, 72, 0.1);
}

.kpi-card--slate {
    border-color: rgba(71, 85, 105, 0.3);
    background: rgba(71, 85, 105, 0.1);
}

.tile-board-chip:hover {
    border-color: rgba(15, 118, 110, 0.5);
    background: rgba(15, 118, 110, 0.16);
}

.commessa-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 12px;
}

.commessa-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
}

.commessa-kpi-pill {
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 8px 24px -20px rgba(20, 17, 15, 0.32);
    background: #fff;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 118px;
}

.commessa-kpi-pill__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--text-muted);
}

.commessa-kpi-pill__value {
    font-size: 21px;
    line-height: 1.15;
    font-weight: 700;
    color: var(--text);
}

.commessa-kpi-pill__meta {
    font-size: 13px;
    color: var(--text-muted);
}

.commessa-kpi-pill--teal {
    border-color: rgba(15, 118, 110, 0.35);
    background: rgba(240, 253, 250, 0.65);
}

.commessa-kpi-pill--blue {
    border-color: rgba(37, 99, 235, 0.3);
    background: rgba(239, 246, 255, 0.68);
}

.commessa-kpi-pill--amber {
    border-color: rgba(217, 119, 6, 0.35);
    background: rgba(255, 251, 235, 0.72);
}

.commessa-kpi-pill--indigo {
    border-color: rgba(79, 70, 229, 0.3);
    background: rgba(238, 242, 255, 0.7);
}

.commessa-kpi-pill--red {
    border-color: rgba(220, 38, 38, 0.3);
    background: rgba(254, 242, 242, 0.7);
}

.commessa-kpi-pill--green {
    border-color: rgba(22, 163, 74, 0.3);
    background: rgba(240, 253, 244, 0.68);
}

.order-detail-top-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: stretch;
}

.order-detail-top-grid__main,
.order-detail-top-grid__side {
    min-width: 0;
    min-height: 0;
    height: 100%;
}

.order-detail-overview-layout,
.order-detail-overview-layout__content,
.order-detail-overview-column {
    min-height: 0;
}

.order-detail-overview-layout,
.order-detail-overview-layout__content,
.order-detail-overview-column,
.order-detail-top-grid__side > .order-detail-overview-layout {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}


.order-detail-header {
    padding: 6px 4px 2px;
}

.order-detail-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.order-detail-title-text {
    min-width: 0;
    overflow-wrap: anywhere;
}

.order-detail-order-number {
    color: #0f172a;
    font-size: 15px;
    font-weight: 500;
}

.order-detail-title-edit-btn {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 9px;
    border: 1px solid rgba(15, 118, 110, 0.2);
    background: rgba(15, 118, 110, 0.08);
    color: var(--primary-strong);
}

.order-detail-title-edit-btn:hover:not(:disabled) {
    border-color: rgba(15, 118, 110, 0.38);
    background: rgba(15, 118, 110, 0.14);
}

.order-detail-title-editor {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.order-detail-home-panels {
    height: auto;
    min-height: 0;
    padding: 0;
    overflow: visible;
    justify-content: flex-start;
}

.dashboard-home--mobile-dashboard .order-detail-home-panels {
    height: auto;
    min-height: 0;
}

.order-documents-panel {
    margin-bottom: 1rem;
}

.order-summary-open-btn {
    width: fit-content;
    align-self: flex-start;
    gap: 8px;
}

.order-summary-modal {
    width: min(720px, 100%);
}

.order-summary-modal__header {
    align-items: center;
    gap: 12px;
}

.order-summary-modal__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.order-tasks-panel {
    border-color: var(--border);
    background: #fff;
}

.order-tasks-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.order-tasks-panel__header-actions {
    margin-left: auto;
}

.order-tasks-panel__history-toggle {
    white-space: nowrap;
    border-color: var(--border);
    background: var(--primary-soft);
    color: var(--primary);
}

.order-tasks-panel__history-toggle:hover {
    border-color: var(--border);
    background: var(--primary-soft);
}

.order-tasks-panel__scroll {
    max-height: min(42vh, 360px);
    overflow: auto;
    padding-right: 4px;
}

.order-tasks-panel__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-tasks-panel__item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.9);
}

.order-tasks-panel__item--completed {
    background: rgba(244, 247, 246, 0.96);
    border-style: dashed;
}

.order-tasks-panel__item-copy {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.order-tasks-panel__item-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}

.order-tasks-panel__item-description {
    font-size: 12px;
    color: var(--text-muted);
    overflow-wrap: anywhere;
}

.order-tasks-panel__item-meta {
    font-size: 11px;
    font-weight: 600;
    color: var(--primary);
}

.order-tasks-panel__item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.order-tasks-panel__history {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.order-tasks-panel__history-header {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    text-transform: uppercase;
}

.order-task-modal {
    width: min(920px, 100%);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-height: calc(100vh - 36px);
}

.order-task-modal__header {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #fff;
}

.order-task-modal__header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.order-task-modal__body {
    overflow: auto;
    min-height: 0;
}

.order-task-modal__material-table {
    flex: 0 0 auto;
}

.order-task-modal__cost-input {
    width: 96px;
    min-width: 96px;
    padding: 8px 8px 8px 10px;
}

.order-task-modal__date-input {
    min-width: 138px;
    padding: 8px 10px;
}

.order-task-modal__date-input--missing {
    border-color: rgba(220, 38, 38, 0.55);
    background: rgba(254, 242, 242, 0.85);
}

.order-task-modal__date-input--invalid {
    border-color: rgba(220, 38, 38, 0.75);
    background: rgba(254, 226, 226, 0.95);
}

.order-task-modal__deferred-lines {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    background: rgba(248, 250, 252, 0.7);
    padding: 12px 14px;
}

.order-task-modal__deferred-lines summary {
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-muted);
}

.order-task-modal__deferred-table {
    margin-top: 12px;
    max-height: min(260px, 32vh);
    overflow: auto;
}

.order-detail-title-editor__input {
    flex: 1;
    min-width: 220px;
    max-width: min(620px, 100%);
    padding-left: 12px;
}

.working-hours-board {
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.working-hours-board__header {
    gap: 12px;
    align-items: flex-start;
}

.working-hours-board__user {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    text-align: right;
}

.working-hours-board__toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    align-items: center;
}

.working-hours-board__week-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.working-hours-board__week-label {
    min-width: 190px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
}

.working-hours-board__toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.working-hours-board__summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.working-hours-table-wrap {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #fff;
    max-height: clamp(280px, 34vh, 430px);
    overflow: auto;
}

.working-hours-table {
    width: 100%;
    min-width: 860px;
    border-collapse: collapse;
}

.working-hours-table th,
.working-hours-table td {
    padding: 10px;
    border-bottom: 1px solid rgba(20, 17, 15, 0.08);
    vertical-align: middle;
}

.working-hours-table thead th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
    white-space: nowrap;
}

.working-hours-table__row--saved {
    background: rgba(240, 253, 244, 0.45);
}

.working-hours-table__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    white-space: nowrap;
}

.weekly-hours-board {
    border: 1px solid var(--dashboard-surface-border, rgba(15, 23, 42, 0.2));
    background: #fff;
    box-shadow: var(--dashboard-surface-shadow, 0 8px 20px rgba(15, 23, 42, 0.1));
}

.weekly-hours-board__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.weekly-hours-board__operator {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 220px;
}

.weekly-hours-board__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.weekly-hours-board__week-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.weekly-hours-board__week-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 240px;
}

.weekly-hours-board__week-picker {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.weekly-hours-board__week-picker .icon {
    display: inline-flex;
    align-items: center;
}

.weekly-hours-board__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.weekly-hours-grid-wrap {
    border: 1px solid rgba(15, 23, 42, 0.2);
    border-radius: 14px;
    background: #fff;
    max-height: min(70vh, 720px);
    overflow: auto;
    box-shadow: none;
}

.weekly-hours-grid {
    width: 100%;
    min-width: 1460px;
    border-collapse: collapse;
}

.weekly-hours-grid th,
.weekly-hours-grid td {
    padding: 10px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
    vertical-align: top;
}

.weekly-hours-grid tbody tr:nth-child(even) td:not(.weekly-hours-grid__day-cell) {
    background: #f8fafc;
}

.weekly-hours-grid thead th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 700;
    white-space: nowrap;
    background: #f8fafc;
}

.weekly-hours-grid__actions-head {
    position: sticky;
    left: 0;
    z-index: 3;
    min-width: 128px;
    background: #f1f5f9;
}

.weekly-hours-grid thead th.weekly-hours-grid__day-head {
    color: #191469;
    border-bottom-color: rgba(25, 20, 105, 0.25);
}

.weekly-hours-grid__day-cell {
    min-width: 120px;
    background: #fff;
}

.weekly-hours-grid__day-head--0,
.weekly-hours-grid__day-cell--0 {
    background: rgba(25, 20, 105, 0.04);
}

.weekly-hours-grid__day-head--1,
.weekly-hours-grid__day-cell--1 {
    background: rgba(25, 20, 105, 0.07);
}

.weekly-hours-grid__day-head--2,
.weekly-hours-grid__day-cell--2 {
    background: rgba(25, 20, 105, 0.04);
}

.weekly-hours-grid__day-head--3,
.weekly-hours-grid__day-cell--3 {
    background: rgba(25, 20, 105, 0.07);
}

.weekly-hours-grid__day-head--4,
.weekly-hours-grid__day-cell--4 {
    background: rgba(25, 20, 105, 0.04);
}

.weekly-hours-grid__day-head--5,
.weekly-hours-grid__day-cell--5 {
    background: rgba(25, 20, 105, 0.07);
}

.weekly-hours-grid__day-head--6,
.weekly-hours-grid__day-cell--6 {
    background: rgba(25, 20, 105, 0.04);
}

.weekly-hours-grid__hours-input {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: lowercase;
}

.weekly-hours-grid__hours-input:last-child {
    margin-bottom: 0;
}

.weekly-hours-grid__hours-input .input {
    min-width: 72px;
}

.weekly-hours-grid__value-input[readonly] {
    background: #f8fafc;
    color: var(--text);
    border-color: rgba(15, 23, 42, 0.14);
}

.weekly-hours-grid__actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 8px;
    min-width: 128px;
}

.weekly-hours-grid__actions-cell {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 1px 0 0 rgba(15, 23, 42, 0.1);
}

.weekly-hours-grid tbody tr:nth-child(even) .weekly-hours-grid__actions-cell {
    background: #f8fafc;
}

@media (max-width: 768px) {
    .supplies-panel-backdrop {
        padding: 10px;
    }

    .supplies-panel {
        max-height: calc(100vh - 20px);
    }

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

    .supplies-toolbar {
        align-items: stretch;
    }

    .supplies-toolbar__actions {
        justify-content: flex-end;
    }

    .working-hours-board__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .working-hours-board__user {
        align-items: flex-start;
        text-align: left;
    }

    .working-hours-board__week-label {
        min-width: 170px;
    }

    .weekly-hours-board__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .weekly-hours-board__operator {
        align-items: flex-start;
        min-width: 0;
    }

    .weekly-hours-board__week-nav {
        width: 100%;
    }

    .weekly-hours-board__week-meta {
        min-width: 0;
        flex: 1;
    }

    .weekly-hours-grid {
        min-width: 1120px;
    }
}

@media (max-width: 1100px) and (min-width: 769px) {
    .supplies-summary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 540px) {
    .supplies-summary-grid {
        grid-template-columns: 1fr;
    }
}

.timeline-gantt {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    height: auto;
    min-height: 260px;
    overflow: visible;
}

.timeline-gantt__header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
}

.timeline-gantt__header > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

.timeline-gantt__content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    gap: 10px;
    padding: 0 14px 14px;
}

.timeline-gantt__edit-btn {
    min-height: 38px;
    border-radius: 8px;
    padding: 8px 14px;
    gap: 8px;
    white-space: nowrap;
}

.gantt-board {
    display: block;
    flex: 0 0 auto;
    min-height: 160px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0;
    overscroll-behavior-x: contain;
}

.gantt-board__track {
    min-width: 1060px;
    width: 100%;
}

.gantt-board__head,
.gantt-row {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.gantt-board__head {
    min-height: 70px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
    color: #374151;
    font-size: 0.76rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.gantt-board__label-head,
.gantt-board__progress-head,
.gantt-board__status-head {
    display: flex;
    align-items: flex-end;
    padding: 0 12px 12px;
}

.gantt-board__label-head,
.gantt-row__meta {
    flex: 0 0 260px;
}

.gantt-board__scale,
.gantt-row__bar {
    flex: 1 1 auto;
    min-width: 560px;
}

.gantt-board__progress-head,
.gantt-row__value {
    flex: 0 0 120px;
}

.gantt-board__status-head,
.gantt-row__status {
    flex: 0 0 170px;
}

.gantt-board__progress-head,
.gantt-board__status-head {
    justify-content: flex-end;
}

.gantt-board__scale {
    position: relative;
    min-width: 0;
}

.gantt-months,
.gantt-weeks {
    position: relative;
    height: 35px;
}

.gantt-month {
    position: absolute;
    top: 12px;
    overflow: hidden;
    white-space: nowrap;
    text-align: center;
}

.gantt-week {
    position: absolute;
    bottom: 8px;
    transform: translateX(-50%);
    color: #4b5563;
}

.gantt-row {
    min-height: 86px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    position: relative;
}

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

.gantt-empty {
    padding: 18px 12px;
    color: #6b7280;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.gantt-row__meta {
    min-width: 0;
    padding: 14px 12px 12px;
    border-right: 1px solid rgba(15, 23, 42, 0.08);
}

.gantt-row__title {
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.25;
}

.gantt-row__dates {
    margin-top: 6px;
    color: #4b5563;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
}

.gantt-row__bar {
    display: flex;
    align-items: center;
    min-width: 0;
    padding: 0 12px;
}

.gantt-lane {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 86px;
    overflow: visible;
}

.gantt-lane__tick {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 1px;
    border-left: 1px dashed rgba(15, 23, 42, 0.1);
    transform: translateX(-50%);
    pointer-events: none;
}

.gantt-window {
    position: absolute;
    top: 1px;
    bottom: 1px;
    min-width: 2%;
    border-radius: 999px;
    border: 1px solid;
    overflow: hidden;
}

.gantt-bar--expected {
    position: absolute;
    height: 18px;
    top: calc(50% - 9px);
    border: 2px dashed;
    border-radius: 999px;
    opacity: 0.9;
    pointer-events: none;
}

.gantt-bar--effective {
    position: absolute;
    height: 18px;
    top: calc(50% - 9px);
    border-radius: 999px;
    border-width: 1px;
    border-style: solid;
    overflow: hidden;
}

.gantt-bar--open {
    border-right-style: dashed !important;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.gantt-bar--late {
    border-right: 2px solid var(--destructive) !important;
}

.gantt-row__value {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 12px;
    font-size: 1rem;
    font-weight: 800;
    text-align: right;
}

.gantt-row__status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 4px 0 12px;
}

.gantt-status-select {
    width: 100%;
    min-width: 132px;
    border-radius: 8px;
    font-weight: 600;
}

.gantt-row__actions {
    display: flex;
    position: absolute;
    right: 12px;
    bottom: 8px;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.gantt-action-modal {
    width: min(420px, 100%);
}

.activity-tool-modal {
    width: min(760px, 100%);
}

.gantt-bulk-edit-modal {
    width: min(1120px, 100%);
    max-height: calc(100vh - 36px);
    overflow: hidden;
}

.gantt-bulk-edit-modal .card-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.gantt-bulk-edit-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.input-sm {
    font-size: 12px;
}

.category-compact {
    max-width: 640px;
    padding-top: 10px;
}

.category-compact__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.category-compact__error {
    margin-bottom: 8px;
    padding: 8px 10px;
    font-size: 12px;
}

.category-compact__list {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: #fff;
    padding: 6px 8px;
}

.category-compact__node {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 0;
}

.category-compact__name {
    font-size: 13px;
    line-height: 1.2;
}

.category-compact__actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.category-compact__btn {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-muted);
    box-shadow: none;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    cursor: pointer;
}

.category-compact__btn .icon {
    font-size: 13px;
}

.category-compact__btn--labelled {
    width: fit-content;
    min-width: 26px;
    min-height: 26px;
    height: auto;
    padding: 0 10px;
    gap: 6px;
    white-space: nowrap;
    flex-shrink: 0;
}

.category-compact__btn:hover:not(:disabled) {
    border-color: rgba(15, 118, 110, 0.4);
    color: var(--primary);
    background: rgba(15, 118, 110, 0.08);
}

.category-compact__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.category-compact__btn--primary {
    border-color: rgba(15, 118, 110, 0.35);
    color: var(--primary);
}

.category-compact__btn--ok {
    border-color: rgba(22, 163, 74, 0.35);
    color: #166534;
}

.category-compact__btn--danger {
    border-color: rgba(220, 38, 38, 0.35);
    color: #991b1b;
}

.category-compact__btn--danger:hover:not(:disabled) {
    border-color: rgba(220, 38, 38, 0.45);
    color: #7f1d1d;
    background: rgba(220, 38, 38, 0.08);
}

.category-compact__editor {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0;
}

.category-compact__editor .input {
    flex: 1;
    min-width: 200px;
    height: 30px;
    padding: 6px 10px;
    font-size: 12px;
}

.reference-browser {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1120px;
    padding-top: 10px;
}

.reference-browser__hero {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 22px;
    border-radius: 20px;
    border: 1px solid rgba(15, 118, 110, 0.16);
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(255, 255, 255, 0.94)),
        var(--surface);
    box-shadow: var(--shadow);
}

.reference-browser__copy {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 680px;
}

.reference-browser__eyebrow {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary);
}

.reference-browser__title {
    margin: 0;
    font-size: 28px;
    line-height: 1.05;
}

.reference-browser__description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
}

.reference-browser__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 10px;
    min-width: 260px;
}

.reference-browser__actions {
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.reference-browser__stat {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(255, 255, 255, 0.8);
}

.reference-browser__stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: var(--text);
}

.reference-browser__stat-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}

.reference-browser__surface {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.reference-browser__empty {
    padding: 22px 24px;
    border-radius: 16px;
    border: 1px dashed rgba(15, 118, 110, 0.26);
    background: rgba(15, 118, 110, 0.05);
    color: var(--text-muted);
}

.reference-tree__row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-left: calc(var(--reference-node-depth, 0) * 18px);
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid rgba(15, 23, 42, 0.06);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92));
    transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.reference-tree__row:hover {
    border-color: rgba(15, 118, 110, 0.22);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

.reference-tree__glyph {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: rgba(15, 118, 110, 0.1);
    color: var(--primary);
    flex-shrink: 0;
}

.reference-tree__content {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.reference-tree__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.reference-tree__code,
.reference-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.1);
    color: var(--primary);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
}

.reference-tree__id {
    font-size: 12px;
    color: var(--text-muted);
}

.reference-tree__title,
.reference-table__primary {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.reference-tree__subtitle,
.reference-table__secondary,
.reference-table__muted {
    font-size: 12px;
    color: var(--text-muted);
}

.reference-table-wrapper {
    overflow-x: auto;
}

.reference-table tbody tr:hover {
    cursor: default;
}

.reference-table__wrap {
    white-space: normal;
}

.reference-table__link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.reference-table__link:hover {
    text-decoration: underline;
}

@media (max-width: 960px) {
    .order-detail-top-grid {
        grid-template-columns: 1fr;
    }

    .order-tasks-panel__header {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .order-tasks-panel__header-actions {
        width: 100%;
        margin-left: 0;
    }

    .order-tasks-panel__history-toggle {
        width: 100%;
        justify-content: center;
    }

    .order-tasks-panel__item {
        flex-direction: column;
    }

    .order-tasks-panel__item-actions {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
    }

    .order-tasks-panel__item-actions .btn {
        width: 100%;
    }

    .dashboard-legend {
        grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
        min-width: 100%;
    }

    .smart-order-intake-card__actions {
        width: 100%;
        align-items: flex-start;
    }

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

    .document-tool-card {
        min-height: 0;
    }

    .document-tool-card__footer,
    .document-tool-card__actions {
        width: 100%;
    }

    .document-tool-card__footer .btn,
    .document-tool-card__actions .btn {
        width: 100%;
        justify-content: center;
    }

    .document-intake-sidecard__tracker-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .document-intake-sidecard__tracker-actions {
        width: 100%;
        justify-content: space-between;
    }

    .smart-order-intake-card__tracker-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .smart-order-intake-card__tracker-actions {
        width: 100%;
        justify-content: space-between;
    }

    .document-manual-split-summary {
        flex-direction: column;
        align-items: flex-start;
    }

    .document-manual-split-row {
        grid-template-columns: 1fr;
        gap: 14px;
        padding: 14px;
    }

    .document-manual-split-modal__footer {
        width: 100%;
    }

    .document-manual-split-modal__footer .btn {
        flex: 1 1 0;
        justify-content: center;
    }

    .smart-order-user-picker__option {
        align-items: flex-start;
    }

    .order-summary-row__actions {
        width: 100%;
        justify-content: flex-end;
    }

    .commessa-overview-grid,
    .commessa-kpi-grid {
        grid-template-columns: 1fr;
    }

    .category-compact {
        max-width: none;
    }

    .reference-browser__hero {
        flex-direction: column;
    }

    .reference-browser__stats {
        min-width: 0;
        width: 100%;
    }

    .reference-tree__row {
        margin-left: calc(var(--reference-node-depth, 0) * 10px);
    }

    .impersonation-picker {
        width: min(100vw - 20px, 680px);
        max-height: 86vh;
    }
}
