@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600&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;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: "Space Grotesk", "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%;
}

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: linear-gradient(120deg, rgba(255, 255, 255, 0.9), rgba(250, 247, 242, 0.9));
}

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

.app-mobile-menu-toggle {
    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);
}

.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);
}

.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: "IBM Plex 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-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: "IBM Plex 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;
}

.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__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 {
    border-color: rgba(14, 116, 144, 0.12);
    background: rgba(224, 242, 254, 0.84);
    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 {
    border-color: rgba(217, 119, 6, 0.12);
    background: rgba(255, 237, 213, 0.9);
    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 {
    border-color: rgba(15, 118, 110, 0.12);
    background: rgba(204, 251, 241, 0.88);
    color: #0f766e;
}

.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 {
    position: fixed;
    inset: 0;
    background: rgba(20, 17, 15, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1200;
    padding: 18px;
}

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

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

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

.document-intake-dropzone {
    position: relative;
    border: 1px dashed rgba(15, 118, 110, 0.45);
    border-radius: 12px;
    background: rgba(15, 118, 110, 0.06);
    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: rgba(15, 118, 110, 0.8);
    background: rgba(15, 118, 110, 0.14);
}

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

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

.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: rgba(15, 118, 110, 0.36);
    box-shadow: 0 20px 40px -28px rgba(15, 118, 110, 0.42);
}

.supplies-entry-card:focus-visible {
    outline: 2px solid rgba(15, 118, 110, 0.58);
    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-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-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;
}

.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: min(420px, 100%);
    margin-right: auto;
}

.archived-orders-section .table-wrapper {
    border-radius: var(--radius-md);
}

.archived-orders-section .table th,
.archived-orders-section .table td {
    padding: 10px 12px;
}

.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(15, 118, 110, 0.12);
    color: var(--primary-strong);
    font-size: 12px;
}

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

.orders-table {
    min-width: 1180px;
}

.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-phase-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.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);
}

.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: hidden;
}

.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%;
}

.dashboard-summary-grid__item--alerts .alerts-banner {
    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;
}

.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__category-select {
    min-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: 14px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--surface-2);
}

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

.note-source-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(15, 118, 110, 0.12);
    color: var(--primary);
}

.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: var(--primary-strong);
    border-color: rgba(15, 118, 110, 0.38);
    background: rgba(15, 118, 110, 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-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) {
    .document-inline-preview {
        width: 168px;
        min-width: 168px;
    }

    .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.4;
    vector-effect: non-scaling-stroke;
    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.8;
    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::-webkit-details-marker {
    display: none;
}

.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 {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    min-height: 100vh;
    width: var(--sidebar-expanded-width);
    padding: 14px 12px;
    background: linear-gradient(180deg, #0f172a 0%, #111827 56%, #0b1220 100%);
    color: #e2e8f0;
    border-right: 1px solid rgba(148, 163, 184, 0.24);
    box-shadow: 16px 0 34px -26px rgba(2, 6, 23, 0.9);
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 25;
    overflow: hidden;
    transition: width 0.2s ease;
}

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

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

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

.sidebar__brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(45, 212, 191, 0.14);
    color: #5eead4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
}

.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: rgba(226, 232, 240, 0.72);
}

.sidebar__collapse-toggle {
    width: 32px;
    height: 32px;
    margin-left: auto;
    border-radius: 9px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(148, 163, 184, 0.14);
    color: rgba(226, 232, 240, 0.95);
    box-shadow: none;
}

.sidebar__collapse-toggle:hover:not(:disabled) {
    background: rgba(148, 163, 184, 0.24);
    color: #ffffff;
}

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

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

.sidebar__footer {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 10px 0 4px;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.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: rgba(226, 232, 240, 0.9);
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    font-size: 13px;
    font-weight: 600;
    transform: none;
}

.sidebar-button.btn-ghost {
    color: rgba(226, 232, 240, 0.9);
}

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

.sidebar-button:hover:not(:disabled) {
    background: rgba(148, 163, 184, 0.18);
    color: #f8fafc;
}

.sidebar-button.btn-secondary {
    background: rgba(45, 212, 191, 0.2);
    color: #ecfeff;
    border-color: rgba(45, 212, 191, 0.42);
}

.sidebar-button.btn-secondary:hover:not(:disabled) {
    background: rgba(45, 212, 191, 0.28);
}

.sidebar-button--logout {
    color: #fecaca;
    border-color: rgba(248, 113, 113, 0.2);
}

.sidebar-button--logout:hover:not(:disabled) {
    background: rgba(248, 113, 113, 0.15);
    border-color: rgba(248, 113, 113, 0.38);
    color: #fff5f5;
}

.sidebar-button:focus-visible {
    outline: 2px solid rgba(45, 212, 191, 0.5);
    outline-offset: 1px;
}

.sidebar--closed .sidebar__brand-meta,
.sidebar--closed .sidebar-button__label {
    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;
}

.app-main--chat {
    padding: 14px 16px 18px;
    height: 100vh;
    height: 100dvh;
    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;
}

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

.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__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #8a3f16;
}

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

.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(15, 118, 110, 0.14), rgba(15, 118, 110, 0.04));
}

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

.chat-header-action-btn {
    font-weight: 600;
}

.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: #0f172a;
    background: rgba(15, 118, 110, 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__messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
    padding-right: 2px;
}

.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);
    white-space: pre-wrap;
    font-size: 14px;
}

.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);
}

.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: 12px 14px 14px;
    background: #fff;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 10px 12px;
    min-height: 72px;
    resize: vertical;
    font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
    font-size: 14px;
}

.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: center;
    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;
    }

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

    .app-main--chat {
        padding: 10px 12px 14px;
        height: 100vh;
        height: 100dvh;
    }

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

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

    .chat-panel__body {
        padding: 12px 10px;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

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

    .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-context-prompts .chat-panel__suggestions > * {
        flex: 0 0 auto;
    }

    .chat-panel__messages {
        flex: 0 0 auto;
        min-height: auto;
        overflow: visible;
        padding-right: 0;
        padding-bottom: 6px;
    }

    .chat-panel__composer {
        gap: 8px;
        padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    }

    .chat-input {
        min-height: 56px;
        max-height: 28vh;
        resize: none;
    }

    .chat-panel__composer-actions {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .app-mobile-menu-toggle {
        display: inline-flex;
        position: fixed;
        top: 12px;
        left: 12px;
        z-index: 26;
        width: 40px;
        height: 40px;
        border-radius: 12px;
        background: rgba(17, 24, 39, 0.88);
        color: #e2e8f0;
        border: 1px solid rgba(148, 163, 184, 0.35);
        backdrop-filter: blur(3px);
    }

    .app-shell--sidebar-open .app-mobile-menu-toggle {
        opacity: 0;
        pointer-events: none;
    }

    .sidebar__overlay {
        display: block;
    }

    .sidebar {
        width: var(--sidebar-expanded-width);
        transform: translateX(calc(-1 * var(--sidebar-expanded-width)));
        transition: transform 0.2s ease;
    }

    .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: 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%;
    }

    .weekly-report-hero__period-nav {
        align-items: flex-start;
    }

    .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 {
    padding: 4px 2px 0;
}

.dashboard-toolbar__category-filter {
    min-width: 220px;
}

.dashboard-toolbar__category-filter .input {
    padding-left: 12px;
}

.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-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 rgba(186, 138, 67, 0.18);
    background:
        radial-gradient(circle at top right, rgba(250, 221, 177, 0.34), transparent 34%),
        linear-gradient(135deg, rgba(255, 248, 238, 0.98), rgba(255, 255, 255, 0.98));
    box-shadow: 0 22px 40px rgba(123, 74, 26, 0.08);
}

.weekly-report-hero--empty,
.weekly-report-hero--loading {
    box-shadow: none;
}

.weekly-report-hero--error {
    border-color: rgba(185, 28, 28, 0.18);
    background: linear-gradient(135deg, rgba(254, 242, 242, 0.98), rgba(255, 255, 255, 0.98));
}

.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: #8a4a16;
}

.weekly-report-hero__toggle:focus-visible {
    outline: 2px solid rgba(154, 90, 34, 0.35);
    outline-offset: 6px;
    border-radius: 16px;
}

.weekly-report-hero__copy {
    display: grid;
    gap: 8px;
}

.weekly-report-hero__period-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.weekly-report-hero__eyebrow {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #9a5a22;
}

.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(154, 90, 34, 0.11);
    color: #8a4a16;
    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__badge {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(154, 90, 34, 0.11);
    color: #8a4a16;
    font-size: 0.78rem;
    font-weight: 700;
}

.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 rgba(186, 138, 67, 0.18);
    background:
        radial-gradient(circle at top right, rgba(250, 221, 177, 0.34), transparent 34%),
        linear-gradient(135deg, rgba(255, 248, 238, 0.98), rgba(255, 255, 255, 0.98));
    box-shadow: 0 22px 40px rgba(123, 74, 26, 0.08);
}

.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__counter {
    font-size: 0.82rem;
    font-weight: 700;
    color: #8a4a16;
}

.weekly-report-archive__selector {
    display: grid;
    gap: 8px;
    min-width: min(100%, 360px);
}

.weekly-report-archive__select {
    min-width: min(100%, 360px);
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(186, 138, 67, 0.24);
}

.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(154, 90, 34, 0.11);
    color: #8a4a16;
}

.weekly-report-archive__badge--chat {
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
}

.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(154, 90, 34, 0.12);
    color: #8a4a16;
    font-size: 0.92em;
}

.markdown-content a {
    color: #8a4a16;
    text-decoration: underline;
    text-decoration-color: rgba(138, 74, 22, 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(--border);
    background: #fff;
    padding: 14px;
    box-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, 0.8fr) minmax(0, 1.2fr);
    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-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(--border);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 247, 242, 0.9));
}

.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 var(--border);
    border-radius: 14px;
    background: #fff;
    overflow-x: auto;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.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(20, 17, 15, 0.08);
    vertical-align: top;
}

.weekly-hours-grid tbody tr:nth-child(even) td:not(.weekly-hours-grid__day-cell) {
    background: rgba(250, 247, 242, 0.55);
}

.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: rgba(20, 17, 15, 0.03);
}

.weekly-hours-grid thead th.weekly-hours-grid__day-head {
    color: #0f4f4f;
    border-bottom-color: rgba(15, 118, 110, 0.28);
}

.weekly-hours-grid__day-cell {
    min-width: 120px;
    background: rgba(248, 252, 250, 0.7);
}

.weekly-hours-grid__day-head--0,
.weekly-hours-grid__day-cell--0 {
    background: rgba(14, 165, 233, 0.12);
}

.weekly-hours-grid__day-head--1,
.weekly-hours-grid__day-cell--1 {
    background: rgba(15, 118, 110, 0.12);
}

.weekly-hours-grid__day-head--2,
.weekly-hours-grid__day-cell--2 {
    background: rgba(59, 130, 246, 0.12);
}

.weekly-hours-grid__day-head--3,
.weekly-hours-grid__day-cell--3 {
    background: rgba(245, 158, 11, 0.14);
}

.weekly-hours-grid__day-head--4,
.weekly-hours-grid__day-cell--4 {
    background: rgba(22, 163, 74, 0.12);
}

.weekly-hours-grid__day-head--5,
.weekly-hours-grid__day-cell--5 {
    background: rgba(147, 51, 234, 0.12);
}

.weekly-hours-grid__day-head--6,
.weekly-hours-grid__day-cell--6 {
    background: rgba(220, 38, 38, 0.11);
}

.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: rgba(255, 255, 255, 0.75);
    color: var(--text);
    border-color: rgba(20, 17, 15, 0.12);
}

.weekly-hours-grid__actions {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    gap: 8px;
    min-width: 110px;
}

@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));
    }

    .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 {
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
}

.gantt-row {
    display: grid;
    grid-template-columns: 220px 1fr 60px 146px minmax(230px, auto);
    gap: 12px;
    align-items: center;
}

.gantt-row__meta {
    min-width: 0;
}

.gantt-row__bar {
    min-width: 0;
}

.gantt-lane {
    position: relative;
    height: 26px;
    border-radius: 999px;
    background: rgba(20, 17, 15, 0.08);
    overflow: hidden;
}

.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: 9px;
    top: 2px;
    border: 2px dashed;
    border-radius: 4px;
    opacity: 0.72;
    pointer-events: none;
}

.gantt-bar--effective {
    position: absolute;
    height: 10px;
    top: 14px;
    border-radius: 4px;
    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-bar--open .gantt-progress {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.gantt-progress {
    height: 100%;
    border-radius: 999px;
}

.gantt-row__value {
    text-align: right;
}

.gantt-row__status {
    display: flex;
    justify-content: flex-end;
}

.gantt-row__actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.gantt-action-modal {
    width: min(420px, 100%);
}

.input-sm {
    font-size: 12px;
}

.gantt-status-select {
    min-width: 140px;
    padding: 6px 10px;
}

.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;
    }

    .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;
    }

    .order-summary-row__actions {
        width: 100%;
        justify-content: flex-end;
    }

    .commessa-overview-grid,
    .commessa-kpi-grid {
        grid-template-columns: 1fr;
    }

    .gantt-row {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .gantt-row__value,
    .gantt-row__status,
    .gantt-row__actions {
        justify-content: flex-start;
        text-align: left;
    }

    .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);
    }

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