:root {
    --teal: #0097B2;
    --teal-dark: #005563;
    --gray: #545454;
    --bg: #F3F6F8;
    --border: #D9E1E7;
    --green: #247A52;
    --red: #B83227;
    --yellow: #F4B400;
    --orange: #D97706;
    --blue: #2563EB;
    --purple: #7C3AED;
    --text: #1F2D38;
    --muted: #64727F;
    --white: #FFFFFF;
    --shadow: 0 1px 2px rgba(22, 38, 50, 0.06);
    --color-primary: #006F83;
    --color-primary-hover: #005563;
    --color-bg: #F3F6F8;
    --color-card: #FFFFFF;
    --color-border: #D9E1E7;
    --color-text: #1F2D38;
    --color-muted: #64727F;
    --status-blue: #246B8A;
    --status-green: #247A52;
    --status-red: #B83227;
    --priority-normal: #EAF7FA;
    --priority-high: #FFF3D1;
    --priority-urgent: #FCECEA;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 40px;
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --shadow-card: none;
    --surface-soft: #F8FAFB;
    --teal-soft: #E7F5F7;
    --danger-soft: #FFF2F0;
    --success-soft: #EEF8F2;
    --warning-soft: #FFF8E2;
    --domiq-primary: #006F83;
    --domiq-primary-strong: #005563;
    --domiq-accent: #0097B2;
    --domiq-primary-soft: #E7F5F7;
    --domiq-text: #1F2D38;
    --domiq-muted: #64727F;
    --domiq-canvas: #F3F6F8;
    --domiq-surface: #FFFFFF;
    --domiq-surface-soft: #F8FAFB;
    --domiq-canvas-strong: #EEF2F5;
    --domiq-section: #F4F7F9;
    --domiq-section-strong: #E9F1F3;
    --domiq-field: #FCFDFE;
    --domiq-border: #D9E1E7;
    --domiq-border-soft: #E9EEF2;
    --domiq-border-strong: #C5D1D8;
    --domiq-focus-ring: rgba(0, 151, 178, .12);
    --domiq-row-hover: #F1F7F8;
    --domiq-info: #246B8A;
    --domiq-success: #247A52;
    --domiq-warning: #8A6100;
    --domiq-danger: #B83227;
    --domiq-inactive: #75818B;
    --shadow-overlay: 0 18px 48px rgba(22, 38, 50, 0.18);
}

/* Expense payment ledger */
.money-positive {
    color: var(--green);
}

.money-alert {
    color: var(--red);
}

.finance-payment-panel {
    border-top: 3px solid var(--teal);
}

.payment-entry-form {
    border-top: 1px solid var(--border);
    margin-top: 14px;
    padding-top: 14px;
}

.form-grid.four-col {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 1100px) {
    .form-grid.four-col {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .form-grid.four-col {
        grid-template-columns: 1fr;
    }
}

/* Sprint 7C: Agenda team, privacy e precisione di selezione */
.agenda-load-compact {
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    overflow: visible;
    width: 100%;
}

.agenda-load-compact .load-card {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 9px minmax(0, 1fr);
    min-width: 0;
    padding: 6px 8px;
    width: 100%;
}

.agenda-load-compact .load-card strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-legend i.private {
    background: #7356B5;
}

.agenda-all-day-grid {
    border: 1px solid var(--domiq-border);
    border-bottom: 0;
    display: grid;
    grid-template-columns: var(--agenda-columns, var(--agenda-time-column, 64px) repeat(7, minmax(var(--agenda-day-column-min, 128px), 1fr)));
    min-width: var(--agenda-grid-min-width, 980px);
}

.agenda-all-day-label,
.agenda-all-day-cell {
    border-bottom: 1px solid var(--domiq-border);
    border-right: 1px solid var(--domiq-border);
    box-sizing: border-box;
    min-height: 42px;
    padding: 4px;
}

.agenda-all-day-label {
    align-items: center;
    color: var(--domiq-muted);
    display: flex;
    font-size: 10px;
    font-weight: 700;
    justify-content: flex-end;
    text-align: right;
}

.agenda-all-day-cell.is-today {
    background: #F4FAFB;
}

.agenda-all-day-event,
.agenda-mobile-all-day {
    background: #7356B5;
    border: 1px solid #5F429F;
    border-radius: 4px;
    color: #FFFFFF;
    display: block;
    margin-bottom: 3px;
    overflow: hidden;
    padding: 4px 6px;
    text-decoration: none;
}

.agenda-all-day-event small {
    color: rgba(255, 255, 255, .82);
    display: block;
}

.agenda-all-day-event.organizational-absence,
.agenda-mobile-all-day.organizational-absence {
    border-style: dashed;
}

.calendar-grid[data-agenda-crosshair] {
    position: relative;
}

.agenda-crosshair-row,
.agenda-crosshair-column {
    background: rgba(0, 151, 178, .065);
    pointer-events: none;
    position: absolute;
    z-index: 1;
}

.agenda-crosshair-row {
    height: var(--agenda-slot-height, 30px);
    right: 0;
}

.calendar-slot-line.is-cell-active {
    background: rgba(0, 151, 178, .16);
    box-shadow: inset 0 0 0 1px rgba(0, 151, 178, .28);
    position: relative;
    z-index: 2;
}

.agenda-calendar-focus .calendar-event {
    z-index: 5;
}

.calendar-day-head.is-axis-active,
.calendar-times span.is-axis-active {
    background: #DCEFF3;
    color: var(--domiq-primary-strong);
}

.agenda-calendar-focus .calendar-event.private-unavailable,
.agenda-calendar-focus .calendar-event.organizational-absence,
.agenda-mobile-event.private-unavailable,
.agenda-mobile-event.organizational-absence {
    background: #7356B5;
    border-color: #5F429F;
    border-left-color: #4C318C;
    color: #FFFFFF;
    z-index: 4;
}

.agenda-calendar-focus .calendar-event.organizational-absence,
.agenda-mobile-event.organizational-absence {
    border-style: dashed;
}

.agenda-calendar-focus .calendar-event.private-unavailable span,
.agenda-calendar-focus .calendar-event.private-unavailable em,
.agenda-calendar-focus .calendar-event.organizational-absence span,
.agenda-calendar-focus .calendar-event.organizational-absence em,
.agenda-mobile-event.private-unavailable small,
.agenda-mobile-event.organizational-absence small {
    color: rgba(255, 255, 255, .84);
}

.appointment-editor {
    display: grid;
    gap: 12px;
    margin: 0 auto;
    max-width: 1180px;
}

.appointment-editor-intro,
.appointment-editor-grid > .panel,
.appointment-editor > .panel {
    margin: 0;
}

.appointment-editor-intro {
    align-items: start;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(220px, .65fr) minmax(0, 1.35fr);
}

.appointment-editor-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.appointment-field[hidden],
.appointment-private-owner-note[hidden] {
    display: none !important;
}

.appointment-field.is-all-day-disabled {
    opacity: .45;
}

.appointment-private-owner-note {
    background: #F2EEFB;
    border-left: 3px solid #7356B5;
    border-radius: 4px;
    color: #493777;
    grid-column: 1 / -1;
    padding: 10px 12px;
}

.appointment-overlap-warning {
    margin: 0;
}

.form-section-copy {
    color: var(--muted);
    font-size: 12.5px;
    margin: -4px 0 10px;
}

.appointment-editor-actions {
    justify-content: flex-end;
}

.appointment-secondary-panel {
    margin-left: auto;
    margin-right: auto;
    max-width: 1180px;
}

.appointment-cancel-form {
    align-items: end;
    border-top: 1px solid var(--domiq-border-soft);
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(220px, 1fr) auto;
    margin-top: 12px;
    padding-top: 12px;
}

@media (max-width: 900px) {
    .appointment-editor-intro,
    .appointment-editor-grid {
        grid-template-columns: 1fr;
    }

    .agenda-load-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .agenda-load-compact,
    .appointment-cancel-form {
        grid-template-columns: 1fr;
    }

    .agenda-mobile-all-day {
        align-items: center;
        display: grid;
        gap: 8px;
        grid-template-columns: 84px minmax(0, 1fr);
    }
}

[hidden] {
    display: none !important;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: #F3F6F9;
    color: var(--text);
    font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.45;
}

a {
    color: var(--teal-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.app-shell {
    display: grid;
    grid-template-columns: 224px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    background: #FFFFFF;
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    max-height: 100vh;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
    padding: 14px 10px;
    position: sticky;
    top: 0;
}

.brand,
.login-brand {
    align-items: center;
    color: var(--text);
    display: flex;
    gap: 10px;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    align-items: center;
    background: var(--teal);
    border-radius: 8px;
    color: var(--white);
    display: inline-flex;
    font-weight: 800;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.brand strong,
.login-brand strong {
    display: block;
    font-size: 15px;
    letter-spacing: 0;
}

.brand small,
.login-brand small {
    color: var(--muted);
    display: block;
    font-size: 11px;
    font-weight: 700;
}

.nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-top: 16px;
    width: 100%;
}

.nav a,
.nav summary {
    border-radius: 8px;
    box-sizing: border-box;
    color: var(--gray);
    font-size: 14px;
    line-height: 1.22;
    min-width: 0;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: 100%;
}

.nav a {
    display: block;
}

.nav summary {
    align-items: center;
    display: flex;
}

.nav a:hover,
.nav summary:hover {
    background: var(--bg);
    color: var(--teal-dark);
    text-decoration: none;
}

.nav-main {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 2px;
    padding: 7px 10px;
}

.nav-main.active,
.nav a.active,
.nav summary.active {
    background: #EAF7FA;
    color: var(--teal);
    box-shadow: inset 3px 0 0 var(--teal);
}

.nav-group {
    border-top: 1px solid #EEF2F5;
    margin: 4px 0 0;
    padding: 5px 0 3px;
    width: 100%;
}

.nav-group summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-size: 14px;
    font-weight: 700;
    gap: 8px;
    justify-content: space-between;
    list-style: none;
    padding: 7px 10px;
}

.nav-group summary::-webkit-details-marker {
    display: none;
}

.nav-group a {
    border-left: 2px solid transparent;
    display: block;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.25;
    margin: 1px 0 0 10px;
    max-width: calc(100% - 10px);
    padding: 5px 8px 5px 12px;
    text-align: left;
    white-space: nowrap;
    width: calc(100% - 10px);
}

.nav-group a.active {
    border-left-color: var(--teal);
    font-weight: 650;
}

.sidebar-user {
    border-top: 1px solid var(--border);
    color: var(--text);
    font-size: 13px;
    margin-top: auto;
    padding-top: 14px;
}

.sidebar-user small {
    color: var(--muted);
}

.sidebar-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.content {
    min-width: 0;
    padding: 22px;
}

.topbar {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}

.topbar h1 {
    font-size: 24px;
    line-height: 1.1;
    margin: 0;
}

.topbar p {
    color: var(--muted);
    font-size: 13px;
    margin: 5px 0 0;
}

.hamburger {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    display: none;
    font-size: 13px;
    padding: 8px 10px;
}

.panel,
.metric-card,
.login-panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.panel {
    margin-bottom: 16px;
    padding: 16px;
}

.page-header {
    align-items: flex-start;
    display: flex;
    gap: var(--space-4);
    justify-content: space-between;
    margin-bottom: var(--space-4);
}

.page-title {
    color: var(--color-text);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.15;
    margin: 0;
}

.page-subtitle {
    color: var(--color-muted);
    font-size: 13px;
    margin: 4px 0 0;
}

.toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    justify-content: flex-end;
}

.card,
.section-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
}

.section-card {
    padding: var(--space-4);
}

.task-status,
.badge {
    align-items: center;
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    max-width: 100%;
    min-height: 24px;
    overflow: hidden;
    padding: 5px 8px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge-blue {
    background: #EAF7FA;
    border: 1px solid #A9DCE5;
    color: var(--status-blue);
}

.badge-green {
    background: #EEF8F2;
    border: 1px solid #CDEBDD;
    color: var(--status-green);
}

.badge-red {
    background: #FCECEA;
    border: 1px solid #E4A8A0;
    color: var(--status-red);
}

.priority-normal {
    background: var(--priority-normal);
    color: var(--teal-dark);
}

.priority-high {
    background: var(--priority-high);
    color: #8A6500;
}

.priority-urgent {
    background: var(--priority-urgent);
    color: var(--status-red);
}

.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger {
    align-items: center;
    border-radius: var(--radius-md);
    display: inline-flex;
    font-size: 13px;
    font-weight: 750;
    justify-content: center;
    min-height: 34px;
    padding: 7px 12px;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--white);
}

.btn-secondary {
    background: var(--white);
    border: 1px solid var(--color-border);
    color: var(--color-text);
}

.btn-ghost {
    background: transparent;
    color: var(--color-primary-hover);
}

.btn-danger {
    background: #FFF2F0;
    border: 1px solid #F3CAC4;
    color: var(--red);
}

.form-field,
.input,
.select {
    min-width: 0;
}

.panel.narrow {
    max-width: 560px;
}

.panel-head {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
}

.panel-head.slim {
    margin-top: 16px;
}

.panel-head h2 {
    font-size: 16px;
    margin: 0;
}

.panel-head p {
    color: var(--muted);
    font-size: 12px;
    margin: 2px 0 0;
}

.panel-head.inline {
    margin-bottom: 8px;
}

.metric-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    margin-bottom: 16px;
}

.metric-grid.compact {
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.metric-grid.compact .metric-card {
    min-height: 72px;
    padding: 12px;
}

.metric-card {
    min-height: 86px;
    padding: 14px;
}

.metric-card span {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 700;
}

.metric-card strong {
    color: var(--text);
    display: block;
    font-size: 22px;
    line-height: 1.2;
    margin-top: 8px;
}

.metric-card.money strong,
.metric-card.lead strong,
.metric-card.quote strong,
.metric-card.case strong {
    color: var(--teal-dark);
}

.metric-card.alert strong {
    color: var(--red);
}

.dashboard-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 16px;
}

.task-list {
    display: grid;
    gap: 8px;
}

.task-row {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    display: grid;
    gap: 8px;
    grid-template-columns: auto minmax(120px, 1fr) minmax(140px, 1.5fr) auto;
    min-height: 44px;
    padding: 8px 10px;
}

.task-row:hover {
    border-color: #BBDDE4;
    text-decoration: none;
}

.task-row strong {
    font-size: 13px;
    overflow-wrap: anywhere;
}

.task-row small {
    color: var(--muted);
    font-size: 12px;
    overflow-wrap: anywhere;
}

.task-row em {
    color: var(--gray);
    font-size: 12px;
    font-style: normal;
    font-weight: 750;
    white-space: nowrap;
}

.projection-strip,
.cash-mini-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    margin-bottom: 14px;
}

.projection-strip div,
.cash-mini-grid div {
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}

.projection-strip span,
.cash-mini-grid span {
    color: var(--muted);
    display: block;
    font-size: 11px;
    font-weight: 800;
}

.projection-strip strong,
.cash-mini-grid strong {
    display: block;
    font-size: 15px;
    margin-top: 4px;
}

.summary-strip {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    margin-bottom: 14px;
}

.summary-strip div,
.detail-grid div {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 12px;
}

.summary-strip span,
.detail-grid span {
    color: var(--muted);
    display: block;
    font-size: 12px;
    font-weight: 700;
}

.summary-strip strong,
.detail-grid strong {
    display: block;
    font-size: 14px;
    margin-top: 4px;
    overflow-wrap: anywhere;
}

.section-title-inline {
    margin: 4px 0 14px;
}

.section-title-inline h2 {
    font-size: 16px;
    margin: 0 0 3px;
}

.section-title-inline p {
    color: var(--muted);
    font-size: 12px;
    margin: 0;
}

.case-control .panel-head {
    align-items: flex-start;
}

.case-control-grid,
.finance-strip {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}

.control-card,
.finance-strip div {
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 0;
    padding: 11px;
}

.control-card span,
.finance-strip span {
    color: var(--muted);
    display: block;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.control-card strong,
.finance-strip strong {
    color: var(--text);
    display: block;
    font-size: 15px;
    line-height: 1.2;
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.control-card small {
    color: var(--muted);
    display: block;
    font-size: 11px;
    margin-top: 5px;
}

.control-card.ok {
    border-left: 4px solid var(--green);
}

.control-card.warning {
    border-left: 4px solid var(--yellow);
}

.control-card.danger {
    border-left: 4px solid var(--red);
}

.control-card.money {
    border-left: 4px solid var(--teal);
}

.case-filters {
    flex: 1 1 auto;
}

.filter-check {
    align-items: center;
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--gray);
    display: inline-flex;
    font-size: 12px;
    font-weight: 750;
    gap: 6px;
    min-height: 36px;
    padding: 7px 9px;
    white-space: nowrap;
}

.filter-check input {
    min-height: auto;
    width: auto;
}

.case-list {
    display: grid;
    gap: 10px;
}

.case-row-card {
    align-items: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 4px solid var(--teal);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(220px, 1.5fr) minmax(110px, .7fr) minmax(160px, .9fr) minmax(210px, 1.1fr);
    padding: 10px;
}

.case-row-card.blocked {
    border-left-color: var(--red);
}

.case-main {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: auto minmax(0, 1fr);
    min-width: 0;
}

.case-code {
    background: #EDF7F9;
    border: 1px solid #BBDDE4;
    border-radius: 8px;
    color: var(--teal-dark);
    font-size: 12px;
    font-weight: 850;
    padding: 7px 8px;
    white-space: nowrap;
}

.case-main h2 {
    font-size: 14px;
    line-height: 1.2;
    margin: 0;
}

.case-main p {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.25;
    margin: 3px 0 0;
}

.case-status small,
.case-people span,
.case-money small,
.case-numbers small {
    color: var(--muted);
    font-size: 11px;
}

.case-people,
.case-numbers,
.case-money,
.case-badges,
.case-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.case-people {
    align-content: center;
    flex-direction: column;
}

.case-numbers span,
.case-money span {
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 74px;
    padding: 7px 8px;
}

.case-numbers strong,
.case-money strong {
    display: block;
    font-size: 13px;
    line-height: 1.1;
}

.case-numbers .danger strong,
.case-money .danger strong {
    color: var(--red);
}

.case-numbers .warning strong,
.case-money .warning strong {
    color: #8A6400;
}

.case-money,
.case-badges,
.case-actions {
    grid-column: 1 / -1;
}

.row-more {
    border: 0;
    display: inline-block;
    padding: 0 0 0 8px;
    position: relative;
}

.row-more summary {
    color: var(--teal-dark);
    font-size: 12.5px;
    font-weight: 750;
    list-style: none;
}

.row-more summary::-webkit-details-marker {
    display: none;
}

.row-more[open] form {
    align-items: center;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 6px;
    padding: 8px;
    position: absolute;
    right: 0;
    top: 22px;
    z-index: 20;
}

.row-more input {
    font-size: 12px;
    min-height: 30px;
    min-width: 180px;
}

.row-more.action-more[open],
.row-more.practice-task-menu[open] {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 6px;
    position: absolute;
    right: 0;
    z-index: 35;
}

.row-more.action-more[open] > a,
.row-more.practice-task-menu[open] > a,
.row-more.action-more[open] > form,
.row-more.practice-task-menu[open] > form {
    background: transparent;
    border: 0;
    box-shadow: none;
    color: var(--teal-dark);
    display: block;
    margin: 0;
    min-width: 160px;
    padding: 7px 9px;
    position: static;
    text-align: left;
}

.row-more.action-more form button,
.row-more.practice-task-menu form button {
    color: inherit;
    font-size: 12.5px;
    text-align: left;
    width: 100%;
}

.detail-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
}

.wide {
    grid-column: 1 / -1;
}

details {
    border-top: 1px solid var(--border);
    padding: 12px 0;
}

details:first-child {
    border-top: 0;
    padding-top: 0;
}

summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 750;
}

.notes {
    white-space: pre-wrap;
}

.action-row,
.inline-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.btn,
button.btn {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 750;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn.primary {
    background: var(--teal);
    color: var(--white);
}

.btn.primary:hover {
    background: var(--teal-dark);
}

.btn.secondary {
    background: var(--white);
    border-color: var(--border);
    color: var(--text);
}

.btn.danger {
    background: #FFF2F0;
    border-color: #F3CAC4;
    color: var(--red);
}

.btn.small {
    font-size: 12px;
    min-height: 30px;
    padding: 5px 9px;
}

.icon-btn {
    background: #FFF5F3;
    border: 1px solid #F1C7C0;
    border-radius: 8px;
    color: var(--red);
    cursor: pointer;
    height: 32px;
    width: 32px;
}

.icon-btn.neutral {
    background: #F8FAFC;
    border-color: var(--border);
    color: var(--gray);
}

.flash-stack {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.flash {
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    padding: 10px 12px;
}

.flash.success {
    background: #EEF8F2;
    border-color: #BFE4CE;
    color: var(--green);
}

.flash.error {
    background: #FFF2F0;
    border-color: #F3CAC4;
    color: var(--red);
}

.flash.warning {
    background: #FFF8E1;
    border-color: #F6D36D;
    color: #8A6500;
}

.filters {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

input,
select,
textarea {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font: inherit;
    min-height: 36px;
    padding: 8px 10px;
    width: 100%;
}

input[type="color"] {
    min-height: 36px;
    padding: 4px;
}

textarea {
    resize: vertical;
}

.filters input,
.filters select {
    min-width: 170px;
}

.form-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid.single {
    grid-template-columns: 1fr;
}

.form-grid label,
.quote-form label {
    color: var(--gray);
    display: grid;
    font-size: 12px;
    font-weight: 750;
    gap: 5px;
}

.required {
    color: var(--red);
    margin-left: 3px;
}

.form-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 4px;
}

.form-advanced {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}

.form-advanced .form-grid {
    margin-top: 10px;
}

.settings-form .form-actions {
    justify-content: flex-start;
}

.checkline {
    align-items: center;
    display: inline-flex;
    gap: 8px;
    min-height: 36px;
}

.checkline input {
    min-height: auto;
    width: auto;
}

.form-checklist-field {
    border: 1px solid var(--border);
    border-radius: 8px;
    box-sizing: border-box;
    margin: 0;
    min-width: 0;
    padding: 10px 12px 12px;
}

.form-checklist-field.wide {
    grid-column: 1 / -1;
}

.form-checklist-field legend {
    color: var(--gray);
    font-size: 12px;
    font-weight: 750;
    padding: 0 5px;
}

.form-checklist {
    display: grid;
    gap: 4px 12px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.form-checklist .checkline {
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 13px;
    min-width: 0;
    padding: 4px 6px;
    width: 100%;
}

.form-checklist .checkline:hover {
    background: var(--light);
}

.form-readonly-value {
    align-items: center;
    background: #F7F9FB;
    border: 1px solid var(--border);
    border-radius: 7px;
    box-sizing: border-box;
    color: #485463;
    display: flex;
    font-size: 13px;
    font-weight: 600;
    min-height: 40px;
    padding: 8px 10px;
    width: 100%;
}

.compact-context-summary {
    align-items: center;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-left: 4px solid var(--teal);
    border-radius: 8px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px 14px;
    margin-bottom: 12px;
    padding: 10px 12px;
}

.compact-context-summary strong {
    color: #263241;
    font-size: 13px;
}

.compact-context-summary span,
.compact-context-summary small {
    color: #697684;
    font-size: 12px;
}

.practice-team-line {
    align-items: center;
    border-top: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    font-size: 12.5px;
    gap: 8px 24px;
    margin-top: 10px;
    padding-top: 10px;
}

.practice-team-line span {
    min-width: 0;
}

.permissions-wrap {
    display: grid;
    gap: 12px;
    margin-top: 10px;
}

.permission-role {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}

.permission-role h3 {
    font-size: 13px;
    margin: 0 0 8px;
}

.permission-cell {
    text-align: center;
}

.permission-cell input {
    min-height: auto;
    width: auto;
}

.table-wrap {
    overflow-x: auto;
    width: 100%;
}

.list-limit-note {
    color: var(--gray);
    font-size: 12px;
    margin: 0 0 10px;
}

.table-wrap.spaced {
    margin-top: 14px;
}

table {
    border-collapse: collapse;
    min-width: 760px;
    width: 100%;
}

th,
td {
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
    padding: 8px 9px;
    text-align: left;
    vertical-align: top;
}

th {
    background: #F8FAFC;
    color: var(--gray);
    font-weight: 800;
    white-space: nowrap;
}

td {
    overflow-wrap: anywhere;
}

.compact table {
    min-width: 640px;
}

.row-actions {
    text-align: right;
    white-space: nowrap;
}

.inline-form {
    display: inline;
}

.inline-form button {
    background: transparent;
    border: 0;
    color: var(--teal-dark);
    cursor: pointer;
    font: inherit;
    font-size: 12.5px;
    padding: 0 0 0 8px;
}

.inline-form button.btn {
    border: 1px solid transparent;
    font-weight: 750;
    padding: 5px 9px;
}

.inline-form button.btn.danger {
    border-color: #F3CAC4;
}

.inline-form button.btn.secondary {
    border-color: var(--border);
}

.actions-cell {
    align-items: center;
    display: flex;
    gap: 6px;
    white-space: nowrap;
}

.inline-form button:hover {
    text-decoration: underline;
}

.status {
    background: #F2F5F7;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--gray);
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    padding: 5px 8px;
    white-space: nowrap;
}

.status.green {
    background: #EEF8F2;
    border-color: #CDEBDD;
    color: var(--green);
}

.status.red {
    background: #FFF2F0;
    border-color: #F3CAC4;
    color: var(--red);
}

.status.yellow {
    background: #FFF8E2;
    border-color: #F7DF8B;
    color: #8A6400;
}

.status.orange {
    background: #FFF4E5;
    border-color: #F3C27A;
    color: var(--orange);
}

.status.blue {
    background: #EEF4FF;
    border-color: #BFD3FF;
    color: var(--blue);
}

.status.purple {
    background: #F4EEFF;
    border-color: #D8C7FF;
    color: var(--purple);
}

.status.teal {
    background: #EDF7F9;
    border-color: #BBDDE4;
    color: var(--teal-dark);
}

.status.gray {
    background: #F2F5F7;
    border-color: var(--border);
    color: var(--gray);
}

.empty {
    color: var(--muted);
    text-align: center;
}

.empty-state {
    align-items: center;
    background: #F8FAFC;
    border: 1px dashed #C9D5DD;
    border-radius: var(--radius-md);
    color: var(--muted);
    display: grid;
    gap: 8px;
    justify-items: center;
    margin: 8px 0;
    padding: 18px;
    text-align: center;
}

.empty-state strong {
    color: var(--text);
    font-size: 14px;
}

.empty-state p {
    font-size: 13px;
    margin: 0;
    max-width: 520px;
}

.empty-state .btn {
    margin-top: 2px;
}

.line-editor {
    margin: 14px 0;
}

.catalog-select {
    min-width: 280px;
}

.catalog-selector {
    display: grid;
    gap: 6px;
    width: 100%;
}

.catalog-selector-search {
    min-width: 0;
    width: 100%;
}

.catalog-selector select {
    width: 100%;
}

.practice-combobox {
    position: relative;
    display: block;
}

.practice-combobox .catalog-selector-search {
    padding-right: 38px;
    background-color: #fff;
    background-image:
        linear-gradient(45deg, transparent 50%, #667784 50%),
        linear-gradient(135deg, #667784 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 13px) 50%;
    background-repeat: no-repeat;
    background-size: 5px 5px, 5px 5px;
}

.practice-combobox .catalog-selector-search[aria-expanded="true"] {
    border-color: var(--teal, #0097b2);
    box-shadow: 0 0 0 3px rgba(0, 151, 178, 0.14);
}

.practice-combobox-native {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.practice-combobox-list {
    position: absolute;
    z-index: 80;
    top: auto;
    bottom: calc(100% + 4px);
    right: 0;
    left: 0;
    max-height: 272px;
    overflow-y: auto;
    padding: 5px;
    border: 1px solid #b9ccd6;
    border-radius: 7px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(31, 54, 68, 0.18);
    transform-origin: bottom center;
}

.practice-combobox-list[hidden] {
    display: none;
}

.practice-combobox-option {
    display: block;
    width: 100%;
    min-height: 38px;
    padding: 8px 10px;
    border: 0;
    border-radius: 5px;
    background: transparent;
    color: #263746;
    font: inherit;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
}

.practice-combobox-option:hover,
.practice-combobox-option.is-active {
    background: #eaf7fa;
    color: #006f83;
}

.practice-combobox-empty {
    padding: 10px;
    color: #667784;
    font-size: 13px;
    text-align: center;
}

.hidden-cell {
    display: none;
}

.quote-live-totals {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
}

.quote-live-totals div {
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}

.quote-live-totals span {
    color: var(--muted);
    display: block;
    font-size: 11px;
    font-weight: 800;
}

.quote-live-totals strong {
    display: block;
    font-size: 15px;
    margin-top: 4px;
}

.alert {
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    margin: 12px 0 0;
    padding: 10px 12px;
}

.alert.warning {
    background: #FFF7DF;
    border-color: #F4B400;
    color: #7A5400;
}

.compact-strip {
    margin-bottom: 12px;
}

.line-editor textarea,
.line-editor input {
    font-size: 12.5px;
}

.activity-list {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 12px 0 0;
    padding: 0;
}

.activity-list li {
    border-bottom: 1px solid var(--border);
    font-size: 12.5px;
    padding-bottom: 8px;
}

.activity-list span {
    color: var(--muted);
    display: block;
}

.procedure-list {
    display: grid;
    gap: 10px;
}

.procedure-item {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 12px;
}

.procedure-item summary {
    cursor: pointer;
    font-weight: 800;
}

.procedure-item small {
    color: var(--muted);
    display: block;
    font-size: 11px;
    margin-top: 2px;
}

.deploy-checklist {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.deploy-check {
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    min-height: 42px;
    padding: 9px 10px;
}

.deploy-check span {
    font-size: 12.5px;
    font-weight: 700;
}

.deploy-check strong {
    border-radius: 999px;
    font-size: 11px;
    padding: 4px 7px;
    white-space: nowrap;
}

.deploy-check.ok strong {
    background: #EEF8F2;
    color: var(--green);
}

.deploy-check.todo strong {
    background: #FFF8E2;
    color: #8A6400;
}

.month-stack {
    display: grid;
    gap: 10px;
}

.cashflow-summary {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin: 0 0 14px;
}

.month-section {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    padding: 0;
}

.month-section.positive {
    border-left: 4px solid var(--green);
}

.month-section.negative {
    border-left: 4px solid var(--red);
}

.month-section:first-child {
    border-top: 1px solid var(--border);
    padding-top: 0;
}

.month-summary {
    align-items: center;
    background: #F8FAFC;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    list-style: none;
    padding: 12px;
}

.month-summary::-webkit-details-marker {
    display: none;
}

.month-summary strong {
    color: var(--text);
    display: block;
    font-size: 13px;
}

.month-summary small {
    color: var(--muted);
    display: block;
    font-size: 11px;
    font-weight: 700;
    margin-top: 2px;
}

.month-totals {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.month-totals em {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--gray);
    font-size: 11px;
    font-style: normal;
    font-weight: 800;
    padding: 5px 8px;
    white-space: nowrap;
}

.month-totals em.pill-teal {
    background: #EDF7F9;
    border-color: #BBDDE4;
    color: var(--teal-dark);
}

.month-totals em.pill-green {
    background: #EEF8F2;
    border-color: #CDEBDD;
    color: var(--green);
}

.month-totals em.pill-yellow {
    background: #FFF8E2;
    border-color: #F7DF8B;
    color: #8A6400;
}

.month-totals em.pill-red {
    background: #FFF2F0;
    border-color: #F3CAC4;
    color: var(--red);
}

.month-totals em.pill-orange {
    background: #FFF3E8;
    border-color: #F4C79D;
    color: #9A4D00;
}

.month-detail-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 12px;
}

.month-detail-grid h3 {
    color: var(--gray);
    font-size: 13px;
    margin: 0 0 8px;
}

.calendar-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    margin-bottom: 12px;
}

.agenda-tabs {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.agenda-tabs a {
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--gray);
    font-size: 12.5px;
    font-weight: 800;
    padding: 7px 10px;
}

.agenda-tabs a.active,
.agenda-tabs a:hover {
    background: #E7F4F7;
    border-color: #BBDDE4;
    color: var(--teal-dark);
    text-decoration: none;
}

.workload-strip,
.agenda-person-strip {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    margin-bottom: 14px;
}

.load-card {
    align-items: center;
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-left: 4px solid var(--teal);
    border-radius: 8px;
    display: flex;
    gap: 10px;
    min-height: 44px;
    padding: 10px 11px;
    text-decoration: none;
}

.load-card.overload {
    background: #FFF7F5;
    border-left-color: var(--red);
}

.load-card strong,
.load-card small {
    display: block;
}

.load-card strong {
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.load-card small {
    color: var(--muted);
    font-size: 11.5px;
    margin: 2px 0 7px;
}

.load-card div {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.load-card em {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--gray);
    font-size: 10.5px;
    font-style: normal;
    font-weight: 800;
    padding: 4px 6px;
}

.load-card em.danger {
    background: #FFF2F0;
    border-color: #F3CAC4;
    color: var(--red);
}

.color-chip {
    background: var(--chip-color, var(--teal));
    border: 1px solid rgba(34, 48, 58, 0.12);
    border-radius: 999px;
    display: inline-block;
    height: 12px;
    margin-right: 6px;
    vertical-align: -1px;
    width: 12px;
}

.week-calendar {
    overflow-x: auto;
    width: 100%;
}

.calendar-grid {
    display: grid;
    grid-template-columns: var(--agenda-columns, var(--agenda-time-column, 64px) repeat(7, minmax(var(--agenda-day-column-min, 128px), 1fr)));
    min-width: var(--agenda-grid-min-width, 980px);
}

.calendar-corner,
.calendar-day-head {
    background: #F8FAFC;
    border-bottom: 1px solid var(--border);
    border-right: 1px solid var(--border);
    min-height: 48px;
    padding: 8px;
}

.calendar-day-head strong {
    display: block;
    font-size: 12px;
}

.calendar-day-head span {
    color: var(--muted);
    font-size: 11px;
}

.calendar-times {
    border-right: 1px solid var(--border);
}

.calendar-times span {
    color: var(--muted);
    display: block;
    font-size: 10px;
    font-weight: 700;
    height: 32px;
    padding: 2px 6px 0 0;
    text-align: right;
}

.calendar-day-col {
    background: var(--white);
    border-right: 1px solid var(--border);
    height: 992px;
    position: relative;
}

.calendar-slot-line {
    background: transparent;
    border: 0;
    border-bottom: 1px solid #EEF2F5;
    cursor: pointer;
    display: block;
    height: 32px;
    padding: 0;
    width: 100%;
}

.calendar-slot-line:hover {
    background: #F8FCFD;
}

.calendar-event {
    background: #EDF7F9;
    border: 1px solid #BBDDE4;
    border-left: 3px solid var(--event-color, var(--teal));
    border-radius: 6px;
    color: var(--text);
    display: block;
    left: 5px;
    overflow: hidden;
    padding: 5px 6px;
    position: absolute;
    right: 5px;
    text-decoration: none;
}

.calendar-event.task {
    background: #FFF3E8;
    border-color: #F4C79D;
}

.calendar-event.quote {
    background: #F3EEFF;
    border-color: #D7C8FF;
}

.calendar-event.money {
    background: #EEF8F2;
    border-color: #CDEBDD;
}

.calendar-event.agenda {
    background: #EDF7F9;
    border-color: #BBDDE4;
}

.calendar-event.planned {
    background: #1A73E8;
    border-color: #185ABC;
    border-left-color: #0B57D0;
    color: #FFFFFF;
}

.calendar-event.done {
    background: #188038;
    border-color: #137333;
    border-left-color: #0B6B2B;
    color: #FFFFFF;
}

.calendar-event.missed {
    background: #D93025;
    border-color: #B3261E;
    border-left-color: #A50E0E;
    color: #FFFFFF;
}

.calendar-event:hover {
    border-color: var(--teal);
    text-decoration: none;
}

.calendar-event strong,
.calendar-event span,
.calendar-event small,
.calendar-event em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event strong {
    font-size: 11.5px;
}

.calendar-event span,
.calendar-event small,
.calendar-event em {
    color: var(--muted);
    font-size: 10.5px;
    font-style: normal;
}

.calendar-event.planned span,
.calendar-event.planned small,
.calendar-event.planned em,
.calendar-event.done span,
.calendar-event.done small,
.calendar-event.done em,
.calendar-event.missed span,
.calendar-event.missed small,
.calendar-event.missed em {
    color: rgba(255, 255, 255, .88);
}

.calendar-event em.danger {
    color: #FFFFFF;
    font-weight: 800;
}

.calendar-event-action {
    background: rgba(255,255,255,0.72);
    border-radius: 5px;
    color: var(--teal) !important;
    display: inline-block !important;
    font-size: 10.5px;
    font-weight: 800;
    margin-top: 2px;
    padding: 1px 4px;
    width: fit-content;
}

.modal-backdrop {
    align-items: center;
    background: rgba(34, 48, 58, 0.32);
    bottom: 0;
    display: flex;
    justify-content: center;
    left: 0;
    overflow: auto;
    padding: 18px;
    position: fixed;
    right: 0;
    top: 0;
    z-index: 30;
}

.modal-backdrop[hidden] {
    display: none;
}

.modal-panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 22px 70px rgba(34, 48, 58, 0.22);
    box-sizing: border-box;
    margin: auto;
    max-height: calc(100dvh - 24px);
    max-width: min(820px, calc(100vw - 24px));
    overflow-x: hidden;
    overflow-y: auto;
    padding: 16px;
    width: 100%;
}

.quick-lead-box {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px;
}

.quick-lead-box summary {
    font-size: 12.5px;
}

.alert-strip {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.panel-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 12px;
}

.settings-subtable {
    border-top: 1px solid var(--border);
    margin-top: 12px;
    padding-top: 10px;
}

.settings-tabs {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
}

.settings-tabs a {
    background: #FFFFFF;
    border: 1px solid #DDE5EE;
    border-radius: 7px;
    color: #526173;
    font-size: 12.5px;
    font-weight: 800;
    padding: 8px 10px;
    text-decoration: none;
}

.settings-tabs a:hover,
.settings-tabs a.active {
    background: #EAF7FA;
    border-color: #B9DDE5;
    color: var(--teal);
}

.settings-section-panel {
    scroll-margin-top: 90px;
}

.settings-list-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.settings-list-grid label {
    color: var(--gray);
    font-size: 12px;
    font-weight: 750;
}

.settings-list-grid textarea {
    margin-top: 5px;
    min-height: 150px;
}

@media (max-width: 760px) {
    .settings-tabs a,
    .settings-list-grid {
        width: 100%;
    }

    .settings-list-grid {
        grid-template-columns: 1fr;
    }
}

.priority {
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 8px;
    white-space: nowrap;
}

.priority.bassa {
    background: #EEF4F7;
    color: var(--gray);
}

.priority.normale {
    background: #E7F4F7;
    color: var(--teal-dark);
}

.priority.alta {
    background: #FFF3D1;
    color: #8A6500;
}

.priority.urgente {
    background: #FCE9E6;
    color: var(--red);
}

.topbar-action {
    margin-left: auto;
    white-space: nowrap;
}

.task-board {
    display: grid;
    gap: 8px;
}

.task-card {
    align-items: start;
    background: #fff;
    border: 1px solid var(--border);
    border-left: 4px solid var(--teal);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1.4fr) minmax(160px, 0.7fr) auto;
    padding: 10px;
}

.task-card.task-blue {
    border-left-color: #0097B2;
}

.task-card.task-green {
    border-left-color: #1F8A5B;
}

.task-card.task-red {
    border-left-color: #C0392B;
}

.task-card-main strong,
.task-card-main small,
.task-card-main em,
.task-card-schedule span,
.task-card-schedule small,
.task-card-duration span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-card-main strong {
    color: var(--text);
    font-size: 13px;
    margin-top: 4px;
}

.task-card-main small,
.task-card-main em,
.task-card-schedule span,
.task-card-schedule small,
.task-card-duration span {
    color: var(--muted);
    font-size: 12px;
    font-style: normal;
}

.task-card-actions {
    align-items: flex-start;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-end;
}

.task-card-actions a,
.danger-link {
    background: #F5F7FA;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 12px;
    min-height: 30px;
    padding: 6px 8px;
    text-decoration: none;
}

.task-card-actions a:hover {
    border-color: var(--teal);
    color: var(--teal);
}

.danger-link {
    color: var(--red) !important;
}

.task-total {
    background: #EAF7FA;
    border: 1px solid #BFE5EC;
    border-radius: 8px;
    color: var(--gray);
    font-size: 13px;
    padding: 10px;
}

.linked-search {
    position: relative;
}

.linked-selected {
    color: var(--muted);
    font-size: 12px;
    margin-top: 5px;
}

.autocomplete-results {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-top: 6px;
    max-height: 280px;
    overflow: auto;
    padding: 6px;
    position: absolute;
    width: min(680px, 100%);
    z-index: 20;
}

.autocomplete-results button {
    background: #fff;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    display: block;
    padding: 8px;
    text-align: left;
    width: 100%;
}

.autocomplete-results button:hover {
    background: #F5F7FA;
}

.autocomplete-results strong,
.autocomplete-results span,
.autocomplete-results em {
    display: block;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.autocomplete-results span,
.autocomplete-results em {
    color: var(--muted);
    font-style: normal;
}

.agenda-green {
    color: #1F8A5B !important;
    font-weight: 800;
}

.agenda-blue {
    color: #0097B2 !important;
    font-weight: 800;
}

.agenda-red {
    color: #C0392B !important;
    font-weight: 800;
}

.agenda-shell {
    border-radius: var(--radius-lg);
    padding: 14px 16px 16px;
}

.agenda-header,
.task-operating-head,
.task-form-head {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 10px;
}

.agenda-context {
    display: grid;
    gap: 2px;
}

.agenda-context strong {
    color: var(--text);
    font-size: 13px;
    font-weight: 850;
}

.agenda-context span {
    color: var(--muted);
    font-size: 12px;
}

.agenda-header h2,
.task-operating-head h2,
.task-form-head h2 {
    font-size: 20px;
    margin: 0;
}

.agenda-header p,
.task-operating-head p,
.task-form-head p {
    color: var(--muted);
    font-size: 12.5px;
    margin: 2px 0 0;
}

.agenda-header-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}

.agenda-header-actions .btn {
    min-height: 34px;
    padding: 7px 11px;
}

.agenda-viewline {
    align-items: center;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 6px 0 12px;
    padding: 8px 0;
}

.agenda-viewline span {
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.agenda-viewline a {
    border-radius: 999px;
    color: var(--gray);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    min-height: 26px;
    padding: 7px 10px;
}

.agenda-viewline a.active,
.agenda-viewline a:hover {
    background: #EAF7FA;
    color: var(--teal-dark);
    text-decoration: none;
}

.agenda-filters {
    margin-bottom: 10px;
}

.agenda-quickbar {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(132px, 0.62fr) minmax(260px, 1.55fr) minmax(170px, 0.9fr) minmax(170px, 0.9fr) auto auto;
}

.agenda-quickbar input,
.agenda-quickbar select,
.agenda-quickbar .btn {
    min-height: 36px;
    padding-top: 7px;
    padding-bottom: 7px;
}

.agenda-advanced-filters {
    border: 0;
    margin: 0;
    padding: 0;
    position: relative;
}

.agenda-advanced-filters summary {
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--gray);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    list-style: none;
    min-height: 36px;
    padding: 8px 11px;
    white-space: nowrap;
}

.agenda-advanced-filters summary::-webkit-details-marker {
    display: none;
}

.agenda-advanced-grid {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    margin-top: 7px;
    padding: 10px;
    position: absolute;
    right: 0;
    width: min(720px, 92vw);
    z-index: 15;
}

.agenda-advanced-grid label {
    color: var(--gray);
    display: grid;
    font-size: 11.5px;
    font-weight: 800;
    gap: 4px;
}

.agenda-advanced-grid .checkline {
    align-content: center;
    display: flex;
    font-size: 12px;
    font-weight: 800;
    min-height: 34px;
}

.agenda-filter-note {
    margin: 7px 0 10px;
    padding: 8px 10px;
}

.agenda-load-compact {
    display: grid;
    gap: 5px;
    grid-template-columns: 1fr;
    margin-bottom: 12px;
}

.agenda-load-compact .load-card {
    align-items: center;
    border-left-width: 3px;
    color: var(--text);
    display: grid;
    gap: 10px;
    grid-template-columns: 22px minmax(210px, 0.45fr) minmax(0, 1fr);
    min-height: 42px;
    padding: 6px 10px;
    text-decoration: none;
}

.agenda-load-compact .load-card:hover,
.agenda-load-compact .load-card.active {
    background: #EAF7FA;
    border-color: #A9DCE5;
    text-decoration: none;
}

.agenda-load-compact .load-card strong {
    font-size: 12.5px;
    line-height: 1.2;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-load-compact .load-card div {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: flex-start;
    min-width: 0;
}

.agenda-load-compact .load-card em {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 10.5px;
    font-style: normal;
    font-weight: 850;
    line-height: 1;
    max-width: 140px;
    overflow: hidden;
    padding: 4px 7px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.agenda-calendar-focus {
    --agenda-day-column-min: 116px;
    --agenda-grid-min-width: 868px;
    --agenda-grid-height: 930px;
    --agenda-slot-height: 30px;
    --agenda-time-column: 56px;
    --agenda-columns: var(--agenda-time-column) repeat(7, minmax(var(--agenda-day-column-min), 1fr));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 22px rgba(34, 48, 58, 0.04);
    overflow: auto;
    overscroll-behavior-x: contain;
    overscroll-behavior-y: auto;
    scrollbar-gutter: stable;
}

.agenda-calendar-focus .calendar-day-head,
.agenda-calendar-focus .calendar-corner {
    background: #F8FAFC;
    box-sizing: border-box;
    height: 52px;
    max-height: 52px;
    min-height: 52px;
    padding: 7px 10px;
}

.agenda-calendar-focus .agenda-all-day-grid {
    border: 0;
}

.agenda-calendar-focus .calendar-times span,
.agenda-calendar-focus .calendar-slot-line {
    box-sizing: border-box;
    height: var(--agenda-slot-height, 30px);
    max-height: var(--agenda-slot-height, 30px);
    min-height: var(--agenda-slot-height, 30px);
}

.agenda-calendar-focus .calendar-slot-line.drag-over {
    background: #EAF7FA;
    box-shadow: inset 0 0 0 2px rgba(0, 151, 178, 0.22);
}

.agenda-calendar-focus .calendar-day-col {
    box-sizing: border-box;
    height: var(--agenda-grid-height, 930px);
    max-height: var(--agenda-grid-height, 930px);
    min-height: var(--agenda-grid-height, 930px);
}

.calendar-event {
    cursor: pointer;
    text-align: left;
}

button.calendar-event {
    font: inherit;
    width: auto;
}

.agenda-calendar-focus .calendar-event {
    border-left-width: 4px;
    box-shadow: 0 5px 14px rgba(34, 48, 58, 0.08);
    min-height: 6px;
    padding: 5px 7px;
}

.agenda-calendar-focus .calendar-event.dragging {
    opacity: 0.58;
}

.agenda-calendar-focus .calendar-event strong {
    font-size: 11.2px;
    line-height: 1.15;
}

.agenda-calendar-focus .calendar-event span,
.agenda-calendar-focus .calendar-event em {
    font-size: 10px;
    line-height: 1.2;
}

.priority-dot {
    border-radius: 999px;
    display: inline-flex;
    font-size: 9.5px;
    font-style: normal;
    font-weight: 900;
    line-height: 1;
    margin-top: 2px;
    max-width: 72px;
    overflow: hidden;
    padding: 3px 5px;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: fit-content;
}

.priority-dot.normale,
.priority-dot.bassa {
    background: #EAF7FA;
    color: var(--teal-dark);
}

.priority-dot.alta {
    background: #FFF3D1;
    color: #8A6500;
}

.priority-dot.urgente {
    background: #FCECEA;
    color: var(--red);
}

.task-form-head {
    margin-bottom: 12px;
}

.task-quick-panel {
    border-radius: var(--radius-lg);
    max-width: 1100px;
    padding: 18px 20px;
}

.task-form-hint {
    color: var(--muted);
    font-size: 12.5px;
    margin: 0 0 12px;
}

.task-preset-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 0;
}

.task-preset-menu {
    border: 0;
    margin: 0;
    padding: 0;
    position: relative;
}

.task-preset-menu summary {
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--gray);
    cursor: pointer;
    font-size: 12px;
    font-weight: 850;
    list-style: none;
    min-height: 32px;
    padding: 7px 11px;
    width: fit-content;
}

.task-preset-menu summary::-webkit-details-marker {
    display: none;
}

.task-preset-menu[open] .task-preset-strip {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-top: 6px;
    padding: 8px;
    position: absolute;
    width: min(420px, 92vw);
    z-index: 18;
}

.task-preset-strip button {
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--gray);
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
    min-height: 28px;
    padding: 5px 8px;
}

.task-preset-strip button span {
    color: var(--teal-dark);
    font-weight: 900;
}

.task-preset-strip button:hover,
.task-preset-strip button.active {
    background: #EAF7FA;
    border-color: #A9DCE5;
    color: var(--teal-dark);
}

.task-form-compact {
    display: grid;
    gap: 12px;
}

.task-title-field input {
    font-size: 14px;
    font-weight: 650;
    min-height: 38px;
}

.task-core-grid,
.task-advanced-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.task-core-grid label,
.task-advanced-grid label,
.task-link-box label,
.quick-task-form label {
    color: var(--gray);
    display: grid;
    font-size: 11.5px;
    font-weight: 800;
    gap: 5px;
}

.task-form-compact input,
.task-form-compact select,
.task-form-compact textarea,
.quick-task-form input,
.quick-task-form textarea,
.quick-task-form select {
    min-height: 36px;
    padding: 7px 9px;
}

.duration-chip-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.duration-chip-strip button {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--gray);
    cursor: pointer;
    font-size: 11px;
    font-weight: 850;
    min-height: 30px;
    padding: 5px 9px;
}

.duration-chip-strip button:hover,
.duration-chip-strip button.active {
    background: #EAF7FA;
    border-color: #A9DCE5;
    color: var(--teal-dark);
}

.task-link-box {
    background: #FBFCFD;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px;
}

.task-link-title {
    color: var(--gray);
    font-size: 12px;
    font-weight: 850;
    margin-bottom: 8px;
}

.task-link-options {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

.task-link-options label {
    align-items: center;
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    flex: 0 1 auto;
    gap: 6px;
    min-height: 30px;
    padding: 5px 9px;
}

.task-link-options input {
    margin: 0;
    min-height: 0;
    width: auto;
}

.task-link-options label:has(input:checked) {
    background: #EAF7FA;
    border-color: #A9DCE5;
    color: var(--teal-dark);
}

.task-link-selects {
    display: grid;
    gap: 8px;
}

.task-link-selects label[hidden] {
    display: none;
}

.task-link-help {
    color: var(--muted);
    font-size: 11.5px;
    margin: 8px 0 0;
}

.internal-task-badge {
    background: #EEF4F7;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--gray);
    display: inline-flex;
    font-size: 11px;
    font-weight: 850;
    padding: 3px 7px;
}

.task-advanced {
    background: #FBFCFD;
    padding: 10px 12px;
}

.task-advanced summary {
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 850;
}

.task-advanced-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 9px;
}

.task-form-footer {
    align-items: center;
    background: rgba(255,255,255,0.94);
    border-top: 1px solid var(--border);
    bottom: 0;
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding-top: 10px;
    position: sticky;
}

.task-form-footer .task-total {
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    flex: 1;
    padding: 8px 10px;
}

.task-page-shell {
    border-radius: var(--radius-lg);
    padding: 14px 16px;
}

.task-summary-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.task-summary-strip span {
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--gray);
    font-size: 12px;
    font-weight: 800;
    padding: 5px 9px;
}

.task-summary-strip span.red {
    background: #FCECEA;
    border-color: #E4A8A0;
    color: var(--red);
}

.task-summary-strip span.today {
    background: #EAF7FA;
    border-color: #A9DCE5;
    color: var(--teal-dark);
}

.task-summary-strip span.orange {
    background: #FFF3D1;
    border-color: #F1D58C;
    color: #8A6500;
}

.task-summary-strip span.delegated {
    background: #EDF7F9;
    border-color: #BBDDE4;
    color: var(--teal-dark);
}

.task-summary-strip strong {
    color: var(--text);
    margin-right: 4px;
}

.task-section .panel-head {
    margin-bottom: 8px;
}

.task-section-collapsible {
    padding: 0;
}

.task-section-summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    list-style: none;
    padding: 10px 12px;
}

.task-section-summary::-webkit-details-marker {
    display: none;
}

.task-section-summary span,
.task-section-summary strong,
.task-section-summary em {
    display: block;
}

.task-section-summary strong {
    color: var(--text);
    font-size: 14px;
}

.task-section-summary em {
    color: var(--muted);
    font-size: 11.5px;
    font-style: normal;
    margin-top: 1px;
}

.task-section-summary b {
    background: #F5F7FA;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--gray);
    font-size: 11px;
    min-width: 26px;
    padding: 3px 7px;
    text-align: center;
}

.task-section-collapsible .task-board {
    border-top: 1px solid var(--border);
    padding: 8px;
}

.task-board-compact {
    gap: 6px;
}

.task-card-compact {
    align-items: center;
    gap: 10px;
    grid-template-columns: 110px minmax(220px, 1fr) 170px 80px 140px 240px;
    min-height: 72px;
    padding: 8px 10px;
}

.task-card-status {
    min-width: 0;
}

.task-card-compact .status {
    font-size: 10.5px;
    padding: 4px 6px;
}

.task-card-compact .task-card-main strong {
    font-size: 12.8px;
    margin: 0;
}

.task-card-compact .task-card-main {
    min-width: 0;
}

.task-card-compact .task-card-main small,
.task-card-compact .task-card-main em,
.task-card-schedule span,
.task-card-schedule small,
.task-card-duration span,
.task-card-priority span {
    font-size: 11.3px;
}

.task-card-schedule {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.task-card-schedule span,
.task-card-schedule small,
.task-card-duration span {
    color: var(--gray);
    display: block;
    font-style: normal;
    font-weight: 750;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-card-schedule small {
    color: var(--muted);
    font-weight: 700;
}

.task-card-duration {
    min-width: 0;
}

.task-card-duration span {
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    font-weight: 850;
    justify-content: center;
    min-width: 64px;
    padding: 4px 7px;
}

.task-card-priority {
    min-width: 0;
}

.task-card-compact .task-card-actions {
    align-items: center;
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: nowrap;
    white-space: nowrap;
}

.task-card-compact .task-card-actions > a {
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--teal-dark);
    font-size: 12px;
    font-weight: 800;
    min-height: 30px;
    padding: 6px 8px;
}

.task-action-btn {
    background: #F5F7FA;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    min-height: 30px;
    padding: 6px 8px;
}

.task-action-btn.primary {
    background: #EAF7FA;
    border-color: #A9DCE5;
    color: var(--teal-dark);
}

.task-red .task-action-btn:not(.primary) {
    background: #EAF7FA;
    border-color: #A9DCE5;
    color: var(--teal-dark);
}

.task-green .task-action-btn {
    display: none;
}

.task-action-btn:hover {
    border-color: var(--teal);
    color: var(--teal-dark);
}

.task-more-actions {
    border: 0;
    margin: 0;
    padding: 0;
    position: relative;
}

.task-more-actions summary {
    background: #F5F7FA;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    list-style: none;
    min-height: 30px;
    padding: 6px 8px;
}

.task-modal-more {
    border: 0;
    margin: 0;
    padding: 0;
    position: relative;
}

.task-modal-more summary {
    align-items: center;
    background: #F5F7FA;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    font-size: 13px;
    font-weight: 750;
    justify-content: center;
    list-style: none;
    min-height: 36px;
    padding: 8px 12px;
    white-space: nowrap;
}

.task-modal-more summary::-webkit-details-marker {
    display: none;
}

.task-modal-more[open] {
    z-index: 20;
}

.task-modal-more[open] > a,
.task-modal-more[open] > button {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    color: var(--text);
    cursor: pointer;
    display: block;
    font: inherit;
    font-size: 12.5px;
    font-weight: 800;
    margin-top: 5px;
    min-height: 32px;
    min-width: 156px;
    padding: 8px 10px;
    position: relative;
    text-align: left;
    text-decoration: none;
    width: 100%;
}

.task-modal-more[open] > button.danger-link {
    color: var(--red) !important;
}

.task-more-actions summary::-webkit-details-marker {
    display: none;
}

.task-more-actions[open] {
    z-index: 12;
}

.task-more-actions[open] > a {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    display: block;
    margin-top: 4px;
    min-width: 104px;
    padding: 7px 9px;
    position: relative;
    text-align: left;
}

.task-action-modal {
    max-width: min(560px, calc(100vw - 24px));
    padding: 14px;
}

.task-modal-summary {
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
    margin-bottom: 10px;
    padding: 9px;
}

.task-modal-summary span,
.task-modal-summary strong,
.task-modal-summary em {
    display: block;
}

.task-modal-summary [hidden] {
    display: none;
}

.task-modal-summary strong {
    color: var(--muted);
    font-size: 10.5px;
    text-transform: uppercase;
}

.task-modal-summary em {
    color: var(--text);
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 10px;
}

.task-modal-actions > .btn,
.task-modal-actions > .inline-action-form > .btn {
    max-width: 100%;
    min-height: 38px;
}

.task-modal-actions .active {
    box-shadow: inset 0 0 0 2px rgba(0,151,178,0.16);
}

.quick-task-form {
    border-top: 1px solid var(--border);
    display: grid;
    gap: 8px;
    margin-top: 8px;
    padding-top: 10px;
}

.compact-two,
.compact-three {
    display: grid;
    gap: 8px;
}

.compact-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.compact-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.login-page {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
}

.login-panel {
    max-width: 430px;
    padding: 26px;
    width: 100%;
}

.login-panel h1 {
    font-size: 24px;
    margin: 22px 0 8px;
}

.login-panel p {
    color: var(--muted);
    font-size: 13px;
    margin: 0 0 18px;
}

.print-body {
    background: var(--white);
}

.print-page {
    margin: 28px auto;
    max-width: 820px;
}

.print-page h1 {
    color: var(--teal-dark);
    font-size: 24px;
}

.print-page h2 {
    font-size: 18px;
}

@media (max-width: 900px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
        min-height: auto;
        position: static;
    }

    .sidebar.open {
        display: flex;
    }

    .hamburger {
        display: inline-flex;
    }

    .content {
        padding: 14px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .form-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .panel-head {
        align-items: stretch;
        flex-direction: column;
    }

    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .task-row {
        align-items: start;
        grid-template-columns: 1fr;
    }

    .task-row em {
        white-space: normal;
    }

    .task-card {
        grid-template-columns: 1fr;
    }

    .task-card-main strong,
    .task-card-main small,
    .task-card-main em,
    .task-card-schedule span,
    .task-card-schedule small,
    .task-card-duration span {
        white-space: normal;
    }

    .task-card-actions {
        justify-content: flex-start;
    }

    .task-card-actions a {
        flex: 1 1 100%;
        text-align: center;
    }

    .topbar-action {
        margin-left: 0;
    }

    .filters input,
    .filters select,
    .catalog-select,
    .filters .btn {
        min-width: 100%;
        width: 100%;
    }

    .quote-live-totals {
        grid-template-columns: 1fr;
    }

    .month-summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .month-totals {
        justify-content: flex-start;
    }

    .month-detail-grid {
        grid-template-columns: 1fr;
    }

    .case-control-grid,
    .finance-strip,
    .case-row-card,
    .case-main {
        grid-template-columns: 1fr;
    }

    .case-people {
        flex-direction: row;
    }

    .case-money,
    .case-badges,
    .case-actions {
        grid-column: auto;
    }

    .row-more {
        display: block;
        padding-left: 0;
        width: 100%;
    }

    .row-more[open] form {
        position: static;
        width: 100%;
    }

    .calendar-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .agenda-header,
    .task-operating-head,
    .task-form-head,
    .task-form-footer {
        align-items: stretch;
        flex-direction: column;
    }

    .agenda-header-actions,
    .task-operating-head .inline-actions,
    .task-modal-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .agenda-quickbar,
    .agenda-advanced-grid,
    .task-core-grid,
    .task-advanced-grid,
    .task-modal-summary,
    .duration-chip-strip,
    .compact-two,
    .compact-three {
        grid-template-columns: 1fr;
    }

    .agenda-advanced-grid {
        position: static;
        width: 100%;
    }

    .agenda-load-compact .load-card,
    .task-card-compact {
        align-items: start;
        grid-template-columns: 1fr;
    }

    .task-card-status {
        min-width: 0;
    }

    .task-card-compact .task-card-actions {
        flex-wrap: wrap;
        white-space: normal;
    }

    .task-card-duration span {
        justify-content: flex-start;
        width: fit-content;
    }

    .task-section-summary {
        align-items: flex-start;
        gap: 8px;
    }

    .task-more-actions {
        width: 100%;
    }

    .task-more-actions summary,
    .task-more-actions[open] > a,
    .duration-chip-strip button,
    .task-preset-strip button {
        text-align: center;
        width: 100%;
    }

    .agenda-tabs a {
        flex: 1 1 100%;
        text-align: center;
    }

    .btn {
        width: 100%;
    }

    .action-row .btn,
    .action-row form,
    .action-row button {
        width: 100%;
    }
}

@media print {
    .sidebar,
    .topbar,
    .btn {
        display: none !important;
    }

    .app-shell {
        display: block;
    }

    .content,
    .panel {
        box-shadow: none;
        padding: 0;
    }
}

/* UI/UX rebuild sprint - decisionale, compatta, contestuale */
.topbar {
    background: transparent;
    margin-bottom: 14px;
}

.topbar h1 {
    font-size: 23px;
    letter-spacing: 0;
}

.topbar p {
    max-width: 720px;
}

.topbar-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    margin-left: auto;
}

.btn,
button.btn,
.task-action-btn {
    min-height: 34px;
}

.btn.primary {
    box-shadow: 0 6px 14px rgba(0, 151, 178, 0.16);
}

.btn.secondary:hover,
.task-action-btn:hover,
.row-actions a:hover {
    background: #EAF7FA;
    border-color: #A9DCE5;
    color: var(--teal-dark);
    text-decoration: none;
}

.panel {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 8px 22px rgba(34, 48, 58, 0.055);
    padding: 14px;
}

.quick-action-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    margin: -2px 0 14px;
}

.quick-action-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    display: grid;
    gap: 3px;
    min-height: 82px;
    padding: 12px;
    text-decoration: none;
    transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.quick-action-card span {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 900;
    letter-spacing: .02em;
    text-transform: uppercase;
}

.quick-action-card strong {
    color: var(--text);
    font-size: 15px;
    line-height: 1.15;
}

.quick-action-card small {
    color: var(--muted);
    font-size: 11.5px;
    line-height: 1.25;
}

.quick-action-card.primary {
    background: var(--teal-soft);
    border-color: #A9DCE5;
}

.quick-action-card.primary strong {
    color: var(--teal-dark);
}

.quick-action-card:hover {
    border-color: #A9DCE5;
    box-shadow: 0 10px 24px rgba(0, 151, 178, .08);
    text-decoration: none;
    transform: translateY(-1px);
}

.panel-head {
    margin-bottom: 10px;
}

.metric-grid.decision-kpis,
.cashflow-summary.decision-kpis {
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
    margin-bottom: 12px;
}

.decision-kpis .metric-card,
.cashflow-summary.decision-kpis .metric-card {
    min-height: 68px;
    padding: 10px 12px;
}

.decision-kpis .metric-card span,
.cashflow-summary.decision-kpis .metric-card span {
    font-size: 11px;
    text-transform: uppercase;
}

.decision-kpis .metric-card strong,
.cashflow-summary.decision-kpis .metric-card strong {
    font-size: 19px;
    margin-top: 5px;
}

.metric-card.alert {
    border-left: 4px solid var(--red);
    background: linear-gradient(90deg, var(--danger-soft), #FFFFFF 36%);
}

.metric-card.money,
.metric-card.case,
.metric-card.lead {
    border-left: 4px solid var(--teal);
    background: linear-gradient(90deg, var(--teal-soft), #FFFFFF 38%);
}

.metric-card.lead {
    border-left-color: var(--green);
    background: linear-gradient(90deg, var(--success-soft), #FFFFFF 38%);
}

.decision-grid,
.dashboard-grid {
    gap: 12px;
    margin-bottom: 12px;
}

.priority-panel {
    border-top: 3px solid #EAF7FA;
}

.priority-panel .task-list {
    max-height: 420px;
    overflow: auto;
}

.task-row {
    min-height: 38px;
    padding: 7px 9px;
}

.task-row .status {
    min-width: 74px;
    justify-content: center;
}

.compact-filter-bar {
    align-items: center;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(220px, 1.2fr) repeat(3, minmax(150px, .75fr)) auto auto;
    width: 100%;
}

.compact-filter-bar input,
.compact-filter-bar select,
.compact-filter-bar .btn {
    min-height: 34px;
    min-width: 0;
}

.advanced-filter-menu {
    border: 0;
    margin: 0;
    padding: 0;
    position: relative;
}

.advanced-filter-menu summary {
    align-items: center;
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--gray);
    cursor: pointer;
    display: inline-flex;
    font-size: 12.5px;
    font-weight: 800;
    list-style: none;
    min-height: 34px;
    padding: 7px 10px;
    white-space: nowrap;
}

.advanced-filter-menu summary::-webkit-details-marker {
    display: none;
}

.advanced-filter-grid {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    margin-top: 6px;
    padding: 10px;
    position: absolute;
    right: 0;
    top: 34px;
    width: min(760px, 92vw);
    z-index: 30;
}

.advanced-filter-grid .filter-check {
    justify-content: flex-start;
}

.filter-check {
    border-radius: 999px;
    min-height: 32px;
    padding: 6px 10px;
}

.filter-check:has(input:checked) {
    background: #EAF7FA;
    border-color: #A9DCE5;
    color: var(--teal-dark);
}

.case-row-card {
    grid-template-columns: minmax(250px, 1.25fr) 118px minmax(150px, .8fr) minmax(220px, 1fr);
    padding: 9px 10px;
}

.case-main h2 {
    font-size: 13.5px;
}

.case-main p {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.case-numbers span,
.case-money span {
    min-width: 70px;
    padding: 6px 8px;
}

.case-actions {
    align-items: center;
}

.case-more[open] {
    z-index: 30;
}

.row-more[open] > a {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: var(--shadow);
    color: var(--teal-dark);
    display: block;
    font-size: 12.5px;
    font-weight: 800;
    margin-top: 4px;
    min-width: 120px;
    padding: 8px 10px;
    position: relative;
    text-align: left;
    text-decoration: none;
}

.row-actions {
    align-items: center;
    display: flex;
    flex-wrap: nowrap;
    gap: 7px;
    justify-content: flex-end;
    text-align: right;
}

.row-actions > a,
.row-actions .inline-form button {
    background: #F8FAFC;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--teal-dark);
    font-size: 12px;
    font-weight: 800;
    min-height: 29px;
    padding: 6px 8px;
}

.row-actions .inline-form button {
    margin: 0;
}

.table-wrap.compact table,
.compact table {
    min-width: 720px;
}

th,
td {
    padding: 7px 8px;
}

.month-section {
    padding: 8px 0;
}

.month-summary {
    min-height: 40px;
}

.month-totals {
    gap: 5px;
}

.month-totals em {
    font-size: 11px;
}

.agenda-shell {
    padding: 12px;
}

.agenda-header {
    margin-bottom: 8px;
}

.agenda-viewline {
    margin: 4px 0 10px;
    padding: 6px 0;
}

.agenda-quickbar {
    grid-template-columns: minmax(130px, .55fr) minmax(240px, 1.4fr) minmax(160px, .8fr) minmax(150px, .7fr) auto auto;
}

.agenda-load-compact .load-card {
    min-height: 36px;
    padding: 5px 9px;
}

.agenda-load-compact .load-card em {
    font-size: 10px;
    padding: 3px 6px;
}

.agenda-calendar-focus .calendar-event:not(.planned):not(.done):not(.missed) {
    background: color-mix(in srgb, var(--event-color, #0097B2) 12%, white);
    border-color: color-mix(in srgb, var(--event-color, #0097B2) 42%, white);
    border-top: 1px solid color-mix(in srgb, var(--event-color, #0097B2) 28%, white);
}

.agenda-calendar-focus .calendar-event strong {
    font-size: 11.5px;
    font-weight: 850;
}

.task-page-shell {
    padding-bottom: 12px;
}

.task-operating-head {
    margin-bottom: 8px;
}

.quick-filter-strip {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.quick-filter-strip a,
.quick-filter-strip span {
    border-radius: 8px;
    color: var(--text);
    min-height: 42px;
    padding: 8px 10px;
    text-decoration: none;
}

.quick-filter-strip a:hover {
    transform: translateY(-1px);
}

.task-section-collapsible {
    padding: 0;
}

.task-section-summary {
    min-height: 42px;
    padding: 10px 12px;
}

.task-card-compact {
    grid-template-columns: 105px minmax(210px, 1fr) 150px 72px 118px 220px;
    min-height: 58px;
    padding: 7px 9px;
}

.task-card-compact .task-card-actions {
    gap: 5px;
}

.task-card-compact .status,
.status {
    min-height: 22px;
}

.task-quick-panel {
    margin-left: auto;
    margin-right: auto;
    max-width: 1040px;
    padding: 14px 16px;
}

.task-form-hint {
    margin-bottom: 8px;
}

.task-core-grid {
    gap: 8px;
}

.duration-chip-strip {
    gap: 5px;
    grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
}

.duration-chip-strip button {
    min-height: 30px;
}

.duration-chip-strip button.active,
.task-preset-strip button.active {
    background: var(--teal-soft);
    border-color: #A9DCE5;
    color: var(--teal-dark);
    font-weight: 900;
}

.production-load-grid .panel {
    min-height: 0;
}

.compact-task-list {
    gap: 6px;
}

.action-table td,
.action-table th {
    vertical-align: middle;
}

.cashflow-summary {
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.summary-strip {
    gap: 8px;
}

.summary-strip div,
.detail-grid div {
    padding: 9px 10px;
}

.action-row {
    margin-bottom: 10px;
}

.action-row .btn,
.action-row button.btn {
    min-height: 32px;
}

@media (max-width: 1100px) {
    .compact-filter-bar,
    .agenda-quickbar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .advanced-filter-grid,
    .agenda-advanced-grid {
        position: static;
        width: 100%;
    }

    .quick-filter-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .task-card-compact {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .topbar-actions {
        margin-left: 0;
        width: 100%;
    }

    .compact-filter-bar,
    .quick-filter-strip,
    .cashflow-summary {
        grid-template-columns: 1fr;
    }

    .advanced-filter-grid {
        grid-template-columns: 1fr;
    }

    .row-actions {
        align-items: stretch;
        flex-direction: column;
        white-space: normal;
    }
}

/* DomiQ Cloud UI refresh - inspired by clean Italian management software */
:root {
    --cloud-blue: #5B9AD6;
    --cloud-blue-dark: #3F7FBA;
    --cloud-blue-soft: #DDEEFF;
    --cloud-blue-pale: #F0F7FF;
    --cloud-green: #55AE61;
    --cloud-green-soft: #EAF8E9;
    --cloud-red: #E33B32;
    --cloud-red-soft: #FDECEC;
    --cloud-page: #F1F3F7;
    --cloud-sidebar: #F8F9FB;
    --cloud-line: #DDE3EA;
    --cloud-line-soft: #EEF2F6;
    --cloud-text: #334155;
    --cloud-muted: #7A8491;
}

body {
    background: var(--cloud-page);
    color: var(--cloud-text);
    font-size: 13.5px;
    line-height: 1.38;
}

a {
    color: var(--cloud-blue-dark);
}

.app-shell {
    background: var(--cloud-page);
    display: grid;
    grid-template-columns: 232px minmax(0, 1fr);
    grid-template-rows: 46px minmax(0, 1fr);
    min-height: 100vh;
}

.app-top-strip {
    align-items: center;
    background: var(--cloud-blue);
    box-shadow: 0 1px 0 rgba(31, 73, 113, .18);
    color: #FFFFFF;
    display: flex;
    gap: 18px;
    grid-column: 1 / -1;
    grid-row: 1;
    justify-content: space-between;
    min-height: 46px;
    padding: 0 16px;
    position: sticky;
    top: 0;
    z-index: 80;
}

.top-brand {
    align-items: center;
    color: #FFFFFF;
    display: inline-flex;
    font-size: 18px;
    font-weight: 850;
    gap: 9px;
    letter-spacing: 0;
    min-width: 0;
}

.top-brand:hover {
    color: #FFFFFF;
    text-decoration: none;
}

.top-brand-mark {
    align-items: center;
    background: rgba(255, 255, 255, .22);
    border-radius: 7px;
    display: inline-flex;
    font-size: 17px;
    height: 28px;
    justify-content: center;
    width: 28px;
}

.top-strip-actions {
    align-items: center;
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    justify-content: flex-end;
    min-width: 0;
}

.top-support,
.top-pill,
.top-user {
    align-items: center;
    background: rgba(255, 255, 255, .16);
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 4px;
    color: #FFFFFF;
    display: inline-flex;
    font-size: 13px;
    font-weight: 750;
    min-height: 32px;
    padding: 6px 12px;
    white-space: nowrap;
}

.top-support {
    background: #FFFFFF;
    color: #263748;
}

.sidebar {
    background: var(--cloud-sidebar);
    border-right: 1px solid var(--cloud-line);
    grid-column: 1;
    grid-row: 2;
    max-height: calc(100vh - 46px);
    min-height: calc(100vh - 46px);
    padding: 0;
    position: sticky;
    top: 46px;
}

.brand {
    background: #FFFFFF;
    border-bottom: 1px solid var(--cloud-line-soft);
    color: #1F2937;
    gap: 10px;
    min-height: 86px;
    padding: 16px 14px;
}

.brand-mark {
    background: #FFFFFF;
    border: 1px solid var(--cloud-line);
    border-radius: 999px;
    color: var(--cloud-blue);
    font-size: 16px;
    height: 34px;
    width: 34px;
}

.brand strong {
    color: #1F2937;
    font-size: 15px;
    font-weight: 850;
}

.brand small {
    color: var(--cloud-muted);
    font-size: 11px;
    font-weight: 750;
}

.nav {
    gap: 0;
    margin-top: 0;
    padding: 9px 0 14px;
}

.nav-main,
.nav-group summary,
.nav-group a {
    border-radius: 0;
    color: #2F3B48;
    min-height: 37px;
}

.nav-main {
    align-items: center;
    display: flex;
    font-size: 13.5px;
    font-weight: 700;
    margin: 0;
    padding: 10px 18px;
}

.nav-main.nav-direction {
    border-top: 1px solid var(--cloud-line);
    margin-top: 7px;
    padding-top: 11px;
}

.nav-group {
    border-top: 0;
    margin: 0;
    padding: 0;
}

.nav-group summary {
    color: #2F3B48;
    font-size: 13.5px;
    font-weight: 750;
    padding: 10px 14px 10px 18px;
}

.nav-group a {
    border-left: 0;
    color: #2F3B48;
    font-size: 13px;
    font-weight: 500;
    margin: 0;
    max-width: 100%;
    min-height: 35px;
    padding: 9px 12px 9px 42px;
    width: 100%;
}

.nav a:hover,
.nav summary:hover {
    background: #E8F2FC;
    color: var(--cloud-blue-dark);
}

.nav-main.active,
.nav summary.active {
    background: #D5E9FA;
    box-shadow: inset 4px 0 0 var(--cloud-blue);
    color: #1E5E94;
}

.nav-group a.active {
    background: var(--cloud-blue);
    box-shadow: none;
    color: #FFFFFF;
    font-weight: 750;
}

.sidebar-user {
    background: #FFFFFF;
    border-top: 1px solid var(--cloud-line);
    font-size: 12.5px;
    padding: 12px 14px;
}

.sidebar-actions a {
    color: var(--cloud-blue-dark);
    font-size: 12px;
    font-weight: 750;
}

.sidebar-logout-form button {
    background: transparent;
    border: 0;
    color: var(--cloud-blue-dark);
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 750;
    padding: 0;
}

.content {
    background: var(--cloud-page);
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    padding: 18px 22px 28px;
}

.topbar {
    align-items: center;
    background: transparent;
    border: 0;
    gap: 12px;
    margin: 0 0 14px;
}

.topbar h1 {
    color: #202A36;
    font-size: 24px;
    font-weight: 850;
    letter-spacing: 0;
}

.topbar p {
    color: var(--cloud-muted);
    font-size: 13px;
    margin-top: 4px;
}

.hamburger {
    border-color: var(--cloud-line);
    border-radius: 4px;
}

.panel,
.metric-card,
.login-panel,
.card,
.section-card {
    background: #FFFFFF;
    border: 1px solid var(--cloud-line);
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(31, 41, 55, .06);
}

.panel {
    margin-bottom: 14px;
    padding: 14px;
}

.panel-head {
    border-bottom: 1px solid var(--cloud-line-soft);
    margin: -2px -2px 12px;
    padding: 0 2px 10px;
}

.panel-head h2,
.section-title-inline h2 {
    color: #202A36;
    font-size: 16px;
    font-weight: 850;
}

.panel-head p,
.section-title-inline p {
    color: var(--cloud-muted);
}

.btn,
button.btn,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger,
.task-action-btn {
    border-radius: 4px;
    font-size: 13px;
    font-weight: 800;
    min-height: 34px;
    padding: 7px 12px;
}

.btn.primary,
.btn-primary {
    background: var(--cloud-blue);
    border-color: var(--cloud-blue);
    box-shadow: 0 1px 2px rgba(52, 112, 170, .25);
    color: #FFFFFF;
}

.btn.primary:hover,
.btn-primary:hover {
    background: var(--cloud-blue-dark);
    border-color: var(--cloud-blue-dark);
}

.btn.secondary,
.btn-secondary {
    background: #FFFFFF;
    border-color: var(--cloud-line);
    color: #2F3B48;
}

.btn.secondary:hover,
.btn-secondary:hover,
.task-action-btn:hover {
    background: var(--cloud-blue-pale);
    border-color: #B8D6F2;
    color: var(--cloud-blue-dark);
}

.btn.danger,
.btn-danger {
    background: #FFFFFF;
    border-color: #F1B8B3;
    color: var(--cloud-red);
}

input,
select,
textarea,
.input,
.select {
    border-color: var(--cloud-line);
    border-radius: 4px;
    color: #334155;
    font-size: 13px;
    min-height: 34px;
    padding: 7px 10px;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--cloud-blue);
    box-shadow: 0 0 0 3px rgba(91, 154, 214, .16);
    outline: 0;
}

.filters,
.compact-filter-bar,
.agenda-quickbar {
    gap: 8px;
}

.advanced-filter-menu summary,
.agenda-advanced-filters summary {
    background: #FFFFFF;
    border-color: var(--cloud-line);
    border-radius: 4px;
    color: #334155;
}

.agenda-tabs {
    border-bottom: 1px solid var(--cloud-line);
    gap: 0;
    margin-bottom: 14px;
}

.agenda-tabs a,
.agenda-viewline a {
    background: #FFFFFF;
    border: 1px solid var(--cloud-line);
    border-bottom-color: var(--cloud-line);
    border-radius: 4px 4px 0 0;
    color: #334155;
    font-size: 13px;
    font-weight: 800;
    margin-right: -1px;
    min-height: 34px;
    padding: 8px 13px;
}

.agenda-tabs a.active,
.agenda-viewline a.active,
.agenda-tabs a:hover,
.agenda-viewline a:hover {
    background: var(--cloud-blue);
    border-color: var(--cloud-blue);
    color: #FFFFFF;
    text-decoration: none;
}

.metric-grid.decision-kpis,
.cashflow-summary.decision-kpis {
    gap: 0;
    overflow: hidden;
}

.decision-kpis .metric-card,
.cashflow-summary.decision-kpis .metric-card,
.metric-card {
    background: #FFFFFF;
    border-radius: 0;
    border-width: 0 1px 1px 0;
    box-shadow: none;
    min-height: 78px;
    padding: 15px 16px;
}

.decision-kpis .metric-card span,
.cashflow-summary.decision-kpis .metric-card span,
.metric-card span {
    color: #334155;
    font-size: 12px;
    font-weight: 750;
    letter-spacing: 0;
}

.decision-kpis .metric-card strong,
.cashflow-summary.decision-kpis .metric-card strong,
.metric-card strong {
    color: #111827;
    font-size: 24px;
    font-weight: 500;
    margin-top: 5px;
}

.metric-card.money,
.metric-card.case,
.metric-card.quote,
.metric-card.lead,
.metric-card.alert {
    background: #FFFFFF;
    border-left: 0;
}

.metric-card.money strong,
.metric-card.case strong,
.metric-card.quote strong {
    color: #2F669A;
}

.metric-card.lead strong {
    color: #2F8C55;
}

.metric-card.alert strong {
    color: var(--cloud-red);
}

.quick-action-grid {
    gap: 0;
    margin-bottom: 16px;
}

.quick-action-card {
    border-color: var(--cloud-line);
    border-radius: 0;
    box-shadow: none;
    min-height: 76px;
}

.quick-action-card.primary {
    background: var(--cloud-blue-pale);
    border-color: #B8D6F2;
}

.quick-action-card span {
    color: var(--cloud-blue-dark);
}

.quick-action-card strong {
    font-size: 15px;
}

.table-wrap {
    background: #FFFFFF;
    border: 1px solid var(--cloud-line);
    border-radius: 4px;
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

th,
td {
    border-bottom: 1px solid var(--cloud-line-soft);
    color: #546173;
    font-size: 13px;
    padding: 10px 12px;
}

th {
    background: #FFFFFF;
    border-bottom: 1px solid var(--cloud-line);
    color: #3F4650;
    font-size: 12px;
    font-weight: 850;
    text-transform: uppercase;
}

tbody tr:hover td {
    background: #F8FBFE;
}

tbody tr:last-child td {
    border-bottom: 0;
}

.row-actions > a,
.row-actions .inline-form button,
.actions-cell a,
.actions-cell button {
    background: #FFFFFF;
    border: 1px solid var(--cloud-line);
    border-radius: 4px;
    color: #627083;
}

.status,
.badge,
.task-status {
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 850;
    min-height: 22px;
    padding: 4px 8px;
}

.status.green,
.status.incassato,
.status.pagata,
.status.completato,
.badge-green,
.agenda-green {
    background: var(--cloud-green-soft);
    border-color: #B8E0BD;
    color: #2F8C55;
}

.status.red,
.status.scaduto,
.status.da-riprogrammare,
.status.perso,
.badge-red,
.agenda-red {
    background: var(--cloud-red-soft);
    border-color: #F4B8B4;
    color: var(--cloud-red);
}

.status.blue,
.status.pianificato,
.badge-blue,
.agenda-blue {
    background: var(--cloud-blue-pale);
    border-color: #B8D6F2;
    color: var(--cloud-blue-dark);
}

.projection-strip,
.cash-mini-grid,
.summary-strip {
    background: #FFFFFF;
    border: 1px solid var(--cloud-line);
    border-radius: 4px;
    gap: 0;
    overflow: hidden;
}

.projection-strip div,
.cash-mini-grid div,
.summary-strip div,
.detail-grid div {
    border-right: 1px solid var(--cloud-line-soft);
    border-radius: 0;
    box-shadow: none;
}

.projection-strip div:last-child,
.cash-mini-grid div:last-child,
.summary-strip div:last-child {
    border-right: 0;
}

.month-section {
    background: #FFFFFF;
    border: 1px solid var(--cloud-line);
    border-radius: 4px;
    margin-bottom: 10px;
    padding: 0;
}

.month-summary {
    background: #FFFFFF;
    border: 0;
    min-height: 48px;
    padding: 11px 13px;
}

.month-summary strong {
    color: #202A36;
}

.month-totals em,
.pill-teal,
.pill-green,
.pill-red,
.pill-yellow,
.pill-orange {
    border-radius: 4px;
    font-weight: 800;
}

.pill-teal,
.pill-green {
    background: var(--cloud-green-soft);
    color: #2F8C55;
}

.pill-red {
    background: var(--cloud-red-soft);
    color: var(--cloud-red);
}

.pill-yellow,
.pill-orange {
    background: #FFF6E3;
    color: #9A6500;
}

.agenda-shell {
    border-radius: 4px;
}

.agenda-header {
    border-bottom: 1px solid var(--cloud-line);
    margin-bottom: 10px;
    padding-bottom: 10px;
}

.agenda-load-compact {
    gap: 8px;
}

.agenda-load-compact .load-card {
    background: #FFFFFF;
    border: 1px solid var(--cloud-line);
    border-left: 4px solid var(--cloud-blue);
    border-radius: 4px;
    box-shadow: none;
}

.agenda-load-compact .load-card.active,
.agenda-load-compact .load-card:hover {
    background: var(--cloud-blue-pale);
    border-color: #B8D6F2;
    border-left-color: var(--cloud-blue);
}

.agenda-calendar-focus {
    border-color: var(--cloud-line);
    border-radius: 4px;
}

.agenda-calendar-focus .calendar-day-head,
.agenda-calendar-focus .calendar-corner {
    background: #FFFFFF;
    color: #202A36;
}

.agenda-calendar-focus .calendar-times span,
.agenda-calendar-focus .calendar-slot-line,
.agenda-calendar-focus .calendar-day-col {
    border-color: #ECF0F4;
}

.agenda-calendar-focus .calendar-event {
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(31, 41, 55, .08);
    color: #2F3B48;
}

.task-card-compact,
.task-card {
    background: #FFFFFF;
    border: 1px solid var(--cloud-line);
    border-radius: 4px;
    box-shadow: none;
}

.task-card.task-blue,
.task-card-compact.task-blue {
    border-left: 5px solid var(--cloud-blue);
}

.task-card.task-green,
.task-card-compact.task-green {
    border-left: 5px solid var(--cloud-green);
}

.task-card.task-red,
.task-card-compact.task-red {
    border-left: 5px solid var(--cloud-red);
}

.task-board-app {
    align-items: start;
    display: grid;
    gap: 12px;
    grid-template-columns: 218px minmax(0, 1fr);
    min-height: calc(100vh - 132px);
}

.task-board-app:has(.task-detail-panel:not([hidden])) {
    grid-template-columns: 218px minmax(0, 1fr) 340px;
}

.task-board-filters,
.task-detail-panel,
.task-board-toolbar,
.task-column {
    background: #FFFFFF;
    border: 1px solid var(--cloud-line);
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(31, 41, 55, .04);
}

.task-board-filters {
    min-height: 320px;
    overflow: hidden;
    position: sticky;
    top: 64px;
}

.task-board-filter-head {
    align-items: center;
    border-bottom: 1px solid var(--cloud-line);
    display: flex;
    justify-content: space-between;
    padding: 12px 12px 10px;
}

.task-board-filter-head strong {
    font-size: 13px;
    font-weight: 850;
}

.task-board-filter-head span,
.task-board-filters b {
    background: #EEF3F8;
    border-radius: 999px;
    color: #506171;
    font-size: 11px;
    min-width: 24px;
    padding: 2px 7px;
    text-align: center;
}

.task-board-filters nav {
    display: grid;
    gap: 2px;
    padding: 8px;
}

.task-board-filters button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: #3E4A56;
    cursor: pointer;
    display: flex;
    font: inherit;
    font-size: 13px;
    font-weight: 650;
    justify-content: space-between;
    padding: 8px 9px;
    text-align: left;
}

.task-board-filters button:hover,
.task-board-filters button.active {
    background: var(--cloud-blue-pale);
    color: var(--cloud-blue-dark);
}

.task-board-workspace {
    min-width: 0;
}

.task-board-toolbar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    padding: 9px 12px;
}

.task-board-toolbar h2 {
    font-size: 16px;
    margin: 0 0 2px;
}

.task-board-toolbar p {
    color: var(--muted);
    font-size: 12px;
    margin: 0;
}

.task-column-rail {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    overflow-x: visible;
    padding-bottom: 8px;
}

.task-column {
    display: flex;
    flex-direction: column;
    max-height: 460px;
    min-height: 280px;
    overflow: hidden;
}

.task-column:has(.task-column-empty) {
    min-height: 190px;
}

.task-column header {
    align-items: center;
    border-bottom: 1px solid var(--cloud-line);
    display: flex;
    justify-content: space-between;
    padding: 11px 12px 9px;
}

.task-column header h3 {
    font-size: 15px;
    line-height: 1.2;
    margin: 0;
}

.task-column header span {
    color: var(--muted);
    display: block;
    font-size: 11px;
    margin-top: 2px;
}

.task-column header a {
    align-items: center;
    background: #F4F8FC;
    border: 1px solid #D9E4EE;
    border-radius: 999px;
    color: var(--cloud-blue-dark);
    display: inline-flex;
    font-size: 18px;
    font-weight: 800;
    height: 28px;
    justify-content: center;
    text-decoration: none;
    width: 28px;
}

.task-column-list,
.task-completed-group > div {
    display: grid;
    gap: 5px;
    overflow-y: auto;
    padding: 8px;
}

.task-column-list {
    flex: 1;
}

.task-board-item {
    align-items: flex-start;
    background: #FFFFFF;
    border: 1px solid #DDE5ED;
    border-left: 5px solid #1A73E8;
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    display: grid;
    gap: 8px;
    grid-template-columns: 20px minmax(0, 1fr);
    padding: 8px 8px 7px;
    text-align: left;
    width: 100%;
}

.task-board-item:hover {
    background: #F8FBFE;
    border-color: #BFD4E8;
}

.task-board-item.state-green {
    background: #F1FAF3;
    border-left-color: #188038;
}

.task-board-item.state-red {
    background: #FFF3F2;
    border-left-color: #D93025;
}

.task-board-item[hidden] {
    display: none !important;
}

.task-check {
    border: 2px solid #9AA8B5;
    border-radius: 50%;
    height: 17px;
    margin-top: 1px;
    width: 17px;
}

.state-green .task-check {
    background: #188038;
    border-color: #188038;
    box-shadow: inset 0 0 0 3px white;
}

.state-red .task-check {
    border-color: #D93025;
}

.task-board-item-body {
    min-width: 0;
}

.task-board-item-body strong,
.task-board-item-body small,
.task-board-item-body em {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}

.task-board-item-body strong {
    font-size: 13px;
    line-height: 1.25;
    white-space: nowrap;
}

.task-board-item-body small {
    color: #526170;
    font-size: 11.5px;
    margin-top: 2px;
    white-space: nowrap;
}

.task-board-item-body em {
    color: #788696;
    font-size: 11px;
    font-style: normal;
    margin-top: 2px;
    white-space: nowrap;
}

.task-board-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    grid-column: 2;
}

.task-board-badges i {
    background: #EEF3F8;
    border-radius: 999px;
    color: #526170;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
    padding: 2px 6px;
}

.state-red .task-board-badges i:first-child {
    background: #FDECEC;
    color: #B3261E;
}

.task-column-empty,
.task-completed-empty {
    border: 1px dashed #CBD7E2;
    border-radius: 6px;
    color: var(--muted);
    display: grid;
    font-size: 12px;
    gap: 2px;
    padding: 14px 10px;
    text-align: center;
}

.task-completed-group {
    border-top: 1px solid var(--cloud-line);
}

.task-completed-group summary {
    color: #566575;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    list-style: none;
    padding: 9px 10px;
}

.task-completed-group summary::-webkit-details-marker {
    display: none;
}

.task-detail-panel {
    max-height: calc(100vh - 132px);
    overflow-y: auto;
    padding: 12px;
    position: sticky;
    top: 64px;
}

.task-detail-head {
    align-items: flex-start;
    border-bottom: 1px solid var(--cloud-line);
    display: flex;
    gap: 10px;
    justify-content: space-between;
    padding-bottom: 10px;
}

.task-detail-head span {
    color: var(--cloud-blue-dark);
    font-size: 11px;
    font-weight: 850;
    text-transform: uppercase;
}

.task-detail-head h2 {
    font-size: 18px;
    line-height: 1.15;
    margin: 2px 0 4px;
}

.task-detail-head p {
    color: var(--muted);
    font-size: 12px;
    margin: 0;
}

.task-detail-grid {
    display: grid;
    gap: 7px;
    grid-template-columns: 1fr 1fr;
    margin: 12px 0;
}

.task-detail-grid div {
    background: #F8FAFC;
    border: 1px solid #E4EAF0;
    border-radius: 6px;
    padding: 7px 8px;
}

.task-detail-grid dt {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 800;
    margin: 0 0 2px;
    text-transform: uppercase;
}

.task-detail-grid dd {
    font-size: 12px;
    font-weight: 800;
    margin: 0;
}

.task-detail-notes {
    border-top: 1px solid var(--cloud-line);
    padding-top: 10px;
}

.task-detail-notes strong {
    font-size: 12px;
}

.task-detail-notes p {
    color: #566575;
    font-size: 12px;
    margin: 4px 0 0;
}

.task-detail-actions {
    border-top: 1px solid var(--cloud-line);
    display: grid;
    gap: 7px;
    grid-template-columns: 1fr 1fr;
    margin-top: 12px;
    padding-top: 12px;
}

.task-detail-actions .btn,
.task-detail-actions form,
.task-detail-actions a {
    min-width: 0;
    width: 100%;
}

.task-detail-panel .quick-task-form {
    border-top: 1px solid var(--cloud-line);
    margin-top: 10px;
    padding-top: 10px;
}

.compact-review-panel {
    margin-top: 12px;
}

.task-column.is-filter-empty {
    opacity: .55;
}

@media (max-width: 1180px) {
    .task-board-app,
    .task-board-app:has(.task-detail-panel:not([hidden])) {
        grid-template-columns: 1fr;
    }

    .task-board-filters,
    .task-detail-panel {
        max-height: none;
        min-height: 0;
        position: static;
    }

    .task-board-filters nav {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding-bottom: 10px;
    }

    .task-board-filters button {
        flex: 0 0 auto;
        min-width: 168px;
    }
}

@media (max-width: 720px) {
    .task-board-toolbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .task-column-rail {
        display: grid;
        overflow-x: visible;
    }

    .task-column {
        flex: initial;
        max-height: none;
        min-height: 260px;
    }

    .task-detail-actions,
    .task-detail-grid {
        grid-template-columns: 1fr;
    }
}

.procedure-categories {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    overflow-x: auto;
    padding-bottom: 3px;
}

.procedure-categories a {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text);
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 750;
    min-height: 34px;
    padding: 7px 10px;
}

.procedure-categories a.active {
    background: #ECF8FA;
    border-color: #A9DCE5;
    color: var(--teal-dark);
}

.procedure-result-count {
    color: var(--muted);
    font-size: 11.5px;
    margin: -3px 0 10px;
}

.procedure-item {
    border: 1px solid var(--border);
    border-radius: 7px;
    margin-bottom: 7px;
    overflow: hidden;
}

.procedure-item > summary {
    background: #FFFFFF;
    min-height: 48px;
    padding: 10px 12px;
}

.procedure-item[open] > summary {
    background: #F4FAFB;
    border-bottom: 1px solid var(--border);
}

@media (max-width: 720px) {
    .procedure-categories a {
        min-height: 44px;
    }
}

.quote-status-summary,
.production-priority-strip,
.production-trend-grid {
    display: grid;
    gap: 1px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 12px;
    overflow: hidden;
}

.quote-status-summary {
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: 7px;
}

.quote-status-summary > div,
.production-trend-grid > div {
    background: #FFFFFF;
    padding: 11px 13px;
}

.quote-status-summary span,
.production-trend-grid span {
    color: var(--muted);
    display: block;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
}

.quote-status-summary strong,
.production-trend-grid strong {
    display: block;
    font-size: 18px;
    margin-top: 3px;
}

.financial-reconciliation {
    align-items: center;
    background: #F7FAFC;
    border: 1px solid var(--border);
    border-left: 4px solid var(--green);
    border-radius: 7px;
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 12px;
    padding: 10px 12px;
}

.financial-reconciliation.warning {
    background: #FFF8E8;
    border-left-color: #B77900;
}

.financial-reconciliation span,
.financial-reconciliation strong {
    display: block;
}

.financial-reconciliation span {
    color: var(--muted);
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
}

.financial-reconciliation strong {
    font-size: 15px;
    margin-top: 2px;
}

.financial-reconciliation p {
    color: var(--muted);
    font-size: 11.5px;
    grid-column: 1 / -1;
    margin: 0;
}

.production-zone-head {
    align-items: end;
    display: flex;
    justify-content: space-between;
    margin: 18px 0 9px;
}

.production-zone-head h2 {
    font-size: 18px;
    margin: 0;
}

.production-zone-head p {
    color: var(--muted);
    font-size: 12px;
    margin: 3px 0 0;
}

.production-attention-zone .production-zone-head {
    margin-top: 0;
}

.production-priority-strip {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.production-priority-strip .metric-card {
    border-radius: 0;
    box-shadow: none;
    min-height: 82px;
}

.production-approval-row {
    align-items: center;
    grid-template-columns: 64px minmax(0, .9fr) minmax(0, 1.1fr) auto;
}

.production-approval-row .production-row-actions {
    grid-column: 1 / -1;
}

.production-row-actions {
    align-items: center;
    display: flex;
    gap: 6px;
    justify-content: flex-end;
}

.dashboard-grid.single-column {
    grid-template-columns: minmax(0, 1fr);
}

.production-secondary-section {
    padding: 0;
}

.production-secondary-section > summary {
    cursor: pointer;
    font-size: 14px;
    font-weight: 850;
    list-style: none;
    min-height: 50px;
    padding: 14px;
}

.production-secondary-section > summary::-webkit-details-marker {
    display: none;
}

.production-secondary-section > .panel-head,
.production-secondary-section > .task-list,
.production-secondary-section > .table-wrap {
    margin-left: 14px;
    margin-right: 14px;
}

.production-secondary-section > :last-child {
    margin-bottom: 14px;
}

.production-trend-panel {
    border-left: 4px solid var(--color-primary);
}

.practice-row-next small {
    color: var(--muted);
    display: block;
    font-size: 11px;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.practice-focus-grid-lean {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 980px) {
    .production-priority-strip,
    .production-approval-row {
        grid-template-columns: 1fr 1fr;
    }

    .production-row-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }
}

@media (max-width: 720px) {
    .quote-status-summary,
    .production-priority-strip,
    .production-trend-grid,
    .financial-reconciliation,
    .production-approval-row {
        grid-template-columns: 1fr;
    }

    .financial-reconciliation p,
    .production-row-actions {
        grid-column: 1;
    }

    .lead-focus-head,
    .lead-next-step,
    .document-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .lead-summary-strip,
    .summary-strip {
        grid-template-columns: 1fr 1fr;
    }

    .quote-document-editor,
    .document-editor {
        max-width: 100%;
        overflow: hidden;
    }

    .quote-document-form .document-card,
    .quote-document-form .line-editor,
    .quote-document-form .form-grid {
        min-width: 0;
    }
}

.task-section-summary,
.task-operating-head,
.task-quick-panel {
    border-radius: 4px;
}

.duration-chip-strip button,
.task-preset-strip button {
    border-radius: 4px;
}

.duration-chip-strip button.active,
.task-preset-strip button.active {
    background: var(--cloud-blue);
    border-color: var(--cloud-blue);
    color: #FFFFFF;
}

.empty-state {
    background: #FBFCFE;
    border: 1px dashed #CAD4DF;
    border-radius: 4px;
}

@media (max-width: 980px) {
    .app-shell {
        display: block;
    }

    .app-top-strip {
        position: sticky;
    }

    .top-brand {
        font-size: 15px;
    }

    .top-support,
    .top-pill {
        display: none;
    }

    .sidebar {
        max-height: none;
        min-height: 0;
        position: relative;
        top: 0;
    }

    .content {
        padding: 14px 12px 22px;
    }

    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .metric-grid.decision-kpis,
    .cashflow-summary.decision-kpis,
    .quick-action-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-top-strip {
        gap: 8px;
        padding: 0 10px;
    }

    .top-user {
        max-width: 132px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .topbar h1 {
        font-size: 21px;
    }

    th,
    td {
        font-size: 12.5px;
        padding: 9px 10px;
    }

    .table-wrap {
        max-width: 100%;
        overflow-x: auto;
    }
}

.lead-focus,
.lead-next-step {
    margin-bottom: 12px;
}

.lead-focus-head,
.lead-next-step {
    align-items: flex-start;
    display: flex;
    gap: 18px;
    justify-content: space-between;
}

.lead-focus-head h2,
.lead-next-step h2 {
    font-size: 18px;
    margin: 3px 0;
}

.lead-focus-head p,
.lead-next-step p,
.lead-next-appointment small {
    color: #718096;
    margin: 0;
}

.lead-summary-strip {
    border-top: 1px solid #E6EBF1;
    margin-top: 12px;
    padding-top: 12px;
}

.lead-next-step {
    border-left: 4px solid #0097B2;
}

.lead-next-step.is-closed {
    border-left-color: #8793A1;
}

.lead-next-appointment {
    background: #F5F8FB;
    border: 1px solid #E1E7EC;
    border-radius: 8px;
    min-width: 260px;
    padding: 10px 12px;
}

.lead-next-appointment span,
.lead-next-appointment strong,
.lead-next-appointment small {
    display: block;
}

.lead-last-interaction {
    color: #6B7280;
    display: block;
    margin-top: 4px;
}

.lead-actions {
    margin-bottom: 12px;
}

.lead-timeline li {
    border-left: 2px solid #DCE5EC;
    padding-left: 12px;
}

.conditional-field[hidden] {
    display: none !important;
}

.closure-blocked-note {
    color: #A13A31;
    font-size: 12.5px;
    font-weight: 700;
}

.practice-documents-table td:first-child strong,
.practice-documents-table td:first-child small {
    display: block;
}

.quote-payment-card > summary {
    color: #2C3745;
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    padding: 14px 16px;
}

@media (max-width: 620px) {
    .lead-focus-head,
    .lead-next-step {
        flex-direction: column;
    }

    .lead-next-appointment,
    .lead-actions .btn,
    .lead-actions .row-more {
        width: 100%;
    }
}

/* Precision pass 2026-07-02 - DomiQ logo, alignment, case rows */
.top-brand {
    gap: 11px;
}

.top-brand-mark,
.brand-logo-wrap {
    align-items: center;
    background: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 8px;
    display: inline-flex;
    flex: 0 0 auto;
    justify-content: center;
    overflow: hidden;
}

.top-brand-mark {
    height: 31px;
    width: 31px;
}

.top-brand-mark img {
    display: block;
    height: 25px;
    object-fit: contain;
    transform: scale(1.72);
    width: 25px;
}

.top-brand-text {
    color: #FFFFFF;
    font-size: 17px;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1;
}

.brand-logo-wrap {
    border-color: var(--cloud-line);
    border-radius: 999px;
    height: 39px;
    width: 39px;
}

.brand-logo {
    display: block;
    height: 31px;
    object-fit: contain;
    transform: scale(1.72);
    width: 31px;
}

.login-brand .brand-logo-wrap {
    height: 42px;
    width: 42px;
}

.login-brand .brand-logo {
    height: 34px;
    transform: scale(1.72);
    width: 34px;
}

.app-top-strip {
    padding-left: 14px;
    padding-right: 14px;
}

.top-strip-actions {
    gap: 7px;
}

.top-support,
.top-pill,
.top-user {
    border-radius: 4px;
    min-height: 31px;
    padding: 6px 11px;
}

.brand {
    min-height: 88px;
    padding: 17px 16px;
}

.nav-main,
.nav-group summary {
    min-height: 38px;
    padding-left: 18px;
}

.nav-group a {
    min-height: 35px;
    padding-left: 44px;
}

.content {
    padding-left: 24px;
    padding-right: 24px;
}

.topbar {
    min-height: 66px;
}

.topbar h1 {
    font-size: 25px;
    line-height: 1.08;
}

.topbar-actions .btn {
    min-width: 116px;
}

.decision-kpis .metric-card,
.cashflow-summary.decision-kpis .metric-card {
    align-content: center;
    display: grid;
    min-height: 80px;
}

.decision-kpis .metric-card span,
.cashflow-summary.decision-kpis .metric-card span {
    line-height: 1.15;
}

.decision-kpis .metric-card strong,
.cashflow-summary.decision-kpis .metric-card strong {
    line-height: 1.08;
}

.panel-head {
    align-items: center;
}

.compact-filter-bar {
    grid-template-columns: minmax(280px, 1.6fr) minmax(180px, .8fr) minmax(210px, .9fr) minmax(210px, .9fr) auto auto;
}

.compact-filter-bar input,
.compact-filter-bar select,
.compact-filter-bar .btn,
.advanced-filter-menu summary {
    min-height: 37px;
}

.case-list {
    gap: 10px;
}

.case-row-card {
    align-items: start;
    border-left-width: 4px;
    border-radius: 7px;
    gap: 9px 16px;
    grid-template-columns: minmax(390px, 1.55fr) minmax(112px, .42fr) minmax(190px, .62fr) minmax(340px, 1fr);
    min-height: 126px;
    padding: 14px 16px 13px;
}

.case-main {
    align-items: start;
    gap: 12px;
}

.case-code {
    border-radius: 8px;
    font-size: 12px;
    min-width: 58px;
    padding: 7px 10px;
    text-align: center;
}

.case-main h2 {
    font-size: 14px;
    font-weight: 850;
}

.case-main p {
    color: #687586;
    font-size: 12.5px;
    line-height: 1.32;
    max-width: 620px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.case-status {
    align-items: center;
    display: flex;
    gap: 7px;
    padding-top: 2px;
}

.case-status small {
    white-space: nowrap;
}

.case-people {
    gap: 6px;
    padding-top: 2px;
}

.case-people span {
    line-height: 1.25;
}

.case-numbers {
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(4, minmax(68px, 1fr));
    justify-self: stretch;
}

.case-numbers span,
.case-money span {
    background: #FAFBFD;
    border-color: #E3E8EF;
    border-radius: 7px;
    min-width: 0;
}

.case-numbers span {
    min-height: 52px;
    padding: 8px 10px;
}

.case-numbers strong {
    font-size: 14px;
}

.case-money {
    display: grid;
    gap: 7px;
    grid-column: 1 / 4;
    grid-template-columns: repeat(4, minmax(108px, max-content));
}

.case-money span {
    min-height: 52px;
    padding: 8px 11px;
}

.case-money small,
.case-numbers small {
    display: block;
    line-height: 1.15;
}

.case-money strong {
    font-size: 13.5px;
    white-space: nowrap;
}

.case-badges {
    align-items: center;
    grid-column: 1 / 3;
    margin-top: 2px;
}

.case-actions {
    align-items: center;
    grid-column: 3 / 5;
    justify-content: flex-end;
    margin-top: 2px;
}

.case-actions .btn.small {
    min-height: 32px;
    padding-left: 11px;
    padding-right: 11px;
}

.row-more {
    padding-left: 4px;
}

.row-more summary {
    align-items: center;
    border: 1px solid transparent;
    border-radius: 4px;
    display: inline-flex;
    min-height: 32px;
    padding: 6px 8px;
}

.row-more summary:hover {
    background: var(--cloud-blue-pale);
    border-color: #B8D6F2;
}

@media (max-width: 1280px) {
    .case-row-card {
        grid-template-columns: minmax(320px, 1.4fr) minmax(112px, .45fr) minmax(170px, .65fr);
    }

    .case-numbers {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .case-money,
    .case-badges,
    .case-actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 980px) {
    .top-brand-text {
        font-size: 15px;
    }

    .compact-filter-bar,
    .agenda-quickbar {
        grid-template-columns: 1fr;
    }

    .compact-filter-bar input,
    .compact-filter-bar select,
    .compact-filter-bar .btn,
    .advanced-filter-menu,
    .advanced-filter-menu summary {
        width: 100%;
    }

    .content {
        padding-left: 12px;
        padding-right: 12px;
    }

    .topbar {
        min-height: 0;
    }

    .case-row-card {
        grid-template-columns: 1fr;
        min-height: 0;
    }

    .case-money,
    .case-badges,
    .case-actions,
    .case-numbers {
        grid-column: 1;
    }

    .case-actions {
        justify-content: flex-start;
    }

    .case-money,
    .case-numbers {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .case-main p {
        white-space: normal;
    }
}

@media (max-width: 620px) {
    .top-brand-mark {
        height: 29px;
        width: 29px;
    }

    .top-brand-mark img {
        height: 23px;
        width: 23px;
    }

    .top-brand-text {
        max-width: 180px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .case-money,
    .case-numbers {
        grid-template-columns: 1fr 1fr;
    }
}

/* 2026-07 polish: clean B2B form/document style */
.form-editor-panel {
    background: #FFFFFF;
    border-color: #E5EAF0;
    box-shadow: 0 6px 18px rgba(34, 48, 58, 0.055);
    margin-left: auto;
    margin-right: auto;
    max-width: 980px;
    padding: 18px;
}

.refined-form {
    gap: 14px 16px;
}

.refined-form label,
.quote-form label {
    color: #656C73;
    font-size: 13px;
    font-weight: 750;
}

.refined-form input,
.refined-form select,
.refined-form textarea,
.quote-form input,
.quote-form select,
.quote-form textarea {
    background: #FFFFFF;
    border-color: #DDE4EB;
    border-radius: 7px;
    min-height: 40px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.refined-form input:focus,
.refined-form select:focus,
.refined-form textarea:focus,
.quote-form input:focus,
.quote-form select:focus,
.quote-form textarea:focus {
    border-color: #6FA8DC;
    box-shadow: 0 0 0 3px rgba(111, 168, 220, .16);
    outline: none;
}

.form-actions {
    align-items: center;
}

.quote-editor-panel {
    background: #FFFFFF;
    border-color: #E7EBF0;
    box-shadow: 0 7px 22px rgba(34, 48, 58, .055);
    padding: 18px;
}

.quote-header-grid {
    align-items: start;
    background: #FAFBFC;
    border: 1px solid #E7EBF0;
    border-radius: 9px;
    gap: 12px 14px;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    padding: 14px;
}

.quote-header-grid label {
    grid-column: span 2;
}

.quote-header-grid label.wide {
    grid-column: span 6;
}

.quote-product-list,
.quote-payment-card {
    background: #FFFFFF;
    border: 1px solid #E7EBF0;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(34, 48, 58, .045);
    margin-top: 16px;
    padding: 14px;
}

.quote-product-list .panel-head,
.quote-payment-card .panel-head {
    border-bottom: 1px solid #EEF2F5;
    margin: -2px 0 12px;
    padding-bottom: 10px;
}

.quote-product-list .panel-head h2,
.quote-payment-card .panel-head h2 {
    color: #555B61;
    font-size: 18px;
    font-weight: 800;
    text-align: center;
}

.quote-product-list table,
.quote-payment-card table {
    min-width: 920px;
}

.quote-product-list th,
.quote-payment-card th {
    background: #FFFFFF;
    border-bottom: 1px solid #E4E9EF;
    color: #6B7075;
    font-size: 12.5px;
}

.quote-product-list td,
.quote-payment-card td {
    background: #FBFCFD;
    border-bottom-color: #EEF2F5;
    padding: 9px;
}

.quote-payment-table .payment-percent-column {
    min-width: 132px;
    width: 132px;
}

.payment-percent-input {
    align-items: center;
    display: grid;
    grid-template-columns: minmax(78px, 1fr) 22px;
    min-width: 112px;
}

.payment-percent-input input {
    border-bottom-right-radius: 0;
    border-top-right-radius: 0;
    min-width: 78px;
    text-align: right;
}

.payment-percent-input > span {
    align-items: center;
    align-self: stretch;
    background: #EAF7FA;
    border: 1px solid #B9DDE4;
    border-left: 0;
    border-radius: 0 6px 6px 0;
    color: #276B78;
    display: flex;
    font-size: 13px;
    font-weight: 800;
    justify-content: center;
}

.quote-product-list tbody tr + tr td,
.quote-payment-card tbody tr + tr td {
    border-top: 1px solid #F1F4F7;
}

.quote-live-totals {
    background: #F7FAFC;
    border: 1px solid #E3E9F0;
    border-radius: 9px;
    display: grid;
    gap: 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 12px;
    overflow: hidden;
}

.quote-live-totals div {
    padding: 12px 14px;
}

.quote-live-totals div + div {
    border-left: 1px solid #E3E9F0;
}

.quote-live-totals span {
    color: #7A828B;
    display: block;
    font-size: 12px;
    font-weight: 750;
}

.quote-live-totals strong {
    color: #3D6FA8;
    display: block;
    font-size: 18px;
    margin-top: 4px;
}

.quote-notes-grid {
    background: #FAFBFC;
    border: 1px solid #E7EBF0;
    border-radius: 9px;
    margin-top: 16px;
    padding: 14px;
}

.case-numbers {
    grid-template-columns: repeat(3, minmax(68px, 1fr));
}

.danger-link,
.row-more .danger-link,
.inline-form .danger-link {
    color: var(--red);
    font-weight: 800;
}

.danger-copy {
    background: #FFF2F0;
    border: 1px solid #F3CAC4;
    border-radius: 8px;
    color: #8F2E24;
    font-size: 13px;
    margin: 0 0 12px;
    padding: 10px 12px;
}

.row-more[open] form {
    min-width: 150px;
}

.row-more form button {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    font-weight: 750;
}

.row-more.danger-zone summary,
.danger-zone summary {
    color: var(--red);
}

/* 2026-07 document mask: task, case, quote editor */
.document-editor {
    margin: 0 auto;
    max-width: 1720px;
}

.document-toolbar {
    align-items: end;
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(180px, 1fr) minmax(280px, 390px) minmax(160px, 1fr);
    margin: 2px 0 26px;
}

.document-back {
    align-items: center;
    background: #FFFFFF;
    border: 1px solid #DDE3EA;
    border-radius: 6px;
    box-shadow: 0 2px 7px rgba(34, 48, 58, .10);
    color: #5D6268;
    display: inline-flex;
    font-size: 15px;
    font-weight: 800;
    gap: 8px;
    min-height: 42px;
    padding: 0 14px;
    text-decoration: none;
    width: max-content;
}

.document-back:hover {
    background: #F8FAFC;
    color: #3D6FA8;
}

.document-selector {
    color: #7B838B;
    display: grid;
    font-size: 13px;
    font-weight: 750;
    gap: 6px;
}

.document-selector select {
    background: #FFFFFF;
    border: 1px solid #D5DCE4;
    border-radius: 7px;
    color: #4C535A;
    font-size: 16px;
    min-height: 43px;
    padding: 0 12px;
}

.document-number {
    color: #9AA1A8;
    font-size: 20px;
    justify-self: center;
    padding-bottom: 8px;
}

.document-number strong {
    color: #5A6066;
    font-weight: 700;
}

.document-form {
    align-items: start;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(280px, .9fr) minmax(430px, 1.15fr) minmax(300px, .95fr);
}

.document-form > * {
    min-width: 0;
}

.document-card,
.document-summary {
    background: #FFFFFF;
    border: 1px solid #E2E7ED;
    border-radius: 11px;
    box-shadow: 0 3px 10px rgba(34, 48, 58, .055);
    min-width: 0;
    padding: 14px;
}

.document-card h2,
.document-summary h2 {
    color: #5B6065;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.15;
    margin: 0 0 10px;
    text-align: center;
}

.document-card-grid {
    display: grid;
    gap: 10px 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.document-card-grid.single {
    grid-template-columns: 1fr;
}

.document-card label,
.document-summary label,
.document-form label {
    color: #666C72;
    font-size: 12.5px;
    font-weight: 780;
}

.document-card input,
.document-card select,
.document-card textarea,
.document-form input,
.document-form select,
.document-form textarea {
    background: #FFFFFF;
    border: 1px solid #DDE4EB;
    border-radius: 7px;
    color: #41474D;
    min-height: 39px;
}

.document-card textarea,
.document-form textarea {
    min-height: 84px;
}

.document-card input:focus,
.document-card select:focus,
.document-card textarea:focus,
.document-form input:focus,
.document-form select:focus,
.document-form textarea:focus {
    border-color: #6FA8DC;
    box-shadow: 0 0 0 3px rgba(111, 168, 220, .16);
    outline: none;
}

.document-card details,
.document-card-side details,
.task-document-options details {
    background: #FBFBFC;
    border: 1px solid #E7EBF0;
    border-radius: 10px;
    box-shadow: 0 2px 7px rgba(34, 48, 58, .035);
    padding: 0;
}

.document-card details + details,
.document-card-side details + details,
.task-document-options details + details {
    margin-top: 10px;
}

.document-card summary,
.document-card-side summary,
.task-document-options summary {
    color: #5A5F64;
    cursor: pointer;
    font-size: 16px;
    font-weight: 800;
    list-style: none;
    padding: 13px 16px;
    text-align: center;
}

.document-card details[open] summary,
.document-card-side details[open] summary,
.task-document-options details[open] summary {
    border-bottom: 1px solid #EAEFF3;
    margin-bottom: 12px;
}

.document-card details > .document-card-grid,
.document-card-side details > .document-card-grid,
.task-document-options details > div,
.quote-document-options details > label,
.quote-document-options details > p {
    margin: 0 14px 14px;
}

.document-card-wide {
    grid-column: 1 / span 2;
}

.document-summary {
    grid-column: 3;
}

.document-summary dl {
    display: grid;
    gap: 12px;
    margin: 0 0 20px;
}

.document-summary dl div {
    align-items: baseline;
    display: flex;
    justify-content: space-between;
    gap: 14px;
}

.document-summary dt {
    color: #8A9299;
    font-weight: 700;
}

.document-summary dd {
    color: #3D6FA8;
    font-size: 18px;
    font-weight: 800;
    margin: 0;
    text-align: right;
}

.document-summary-actions {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
}

.document-summary-actions .btn {
    justify-content: center;
    width: 100%;
}

.case-document-form .document-card-side {
    grid-column: 3;
    grid-row: 1 / span 2;
}

.case-document-form .document-summary {
    grid-column: 3;
}

.quote-document-form .quote-document-client {
    grid-column: 1;
}

.quote-document-form .quote-document-data {
    grid-column: 2;
}

.quote-document-form .quote-document-options {
    grid-column: 3;
}

.quote-document-data .wide,
.quote-document-options label {
    margin-top: 10px;
}

.quote-document-form .quote-product-list,
.quote-document-form .quote-payment-card,
.quote-document-form .quote-notes-grid {
    grid-column: 1 / span 2;
    min-width: 0;
}

.quote-document-form .quote-product-list {
    margin-top: 22px;
}

.quote-document-form .quote-payment-card,
.quote-document-form .quote-notes-grid {
    margin-top: 0;
}

.quote-document-options .muted {
    color: #8A9299;
    font-size: 13px;
}

.task-document-card {
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
}

.task-document-card .task-form-hint {
    background: #FFFFFF;
    border: 1px solid #E2E7ED;
    border-radius: 10px;
    box-shadow: 0 3px 10px rgba(34, 48, 58, .045);
    grid-column: 1 / -1;
    margin: 0;
    padding: 12px 14px;
}

.task-document-card .task-form-compact {
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(280px, .9fr) minmax(430px, 1.15fr) minmax(300px, .95fr);
}

.task-document-card .task-title-field,
.task-document-card .task-link-box,
.task-document-card .task-core-grid,
.task-document-card .duration-chip-strip,
.task-document-card .task-preset-menu,
.task-document-card .task-advanced,
.task-document-card .task-form-footer {
    background: #FFFFFF;
    border: 1px solid #E2E7ED;
    border-radius: 11px;
    box-shadow: 0 3px 10px rgba(34, 48, 58, .055);
    min-width: 0;
    padding: 14px;
}

.task-document-card .task-title-field,
.task-document-card .task-link-box {
    grid-column: 1;
}

.task-document-card .task-title-field::before {
    color: #5B6065;
    content: "Attivita";
    display: block;
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 10px;
    text-align: center;
}

.task-document-card .task-core-grid {
    grid-column: 2;
    grid-row: 1 / span 2;
}

.task-document-card .task-core-grid::before {
    color: #5B6065;
    content: "Dati task";
    display: block;
    font-size: 17px;
    font-weight: 800;
    grid-column: 1 / -1;
    margin-bottom: 0;
    text-align: center;
}

.task-document-card .duration-chip-strip,
.task-document-card .task-preset-menu {
    grid-column: 3;
}

.task-document-card .task-advanced {
    grid-column: 1 / span 2;
}

.task-document-card .task-form-footer {
    align-self: start;
    display: grid;
    gap: 16px;
    grid-column: 3;
    grid-row: 3 / span 2;
}

.task-document-card .task-total {
    background: transparent;
    border: 0;
    padding: 0;
}

.task-document-card .task-core-grid {
    align-content: start;
    gap: 12px 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-document-card .task-core-grid label,
.task-document-card .task-title-field,
.task-document-card .task-link-box {
    min-width: 0;
}

.task-document-card .task-core-grid input,
.task-document-card .task-core-grid select,
.task-document-card .task-title-field input,
.task-document-card .task-link-box input,
.task-document-card .task-link-box select {
    box-sizing: border-box;
    width: 100%;
}

.task-document-card .task-core-grid label:nth-child(1),
.task-document-card .task-core-grid label:nth-child(2) {
    grid-column: auto;
}

.task-document-card .duration-chip-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.task-document-card .duration-chip-strip button {
    border-radius: 5px;
    justify-content: center;
    width: 100%;
}

@media (min-width: 981px) and (max-width: 1360px) {
    .task-document-card .task-form-compact {
        grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
    }

    .task-document-card .task-title-field,
    .task-document-card .task-link-box {
        grid-column: 1;
    }

    .task-document-card .task-core-grid {
        grid-column: 2;
        grid-row: 1 / span 2;
    }

    .task-document-card .task-priority-fields,
    .task-document-card .task-advanced,
    .task-document-card .task-form-footer {
        grid-column: 1 / -1;
        grid-row: auto;
        min-width: 0;
    }

    .task-document-card .duration-chip-strip {
        grid-column: 1;
    }

    .task-document-card .task-preset-menu {
        grid-column: 2;
    }

    .task-document-card .task-form-footer {
        align-items: center;
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

.agenda-calendar-focus .calendar-event.planned {
    background: #1A73E8;
    border-color: #185ABC;
    border-left-color: #0B57D0;
    color: #FFFFFF;
}

.agenda-calendar-focus .calendar-event.done {
    background: #188038;
    border-color: #137333;
    border-left-color: #0B6B2B;
    color: #FFFFFF;
}

.agenda-calendar-focus .calendar-event.missed {
    background: #D93025;
    border-color: #B3261E;
    border-left-color: #A50E0E;
    color: #FFFFFF;
}

.agenda-calendar-focus .calendar-event.planned span,
.agenda-calendar-focus .calendar-event.planned small,
.agenda-calendar-focus .calendar-event.planned em,
.agenda-calendar-focus .calendar-event.done span,
.agenda-calendar-focus .calendar-event.done small,
.agenda-calendar-focus .calendar-event.done em,
.agenda-calendar-focus .calendar-event.missed span,
.agenda-calendar-focus .calendar-event.missed small,
.agenda-calendar-focus .calendar-event.missed em {
    color: rgba(255, 255, 255, .88);
}

@media (max-width: 980px) {
    .document-toolbar,
    .document-form,
    .task-document-card .task-form-compact {
        grid-template-columns: 1fr;
    }

    .document-toolbar {
        align-items: stretch;
        gap: 12px;
        margin-bottom: 16px;
    }

    .document-back {
        width: 100%;
    }

    .document-number {
        justify-self: start;
        padding-bottom: 0;
    }

    .document-card,
    .document-summary,
    .document-card-wide,
    .case-document-form .document-card-side,
    .case-document-form .document-summary,
    .quote-document-form .quote-document-client,
    .quote-document-form .quote-document-data,
    .quote-document-form .quote-document-options,
    .quote-document-form .quote-product-list,
    .quote-document-form .quote-payment-card,
    .quote-document-form .quote-notes-grid,
    .task-document-card .task-title-field,
    .task-document-card .task-link-box,
    .task-document-card .task-core-grid,
    .task-document-card .duration-chip-strip,
    .task-document-card .task-preset-menu,
    .task-document-card .task-advanced,
    .task-document-card .task-form-footer {
        grid-column: 1;
        grid-row: auto;
    }

    .document-card-grid {
        grid-template-columns: 1fr;
    }

    .quote-header-grid {
        grid-template-columns: 1fr;
    }

    .quote-header-grid label,
    .quote-header-grid label.wide {
        grid-column: 1;
    }

    .quote-live-totals {
        grid-template-columns: 1fr;
    }

    .quote-live-totals div + div {
        border-left: 0;
        border-top: 1px solid #E3E9F0;
    }
}

/* 2026-07 practice simplification: few operational data, clear task menu */
.practice-list-simple {
    gap: 8px;
}

.practice-row.case-row-card {
    align-items: center;
    grid-template-columns: minmax(260px, 1.35fr) minmax(118px, .55fr) minmax(260px, 1.2fr) minmax(210px, .9fr) minmax(150px, .65fr);
    min-height: 0;
    padding: 12px 14px;
}

.practice-row-main h2 {
    font-size: 14px;
    margin: 0;
}

.practice-row-main p {
    color: #718093;
    font-size: 12px;
    margin-top: 3px;
    max-width: 420px;
}

.practice-row-status,
.practice-row-next,
.practice-row-owner {
    min-width: 0;
}

.practice-row-status {
    display: grid;
    gap: 4px;
}

.practice-row-status small,
.practice-row-next span,
.practice-row-owner span,
.practice-row-metrics small {
    color: #7B8794;
    display: block;
    font-size: 11px;
    line-height: 1.2;
}

.practice-row-next strong,
.practice-row-owner strong {
    color: #2B3440;
    display: block;
    font-size: 13px;
    line-height: 1.25;
    margin-top: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.practice-row-next.missing strong {
    color: #A46A00;
}

.practice-row-metrics {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.practice-row-metrics span {
    background: #FAFBFD;
    border: 1px solid #E4E9F0;
    border-radius: 7px;
    min-width: 0;
    padding: 7px 9px;
}

.practice-row-metrics strong {
    color: #2D5B93;
    display: block;
    font-size: 14px;
    line-height: 1.1;
}

.practice-row-metrics .danger strong {
    color: var(--red);
}

.practice-row-badges {
    grid-column: 1 / 4;
    margin-top: 0;
}

.practice-row-actions {
    grid-column: 4 / 6;
    justify-content: flex-end;
    margin-top: 0;
}

.practice-focus {
    display: grid;
    gap: 14px;
}

.practice-focus-compact {
    gap: 12px;
}

.practice-compact-stack {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.practice-details-compact,
.practice-details-compact > .table-wrap {
    min-width: 0;
    max-width: 100%;
}

.practice-focus-grid-lean {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.section-inline-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
    margin: -4px 0 8px;
}

.phase-value-note {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    margin-right: auto;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8fafc;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.phase-value-note.ok {
    color: var(--green);
    background: #eef9f3;
    border-color: #cfeadb;
}

.phase-value-note.warning,
.compact-warning {
    color: #8a5b00;
    background: #fff7df;
    border-color: #f5d991;
}

.compact-warning {
    margin: 0 0 12px;
    padding: 8px 10px;
    border: 1px solid #f5d991;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.inline-action-form {
    display: inline-flex;
    margin: 0;
}

.btn.success,
button.success {
    background: #1F8A5B;
    border-color: #1F8A5B;
    color: #FFFFFF;
}

.practice-focus-head,
.practice-section-head {
    align-items: flex-start;
    display: flex;
    gap: 14px;
    justify-content: space-between;
}

.practice-title {
    align-items: center;
    display: flex;
    gap: 12px;
    min-width: 0;
}

.practice-title h2,
.practice-section-head h2 {
    color: #222A35;
    font-size: 17px;
    line-height: 1.15;
    margin: 0;
}

.practice-eyebrow {
    color: #7B8794;
    display: block;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1.2;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.practice-title p,
.practice-section-head p {
    color: #738092;
    font-size: 12.5px;
    margin: 4px 0 0;
}

.practice-alerts {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.practice-focus-grid,
.practice-status-grid,
.practice-hours-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.practice-focus-card,
.practice-status-grid > div,
.practice-hours-grid > article {
    background: #FAFBFD;
    border: 1px solid #E3E8EF;
    border-radius: 8px;
    min-width: 0;
    padding: 12px;
}

.practice-focus-card.warning,
.practice-task-item.danger {
    border-left: 4px solid var(--yellow);
}

.practice-focus-card.danger {
    border-left: 4px solid var(--red);
}

.practice-focus-card span,
.practice-status-grid span,
.practice-hours-grid span {
    color: #718093;
    display: block;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
    text-transform: uppercase;
}

.practice-focus-card strong,
.practice-status-grid strong,
.practice-hours-grid strong {
    color: #2B3440;
    display: block;
    font-size: 16px;
    line-height: 1.2;
    margin-top: 5px;
    overflow-wrap: anywhere;
}

.practice-focus-card small {
    color: #7B8794;
    display: block;
    font-size: 11.5px;
    margin-top: 5px;
}

.practice-section-menu {
    align-items: center;
    border-top: 1px solid #E6EBF1;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-top: 12px;
}

.practice-section-menu a {
    background: #F6F9FC;
    border: 1px solid #E0E7EF;
    border-radius: 7px;
    color: #526173;
    font-size: 12.5px;
    font-weight: 800;
    padding: 7px 10px;
    text-decoration: none;
}

.practice-section-menu a:hover {
    background: #EAF7FA;
    border-color: #B7DDE5;
    color: var(--teal);
}

.practice-section {
    scroll-margin-top: 88px;
}

.practice-two-columns {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 12px;
}

.practice-details-compact {
    border-top: 1px solid #E6EBF1;
    margin-top: 12px;
    padding: 12px 0 0;
}

.practice-details-compact summary {
    color: #374151;
    font-size: 13px;
}

.practice-task-list {
    display: grid;
    gap: 8px;
}

.practice-task-item {
    align-items: center;
    background: #FFFFFF;
    border: 1px solid #E4E9F0;
    border-radius: 8px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(280px, 1.3fr) minmax(280px, 1fr) auto;
    padding: 10px 12px;
}

.practice-task-main {
    align-items: center;
    display: flex;
    gap: 10px;
    min-width: 0;
}

.practice-task-main h3 {
    color: #273140;
    font-size: 13.5px;
    line-height: 1.2;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.practice-task-main p {
    color: #7B8794;
    font-size: 12px;
    margin: 3px 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.practice-task-meta {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.practice-task-meta span {
    background: #FAFBFD;
    border: 1px solid #E6EBF1;
    border-radius: 7px;
    min-width: 0;
    padding: 6px 8px;
}

.practice-task-meta strong {
    color: #2B3440;
    display: block;
    font-size: 12.5px;
    line-height: 1.15;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.practice-task-meta small {
    color: #7B8794;
    display: block;
    font-size: 10.5px;
    margin-top: 2px;
}

.practice-task-menu {
    justify-self: end;
    padding-left: 0;
}

.practice-task-menu summary {
    white-space: nowrap;
}

.practice-danger-row {
    border-top: 1px solid #E6EBF1;
    margin: 14px 0 0;
    padding-top: 14px;
}

.dcoin-inline {
    background: url("../img/dcoin.svg") center / contain no-repeat;
    display: inline-block;
    height: 18px;
    margin-right: 5px;
    vertical-align: -3px;
    width: 18px;
}

.dcoin-badge {
    align-items: center;
    background: #FFF8E3;
    border: 1px solid #E8C46F;
    border-radius: 999px;
    color: #7A5412;
    display: inline-flex;
    font-size: 12.5px;
    font-weight: 700;
    gap: 2px;
    line-height: 1;
    padding: 5px 9px;
    white-space: nowrap;
}

.dcoin-badge .dcoin-inline {
    height: 15px;
    margin-right: 2px;
    width: 15px;
}

.muted-inline {
    color: #7B8794;
    font-size: 11.5px;
    font-weight: 600;
}

.dcoin-goal-panel {
    border-left: 4px solid #D6A43D;
}

.dcoin-goal-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dcoin-goal-grid article {
    background: #FAFBFD;
    border: 1px solid #E6EBF1;
    border-radius: 8px;
    padding: 12px;
}

.dcoin-goal-grid span,
.dcoin-goal-grid small {
    color: #7B8794;
    display: block;
    font-size: 12px;
}

.dcoin-goal-grid strong {
    color: #263241;
    display: block;
    font-size: 18px;
    margin-top: 4px;
}

@media (max-width: 1280px) {
    .practice-row.case-row-card {
        grid-template-columns: minmax(260px, 1.2fr) minmax(110px, .55fr) minmax(240px, 1fr);
    }

    .practice-row-metrics,
    .practice-row-owner,
    .practice-row-badges,
    .practice-row-actions {
        grid-column: 1 / -1;
    }

    .practice-row-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 980px) {
    .practice-row.case-row-card,
    .practice-task-item {
        grid-template-columns: 1fr;
    }

    .practice-focus-head,
    .practice-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .practice-focus-grid,
    .practice-status-grid,
    .practice-hours-grid,
    .practice-two-columns,
    .dcoin-goal-grid {
        grid-template-columns: 1fr;
    }

    .practice-task-meta,
    .practice-row-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .practice-task-menu {
        justify-self: start;
    }
}

@media (max-width: 620px) {
    .form-checklist {
        grid-template-columns: 1fr;
    }

    .compact-context-summary,
    .practice-team-line {
        align-items: flex-start;
        flex-direction: column;
    }

    .practice-row-metrics,
    .practice-task-meta {
        grid-template-columns: 1fr;
    }

    .practice-section-menu a,
    .practice-section-head .btn,
    .practice-section-head .inline-actions {
        width: 100%;
    }
}
.pagination-bar {
    align-items: center;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 14px;
    padding-top: 12px;
}

.pagination-bar span {
    color: var(--muted);
    font-size: 13px;
}

/* Sprint 7A: sistema visivo DomiQ canonico */
:root {
    --teal-dark: var(--domiq-primary-strong);
    --color-primary: var(--domiq-primary);
    --color-primary-hover: var(--domiq-primary-strong);
    --color-bg: var(--domiq-canvas);
    --color-card: var(--domiq-surface);
    --color-border: var(--domiq-border);
    --color-text: var(--domiq-text);
    --color-muted: var(--domiq-muted);
    --cloud-blue: var(--domiq-primary);
    --cloud-blue-dark: var(--domiq-primary-strong);
    --cloud-blue-soft: #D8EEF2;
    --cloud-blue-pale: var(--domiq-primary-soft);
    --cloud-page: var(--domiq-canvas);
    --cloud-sidebar: #FFFFFF;
    --cloud-line: var(--domiq-border);
    --cloud-line-soft: var(--domiq-border-soft);
    --cloud-text: var(--domiq-text);
    --cloud-muted: var(--domiq-muted);
    --cloud-green: var(--domiq-success);
    --cloud-green-soft: #EAF6EF;
    --cloud-red: var(--domiq-danger);
    --cloud-red-soft: #FCEDEB;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
    outline: 3px solid rgba(0, 111, 131, .32);
    outline-offset: 2px;
}

.btn.primary,
.btn-primary,
button.btn.primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #FFFFFF;
}

.nav-main.active,
.nav a.active,
.nav summary.active {
    color: var(--teal-dark);
}

.list-result-count {
    color: var(--muted);
    font-size: 12.5px;
    margin: -4px 0 10px;
}

.people-picker {
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 0;
    padding: 10px;
}

.people-picker legend {
    color: var(--gray);
    font-size: 12px;
    font-weight: 800;
    padding: 0 4px;
}

.people-picker-controls {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) minmax(110px, .45fr);
}

.people-picker-controls label {
    color: var(--muted);
    display: grid;
    font-size: 11px;
    gap: 4px;
    min-width: 0;
}

.people-picker-controls input,
.people-picker-controls select {
    min-width: 0;
    width: 100%;
}

.people-picker-source {
    margin-top: 8px;
    min-height: 130px;
    width: 100%;
}

.people-picker.is-enhanced .people-picker-source {
    height: 1px;
    left: -10000px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    width: 1px;
}

.people-picker-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
    min-height: 30px;
}

.person-chip {
    background: #EAF7FA;
    border: 1px solid #A9DCE5;
    border-radius: 999px;
    color: var(--teal-dark);
    cursor: pointer;
    font: inherit;
    font-size: 11.5px;
    font-weight: 750;
    min-height: 30px;
    padding: 5px 9px;
}

.people-picker-selected.static .person-chip {
    cursor: default;
}

.people-picker-results {
    border-top: 1px solid var(--border);
    display: grid;
    gap: 4px;
    margin-top: 8px;
    max-height: 230px;
    overflow-y: auto;
    padding-top: 8px;
}

.people-result {
    align-items: center;
    background: #FFFFFF;
    border: 1px solid transparent;
    border-radius: 6px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    font: inherit;
    justify-content: space-between;
    min-height: 40px;
    padding: 7px 9px;
    text-align: left;
}

.people-result:hover,
.people-result:focus-visible {
    background: #ECF8FA;
    border-color: #A9DCE5;
}

.people-result small,
.people-picker-help,
.people-picker-empty {
    color: var(--muted);
    font-size: 11px;
}

.people-picker-help {
    margin: 7px 0 0;
}

.people-picker-empty {
    align-self: center;
    padding: 6px;
}

.agenda-person-filter {
    display: grid;
    gap: 5px;
    grid-template-columns: minmax(105px, .75fr) minmax(150px, 1.25fr);
    min-width: 0;
    width: 100%;
}

.agenda-person-filter input,
.agenda-person-filter select {
    min-width: 0;
    width: 100%;
}

.agenda-quickbar:has(.agenda-person-filter) {
    grid-template-columns: minmax(130px, .5fr) minmax(190px, 1fr) minmax(285px, 1.25fr) minmax(145px, .7fr) auto auto;
}

.agenda-filters.compact-filter-bar {
    display: block;
}

.agenda-filters .agenda-quickbar {
    width: 100%;
}

.agenda-quickbar .compact-filter-submit {
    min-width: 68px;
    white-space: nowrap;
}

.task-list-app {
    grid-template-columns: minmax(0, 1fr);
}

.task-list-app:has(.task-detail-panel:not([hidden])) {
    grid-template-columns: minmax(0, 1fr) 340px;
}

.task-list-filters {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 6px;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(150px, .7fr)) auto;
    margin-bottom: 10px;
    padding: 10px;
}

.scope-tabs {
    display: inline-flex;
    gap: 4px;
}

.scope-tabs a {
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-size: 12.5px;
    font-weight: 800;
    min-height: 36px;
    padding: 8px 12px;
}

.scope-tabs a.active {
    background: #ECF8FA;
    border-color: #A9DCE5;
    color: var(--teal-dark);
}

.task-section-stack {
    display: grid;
    gap: 8px;
}

.task-list-section {
    background: #FFFFFF;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
}

.task-list-section > summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    list-style: none;
    min-height: 52px;
    padding: 9px 12px;
}

.task-list-section > summary::-webkit-details-marker {
    display: none;
}

.task-list-section > summary h3 {
    font-size: 14px;
    margin: 0;
}

.task-list-section > summary span {
    color: var(--muted);
    display: block;
    font-size: 11px;
    margin-top: 2px;
}

.task-list-section > summary b {
    background: #EEF3F8;
    border-radius: 999px;
    color: #4A5A69;
    font-size: 11px;
    min-width: 28px;
    padding: 3px 7px;
    text-align: center;
}

.task-list-section.state-rossi > summary {
    box-shadow: inset 4px 0 0 #C0392B;
}

.task-list-section.state-oggi > summary {
    box-shadow: inset 4px 0 0 var(--color-primary);
}

.task-section-list {
    border-top: 1px solid var(--border);
    display: grid;
    gap: 5px;
    padding: 7px;
}

.task-section-list .task-board-item {
    align-items: center;
    grid-template-columns: 20px minmax(0, 1fr) auto;
}

.task-section-list .task-board-badges {
    grid-column: 3;
    justify-content: flex-end;
}

.calendar-day-head.is-today {
    background: #DDF2F6;
    box-shadow: inset 0 -3px 0 var(--color-primary);
}

.calendar-day-col.is-today {
    background: #F8FCFD;
}

.calendar-day-head.is-past,
.calendar-day-col.is-past {
    background: #F2F4F6;
}

.event-kind-label {
    background: rgba(255, 255, 255, .2);
    border-radius: 3px;
    color: inherit;
    display: inline-flex;
    font-size: 9px;
    font-style: normal;
    font-weight: 850;
    margin-top: 2px;
    padding: 1px 4px;
}

.agenda-mobile-day {
    display: none;
}

@media (max-width: 900px) {
    .task-list-app,
    .task-list-app:has(.task-detail-panel:not([hidden])) {
        grid-template-columns: 1fr;
    }

    .task-list-filters {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 720px) {
    .btn,
    button.btn,
    .scope-tabs a,
    .people-result,
    .person-chip,
    .nav a,
    .nav summary {
        min-height: 44px;
    }

    .people-picker-controls,
    .agenda-person-filter,
    .task-list-filters {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .scope-tabs,
    .scope-tabs a {
        width: 100%;
    }

    .scope-tabs a {
        text-align: center;
    }

    .task-section-list .task-board-item {
        align-items: start;
        grid-template-columns: 20px minmax(0, 1fr);
        min-height: 68px;
    }

    .task-section-list .task-board-badges {
        grid-column: 2;
        justify-content: flex-start;
    }

    .agenda-all-day-grid,
    .agenda-desktop-calendar {
        display: none;
    }

    .agenda-mobile-day {
        display: grid;
        gap: 10px;
    }

    .agenda-mobile-day-head {
        align-items: center;
        background: #F8FAFC;
        border: 1px solid var(--border);
        border-radius: 8px;
        display: grid;
        grid-template-columns: 44px 1fr 44px;
        min-height: 58px;
        padding: 6px;
        text-align: center;
    }

    .agenda-mobile-day-head strong,
    .agenda-mobile-day-head span {
        display: block;
    }

    .agenda-mobile-day-head strong {
        font-size: 14px;
    }

    .agenda-mobile-day-head span {
        color: var(--muted);
        font-size: 12px;
    }

    .agenda-mobile-day-head .icon-btn {
        align-items: center;
        display: inline-flex;
        height: 44px;
        justify-content: center;
        width: 44px;
    }

    .agenda-mobile-timeline {
        display: grid;
        gap: 7px;
    }

    .agenda-mobile-event {
        align-items: center;
        background: #1A73E8;
        border: 0;
        border-left: 6px solid #0B57D0;
        border-radius: 7px;
        color: #FFFFFF;
        display: grid;
        gap: 9px;
        grid-template-columns: 48px minmax(0, 1fr) auto;
        min-height: 64px;
        padding: 9px;
        text-align: left;
        width: 100%;
    }

    .agenda-mobile-event.done {
        background: #188038;
        border-left-color: #0B6B2B;
    }

    .agenda-mobile-event.missed {
        background: #D93025;
        border-left-color: #A50E0E;
    }

    .agenda-mobile-event time,
    .agenda-mobile-event strong,
    .agenda-mobile-event small {
        display: block;
    }

    .agenda-mobile-event time,
    .agenda-mobile-event i {
        font-size: 11px;
        font-style: normal;
        font-weight: 850;
    }

    .agenda-mobile-event strong {
        font-size: 13px;
    }

    .agenda-mobile-event small {
        color: rgba(255,255,255,.9);
        font-size: 11px;
        margin-top: 2px;
    }

    .agenda-viewline {
        overflow-x: auto;
    }

    .agenda-viewline a {
        flex: 0 0 auto;
        min-height: 44px;
    }

    .table-wrap table.responsive-list,
    .panel > .table-wrap > table {
        min-width: 0;
    }

    .panel > .table-wrap > table thead {
        display: none;
    }

    .panel > .table-wrap > table,
    .panel > .table-wrap > table tbody,
    .panel > .table-wrap > table tr,
    .panel > .table-wrap > table td {
        display: block;
        width: 100%;
    }

    .panel > .table-wrap > table tr {
        border: 1px solid var(--border);
        border-radius: 7px;
        margin-bottom: 8px;
        padding: 8px;
    }

    .panel > .table-wrap > table td {
        border: 0;
        min-height: 34px;
        padding: 5px 4px;
    }

    .panel > .table-wrap > table td[data-label]::before {
        color: var(--muted);
        content: attr(data-label);
        display: block;
        font-size: 10.5px;
        font-weight: 800;
        text-transform: uppercase;
    }
}

@media (max-width: 980px) {
    .agenda-quickbar,
    .agenda-quickbar:has(.agenda-person-filter) {
        grid-template-columns: minmax(0, 1fr);
    }

    .agenda-quickbar > *,
    .agenda-person-filter {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 720px) {
    .top-brand,
    .hamburger,
    .agenda-header-actions .btn,
    .agenda-quickbar > input:not([type="hidden"]),
    .agenda-quickbar > select,
    .agenda-quickbar > button,
    .agenda-quickbar > .btn.compact-filter-submit,
    .agenda-advanced-filters > summary,
    .agenda-person-filter input,
    .agenda-person-filter select,
    .agenda-advanced-grid input:not([type="checkbox"]),
    .agenda-advanced-grid select,
    .task-list-filters input,
    .task-list-filters select,
    .task-list-filters button,
    .pagination-bar .btn {
        min-height: 44px;
    }

    .agenda-advanced-grid .checkline input[type="checkbox"] {
        flex: 0 0 18px;
        height: 18px;
        min-height: 18px;
        width: 18px;
    }

    .panel > .table-wrap > table td.row-actions {
        align-items: center;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: flex-start;
        min-height: 44px;
        text-align: left;
    }

    .panel > .table-wrap > table td.row-actions::before {
        flex: 0 0 100%;
    }

    .panel > .table-wrap > table td.row-actions > a,
    .panel > .table-wrap > table td.row-actions > form,
    .panel > .table-wrap > table td.row-actions > details {
        flex: 0 0 auto;
        width: auto;
    }

    .panel > .table-wrap > table td.row-actions > a,
    .panel > .table-wrap > table td.row-actions > details > summary,
    .panel > .table-wrap > table td.row-actions > form button {
        align-items: center;
        display: inline-flex;
        min-height: 44px;
        padding: 8px 10px;
    }

    .quote-product-list .table-wrap,
    .quote-payment-card .table-wrap {
        overflow: visible;
    }

    .quote-product-list table,
    .quote-product-list tbody,
    .quote-product-list tr,
    .quote-payment-card .table-wrap.compact table,
    .quote-payment-card tbody,
    .quote-payment-card tr {
        display: block;
        min-width: 0;
        width: 100%;
    }

    .quote-product-list thead,
    .quote-payment-card thead {
        display: none;
    }

    .quote-product-list tbody tr,
    .quote-payment-card tbody tr {
        background: #FBFCFD;
        border: 1px solid var(--border);
        border-radius: 7px;
        margin-bottom: 10px;
        padding: 8px;
    }

    .quote-product-list td:not(.hidden-cell),
    .quote-payment-card td {
        background: transparent;
        border: 0;
        display: block;
        padding: 5px 3px;
        width: 100%;
    }

    .quote-product-list td:not(.hidden-cell)::before,
    .quote-payment-card td::before {
        color: var(--muted);
        display: block;
        font-size: 10.5px;
        font-weight: 800;
        margin-bottom: 4px;
        text-transform: uppercase;
    }

    .quote-product-list td:nth-child(2)::before { content: "Descrizione"; }
    .quote-product-list td:nth-child(3)::before { content: "Quantita"; }
    .quote-product-list td:nth-child(4)::before { content: "Prezzo unitario"; }
    .quote-product-list td:nth-child(5)::before { content: "IVA"; }
    .quote-payment-card td:nth-child(1)::before { content: "Descrizione quota"; }
    .quote-payment-card td:nth-child(2)::before { content: "Percentuale"; }
    .quote-payment-card td:nth-child(3)::before { content: "Importo fisso"; }
    .quote-payment-card td:nth-child(4)::before { content: "Importo calcolato"; }
    .quote-payment-card td:nth-child(5)::before { content: "Data prevista"; }
    .quote-payment-card td:nth-child(6)::before { content: "Stato"; }
    .quote-payment-card td:nth-child(7)::before { content: "Incassato"; }
    .quote-payment-card td:nth-child(8)::before { content: "Data incasso"; }
    .quote-payment-card td:nth-child(9)::before { content: "Note"; }

    .quote-product-list td input,
    .quote-product-list td textarea,
    .quote-payment-card td input,
    .quote-payment-card td select {
        min-height: 44px;
        width: 100%;
    }

    .quote-payment-table .payment-percent-column {
        min-width: 0;
        width: 100%;
    }

    .payment-percent-input {
        grid-template-columns: minmax(0, 1fr) 38px;
        min-width: 0;
        width: 100%;
    }

    .quote-product-list td:last-child,
    .quote-payment-card td:last-child {
        align-items: center;
        display: flex;
        justify-content: flex-end;
    }

    .quote-product-list .icon-btn,
    .quote-payment-card .icon-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .people-picker-controls input,
    .people-picker-controls select {
        min-height: 44px;
    }

    main .filters input:not([type="hidden"]),
    main .filters select,
    main .filters button {
        min-height: 44px;
    }

    .practice-details-compact .table-wrap:has(.practice-phases-table) {
        overflow: visible;
    }

    .practice-details-compact .table-wrap.compact .practice-phases-table,
    .practice-phases-table tbody,
    .practice-phases-table tr {
        display: block;
        min-width: 0;
        width: 100%;
    }

    .practice-phases-table thead {
        display: none;
    }

    .practice-phases-table tbody tr {
        background: #FFFFFF;
        border: 1px solid var(--border);
        border-radius: 7px;
        margin-bottom: 10px;
        padding: 9px;
    }

    .practice-phases-table td {
        background: transparent;
        border: 0;
        display: block;
        min-height: 0;
        padding: 5px 3px;
        width: 100%;
    }

    .practice-phases-table td[data-label]::before {
        color: var(--muted);
        content: attr(data-label);
        display: block;
        font-size: 10.5px;
        font-weight: 800;
        margin-bottom: 3px;
        text-transform: uppercase;
    }

    .practice-phases-table td.row-actions {
        align-items: center;
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        justify-content: flex-start;
    }

    .practice-phases-table td.row-actions::before {
        flex: 0 0 100%;
    }

    .practice-phases-table td.phase-order-cell {
        align-items: center;
        display: flex;
        gap: 10px;
        text-align: left;
    }

    .practice-phases-table td.phase-order-cell::before {
        display: inline;
        margin: 0;
    }

    .practice-details-compact > .section-inline-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .practice-details-compact > .section-inline-actions .phase-value-note {
        display: block;
        margin-right: 0;
        width: 100%;
    }

    .practice-details-compact > .section-inline-actions .btn {
        width: 100%;
    }
}

@media (max-width: 1280px) {
    .compact-filter-bar:not(.agenda-filters) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .document-form {
        grid-template-columns: minmax(0, 1fr);
    }

    .quote-document-form .quote-document-client,
    .quote-document-form .quote-document-data,
    .quote-document-form .quote-document-options,
    .quote-document-form .quote-product-list,
    .quote-document-form .quote-payment-card,
    .quote-document-form .quote-notes-grid,
    .case-document-form .document-card,
    .case-document-form .document-card-side,
    .case-document-form .document-summary {
        grid-column: 1;
        grid-row: auto;
    }
}

@media (max-width: 980px) {
    .compact-filter-bar:not(.agenda-filters) {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 900px) {
    .production-load-grid .table-wrap.compact table {
        min-width: 0;
        width: 100%;
    }
}

@media (max-width: 720px) {
    main .btn {
        min-height: 44px;
    }

    main .compact-filter-bar .btn,
    main .task-list-filters .btn {
        min-height: 44px;
    }
}

/* Fondazioni e componenti condivisi */
.sr-only {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

body {
    background: var(--domiq-canvas);
    color: var(--domiq-text);
    font-size: 13.5px;
    line-height: 1.45;
}

a {
    color: var(--domiq-primary-strong);
}

.app-shell {
    background: var(--domiq-canvas);
    grid-template-columns: 228px minmax(0, 1fr);
    grid-template-rows: 44px minmax(0, 1fr);
}

.app-top-strip {
    background: var(--domiq-primary);
    box-shadow: none;
    min-height: 44px;
    padding: 0 14px;
}

.top-brand-mark {
    background: rgba(255, 255, 255, .96);
    border: 0;
    border-radius: 6px;
    height: 30px;
    width: 30px;
}

.top-brand-text {
    font-size: 16px;
    font-weight: 800;
}

.top-strip-actions {
    gap: 2px;
}

.top-support,
.top-pill,
.top-user {
    background: transparent;
    border: 0;
    border-radius: 4px;
    font-size: 12px;
    min-height: 32px;
    padding: 6px 10px;
}

.top-support {
    color: #FFFFFF;
}

.top-support::after,
.top-pill::after {
    background: rgba(255, 255, 255, .28);
    content: "";
    height: 16px;
    margin-left: 12px;
    width: 1px;
}

.top-user {
    background: rgba(255, 255, 255, .13);
}

.sidebar {
    background: var(--domiq-surface);
    border-color: var(--domiq-border);
    max-height: calc(100vh - 44px);
    min-height: calc(100vh - 44px);
    top: 44px;
}

.brand {
    border-color: var(--domiq-border-soft);
    min-height: 72px;
    padding: 13px 15px;
}

.brand-logo-wrap {
    border-color: var(--domiq-border);
    height: 36px;
    width: 36px;
}

.brand-logo {
    height: 29px;
    width: 29px;
}

.nav {
    gap: 1px;
    padding: 8px;
}

.nav-main,
.nav-group summary,
.nav-group a,
.sidebar-nav-row,
.sidebar-nav-submenu a {
    border-radius: 6px;
    color: #34434F;
}

.nav > .sidebar-nav-row,
.nav > .sidebar-nav-section > .sidebar-nav-row,
.sidebar-secondary-links > .sidebar-nav-row,
.sidebar-secondary-links > .sidebar-nav-section > .sidebar-nav-row {
    align-items: center;
    box-sizing: border-box;
    column-gap: 10px;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 38px;
    margin: 0;
    padding: 9px 10px;
    text-align: left;
    width: 100%;
}

.sidebar-nav-label {
    display: block;
    grid-column: 1;
    justify-self: start;
    margin: 0;
    min-width: 0;
    padding: 0;
    text-align: left;
}

.sidebar-nav-link {
    text-decoration: none;
}

.sidebar-nav-section {
    border: 0;
    margin: 0;
    padding: 0;
    width: 100%;
}

.sidebar-nav-summary {
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    list-style: none !important;
}

.sidebar-nav-summary::-webkit-details-marker {
    display: none !important;
}

.sidebar-nav-summary::marker {
    content: "" !important;
    font-size: 0 !important;
}

.sidebar-nav-summary::before,
.sidebar-nav-summary::after {
    content: none !important;
    display: none !important;
}

.sidebar-nav-chevron {
    border-bottom: 2px solid #7B8791;
    border-right: 2px solid #7B8791;
    grid-column: 2;
    height: 6px;
    justify-self: end;
    margin: 0 2px 0 0;
    transform: rotate(45deg);
    transition: transform .15s ease;
    width: 6px;
}

.sidebar-nav-section[open] > .sidebar-nav-summary .sidebar-nav-chevron {
    transform: rotate(225deg);
}

.sidebar-nav-submenu {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.sidebar-nav-submenu a {
    box-sizing: border-box;
    display: block;
    margin: 0;
    min-height: 34px;
    padding: 8px 10px 8px 32px;
    width: 100%;
}

.nav a:hover,
.nav summary:hover,
.sidebar-resource-link:hover {
    background: var(--domiq-surface-soft);
    color: var(--domiq-primary-strong);
}

.nav-main.active,
.nav summary.active,
.sidebar-nav-submenu a.active {
    background: var(--domiq-primary-soft);
    box-shadow: inset 3px 0 0 var(--domiq-primary);
    color: var(--domiq-primary-strong);
    font-weight: 750;
}

.sidebar-nav-submenu a.active {
    padding-left: 32px;
}

.nav-secondary-area {
    color: var(--domiq-muted);
}

.nav-main.nav-direction {
    border-top: 1px solid var(--domiq-border-soft);
    border-radius: 0 0 6px 6px;
    margin-top: 7px;
}

.sidebar-nav-section.nav-secondary-area {
    border-top: 1px solid var(--domiq-border-soft);
    margin-top: 7px;
    padding-top: 7px;
}

.sidebar-user {
    border-color: var(--domiq-border-soft);
    padding: 11px 14px;
}

.sidebar-secondary-links {
    border-top: 1px solid var(--domiq-border-soft);
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: auto;
    padding: 9px 8px 8px;
}

.sidebar-secondary-links .sidebar-nav-submenu a {
    color: #52616C;
    font-size: 13px;
}

.sidebar-resource-link {
    color: var(--domiq-muted);
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.22;
}

.sidebar-resource-link:hover,
.sidebar-resource-link.active {
    background: var(--domiq-surface-soft);
    color: var(--domiq-primary-strong);
    text-decoration: none;
}

.sidebar-secondary-links + .sidebar-user {
    margin-top: 0;
}

.content {
    background: var(--domiq-canvas);
    padding: 18px 24px 28px;
}

.topbar {
    align-items: flex-start;
    margin-bottom: 14px;
    min-height: 58px;
}

.topbar h1 {
    color: var(--domiq-text);
    font-size: 24px;
    font-weight: 800;
    line-height: 1.15;
}

.topbar p {
    color: var(--domiq-muted);
    font-size: 12.5px;
    margin-top: 4px;
}

.topbar-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.topbar-actions .btn {
    min-width: 0;
}

.hamburger {
    align-items: center;
    gap: 8px;
    justify-content: center;
    min-height: 40px;
}

.hamburger-icon {
    display: grid;
    gap: 3px;
    width: 18px;
}

.hamburger-icon i {
    background: currentColor;
    display: block;
    height: 2px;
    width: 18px;
}

.panel,
.metric-card,
.card,
.section-card {
    border-color: var(--domiq-border);
    border-radius: var(--radius-lg);
    box-shadow: none;
}

.panel {
    margin-bottom: 16px;
    padding: 15px;
}

.panel-head {
    border-color: var(--domiq-border-soft);
    margin: 0 0 12px;
    padding: 0 0 11px;
}

.panel-head h2,
.section-title-inline h2 {
    color: var(--domiq-text);
    font-size: 16px;
    font-weight: 750;
}

.btn,
button.btn,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger,
.task-action-btn {
    border-radius: var(--radius-md);
    font-size: 12.5px;
    font-weight: 750;
    min-height: 36px;
    padding: 7px 12px;
}

.btn.primary,
.btn-primary,
button.btn.primary {
    background: var(--domiq-primary);
    border-color: var(--domiq-primary);
    box-shadow: none;
}

.btn.primary:hover,
.btn-primary:hover,
button.btn.primary:hover {
    background: var(--domiq-primary-strong);
    border-color: var(--domiq-primary-strong);
}

.btn.secondary,
.btn-secondary {
    border-color: var(--domiq-border);
    color: var(--domiq-text);
}

.btn.secondary:hover,
.btn-secondary:hover,
.task-action-btn:hover {
    background: var(--domiq-primary-soft);
    border-color: #A9CFD6;
    color: var(--domiq-primary-strong);
}

.btn.danger,
.btn-danger {
    border-color: #E7B9B4;
    color: var(--domiq-danger);
}

input,
select,
textarea,
.input,
.select {
    border-color: var(--domiq-border);
    border-radius: var(--radius-md);
    color: var(--domiq-text);
    font-size: 13px;
    min-height: 38px;
    padding: 8px 10px;
}

input::placeholder,
textarea::placeholder {
    color: #87939D;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--domiq-primary);
    box-shadow: 0 0 0 3px rgba(0, 111, 131, .16);
}

.advanced-filter-menu summary,
.agenda-advanced-filters summary {
    border-color: var(--domiq-border);
    border-radius: var(--radius-md);
}

.metric-grid.decision-kpis,
.cashflow-summary.decision-kpis,
.quote-status-summary,
.production-priority-strip {
    background: var(--domiq-surface);
    border: 1px solid var(--domiq-border);
    border-radius: var(--radius-lg);
    gap: 0;
    overflow: hidden;
}

.decision-kpis .metric-card,
.cashflow-summary.decision-kpis .metric-card,
.production-priority-strip .metric-card {
    border: 0;
    border-right: 1px solid var(--domiq-border-soft);
    min-height: 70px;
    padding: 12px 14px;
}

.decision-kpis .metric-card:last-child,
.production-priority-strip .metric-card:last-child {
    border-right: 0;
}

.decision-kpis .metric-card span,
.production-priority-strip .metric-card span {
    color: var(--domiq-muted);
    font-size: 11px;
    text-transform: none;
}

.decision-kpis .metric-card strong,
.production-priority-strip .metric-card strong {
    color: var(--domiq-text);
    font-size: 21px;
    font-weight: 650;
    margin-top: 3px;
}

.table-wrap {
    border-color: var(--domiq-border);
    border-radius: var(--radius-md);
}

th,
td {
    border-color: var(--domiq-border-soft);
    color: #4D5B67;
    font-size: 12.5px;
    padding: 10px 12px;
}

th {
    background: var(--domiq-surface-soft);
    color: #41505C;
    font-size: 11.5px;
    font-weight: 750;
    text-transform: none;
}

tbody tr:hover td {
    background: #F7FBFC;
}

.status,
.badge,
.task-status {
    border-radius: 999px;
    font-size: 11px;
    font-weight: 750;
    min-height: 22px;
    padding: 4px 8px;
}

.empty-state {
    background: var(--domiq-surface-soft);
    border-color: #BECBD3;
    border-radius: var(--radius-md);
    padding: 22px 16px;
}

/* Task */
.task-list-app,
.task-list-app:has(.task-detail-panel:not([hidden])) {
    gap: 14px;
}

.task-board-toolbar {
    background: transparent;
    border: 0;
    border-bottom: 1px solid var(--domiq-border);
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 10px;
    padding: 0 0 11px;
}

.task-board-toolbar h2 {
    color: var(--domiq-text);
    font-size: 17px;
}

.task-list-filters {
    background: var(--domiq-section);
    border-color: var(--domiq-border-strong);
    border-radius: var(--radius-md);
    grid-template-columns: minmax(220px, 1.4fr) repeat(3, minmax(120px, .7fr)) auto auto;
    margin-bottom: 12px;
    padding: 8px;
}

.task-list-filters input,
.task-list-filters select {
    background: var(--domiq-field);
}

.scope-tabs a {
    border-color: transparent;
    border-radius: var(--radius-md);
    color: var(--domiq-muted);
    min-height: 34px;
}

.scope-tabs a.active {
    background: var(--domiq-primary-soft);
    border-color: #B8D8DD;
    color: var(--domiq-primary-strong);
}

.task-list-section {
    border-color: var(--domiq-border);
    border-radius: var(--radius-md);
    box-shadow: 0 1px 2px rgba(28, 48, 63, .04);
}

.task-list-section > summary {
    background: var(--domiq-surface);
    min-height: 46px;
    padding: 8px 12px;
}

.task-list-section[open] > summary {
    background: var(--domiq-section);
    border-bottom: 1px solid var(--domiq-border-soft);
}

.task-list-section > summary h3 {
    font-size: 13.5px;
}

.task-list-section > summary .task-section-summary-meta {
    align-items: center;
    display: inline-flex;
    flex: 0 0 auto;
    gap: 10px;
    margin: 0;
}

.task-section-summary-meta i {
    border-bottom: 2px solid #778691;
    border-right: 2px solid #778691;
    display: block;
    height: 7px;
    transform: rotate(45deg) translateY(-2px);
    transition: transform .16s ease;
    width: 7px;
}

.task-list-section[open] .task-section-summary-meta i {
    transform: rotate(225deg) translate(-1px, -1px);
}

.task-list-section.is-empty {
    background: var(--domiq-surface-soft);
    box-shadow: none;
}

.task-list-section.is-empty > summary {
    background: var(--domiq-surface-soft);
    min-height: 42px;
    padding-bottom: 6px;
    padding-top: 6px;
}

.task-list-section.is-empty > summary h3,
.task-list-section.is-empty > summary span {
    color: #667681;
}

.task-list-section.is-empty > summary > div > span {
    display: none;
}

.task-list-section.state-p1-overdue > summary,
.task-list-section.state-p1-due > summary,
.task-list-section.state-p1-blocked > summary {
    box-shadow: inset 4px 0 0 var(--domiq-danger);
}

.task-list-section.state-p2-overdue > summary,
.task-list-section.state-p2-next > summary {
    box-shadow: inset 4px 0 0 #D28A16;
}

.task-list-section.state-p3-review > summary {
    box-shadow: inset 4px 0 0 var(--domiq-info);
}

.task-list-section.state-unclassified > summary {
    box-shadow: inset 4px 0 0 #7B8790;
}

.task-list-section.state-completate > summary {
    box-shadow: inset 4px 0 0 var(--domiq-success);
}

.task-section-list {
    gap: 0;
    padding: 0;
}

.task-list-section.is-empty .task-column-empty {
    align-items: center;
    background: var(--domiq-surface-soft);
    border: 0;
    border-radius: 0;
    display: flex;
    gap: 8px;
    justify-content: flex-start;
    padding: 9px 12px;
    text-align: left;
}

.task-list-section.is-empty .task-column-empty strong {
    color: #566671;
}

.table-wrap.compact .receivables-table {
    min-width: 1120px;
    table-layout: fixed;
}

.receivables-table th:nth-child(1) { width: 140px; }
.receivables-table th:nth-child(2) { width: 125px; }
.receivables-table th:nth-child(3) { width: 135px; }
.receivables-table th:nth-child(4) { width: 105px; }
.receivables-table th:nth-child(5),
.receivables-table th:nth-child(6) { width: 128px; }
.receivables-table th:nth-child(7) { width: 72px; }
.receivables-table th:nth-child(8) { width: 96px; }
.receivables-table th:nth-child(9) { width: 191px; }

.receivables-table td {
    overflow-wrap: normal;
    word-break: normal;
}

.receivable-payment-state {
    align-items: flex-start;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.receivable-paid-amount,
.receivable-paid-warning {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.25;
}

.receivable-paid-amount {
    color: var(--domiq-success);
    white-space: nowrap;
}

.receivable-paid-warning {
    color: var(--domiq-danger);
}

.task-section-list .task-board-item {
    background: #FFFFFF;
    border: 0;
    border-bottom: 1px solid var(--domiq-border-soft);
    border-left: 4px solid #2F75B5;
    border-radius: 0;
    min-height: 58px;
    padding: 9px 11px;
}

.task-section-list .task-board-item:last-child {
    border-bottom: 0;
}

.task-section-list .task-board-item:hover {
    background: #F7FBFC;
}

.task-section-list .task-board-item.state-green {
    background: #FFFFFF;
    border-left-color: var(--domiq-success);
}

.task-section-list .task-board-item.state-red {
    background: #FFFFFF;
    border-left-color: var(--domiq-danger);
}

.task-board-item-body strong {
    color: var(--domiq-text);
    font-size: 13.5px;
    font-weight: 700;
}

.task-board-item-body .task-item-context {
    color: #556572;
}

.task-board-item-body .task-item-meta {
    color: var(--domiq-muted);
}

.task-board-badges i {
    background: #F0F4F6;
    color: #53636F;
    font-weight: 700;
}

.task-board-badges .task-state-badge.state-red {
    background: #FCEDEB;
    color: var(--domiq-danger);
}

.task-board-badges .task-state-badge.state-green {
    background: #EAF6EF;
    color: var(--domiq-success);
}

.task-board-badges .task-state-badge.state-blue {
    background: var(--domiq-primary-soft);
    color: var(--domiq-info);
}

.task-detail-panel {
    border-color: var(--domiq-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-overlay);
}

/* Agenda */
.agenda-shell {
    border-radius: var(--radius-lg);
    padding: 14px;
}

.agenda-header {
    margin-bottom: 8px;
    padding-bottom: 9px;
}

.agenda-header-actions {
    align-items: center;
    display: flex;
    gap: 6px;
}

.agenda-week-nav {
    font-size: 16px;
    min-width: 38px;
    padding-left: 10px;
    padding-right: 10px;
}

.agenda-viewline {
    border-bottom: 1px solid var(--domiq-border);
    gap: 2px;
    margin-bottom: 10px;
}

.agenda-view-label {
    align-items: center;
    color: var(--domiq-muted);
    display: inline-flex;
    font-size: 11px;
    font-weight: 750;
    margin-right: 6px;
    text-transform: uppercase;
}

.agenda-viewline a {
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    color: #45545F;
    margin: 0;
    min-height: 36px;
    padding: 8px 10px 7px;
}

.agenda-viewline a.active,
.agenda-viewline a:hover {
    background: transparent;
    border-color: var(--domiq-primary);
    color: var(--domiq-primary-strong);
}

.agenda-quickbar {
    gap: 7px;
}

.agenda-load-compact {
    display: flex;
    gap: 6px;
    margin: 8px 0;
    overflow-x: auto;
    padding-bottom: 2px;
}

.agenda-load-compact .load-card {
    border-left: 3px solid var(--event-color, var(--domiq-primary));
    border-radius: var(--radius-md);
    flex: 0 0 auto;
    min-height: 36px;
    min-width: 150px;
    padding: 7px 10px;
}

.agenda-legend {
    align-items: center;
    border-top: 1px solid var(--domiq-border-soft);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
    padding: 8px 0;
}

.agenda-legend > span {
    align-items: center;
    color: #4E5D69;
    display: inline-flex;
    font-size: 11.5px;
    gap: 5px;
}

.agenda-legend i {
    border-radius: 3px;
    display: inline-block;
    height: 10px;
    width: 10px;
}

.agenda-legend i.planned { background: #1A73E8; }
.agenda-legend i.done { background: #188038; }
.agenda-legend i.missed { background: #D93025; }

.agenda-legend small {
    color: var(--domiq-muted);
    margin-left: auto;
}

.agenda-calendar-focus {
    border-color: var(--domiq-border);
    border-radius: var(--radius-md);
}

.calendar-day-head.is-today {
    background: #DCEFF3;
    box-shadow: inset 0 -3px 0 var(--domiq-primary);
}

.calendar-day-col.is-today {
    background: #F4FAFB;
}

.calendar-day-head.is-past,
.calendar-day-col.is-past {
    background: #EFF2F4;
}

.agenda-calendar-focus .calendar-event {
    border-radius: 4px;
    box-shadow: none;
}

.event-kind-label {
    background: rgba(255, 255, 255, .24);
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 3px;
}

/* Liste operative e Pratiche */
.entity-list-panel .panel-head {
    align-items: center;
}

.entity-list-filters {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(260px, 1.5fr) minmax(170px, .7fr) auto;
    width: auto;
}

.entity-table td:first-child {
    color: var(--domiq-text);
    font-weight: 650;
}

.entity-table .row-actions {
    justify-content: flex-end;
    min-width: 104px;
}

.practice-row.case-row-card {
    border-color: var(--domiq-border);
    border-left: 3px solid var(--domiq-primary);
    border-radius: var(--radius-md);
    gap: 8px 14px;
    grid-template-areas:
        "main status next metrics owner actions"
        "badges badges badges badges badges actions";
    grid-template-columns: minmax(250px, 1.4fr) minmax(108px, .55fr) minmax(220px, 1fr) minmax(190px, .85fr) minmax(145px, .65fr) minmax(110px, auto);
    padding: 11px 12px;
}

.practice-row.blocked {
    border-left-color: var(--domiq-danger);
}

.practice-row-main { grid-area: main; }
.practice-row-status { grid-area: status; }
.practice-row-next { grid-area: next; }
.practice-row-metrics { grid-area: metrics; }
.practice-row-owner { grid-area: owner; }
.practice-row-badges { grid-area: badges; }
.practice-row-actions { grid-area: actions; }

.practice-row-main h2 {
    font-size: 13.5px;
}

.practice-row-metrics span {
    background: var(--domiq-surface-soft);
    border-color: var(--domiq-border-soft);
    border-radius: var(--radius-md);
    padding: 6px 7px;
}

.practice-row-metrics strong {
    color: var(--domiq-info);
    font-size: 13px;
}

.practice-row-actions {
    align-self: stretch;
    align-items: flex-end;
    flex-direction: column;
    justify-content: center;
}

.practice-focus {
    border-top: 3px solid var(--domiq-primary);
}

.practice-focus-grid-lean {
    background: var(--domiq-border-soft);
    border: 1px solid var(--domiq-border);
    border-radius: var(--radius-md);
    gap: 1px;
    overflow: hidden;
}

.practice-focus-card {
    background: var(--domiq-surface);
    border: 0;
    border-radius: 0;
    padding: 11px 12px;
}

.practice-focus-card strong {
    font-size: 14.5px;
}

.practice-details-compact {
    border: 1px solid var(--domiq-border);
    border-radius: var(--radius-md);
    margin: 0;
    padding: 0;
}

.practice-details-compact > summary,
.production-secondary-section > summary {
    align-items: center;
    cursor: pointer;
    display: flex;
    font-size: 13.5px;
    font-weight: 750;
    justify-content: space-between;
    list-style: none;
    min-height: 46px;
    padding: 10px 12px;
}

.practice-details-compact > summary::after,
.production-secondary-section > summary::after,
.procedure-item > summary::after {
    border-bottom: 2px solid #7B8791;
    border-right: 2px solid #7B8791;
    content: "";
    height: 6px;
    margin-left: 10px;
    transform: rotate(45deg);
    transition: transform .15s ease;
    width: 6px;
}

.practice-details-compact[open] > summary::after,
.production-secondary-section[open] > summary::after,
.procedure-item[open] > summary::after {
    transform: rotate(225deg);
}

.practice-details-compact[open] > summary {
    background: var(--domiq-surface-soft);
    border-bottom: 1px solid var(--domiq-border);
}

.practice-details-compact > :not(summary) {
    margin-left: 12px;
    margin-right: 12px;
}

.practice-details-compact > :last-child {
    margin-bottom: 12px;
}

.practice-task-item {
    border-color: var(--domiq-border-soft);
    border-radius: var(--radius-md);
}

/* Produzione */
.production-zone-head {
    border-bottom: 1px solid var(--domiq-border);
    margin: 20px 0 10px;
    padding-bottom: 8px;
}

.production-zone-head h2 {
    color: var(--domiq-text);
    font-size: 17px;
    font-weight: 750;
}

.production-priority-strip .metric-card.alert {
    border-left: 3px solid var(--domiq-danger);
}

.production-priority-strip .metric-card.case {
    border-left: 3px solid var(--domiq-info);
}

.production-attention-zone + .panel {
    border-left: 3px solid var(--domiq-danger);
}

.priority-panel {
    border-top: 3px solid var(--domiq-warning);
}

.production-load-grid .panel {
    border-top: 3px solid var(--domiq-info);
}

.production-approval-row {
    border: 0;
    border-bottom: 1px solid var(--domiq-border-soft);
    border-radius: 0;
}

.production-secondary-section {
    border-radius: var(--radius-md);
}

/* Lead, Preventivi e Procedure */
.lead-focus {
    border-top: 3px solid var(--domiq-primary);
}

.lead-next-step {
    border-left: 3px solid var(--domiq-primary);
}

.lead-summary-strip,
.summary-strip {
    border-color: var(--domiq-border);
    border-radius: var(--radius-md);
}

.summary-strip div {
    padding: 10px 12px;
}

.document-toolbar {
    align-items: end;
    margin: 0 0 14px;
}

.document-back {
    border-color: var(--domiq-border);
    border-radius: var(--radius-md);
    box-shadow: none;
    font-size: 13px;
    min-height: 38px;
}

.document-form {
    gap: 12px;
    grid-template-columns: minmax(250px, .75fr) minmax(430px, 1.25fr) minmax(270px, .85fr);
}

.document-card,
.document-summary,
.quote-product-list,
.quote-payment-card {
    border-color: var(--domiq-border);
    border-radius: var(--radius-lg);
    box-shadow: none;
}

.document-card h2,
.document-summary h2 {
    color: var(--domiq-text);
    font-size: 15px;
    text-align: left;
}

.document-card summary,
.document-card-side summary,
.task-document-options summary {
    font-size: 13.5px;
    text-align: left;
}

.quote-document-form .quote-product-list,
.quote-document-form .quote-payment-card,
.quote-document-form .quote-notes-grid {
    grid-column: 1 / -1;
}

.quote-document-form .quote-product-list {
    margin-top: 6px;
}

.quote-product-list .panel-head {
    align-items: flex-start;
}

.quote-live-totals {
    border-color: var(--domiq-border);
    border-radius: var(--radius-md);
}

.financial-reconciliation {
    border-color: var(--domiq-border);
    border-left-color: var(--domiq-success);
    border-radius: var(--radius-md);
}

.procedure-library {
    padding: 0;
}

.procedure-library > * {
    margin-left: 14px;
    margin-right: 14px;
}

.procedure-library > .procedure-categories {
    margin: 0;
    padding: 10px 14px 0;
}

.procedure-categories {
    border-bottom: 1px solid var(--domiq-border);
    gap: 2px;
}

.procedure-categories a {
    background: transparent;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: 0;
    min-height: 36px;
}

.procedure-categories a.active {
    background: transparent;
    border-color: var(--domiq-primary);
    color: var(--domiq-primary-strong);
}

.procedure-toolbar {
    margin-top: 12px;
}

.procedure-filters {
    display: grid;
    flex: 1 1 auto;
    grid-template-columns: minmax(260px, 1.5fr) minmax(150px, .6fr) minmax(150px, .6fr) auto;
    width: auto;
}

.procedure-list {
    margin-bottom: 14px;
}

.procedure-item {
    border-color: var(--domiq-border);
    border-radius: var(--radius-md);
    margin-bottom: 6px;
}

.procedure-item > summary {
    align-items: center;
    display: flex;
    justify-content: space-between;
    min-height: 54px;
    padding: 10px 12px;
}

.procedure-item > summary::after {
    margin-left: 0;
}

.procedure-title {
    min-width: 0;
}

.procedure-title strong,
.procedure-title small {
    display: block;
}

.procedure-open-label {
    color: var(--domiq-muted);
    font-size: 11px;
    margin-left: auto;
    padding-right: 12px;
}

/* People picker */
.people-picker {
    border-color: var(--domiq-border);
    border-radius: var(--radius-lg);
    padding: 12px;
}

.people-picker-controls {
    grid-template-columns: minmax(0, 1.4fr) minmax(140px, .6fr);
}

.people-picker-selection-label {
    color: var(--domiq-muted);
    font-size: 11px;
    font-weight: 750;
    margin-top: 9px;
}

.people-picker-selected {
    margin-top: 5px;
}

.person-chip {
    background: var(--domiq-primary-soft);
    border-color: #B8D8DD;
    border-radius: 999px;
    color: var(--domiq-primary-strong);
}

.person-chip::after {
    content: "\00D7";
    font-size: 15px;
    line-height: 1;
    margin-left: 6px;
}

.people-picker-results {
    gap: 0;
    padding-top: 6px;
}

.people-result {
    border-bottom: 1px solid var(--domiq-border-soft);
    border-radius: 0;
    display: grid;
    gap: 9px;
    grid-template-columns: 32px minmax(0, 1fr);
    justify-content: start;
    min-height: 48px;
    padding: 7px 8px;
}

.people-result:last-child {
    border-bottom: 0;
}

.person-avatar {
    align-items: center;
    background: var(--domiq-primary-soft);
    border: 1px solid #B8D8DD;
    border-radius: 50%;
    color: var(--domiq-primary-strong);
    display: inline-flex;
    font-size: 11px;
    font-weight: 800;
    height: 32px;
    justify-content: center;
    width: 32px;
}

.person-identity,
.person-name {
    display: block;
    min-width: 0;
}

.person-name {
    color: var(--domiq-text);
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.person-identity small {
    display: block;
    margin-top: 2px;
}

/* Responsive canonico */
@media (max-width: 1280px) {
    .practice-row.case-row-card {
        grid-template-areas:
            "main status next owner"
            "metrics metrics badges actions";
        grid-template-columns: minmax(260px, 1.35fr) minmax(105px, .5fr) minmax(210px, 1fr) minmax(150px, .7fr);
    }

    .practice-row-metrics,
    .practice-row-owner,
    .practice-row-badges,
    .practice-row-actions {
        grid-column: auto;
    }

    .practice-row-actions {
        align-items: flex-end;
        justify-content: flex-end;
    }

    .document-form {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 1024px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        box-shadow: var(--shadow-overlay);
        display: none;
        inset: 44px auto 0 0;
        max-height: calc(100vh - 44px);
        min-height: 0;
        position: fixed;
        top: 44px;
        width: min(310px, 88vw);
        z-index: 90;
    }

    .sidebar.open {
        display: flex;
    }

    .hamburger {
        display: inline-flex;
    }

    .content {
        padding: 16px;
    }

    .topbar {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
    }

    .topbar-actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .entity-list-filters,
    .procedure-filters,
    .task-list-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }

    .practice-row.case-row-card {
        grid-template-areas:
            "main status"
            "next owner"
            "metrics metrics"
            "badges actions";
        grid-template-columns: minmax(0, 1fr) minmax(150px, .45fr);
    }

    .practice-row-actions {
        align-items: flex-end;
    }

    .practice-focus-grid-lean {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .production-priority-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .agenda-header-actions {
        align-items: center;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
        width: 100%;
    }

    .agenda-header-actions .btn:not(.agenda-week-nav) {
        flex: 1 1 auto;
    }

    .agenda-header-actions .agenda-week-nav {
        flex: 0 0 44px;
        width: 44px;
    }
}

@media (max-width: 767px) {
    .app-top-strip {
        padding: 0 10px;
    }

    .top-brand-text {
        font-size: 14px;
    }

    .top-strip-actions {
        margin-left: auto;
    }

    .top-support,
    .top-pill {
        display: none;
    }

    .top-user {
        max-width: 118px;
        overflow: hidden;
        padding: 5px 8px;
        text-overflow: ellipsis;
    }

    .content {
        padding: 12px 10px 20px;
    }

    .topbar {
        gap: 9px;
        margin-bottom: 12px;
    }

    .topbar h1 {
        font-size: 21px;
    }

    .topbar p {
        font-size: 12px;
    }

    .hamburger-label {
        display: none;
    }

    .hamburger {
        min-width: 44px;
        padding: 8px;
    }

    .topbar-actions,
    .topbar-actions .btn {
        width: 100%;
    }

    .topbar-actions .btn {
        flex: 1 1 auto;
    }

    .panel {
        padding: 12px;
    }

    .entity-list-panel .panel-head,
    .procedure-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .entity-list-filters,
    .procedure-filters,
    .task-list-filters,
    .people-picker-controls {
        grid-template-columns: 1fr;
    }

    .entity-list-panel .panel-head > .btn,
    .procedure-toolbar > .btn {
        width: 100%;
    }

    .task-board-toolbar {
        align-items: stretch;
    }

    .task-section-list .task-board-item {
        grid-template-columns: 20px minmax(0, 1fr);
        min-height: 72px;
    }

    .task-section-list .task-board-badges {
        grid-column: 2;
    }

    .agenda-header {
        align-items: stretch;
        display: grid;
        gap: 8px;
    }

    .agenda-header-actions {
        align-items: center;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: flex-start;
        width: 100%;
    }

    .agenda-header-actions .btn:not(.agenda-week-nav) {
        flex: 1 1 auto;
    }

    .agenda-header-actions .agenda-week-nav {
        flex: 0 0 44px;
        width: 44px;
    }

    .agenda-viewline {
        display: flex;
        overflow-x: auto;
    }

    .agenda-view-label {
        display: none;
    }

    .agenda-legend {
        gap: 8px 12px;
    }

    .agenda-legend small {
        flex: 0 0 100%;
        margin-left: 0;
    }

    .metric-grid.decision-kpis,
    .cashflow-summary.decision-kpis,
    .production-priority-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .decision-kpis .metric-card,
    .production-priority-strip .metric-card {
        border-bottom: 1px solid var(--domiq-border-soft);
        min-height: 66px;
    }

    .practice-row.case-row-card {
        grid-template-areas:
            "main"
            "status"
            "next"
            "owner"
            "metrics"
            "badges"
            "actions";
        grid-template-columns: 1fr;
    }

    .practice-row-actions {
        align-items: stretch;
        flex-direction: row;
        justify-content: flex-start;
    }

    .practice-row-actions .btn {
        flex: 1 1 auto;
    }

    .practice-focus-grid-lean {
        grid-template-columns: 1fr;
    }

    .practice-details-compact > :not(summary) {
        margin-left: 9px;
        margin-right: 9px;
    }

    .document-toolbar {
        gap: 8px;
    }

    .document-number {
        font-size: 16px;
    }

    .procedure-library > * {
        margin-left: 10px;
        margin-right: 10px;
    }

    .procedure-library > .procedure-categories {
        padding-left: 10px;
        padding-right: 10px;
    }

    .procedure-open-label {
        display: none;
    }
}

@media (max-width: 420px) {
    .top-brand-text {
        max-width: 185px;
    }

    .top-user {
        display: none;
    }

    .metric-grid.decision-kpis,
    .cashflow-summary.decision-kpis,
    .production-priority-strip {
        grid-template-columns: 1fr 1fr;
    }

    .practice-row-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .practice-row-metrics span {
        padding: 6px 5px;
    }
}

/* Visual refinement: compact operational lists inspired by studio workbenches */
.task-row-head,
.task-section-list .task-board-item {
    display: grid;
    grid-template-columns: 14px minmax(260px, 1.7fr) minmax(105px, .55fr) minmax(125px, .65fr) minmax(125px, .7fr) minmax(74px, .4fr) minmax(80px, auto);
}

.task-row-head {
    align-items: center;
    background: #F5F7F8;
    border-bottom: 1px solid var(--domiq-border);
    color: #61707B;
    column-gap: 12px;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0;
    min-height: 32px;
    padding: 6px 12px;
    text-transform: uppercase;
}

.task-section-list .task-board-item {
    align-items: center;
    column-gap: 12px;
    min-height: 62px;
    padding: 8px 12px;
}

.task-section-list .task-check {
    align-self: center;
    background: #1A73E8;
    border: 0;
    border-radius: 50%;
    height: 10px;
    margin: 0;
    width: 10px;
}

.task-section-list .state-green .task-check { background: #188038; }
.task-section-list .state-red .task-check { background: #D93025; }

.task-board-item-body,
.task-row-when,
.task-row-state,
.task-row-person,
.task-row-duration {
    min-width: 0;
}

.task-board-item-body strong,
.task-board-item-body small,
.task-row-when strong,
.task-row-when small,
.task-row-person strong,
.task-row-person small,
.task-row-duration strong,
.task-row-duration small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-board-item-body strong {
    font-size: 13px;
    line-height: 1.25;
}

.task-board-item-body .task-item-context {
    font-size: 11.5px;
    margin-top: 3px;
}

.task-row-when strong,
.task-row-person strong,
.task-row-duration strong {
    color: #344451;
    font-size: 11.5px;
    font-style: normal;
    font-weight: 750;
}

.task-row-when small,
.task-row-person small,
.task-row-duration small {
    color: var(--domiq-muted);
    font-size: 10.5px;
    margin-top: 2px;
}

.task-row-state {
    align-items: center;
    display: flex;
    gap: 7px;
}

.task-row-state i {
    background: #1A73E8;
    border-radius: 2px;
    flex: 0 0 6px;
    height: 20px;
    width: 6px;
}

.state-green .task-row-state i { background: #188038; }
.state-red .task-row-state i { background: #D93025; }

.task-row-state strong {
    color: #455560;
    font-size: 11.5px;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.task-section-list .task-board-badges {
    grid-column: auto;
    justify-content: flex-end;
    min-width: 0;
}

.practice-overview-strip {
    background: #FFFFFF;
    border: 1px solid var(--domiq-border);
    border-radius: var(--radius-md);
    gap: 0;
    overflow: hidden;
}

.practice-overview-strip .metric-card {
    border: 0;
    border-left: 3px solid var(--domiq-primary);
    border-radius: 0;
    box-shadow: none;
    min-height: 72px;
    padding: 11px 14px;
}

.practice-overview-strip .metric-card + .metric-card {
    border-left-color: var(--domiq-border);
}

.practice-overview-strip .metric-card.alert {
    box-shadow: inset 3px 0 0 var(--domiq-danger);
}

.practice-overview-strip .metric-card span {
    font-size: 10.5px;
    text-transform: uppercase;
}

.practice-overview-strip .metric-card strong {
    font-size: 22px;
    margin-top: 4px;
}

.practice-list-panel {
    overflow: visible;
    padding: 0;
}

.practice-list-panel > .panel-head {
    border-bottom: 1px solid var(--domiq-border);
    padding: 10px 12px;
}

.practice-list-panel .case-filters {
    margin: 0;
}

.practice-list-head {
    background: #F5F7F8;
    border-bottom: 1px solid var(--domiq-border);
    color: #53626D;
    display: grid;
    font-size: 10.5px;
    font-weight: 800;
    gap: 14px;
    grid-template-columns: minmax(250px, 1.4fr) minmax(108px, .55fr) minmax(220px, 1fr) minmax(190px, .85fr) minmax(145px, .65fr) minmax(110px, auto);
    letter-spacing: 0;
    padding: 8px 15px;
    text-transform: uppercase;
}

.practice-list-simple {
    gap: 0;
}

.practice-row.case-row-card {
    border: 0;
    border-bottom: 1px solid var(--domiq-border-soft);
    border-left: 4px solid var(--domiq-primary);
    border-radius: 0;
    box-shadow: none;
    grid-template-areas: "main status next metrics owner actions";
    min-height: 78px;
    padding: 10px 11px;
}

.practice-row.case-row-card:last-child {
    border-bottom: 0;
}

.practice-row.case-row-card:hover {
    background: #F8FBFC;
}

.practice-row-main .case-code {
    background: transparent;
    border: 0;
    color: var(--domiq-primary-strong);
    font-size: 11.5px;
    min-width: 54px;
    padding: 0;
}

.practice-row-main {
    align-items: center;
    display: grid;
    gap: 3px 10px;
    grid-template-columns: auto minmax(0, 1fr);
}

.practice-row-main .practice-row-badges {
    grid-area: auto;
    grid-column: 2;
    grid-row: 2;
    margin-top: 2px;
    min-height: 0;
}

.practice-row-main .practice-row-badges .status {
    font-size: 9.5px;
    min-height: 18px;
    padding: 2px 6px;
}

.practice-row-main h2 {
    margin-bottom: 3px;
}

.practice-row-next strong,
.practice-row-owner strong {
    font-size: 12px;
}

.practice-row-next small,
.practice-row-main p {
    line-height: 1.3;
}

.practice-row-metrics {
    gap: 5px;
}

.practice-row-metrics span {
    background: transparent;
    border: 0;
    border-left: 1px solid var(--domiq-border);
    border-radius: 0;
    padding: 2px 7px;
}

.practice-row-metrics span:first-child {
    border-left: 0;
}

.practice-row-actions {
    align-items: center;
    align-self: center;
    flex-direction: row;
    grid-column: 6;
    grid-row: 1;
    justify-content: flex-end;
}

.practice-row-actions .btn {
    min-height: 32px;
}

.practice-context-tabs {
    align-items: stretch;
    background: #FFFFFF;
    border: 1px solid var(--domiq-border);
    border-radius: var(--radius-md);
    display: flex;
    gap: 0;
    margin-bottom: 10px;
    overflow-x: auto;
    padding: 0 8px;
}

.practice-context-tabs a {
    align-items: center;
    border-bottom: 3px solid transparent;
    color: #4A5965;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    gap: 6px;
    min-height: 42px;
    padding: 9px 13px 7px;
}

.practice-context-tabs a:hover,
.practice-context-tabs a.active {
    border-bottom-color: var(--domiq-primary);
    color: var(--domiq-primary-strong);
    text-decoration: none;
}

.practice-context-tabs a span,
.practice-details-compact > summary b {
    background: #EDF2F4;
    border-radius: 999px;
    color: #53636F;
    font-size: 10px;
    font-weight: 800;
    min-width: 22px;
    padding: 2px 6px;
    text-align: center;
}

#quadro-generale,
#fasi-pratica,
#task-pratica,
#ore-pratica,
#dati-pratica {
    scroll-margin-top: 12px;
}

.practice-details-compact > summary b {
    margin-left: auto;
}

.practice-details-compact > summary::after {
    margin-left: 12px;
}

.practice-phases-table tbody tr {
    box-shadow: inset 3px 0 0 #B8C7CF;
}

.practice-phases-table tbody tr:hover {
    box-shadow: inset 3px 0 0 var(--domiq-primary);
}

.practice-phases-table .phase-order-heading,
.practice-phases-table .phase-order-cell {
    text-align: center;
    width: 68px;
}

.phase-order-cell form {
    display: inline-flex;
    margin: 0;
}

.phase-order-cell select {
    appearance: auto;
    background: #F2FAFC;
    border: 1px solid #9ACCD6;
    border-radius: 6px;
    color: var(--domiq-primary-strong);
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    height: 30px;
    min-width: 48px;
    padding: 3px 5px;
    text-align: center;
}

.phase-order-cell select:hover,
.phase-order-cell select:focus-visible {
    background: #E5F6F9;
    border-color: var(--domiq-primary);
    outline: 2px solid rgba(0, 151, 178, .16);
    outline-offset: 1px;
}

.phase-order-number {
    align-items: center;
    background: #EDF2F4;
    border-radius: 6px;
    color: #53636F;
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    height: 30px;
    justify-content: center;
    min-width: 32px;
}

.practice-task-list {
    gap: 0;
}

.practice-task-item {
    border: 0;
    border-bottom: 1px solid var(--domiq-border-soft);
    border-left: 3px solid #1A73E8;
    border-radius: 0;
}

.practice-task-item:last-child {
    border-bottom: 0;
}

.practice-task-item.danger {
    border-left-color: #D93025;
}

@media (max-width: 1280px) {
    .task-row-head,
    .task-section-list .task-board-item {
        grid-template-columns: 14px minmax(230px, 1.6fr) minmax(100px, .55fr) minmax(115px, .65fr) minmax(120px, .7fr) minmax(70px, .4fr) auto;
    }

    .practice-list-head {
        display: none;
    }

    .practice-row.case-row-card {
        grid-template-areas:
            "main status owner"
            "next metrics actions";
        grid-template-columns: minmax(310px, 1.45fr) minmax(190px, .85fr) minmax(170px, .7fr);
    }

    .practice-row-actions {
        align-items: center;
        grid-column: 3;
        grid-row: 2;
        justify-content: flex-end;
    }
}

@media (max-width: 1024px) {
    .task-row-head {
        display: none;
    }

    .task-section-list .task-board-item {
        grid-template-areas:
            "dot body body body"
            "dot when state person"
            "dot duration badges badges";
        grid-template-columns: 14px minmax(100px, .8fr) minmax(120px, 1fr) minmax(120px, 1fr);
        row-gap: 7px;
    }

    .task-section-list .task-check { grid-area: dot; }
    .task-section-list .task-board-item-body { grid-area: body; }
    .task-section-list .task-row-when { grid-area: when; }
    .task-section-list .task-row-state { grid-area: state; }
    .task-section-list .task-row-person { grid-area: person; }
    .task-section-list .task-row-duration { grid-area: duration; }
    .task-section-list .task-board-badges { grid-area: badges; }

    .practice-row.case-row-card {
        grid-template-areas:
            "main status"
            "next owner"
            "metrics actions";
        grid-template-columns: minmax(0, 1fr) minmax(150px, .45fr);
    }

    .practice-row-actions {
        grid-column: 2;
        grid-row: 3;
    }
}

@media (max-width: 767px) {
    .practice-overview-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .practice-overview-strip .metric-card:nth-child(3) {
        border-top: 1px solid var(--domiq-border-soft);
    }

    .practice-overview-strip .metric-card:nth-child(4) {
        border-top: 1px solid var(--domiq-border-soft);
    }

    .practice-context-tabs {
        margin-left: -2px;
        margin-right: -2px;
    }

    .practice-row.case-row-card {
        grid-template-areas:
            "main"
            "status"
            "next"
            "owner"
            "metrics"
            "actions";
        grid-template-columns: 1fr;
    }

    .practice-row-actions {
        align-items: stretch;
        flex-direction: row;
        grid-column: 1;
        grid-row: 6;
        justify-content: flex-start;
    }
}

@media (max-width: 560px) {
    .task-section-list .task-board-item {
        grid-template-areas:
            "dot body body"
            "dot when state"
            "dot person duration"
            "dot badges badges";
        grid-template-columns: 14px minmax(0, 1fr) minmax(0, 1fr);
    }

    .task-row-state,
    .task-row-when,
    .task-row-person,
    .task-row-duration {
        border-top: 1px solid var(--domiq-border-soft);
        padding-top: 6px;
    }

    .practice-list-panel > .panel-head {
        padding: 9px;
    }
}

/* Sprint 7B: priorita operative */
.nav-alert-count {
    align-items: center;
    background: #B42318;
    border: 2px solid #FFFFFF;
    border-radius: 999px;
    color: #FFFFFF;
    display: inline-flex;
    font-size: 10px;
    font-weight: 800;
    grid-column: 2;
    justify-content: center;
    line-height: 1;
    min-height: 20px;
    min-width: 20px;
    padding: 2px 5px;
}

.task-priority-badge,
.priority-dot.priority-p1,
.priority-dot.priority-p2,
.priority-dot.priority-p3 {
    border: 1px solid transparent;
    border-radius: 999px;
    display: inline-flex;
    font-size: 10.5px;
    font-style: normal;
    font-weight: 800;
    line-height: 1.2;
    padding: 4px 7px;
    white-space: nowrap;
}

.task-priority-badge.priority-p1,
.priority-dot.priority-p1 {
    background: #B42318;
    border-color: #B42318;
    color: #FFFFFF;
}

.task-priority-badge.priority-p2,
.priority-dot.priority-p2 {
    background: #F4B400;
    border-color: #D89D00;
    color: #352700;
}

.task-priority-badge.priority-p3,
.priority-dot.priority-p3 {
    background: #2767B1;
    border-color: #2767B1;
    color: #FFFFFF;
}

.task-priority-badge.priority-unclassified {
    background: #EDF1F4;
    border-color: #CCD5DC;
    color: #465661;
}

.priority-notification-banner {
    align-items: flex-start;
    background: #FFF7ED;
    border: 1px solid #F6C98D;
    border-left: 4px solid #B42318;
    border-radius: 7px;
    display: grid;
    gap: 10px;
    grid-column: 1 / -1;
    grid-template-columns: minmax(190px, .55fr) minmax(300px, 1.45fr);
    margin-bottom: 12px;
    padding: 10px 12px;
}

.priority-notification-banner > div:first-child {
    display: grid;
    gap: 3px;
}

.priority-notification-banner > div:first-child span {
    color: #6E4A1F;
    font-size: 11px;
}

.priority-notification-list {
    display: grid;
    gap: 5px;
}

.priority-notification-list form,
.priority-notification-list button {
    width: 100%;
}

.priority-notification-list button {
    align-items: center;
    background: #FFFFFF;
    border: 1px solid #E7C79D;
    border-radius: 5px;
    color: var(--domiq-text);
    display: grid;
    font-size: 11px;
    gap: 7px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 32px;
    padding: 5px 8px;
    text-align: left;
}

.priority-notification-list button span {
    color: var(--domiq-primary-strong);
    font-weight: 750;
}

.task-secondary-actions {
    margin: 0;
    position: relative;
}

.task-secondary-actions > summary {
    align-items: center;
    background: #FFFFFF;
    border: 1px solid var(--domiq-border);
    border-radius: 6px;
    color: var(--domiq-text);
    cursor: pointer;
    display: inline-flex;
    font-size: 12px;
    font-weight: 750;
    min-height: 34px;
    padding: 7px 10px;
}

.task-secondary-actions > summary::marker,
.task-secondary-actions > summary::-webkit-details-marker {
    display: none;
}

.task-secondary-actions > div {
    background: #FFFFFF;
    border: 1px solid var(--domiq-border);
    border-radius: 6px;
    box-shadow: var(--shadow-overlay);
    display: grid;
    max-width: min(260px, calc(100vw - 48px));
    min-width: 190px;
    padding: 5px;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    z-index: 20;
}

.task-secondary-actions a,
.task-secondary-actions button {
    background: transparent;
    border: 0;
    border-radius: 4px;
    color: var(--domiq-text);
    font: inherit;
    font-size: 12px;
    min-height: 32px;
    padding: 7px 8px;
    text-align: left;
    text-decoration: none;
}

.task-secondary-actions a:hover,
.task-secondary-actions button:hover {
    background: var(--domiq-primary-soft);
}

.task-secondary-actions .danger-link {
    color: #B42318;
}

.practice-status-stack {
    align-items: flex-end;
    display: grid;
    gap: 6px;
    justify-items: end;
}

.practice-risk {
    border: 1px solid var(--domiq-border);
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 800;
    padding: 4px 8px;
}

.practice-risk.risk-critica {
    background: #B42318;
    border-color: #B42318;
    color: #FFFFFF;
}

.practice-risk.risk-a-rischio {
    background: #FFF0D5;
    border-color: #E9B65A;
    color: #684500;
}

.practice-risk.risk-monitoraggio {
    background: #E8F1FC;
    border-color: #9ABCE3;
    color: #174E8A;
}

.practice-risk.risk-sotto-controllo {
    background: #E8F5ED;
    border-color: #92C5A5;
    color: #17613C;
}

.task-block-note {
    color: #B42318;
    display: block;
    font-weight: 700;
    margin-top: 4px;
}

.direction-priority-summary {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    margin-bottom: 12px;
}

.priority-decision-panel {
    border-left: 3px solid #B42318;
}

.priority-request-row {
    grid-template-columns: auto minmax(130px, .6fr) minmax(260px, 1.4fr) minmax(185px, .7fr) auto;
}

@media (max-width: 1100px) {
    .direction-priority-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .priority-request-row {
        grid-template-columns: auto minmax(0, 1fr);
    }
}

@media (max-width: 767px) {
    .modal-backdrop {
        align-items: flex-start;
        padding: 8px;
    }

    .modal-panel,
    .task-action-modal {
        max-height: calc(100dvh - 16px);
        max-width: calc(100vw - 16px);
        width: 100%;
    }

    .priority-notification-banner {
        grid-template-columns: 1fr;
    }

    .direction-priority-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .practice-status-stack {
        align-items: flex-start;
        justify-items: start;
    }

    .task-secondary-actions > div {
        left: auto;
        right: 0;
    }
}

/* Sprint 7C final cascade overrides */
.agenda-load-compact {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    overflow: visible;
}

.agenda-load-compact .load-card {
    flex: initial;
    gap: 6px;
    grid-template-columns: 9px minmax(0, 1fr);
    min-width: 0;
    width: 100%;
}

.agenda-load-compact .load-card strong {
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    width: auto;
}

.agenda-calendar-focus .calendar-event.private-unavailable,
.agenda-calendar-focus .calendar-event.organizational-absence,
.agenda-mobile-event.private-unavailable,
.agenda-mobile-event.organizational-absence {
    background: #7356B5;
    border-color: #5F429F;
    border-left-color: #4C318C;
    color: #FFFFFF;
}

.calendar-slot-line.is-cell-active {
    background: rgba(0, 151, 178, .16);
    box-shadow: inset 0 0 0 1px rgba(0, 151, 178, .28);
}

@media (max-width: 900px) {
    .agenda-load-compact {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .agenda-all-day-grid,
    .agenda-desktop-calendar {
        display: none;
    }

    .agenda-mobile-day {
        display: grid;
        gap: 10px;
    }

    .agenda-mobile-day-head {
        align-items: center;
        background: #F8FAFC;
        border: 1px solid var(--border);
        border-radius: 8px;
        display: grid;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        min-height: 58px;
        padding: 6px;
        text-align: center;
    }

    .agenda-mobile-day-head strong,
    .agenda-mobile-day-head span,
    .agenda-mobile-event time,
    .agenda-mobile-event strong,
    .agenda-mobile-event small {
        display: block;
    }

    .agenda-mobile-day-head strong {
        font-size: 14px;
    }

    .agenda-mobile-day-head span {
        color: var(--muted);
        font-size: 12px;
    }

    .agenda-mobile-day-head .icon-btn {
        align-items: center;
        display: inline-flex;
        height: 44px;
        justify-content: center;
        width: 44px;
    }

    .agenda-mobile-timeline {
        display: grid;
        gap: 7px;
    }

    .agenda-mobile-all-day {
        align-items: center;
        display: grid;
        gap: 8px;
        grid-template-columns: 84px minmax(0, 1fr);
    }

    .agenda-mobile-event {
        align-items: center;
        background: #1A73E8;
        border: 0;
        border-left: 6px solid #0B57D0;
        border-radius: 7px;
        color: #FFFFFF;
        display: grid;
        gap: 9px;
        grid-template-columns: 48px minmax(0, 1fr) auto;
        min-height: 64px;
        padding: 9px;
        text-align: left;
        width: 100%;
    }

    .agenda-mobile-event.done {
        background: #188038;
        border-left-color: #0B6B2B;
    }

    .agenda-mobile-event.missed {
        background: #D93025;
        border-left-color: #A50E0E;
    }

    .agenda-mobile-event time,
    .agenda-mobile-event i {
        font-size: 11px;
        font-style: normal;
        font-weight: 850;
    }

    .agenda-mobile-event strong {
        font-size: 13px;
    }

    .agenda-mobile-event small {
        color: rgba(255, 255, 255, .9);
        font-size: 11px;
        margin-top: 2px;
    }
}

@media (max-width: 640px) {
    .agenda-load-compact {
        grid-template-columns: 1fr;
    }
}

/* Task creation: one clear flow, compact planning and a single action area. */
.task-create-page {
    margin: 0 auto;
    max-width: 980px;
}

.task-create-backbar {
    margin-bottom: 8px;
}

.task-create-backbar .document-back {
    box-shadow: none;
    font-size: 13px;
    min-height: 36px;
    padding: 0 11px;
}

.task-create-panel {
    background: #FFFFFF;
    border: 1px solid #DDE4EA;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(34, 48, 58, .06);
    overflow: hidden;
}

.task-create-form {
    align-items: start;
    display: grid;
    gap: 0;
    grid-template-columns: minmax(0, 1fr);
}

.task-create-main {
    grid-column: 1;
    min-width: 0;
    padding: 0 16px;
}

.task-primary-grid {
    border-bottom: 1px solid #E1E7EC;
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
}

.task-create-section {
    background: transparent;
    border: 0;
    border-bottom: 1px solid #E7ECF0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 11px 0;
}

.task-create-section:last-child {
    border-bottom: 0;
}

.task-primary-grid .task-create-section {
    border-bottom: 0;
}

.task-primary-grid .task-essential-section {
    padding-right: 18px;
}

.task-primary-grid .task-schedule-section {
    background: #F8FBFC;
    border-left: 1px solid #E1E7EC;
    padding-left: 18px;
    padding-right: 18px;
}

.task-section-heading {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.task-section-heading h2 {
    color: #263746;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.task-create-form label {
    color: #586571;
    display: grid;
    font-size: 12px;
    font-weight: 750;
    gap: 4px;
    min-width: 0;
}

.task-create-form input,
.task-create-form select,
.task-create-form textarea {
    box-sizing: border-box;
    min-height: 36px;
    padding: 6px 9px;
    width: 100%;
}

.task-create-form input:focus,
.task-create-form select:focus,
.task-create-form textarea:focus {
    border-color: #0097B2;
    box-shadow: 0 0 0 3px rgba(0, 151, 178, .12);
    outline: 0;
}

.task-create-form textarea {
    min-height: 78px;
}

.task-create-form .task-title-field input {
    font-size: 15px;
    font-weight: 650;
    min-height: 40px;
}

.task-basics-grid,
.task-schedule-grid,
.task-priority-fields,
.task-link-selects,
.task-create-form .task-advanced-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.task-basics-grid {
    margin-top: 9px;
}

.task-priority-fields {
    background: #F7F9FB;
    border-left: 3px solid #0097B2;
    margin-top: 12px;
    padding: 10px 12px;
}

.task-priority-fields > [hidden] {
    display: none;
}

.task-priority-fields[hidden] {
    display: none;
}

.task-priority-help {
    color: #667583;
    font-size: 11.5px;
    grid-column: 1 / -1;
    margin: 0;
}

.task-schedule-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.task-duration-row {
    align-items: center;
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.task-duration-row > span {
    color: #71808C;
    flex: 0 0 auto;
    font-size: 11.5px;
    font-weight: 750;
}

.task-create-form .duration-chip-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.task-create-form .duration-chip-strip button {
    background: #FFFFFF;
    border: 1px solid #DCE4EA;
    border-radius: 6px;
    color: #4C5B67;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 750;
    min-height: 28px;
    padding: 4px 8px;
}

.task-create-form .duration-chip-strip button:hover,
.task-create-form .duration-chip-strip button.active {
    background: #EAF7FA;
    border-color: #70C4D2;
    color: #007D93;
}

.task-create-form .task-link-box {
    align-items: start;
    display: grid;
    gap: 8px 16px;
    grid-template-columns: 145px minmax(0, 1fr);
    padding: 11px 0;
}

.task-create-form .task-link-box > .task-section-heading {
    margin: 4px 0 0;
}

.task-create-form .task-link-box > :not(.task-section-heading):not(input[type="hidden"]) {
    grid-column: 2;
}

.task-create-form .task-link-options {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
}

.task-create-form .task-link-options label {
    align-items: center;
    background: #FFFFFF;
    border: 1px solid #DCE4EA;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    gap: 8px;
    min-height: 36px;
    padding: 6px 9px;
}

.task-create-form .task-link-options label:has(input:checked) {
    background: #EAF7FA;
    border-color: #70C4D2;
    color: #007D93;
}

.task-create-form .task-link-options input {
    flex: 0 0 18px;
    height: 18px;
    margin: 0;
    min-height: 18px;
    width: 18px;
}

.task-create-form .task-link-selects {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 2px;
}

.task-create-form .task-link-selects label[hidden],
.task-create-form .linked-selected[hidden] {
    display: none;
}

.task-create-form .linked-selected {
    margin-top: 10px;
}

.task-create-form .task-link-help {
    color: #74828E;
    font-size: 11.5px;
    margin: 0;
}

.task-create-form .task-advanced {
    padding: 10px 0 6px;
}

.task-create-form .task-advanced summary {
    align-items: center;
    color: #3F5261;
    cursor: pointer;
    display: flex;
    font-size: 13px;
    font-weight: 800;
    justify-content: space-between;
    list-style: none;
    padding: 3px 0;
}

.task-create-form .task-advanced summary::after {
    color: #7D8B96;
    content: "+";
    font-size: 18px;
    font-weight: 500;
}

.task-create-form .task-advanced[open] summary::after {
    content: "-";
}

.task-create-form .task-advanced summary::-webkit-details-marker {
    display: none;
}

.task-create-form .task-advanced-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 14px;
}

.task-create-form .task-advanced-grid .wide {
    grid-column: 1 / -1;
}

.task-submit-panel {
    align-items: center;
    background: #F7F9FB;
    border: 0;
    border-top: 1px solid #E1E7EC;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    gap: 16px;
    grid-column: 1;
    margin: 0;
    padding: 8px 16px;
    position: sticky;
    bottom: 0;
    z-index: 12;
}

.task-submit-state,
.task-submit-panel .task-total {
    align-items: center;
    background: transparent;
    border: 0;
    border-bottom: 0;
    border-radius: 0;
    display: flex;
    flex-direction: row;
    gap: 7px;
    padding: 0;
}

.task-submit-state span,
.task-submit-panel .task-total span {
    color: #74828E;
    font-size: 11.5px;
    font-weight: 750;
}

.task-submit-state strong {
    background: #EAF7FA;
    border-radius: 999px;
    color: #007D93;
    font-size: 11.5px;
    padding: 5px 8px;
}

.task-submit-panel .task-total {
    padding: 0;
}

.task-submit-panel .task-total strong {
    color: #243746;
    font-size: 15px;
}

.task-submit-panel .form-actions {
    display: flex;
    gap: 8px;
    margin: 0 0 0 auto;
}

.task-submit-panel .form-actions .btn {
    justify-content: center;
    min-height: 36px;
    width: auto;
}

@media (max-width: 900px) {
    .task-create-form {
        grid-template-columns: 1fr;
    }

    .task-create-main {
        padding: 0 14px;
    }

    .task-primary-grid {
        grid-template-columns: 1fr;
    }

    .task-primary-grid .task-essential-section {
        padding-right: 0;
    }

    .task-primary-grid .task-schedule-section {
        border-left: 0;
        border-top: 1px solid #E1E7EC;
        padding-left: 0;
        padding-right: 0;
    }

    .task-submit-panel {
        padding: 8px 14px;
    }

    .task-submit-state,
    .task-submit-panel .task-total {
        align-items: center;
        border-bottom: 0;
        flex-direction: row;
        justify-content: flex-start;
        gap: 8px;
        padding: 0;
    }

    .task-submit-panel .form-actions {
        display: flex;
        margin: 0 0 0 auto;
    }

    .task-submit-panel .form-actions .btn {
        min-width: 110px;
        width: auto;
    }
}

@media (max-width: 640px) {
    .task-create-backbar .document-back {
        width: fit-content;
    }

    .task-create-main {
        padding: 0 12px;
    }

    .task-basics-grid,
    .task-schedule-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .task-field-type {
        order: 1;
    }

    .task-field-priority {
        order: 2;
    }

    .task-field-assignee {
        grid-column: 1 / -1;
        order: 3;
    }

    .task-field-duration {
        grid-column: 1 / -1;
    }

    .task-priority-fields,
    .task-create-form .task-link-options,
    .task-create-form .task-link-selects,
    .task-create-form .task-advanced-grid {
        grid-template-columns: 1fr;
    }

    .task-create-form .task-link-box {
        gap: 8px;
        grid-template-columns: 1fr;
    }

    .task-create-form .task-link-box > :not(.task-section-heading):not(input[type="hidden"]) {
        grid-column: 1;
    }

    .task-duration-row {
        align-items: stretch;
        flex-direction: column;
        gap: 7px;
    }

    .task-create-form .duration-chip-strip {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .task-submit-panel {
        align-items: center;
        display: grid;
        gap: 8px;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 7px 10px;
    }

    .task-submit-panel .form-actions {
        grid-column: auto;
        gap: 5px;
    }

    .task-submit-panel .form-actions .btn {
        font-size: 12px;
        min-height: 34px;
        min-width: 0;
        padding: 6px 9px;
    }

    .task-submit-panel .task-total {
        align-items: flex-start;
        display: grid;
        gap: 0;
    }

    .task-submit-panel .task-total span {
        font-size: 10.5px;
    }

    .task-submit-panel .task-total strong {
        font-size: 13px;
    }
}

/* Appointment creation: essentials first, optional context on demand. */
.appointment-create-page {
    margin: 0 auto;
    max-width: 980px;
}

.appointment-create-backbar {
    margin-bottom: 8px;
}

.appointment-create-backbar .document-back {
    box-shadow: none;
    font-size: 13px;
    min-height: 36px;
    padding: 0 11px;
}

.appointment-create-panel {
    background: #FFFFFF;
    border: 1px solid #DDE4EA;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(34, 48, 58, .06);
    overflow: hidden;
}

.appointment-create-form {
    align-items: start;
    display: grid;
    gap: 0;
    grid-template-columns: minmax(0, 1fr);
    margin: 0;
    max-width: none;
}

.appointment-create-main {
    grid-column: 1;
    min-width: 0;
    padding: 0 16px;
}

.appointment-create-section {
    background: transparent;
    border: 0;
    border-bottom: 1px solid #E7ECF0;
    border-radius: 0;
    box-shadow: none;
    margin: 0;
    padding: 11px 0;
}

.appointment-core-section {
    border-bottom: 0;
}

.appointment-section-heading {
    align-items: baseline;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 7px;
}

.appointment-section-heading h2 {
    color: #263746;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.appointment-section-heading p {
    color: #74828E;
    font-size: 11.5px;
    line-height: 1.35;
    margin: 0;
    text-align: right;
}

.appointment-create-form .appointment-field {
    color: #586571;
    display: grid;
    font-size: 12px;
    font-weight: 750;
    gap: 4px;
    min-width: 0;
}

.appointment-create-form input,
.appointment-create-form select,
.appointment-create-form textarea {
    box-sizing: border-box;
    min-height: 36px;
    padding: 6px 9px;
    width: 100%;
}

.appointment-create-form input:focus,
.appointment-create-form select:focus,
.appointment-create-form textarea:focus {
    border-color: #0097B2;
    box-shadow: 0 0 0 3px var(--domiq-focus-ring);
    outline: 0;
}

.appointment-create-form textarea {
    min-height: 78px;
}

.appointment-purpose-grid,
.appointment-title-grid,
.appointment-commercial-grid,
.appointment-context-grid,
.appointment-plan-grid,
.appointment-advanced-grid {
    display: grid;
    gap: 7px;
}

.appointment-purpose-grid {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.appointment-title-grid {
    grid-template-columns: 1fr;
    margin-top: 7px;
}

.appointment-commercial-grid,
.appointment-context-grid {
    background: var(--domiq-section);
    border: 1px solid var(--domiq-border-strong);
    border-radius: 7px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 8px;
    padding: 8px;
}

.appointment-plan-grid {
    border-top: 1px solid #E7ECF0;
    grid-template-columns: 1.05fr .8fr .85fr 1.15fr 1.45fr;
    margin-top: 9px;
    padding-top: 9px;
}

.appointment-advanced-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.appointment-field-motivazione input,
.appointment-field-private-title input {
    font-size: 15px;
    font-weight: 650;
    min-height: 40px;
}

.appointment-field-all-day .checkline {
    align-items: center;
    background: #F7F9FB;
    border: 1px solid #DCE4EA;
    border-radius: 7px;
    display: flex;
    gap: 8px;
    min-height: 36px;
    padding: 5px 9px;
}

.appointment-field-all-day .checkline input {
    flex: 0 0 18px;
    height: 18px;
    margin: 0;
    min-height: 18px;
    width: 18px;
}

.appointment-duration-row {
    align-items: center;
    display: flex;
    gap: 8px;
    margin-top: 7px;
}

.appointment-duration-row > span {
    color: #71808C;
    flex: 0 0 auto;
    font-size: 11.5px;
    font-weight: 750;
}

.appointment-duration-row .duration-chip-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.appointment-duration-row button {
    background: #FFFFFF;
    border: 1px solid #DCE4EA;
    border-radius: 6px;
    color: #4C5B67;
    cursor: pointer;
    font-size: 11.5px;
    font-weight: 750;
    min-height: 28px;
    padding: 4px 8px;
}

.appointment-duration-row button:hover,
.appointment-duration-row button.active {
    background: #EAF7FA;
    border-color: #70C4D2;
    color: #007D93;
}

.appointment-private-owner-note {
    margin: 7px 0 0;
    min-height: 0;
    padding: 6px 9px;
}

.appointment-options-row {
    display: grid;
    gap: 0 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.appointment-participants {
    border-bottom: 0;
    margin: 0;
    padding: 9px 0;
}

.appointment-participants > summary,
.appointment-advanced > summary {
    align-items: center;
    color: #3F5261;
    cursor: pointer;
    display: flex;
    font-size: 13px;
    font-weight: 800;
    gap: 8px;
    justify-content: space-between;
    list-style: none;
    padding: 3px 0;
}

.appointment-participants > summary small,
.appointment-advanced > summary small {
    color: #7D8B96;
    font-size: 11px;
    font-weight: 650;
    margin-left: auto;
}

.appointment-participants > summary::after,
.appointment-advanced > summary::after {
    color: #7D8B96;
    content: "+";
    font-size: 18px;
    font-weight: 500;
}

.appointment-participants[open] > summary::after,
.appointment-advanced[open] > summary::after {
    content: "-";
}

.appointment-participants > summary::-webkit-details-marker,
.appointment-advanced > summary::-webkit-details-marker {
    display: none;
}

.appointment-participants-body,
.appointment-advanced-grid {
    margin-top: 8px;
}

.appointment-create-form .people-picker {
    border-color: #DCE4EA;
    border-radius: 7px;
    padding: 8px;
}

.appointment-create-form .people-picker-results {
    max-height: 176px;
}

.appointment-advanced {
    border-bottom: 0;
    padding: 9px 0;
}

.appointment-advanced-grid .wide {
    grid-column: 1 / -1;
}

.appointment-submit-panel {
    align-items: center;
    background: #F7F9FB;
    border-top: 1px solid #DDE4EA;
    display: flex;
    gap: 16px;
    grid-column: 1;
    padding: 8px 16px;
    position: sticky;
    bottom: 0;
    z-index: 12;
}

.appointment-submit-state,
.appointment-submit-summary {
    align-items: center;
    border-bottom: 0;
    display: flex;
    flex-direction: row;
    gap: 7px;
    padding: 0;
}

.appointment-submit-state > span,
.appointment-submit-summary > span {
    color: #74828E;
    font-size: 11.5px;
    font-weight: 750;
}

.appointment-submit-state strong {
    background: #EAF7FA;
    border-radius: 999px;
    color: #007D93;
    font-size: 11.5px;
    padding: 5px 8px;
}

.appointment-submit-summary {
    padding: 0;
}

.appointment-submit-summary strong {
    color: #243746;
    font-size: 15px;
}

.appointment-submit-summary small {
    color: #667583;
    font-size: 12px;
}

.appointment-submit-panel .form-actions {
    display: flex;
    gap: 8px;
    margin: 0 0 0 auto;
}

.appointment-submit-panel .form-actions .btn {
    justify-content: center;
    min-height: 36px;
    width: auto;
}

.appointment-create-main > .appointment-overlap-warning {
    margin: 14px 0 0;
}

@media (max-width: 900px) {
    .appointment-create-main {
        padding: 0 14px;
    }

    .appointment-plan-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .appointment-field-responsabile-id {
        grid-column: span 2;
    }

    .appointment-options-row {
        grid-template-columns: 1fr;
    }

    .appointment-participants {
        border-bottom: 1px solid #E7ECF0;
    }

    .appointment-submit-panel {
        padding: 8px 14px;
    }

    .appointment-submit-panel .form-actions {
        display: flex;
        margin: 0 0 0 auto;
    }

    .appointment-submit-panel .form-actions .btn {
        min-width: 110px;
        width: auto;
    }
}

@media (max-width: 640px) {
    .appointment-create-backbar .document-back {
        width: fit-content;
    }

    .appointment-create-main {
        padding: 0 12px;
    }

    .appointment-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .appointment-section-heading p {
        text-align: left;
    }

    .appointment-purpose-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .appointment-title-grid,
    .appointment-commercial-grid,
    .appointment-context-grid,
    .appointment-advanced-grid {
        grid-template-columns: 1fr;
    }

    .appointment-plan-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .appointment-field-responsabile-id {
        grid-column: 1 / -1;
    }

    .appointment-duration-row {
        align-items: stretch;
        flex-direction: column;
        gap: 7px;
    }

    .appointment-duration-row .duration-chip-strip {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .appointment-private-owner-note,
    .appointment-field-motivazione,
    .appointment-field-private-title,
    .appointment-advanced-grid .wide {
        grid-column: 1;
    }

    .appointment-create-form .people-picker-controls {
        grid-template-columns: 1fr;
    }

    .appointment-submit-panel {
        align-items: center;
        display: grid;
        gap: 8px;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 7px 10px;
    }

    .appointment-submit-panel .form-actions {
        grid-column: auto;
        gap: 5px;
    }

    .appointment-submit-panel .form-actions .btn {
        font-size: 12px;
        min-height: 34px;
        min-width: 0;
        padding: 6px 9px;
    }

    .appointment-submit-summary {
        align-items: flex-start;
        display: grid;
        gap: 0;
    }

    .appointment-submit-summary > span {
        display: none;
    }

    .appointment-submit-summary strong {
        font-size: 13px;
    }

    .appointment-submit-summary small {
        font-size: 11px;
    }
}

/* 2026-07 unified compact form system */
.compact-editor-panel {
    border-radius: 8px;
    max-width: 1120px;
    overflow: hidden;
    padding: 0;
}

.compact-editor-form {
    display: block;
}

.compact-editor-toolbar {
    align-items: center;
    background: #F7FAFB;
    border-bottom: 1px solid #E1E7EC;
    display: flex;
    gap: 14px;
    justify-content: space-between;
    min-height: 54px;
    padding: 8px 14px;
}

.compact-editor-toolbar > div:first-child {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.compact-editor-toolbar strong {
    color: #243746;
    font-size: 14px;
    font-weight: 800;
}

.compact-editor-toolbar small {
    color: #6B7985;
    font-size: 12px;
    line-height: 1.35;
}

.compact-editor-toolbar .form-actions {
    flex: 0 0 auto;
    margin: 0;
}

.compact-editor-toolbar .btn {
    min-height: 36px;
}

.compact-form-section {
    padding: 12px 14px 14px;
}

.compact-section-head {
    align-items: baseline;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 8px;
}

.compact-section-head h2 {
    color: #243746;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
}

.compact-section-head span {
    color: #798691;
    font-size: 11.5px;
}

.compact-editor-fields {
    display: grid;
    gap: 8px 10px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.compact-editor-fields > label,
.compact-editor-fields > fieldset {
    min-width: 0;
}

.compact-editor-form label,
.compact-standalone-form label,
.payment-template-form label {
    color: #52616D;
    font-size: 12.5px;
    font-weight: 750;
    gap: 5px;
}

.compact-editor-form input,
.compact-editor-form select,
.compact-editor-form textarea,
.compact-standalone-form input,
.compact-standalone-form select,
.payment-template-form input,
.payment-template-form select {
    border-color: #D8E1E7;
    border-radius: 7px;
    min-height: 36px;
    padding: 6px 9px;
}

.compact-editor-form textarea {
    min-height: 72px;
}

.compact-editor-form input:focus,
.compact-editor-form select:focus,
.compact-editor-form textarea:focus,
.compact-standalone-form input:focus,
.compact-standalone-form select:focus,
.payment-template-form input:focus,
.payment-template-form select:focus {
    border-color: #0097B2;
    box-shadow: 0 0 0 3px rgba(0, 151, 178, .13);
    outline: none;
}

.compact-editor-form .check-field,
.compact-editor-fields .check-field {
    align-content: end;
}

.compact-editor-form .checkline {
    background: #F8FBFC;
    border: 1px solid #DCE5EA;
    border-radius: 7px;
    box-sizing: border-box;
    min-height: 36px;
    padding: 6px 9px;
}

.compact-optional-section {
    border: 0;
    border-top: 1px solid #E1E7EC;
    margin: 0;
    padding: 0;
}

.compact-optional-section > summary {
    align-items: center;
    color: #334A59;
    cursor: pointer;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    list-style: none;
    min-height: 42px;
    padding: 8px 14px;
}

.compact-optional-section > summary::-webkit-details-marker {
    display: none;
}

.compact-optional-section > summary span {
    font-size: 13px;
    font-weight: 800;
}

.compact-optional-section > summary small {
    color: #7A8791;
    font-size: 11.5px;
    font-weight: 500;
    margin-left: auto;
}

.compact-optional-section > summary::after {
    color: #0097B2;
    content: "+";
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
}

.compact-optional-section[open] > summary {
    background: #F8FBFC;
    border-bottom: 1px solid #E7EDF1;
}

.compact-optional-section[open] > summary::after {
    content: "−";
}

.compact-editor-fields-optional {
    background: #FCFDFE;
    padding: 11px 14px 13px;
}

.compact-standalone-panel,
.payment-template-panel {
    max-width: 960px;
}

.compact-standalone-form,
.payment-template-form {
    display: block;
}

.compact-standalone-form > .compact-editor-fields,
.payment-template-basics {
    padding: 12px 14px 14px;
}

.payment-template-form > .line-editor {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    margin: 0;
}

.unified-form-page {
    margin: 0 auto;
    max-width: 1240px;
}

.compact-document-toolbar {
    align-items: center;
    gap: 12px;
    grid-template-columns: minmax(150px, 1fr) minmax(220px, 320px) minmax(130px, 1fr);
    margin: 0 0 12px;
}

.compact-document-toolbar .document-back {
    box-shadow: none;
    min-height: 38px;
}

.compact-document-toolbar .document-selector {
    font-size: 11.5px;
    gap: 3px;
}

.compact-document-toolbar .document-selector select {
    font-size: 13px;
    min-height: 38px;
}

.compact-document-toolbar .document-number {
    font-size: 15px;
    padding: 0;
}

.unified-case-form {
    gap: 12px;
    grid-template-columns: minmax(240px, .8fr) minmax(0, 1.7fr);
}

.unified-case-form .document-card,
.unified-case-form .document-summary,
.unified-quote-form .document-card,
.unified-quote-form .line-editor,
.unified-quote-form .quote-notes-grid {
    border-color: #E1E7EC;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(35, 55, 68, .045);
    padding: 12px;
}

.unified-case-form .document-card h2,
.unified-case-form .document-summary h2,
.unified-quote-form .document-card h2 {
    color: #2D4655;
    font-size: 14px;
    margin-bottom: 9px;
    text-align: left;
}

.unified-case-form .document-card-client {
    grid-column: 1;
    grid-row: 1;
}

.unified-case-form .document-card-main {
    grid-column: 2;
    grid-row: 1;
}

.unified-case-form .document-card-side {
    grid-column: 1;
    grid-row: 2;
}

.unified-case-form .document-card-side .people-picker-controls {
    grid-template-columns: 1fr;
}

.unified-case-form .document-card-side .people-picker-result {
    min-width: 0;
}

.unified-case-form .document-card-wide {
    grid-column: 2;
    grid-row: 2;
}

.unified-case-form .document-summary {
    align-items: center;
    display: grid;
    gap: 12px;
    grid-column: 1 / -1;
    grid-row: auto;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 10px 12px;
}

.unified-case-form .document-summary h2 {
    margin: 0;
}

.unified-case-form .document-summary dl {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
}

.unified-case-form .document-summary dl div {
    background: #F7FAFB;
    border: 1px solid #E3EAEE;
    border-radius: 6px;
    display: grid;
    gap: 1px;
    padding: 6px 8px;
}

.unified-case-form .document-summary dd {
    color: #007D93;
    font-size: 13px;
    text-align: left;
}

.unified-case-form .document-summary-actions {
    display: flex;
    gap: 7px;
}

.unified-case-form .document-summary-actions .btn {
    min-height: 36px;
    width: auto;
}

.unified-quote-form {
    gap: 12px;
    grid-template-columns: minmax(220px, .75fr) minmax(420px, 1.6fr) minmax(230px, .8fr);
}

.unified-quote-form .quote-document-client {
    grid-column: 1;
    grid-row: 1;
}

.unified-quote-form .quote-document-data {
    grid-column: 2;
    grid-row: 1;
}

.unified-quote-form .quote-document-options {
    grid-column: 3;
    grid-row: 1;
}

.unified-quote-form .quote-product-list,
.unified-quote-form .quote-payment-card,
.unified-quote-form .quote-notes-grid {
    grid-column: 1 / -1;
}

.unified-quote-form .quote-product-list {
    margin-top: 0;
}

.unified-quote-form .document-card-grid {
    gap: 8px 10px;
}

.unified-quote-form input,
.unified-quote-form select {
    min-height: 37px;
}

.unified-quote-form textarea {
    min-height: 64px;
}

.unified-quote-form input:focus,
.unified-quote-form select:focus,
.unified-quote-form textarea:focus {
    border-color: #0097B2;
    box-shadow: 0 0 0 3px rgba(0, 151, 178, .13);
}

.unified-quote-form .quote-product-list .panel-head,
.unified-quote-form .quote-payment-card .panel-head {
    margin-bottom: 8px;
}

.settings-section-panel {
    margin-left: auto;
    margin-right: auto;
    max-width: 1240px;
    padding: 14px;
}

.settings-section-panel > h3 {
    color: #23384A;
    font-size: 14px;
    margin: 14px 0 8px;
}

.settings-catalog-separator {
    border-top: 1px solid #D8E1E7;
    margin: 18px 0 4px;
}

.settings-form > .panel-head {
    margin-bottom: 11px;
}

.settings-form > .panel-head h2 {
    font-size: 15px;
}

.settings-form > .form-grid,
.settings-list-grid {
    gap: 10px 12px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.settings-form input,
.settings-form select,
.settings-form textarea {
    border-color: #D8E1E7;
    min-height: 38px;
}

.settings-form input:focus,
.settings-form select:focus,
.settings-form textarea:focus {
    border-color: #0097B2;
    box-shadow: 0 0 0 3px rgba(0, 151, 178, .13);
    outline: none;
}

.settings-form > .form-actions {
    border-top: 1px solid #E5EBEF;
    margin-top: 12px;
    padding-top: 10px;
}

@media (max-width: 1080px) {
    .unified-case-form,
    .unified-quote-form {
        grid-template-columns: 1fr 1fr;
    }

    .unified-case-form .document-card-client,
    .unified-case-form .document-card-main,
    .unified-case-form .document-card-side,
    .unified-case-form .document-card-wide,
    .unified-case-form .document-summary,
    .unified-quote-form .quote-document-client,
    .unified-quote-form .quote-document-data,
    .unified-quote-form .quote-document-options,
    .unified-quote-form .quote-product-list,
    .unified-quote-form .quote-payment-card,
    .unified-quote-form .quote-notes-grid {
        grid-column: 1 / -1;
        grid-row: auto;
    }

    .unified-quote-form .quote-document-client {
        grid-column: 1;
        grid-row: 1;
    }

    .unified-quote-form .quote-document-options {
        grid-column: 2;
        grid-row: 1;
    }

    .unified-quote-form .quote-document-data {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

@media (max-width: 700px) {
    .compact-editor-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 9px;
    }

    .compact-editor-toolbar .form-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .compact-editor-toolbar .btn {
        justify-content: center;
        width: 100%;
    }

    .compact-section-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }

    .compact-editor-fields {
        grid-template-columns: 1fr;
    }

    .compact-optional-section > summary small {
        display: none;
    }

    .compact-document-toolbar {
        align-items: center;
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .compact-document-toolbar .document-selector {
        display: none;
    }

    .compact-document-toolbar .document-back {
        max-width: 100%;
        width: auto;
    }

    .compact-document-toolbar .document-number {
        justify-self: end;
        margin: 0;
    }

    .unified-case-form,
    .unified-quote-form {
        grid-template-columns: 1fr;
    }

    .unified-quote-form .quote-document-client,
    .unified-quote-form .quote-document-data,
    .unified-quote-form .quote-document-options {
        grid-column: 1;
        grid-row: auto;
    }

    .unified-case-form .document-summary {
        align-items: stretch;
        grid-template-columns: 1fr;
    }

    .unified-case-form .document-summary dl {
        grid-template-columns: 1fr 1fr;
    }

    .unified-case-form .document-summary-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .unified-case-form .document-summary-actions .btn {
        justify-content: center;
        width: 100%;
    }
}

/* Incassi: azioni compatte e menu ancorato alla propria riga. */
.table-wrap.compact .receivables-table {
    min-width: 1180px;
}

.receivables-table th:nth-child(9) {
    width: 250px;
}

.receivables-action-cell {
    overflow: visible;
    position: relative;
    vertical-align: middle;
    white-space: nowrap;
}

.receivables-action-cluster {
    align-items: center;
    display: flex;
    gap: 6px;
    justify-content: flex-end;
    min-width: 0;
}

.receivables-action-cluster > a,
.receivables-action-cluster > .inline-form button,
.receivables-row-more > summary {
    align-items: center;
    background: #FFFFFF;
    border: 1px solid var(--domiq-border);
    border-radius: 6px;
    color: var(--domiq-primary-strong);
    display: inline-flex;
    font-size: 12px;
    font-weight: 750;
    justify-content: center;
    line-height: 1.2;
    margin: 0;
    min-height: 32px;
    padding: 7px 9px;
    text-decoration: none;
    white-space: nowrap;
}

.receivables-action-cluster > a:hover,
.receivables-action-cluster > .inline-form button:hover,
.receivables-row-more > summary:hover {
    background: var(--domiq-row-hover);
    border-color: var(--domiq-primary);
}

.receivables-action-cluster > .inline-form {
    display: block;
    margin: 0;
}

.receivables-row-more,
.receivables-row-more[open] {
    border: 0;
    flex: 0 0 auto;
    padding: 0;
    position: relative;
}

.receivables-row-more > summary {
    cursor: pointer;
    list-style: none;
}

.receivables-row-more > summary::-webkit-details-marker {
    display: none;
}

.receivables-row-more > summary::marker {
    content: "";
}

.receivables-action-menu {
    display: none;
}

.receivables-row-more[open] {
    z-index: 60;
}

.receivables-row-more[open] .receivables-action-menu {
    background: #FFFFFF;
    border: 1px solid var(--domiq-border);
    border-radius: 7px;
    box-shadow: 0 10px 24px rgba(23, 46, 58, .16);
    display: grid;
    gap: 2px;
    min-width: 172px;
    padding: 5px;
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
}

/* Keep the dropdown inside the horizontally scrollable table viewport. */
.table-wrap.compact:has(.receivables-row-more[open]) {
    padding-bottom: 96px;
}

.receivables-row-more[open] .receivables-action-menu > a,
.receivables-row-more[open] .receivables-action-menu > form {
    background: transparent;
    border: 0;
    box-shadow: none;
    display: block;
    margin: 0;
    min-width: 0;
    padding: 0;
    position: static;
    text-align: left;
}

.receivables-action-menu > a,
.receivables-action-menu button,
.receivables-action-menu input {
    box-sizing: border-box;
    width: 100%;
}

.receivables-action-menu > a,
.receivables-action-menu button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 5px;
    color: var(--domiq-text);
    display: flex;
    font-size: 12px;
    font-weight: 700;
    justify-content: flex-start;
    min-height: 34px;
    padding: 8px 10px;
    text-align: left;
    text-decoration: none;
}

.receivables-action-menu > a:hover,
.receivables-action-menu button:hover {
    background: var(--domiq-row-hover);
}

.receivables-action-menu .danger-link {
    color: var(--domiq-danger);
}

@media (max-width: 720px) {
    .receivables-action-cluster {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .receivables-row-more[open] .receivables-action-menu {
        left: 0;
        right: auto;
    }
}

/* 2026-07 visual clarity and deterministic Agenda alignment */
body,
.content {
    background: var(--domiq-canvas-strong);
}

.panel,
.metric-card,
.card,
.section-card,
.table-wrap {
    border-color: var(--domiq-border-strong);
}

.panel {
    box-shadow: 0 2px 8px rgba(31, 45, 56, .055);
}

.panel-head {
    border-bottom-color: #D7E0E6;
}

input,
select,
textarea,
.input,
.select {
    background-color: var(--domiq-field);
    border-color: var(--domiq-border-strong);
}

input:hover,
select:hover,
textarea:hover {
    border-color: #AAB9C3;
}

input:focus,
select:focus,
textarea:focus {
    background-color: #FFFFFF;
}

.table-wrap,
table {
    background: #FFFFFF;
}

th {
    background: #EAF0F3;
    border-bottom-color: #C8D3DA;
    color: #31424E;
}

tbody tr:hover > td {
    background: var(--domiq-row-hover);
}

.compact-editor-panel {
    border: 1px solid var(--domiq-border-strong);
    border-top: 3px solid var(--domiq-primary);
    box-shadow: 0 5px 16px rgba(31, 45, 56, .075);
    max-width: 1040px;
}

.compact-editor-toolbar {
    background: var(--domiq-section-strong);
    border-bottom-color: #C9D8DD;
    min-height: 52px;
    padding: 8px 14px;
}

.compact-editor-toolbar strong {
    color: #183845;
    font-size: 14.5px;
}

.compact-editor-toolbar small {
    color: #566B77;
}

.compact-form-section {
    background: #FFFFFF;
    padding: 12px 14px 15px;
}

.compact-section-head {
    border-bottom: 1px solid #DCE4E9;
    margin-bottom: 10px;
    padding-bottom: 8px;
}

.compact-section-head h2 {
    color: #1D3B48;
}

.compact-editor-fields {
    gap: 10px 12px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-editor-form label,
.compact-standalone-form label,
.payment-template-form label {
    color: #344651;
    gap: 4px;
}

.field-label {
    align-items: baseline;
    display: inline-flex;
    gap: 4px;
    line-height: 1.25;
    min-height: 16px;
}

.field-label .required {
    margin-left: 0;
}

.compact-editor-form input,
.compact-editor-form select,
.compact-editor-form textarea,
.compact-standalone-form input,
.compact-standalone-form select,
.payment-template-form input,
.payment-template-form select {
    background: #FFFFFF;
    border-color: var(--domiq-border-strong);
    min-height: 40px;
}

.compact-optional-section {
    background: var(--domiq-section);
    border-top-color: #CBD6DD;
}

.compact-optional-section > summary {
    min-height: 44px;
}

.compact-optional-section > summary:hover {
    background: #EAF2F4;
    color: var(--domiq-primary-strong);
}

.compact-editor-fields-optional {
    background: #F9FBFC;
    border-top: 1px solid #DCE4E9;
}

.agenda-calendar-focus {
    background: #FFFFFF;
    border-color: #BCC9D1;
    box-shadow: 0 3px 10px rgba(31, 45, 56, .065);
}

.agenda-calendar-focus .agenda-all-day-grid,
.agenda-calendar-focus .calendar-grid {
    box-sizing: border-box;
    grid-template-columns: var(--agenda-columns);
    min-width: var(--agenda-grid-min-width);
    width: 100%;
}

.agenda-crosshair-row,
.agenda-crosshair-column {
    background: transparent;
}

.agenda-crosshair-row {
    background: rgba(0, 111, 131, .42);
    height: 2px;
    right: auto;
    transform: translateY(-1px);
}

.agenda-crosshair-column {
    box-shadow: inset 1px 0 rgba(0, 111, 131, .16), inset -1px 0 rgba(0, 111, 131, .16);
}

.calendar-slot-line.is-cell-active {
    background: rgba(0, 111, 131, .09);
    box-shadow: inset 0 0 0 1px rgba(0, 111, 131, .28);
}

.calendar-day-head.is-axis-active,
.calendar-times span.is-axis-active {
    background: #D5E9ED;
    color: #004C59;
}

.agenda-calendar-focus .calendar-event {
    box-sizing: border-box;
    line-height: 1.15;
    left: calc(var(--event-lane-left, 0%) + 4px);
    min-height: 0;
    right: auto;
    top: calc(var(--event-top) + 1px);
    height: max(6px, calc(var(--event-height) - 2px));
    width: calc(var(--event-lane-width, 100%) - 8px);
}

.agenda-calendar-focus .calendar-slot-line {
    border-bottom: 0;
}

.agenda-calendar-focus .calendar-slot-line.is-hour-start,
.agenda-calendar-focus .calendar-times span.is-hour-start {
    border-top: 1px solid #C8D5DC;
}

.agenda-calendar-focus .calendar-slot-line.is-half-hour-start,
.agenda-calendar-focus .calendar-times span.is-half-hour-start {
    border-top: 1px solid #E5EBEF;
}

/* Keep each event readable without letting its content spill into the next slot. */
.agenda-calendar-focus .calendar-event.density-micro,
.agenda-calendar-focus .calendar-event.density-compact {
    align-items: center;
    display: flex;
    padding: 1px 5px;
}

.agenda-calendar-focus .calendar-event.density-micro > :not(.event-title):not(.priority-dot),
.agenda-calendar-focus .calendar-event.density-compact > :not(.event-title):not(.priority-dot) {
    display: none !important;
}

.agenda-calendar-focus .calendar-event.density-micro .event-title,
.agenda-calendar-focus .calendar-event.density-compact .event-title {
    font-size: 10.5px;
    line-height: 1;
    padding-right: 11px;
    width: 100%;
}

.agenda-calendar-focus .calendar-event.density-micro .priority-dot,
.agenda-calendar-focus .calendar-event.density-compact .priority-dot,
.agenda-calendar-focus .calendar-event.density-medium .priority-dot {
    border-width: 0;
    font-size: 0;
    height: 7px;
    margin: 0;
    padding: 0;
    position: absolute;
    right: 4px;
    top: 4px;
    width: 7px;
}

.agenda-calendar-focus .calendar-event.density-medium {
    padding: 3px 6px;
}

.agenda-calendar-focus .calendar-event.density-medium .event-title {
    font-size: 10.8px;
    line-height: 1.1;
    padding-right: 11px;
}

.agenda-calendar-focus .calendar-event.density-medium .event-context,
.agenda-calendar-focus .calendar-event.density-medium .event-time-meta {
    font-size: 9.5px;
    line-height: 1.1;
}

.agenda-calendar-focus .calendar-event.density-medium .event-commercial-secondary,
.agenda-calendar-focus .calendar-event.density-medium .event-commercial-participants,
.agenda-calendar-focus .calendar-event.density-medium .event-kind-label,
.agenda-calendar-focus .calendar-event.density-medium .danger {
    display: none !important;
}

.calendar-grid.is-dragging .agenda-crosshair-row,
.calendar-grid.is-dragging .agenda-crosshair-column {
    display: none;
}

.agenda-drop-preview {
    align-items: flex-start;
    background: rgba(0, 151, 178, .2);
    border: 2px dashed #00798E;
    border-radius: 5px;
    box-sizing: border-box;
    color: #004C59;
    display: flex;
    font-size: 10px;
    font-weight: 850;
    justify-content: flex-start;
    left: 3px;
    line-height: 1.15;
    min-height: 8px;
    overflow: hidden;
    padding: 3px 5px;
    pointer-events: none;
    position: absolute;
    right: 3px;
    z-index: 9;
}

.calendar-day-col.is-drop-target {
    box-shadow: inset 0 0 0 2px rgba(0, 121, 142, .28);
}

.agenda-calendar-focus .calendar-event:focus-visible {
    box-shadow: 0 0 0 2px var(--domiq-primary-strong), 0 2px 7px rgba(31, 45, 56, .2);
    outline: 2px solid rgba(255, 255, 255, .92);
    outline-offset: -4px;
}

.agenda-calendar-focus .calendar-event:hover {
    border-color: rgba(255, 255, 255, .78);
    box-shadow: 0 5px 14px rgba(20, 43, 55, .28), 0 0 0 2px var(--domiq-primary-strong);
    filter: brightness(1.06) saturate(1.04);
    z-index: 7;
}

.agenda-calendar-focus .calendar-event.private-unavailable:hover,
.agenda-calendar-focus .calendar-event.organizational-absence:hover {
    box-shadow: 0 5px 14px rgba(52, 31, 91, .3), 0 0 0 2px #4C318C;
}

.agenda-legend i.travel {
    background: #B86B00;
}

.agenda-calendar-focus .calendar-event.travel-segment {
    background: #B86B00 !important;
    border-color: #8A4E00 !important;
    border-left-color: #663900 !important;
    color: #FFFFFF !important;
}

.agenda-calendar-focus .calendar-event.travel-segment span,
.agenda-calendar-focus .calendar-event.travel-segment small,
.agenda-calendar-focus .calendar-event.travel-segment em {
    color: rgba(255, 255, 255, .9) !important;
}

.agenda-calendar-focus .calendar-event.travel-segment:hover {
    background: #9D5900 !important;
    box-shadow: 0 5px 14px rgba(75, 42, 0, .32), 0 0 0 2px #663900;
}

.agenda-mobile-event.travel-segment {
    background: #B86B00 !important;
    border-left-color: #663900 !important;
    color: #FFFFFF !important;
}

.agenda-mobile-event.travel-segment small {
    color: rgba(255, 255, 255, .9) !important;
}

@media (max-width: 900px) {
    .compact-editor-fields {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1025px) and (max-width: 1280px) {
    .task-list-filters.compact-filter-bar {
        grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(112px, .7fr)) auto auto;
    }
}

@media (min-width: 1180px) and (max-width: 1280px) {
    .case-filters.compact-filter-bar,
    .receivables-filters.compact-filter-bar {
        grid-template-columns: minmax(180px, 1.35fr) repeat(3, minmax(112px, .72fr)) auto auto;
    }
}

@media (max-width: 620px) {
    .compact-editor-panel {
        border-left: 0;
        border-radius: 0;
        border-right: 0;
    }

    .compact-editor-fields {
        grid-template-columns: 1fr;
    }
}

/* Gate 7E: agenda creation, recurrence and priority cues. */
.agenda-create-choice {
    max-width: 520px;
    padding: 0;
}

.agenda-create-choice .panel-head {
    background: #F3F8FA;
    border-bottom: 1px solid #D5E1E6;
    padding: 14px 16px;
}

.agenda-create-choice .panel-head h2 {
    color: #183845;
    font-size: 18px;
    margin: 0 0 3px;
}

.agenda-create-choice .panel-head p {
    color: #667985;
    font-size: 12.5px;
    margin: 0;
}

.agenda-create-options {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 14px 16px 16px;
}

.agenda-create-option {
    background: #FFFFFF;
    border: 1px solid #CCD9DF;
    border-left: 4px solid #0097B2;
    border-radius: 7px;
    color: #243746;
    display: grid;
    gap: 4px;
    min-height: 94px;
    padding: 15px;
    text-decoration: none;
}

.agenda-create-option:hover,
.agenda-create-option:focus-visible {
    background: #EAF7FA;
    border-color: #70C4D2;
    color: #006E82;
    outline: 0;
}

.agenda-create-option strong {
    font-size: 15px;
}

.agenda-create-option span {
    color: #667985;
    font-size: 12px;
    line-height: 1.4;
}

.appointment-recurrence-row {
    align-items: end;
    background: #F5F9FA;
    border: 1px solid #D5E1E6;
    border-left: 3px solid #0097B2;
    border-radius: 7px;
    display: grid;
    gap: 8px 12px;
    grid-template-columns: repeat(2, minmax(170px, 240px)) minmax(220px, 1fr);
    margin-top: 9px;
    padding: 9px 11px;
}

.appointment-recurrence-row p,
.appointment-history-note {
    color: #5D707C;
    font-size: 11.5px;
    line-height: 1.4;
    margin: 0;
}

.appointment-history-note {
    background: #F5F9FA;
    border-left: 3px solid #0097B2;
    margin-top: 9px;
    padding: 8px 10px;
}

.task-create-form[data-priority-tone="p1"] .task-priority-fields {
    background: #FFF4F2;
    border-left-color: #B42318;
}

.task-create-form[data-priority-tone="p2"] .task-priority-fields {
    background: #FFF9E8;
    border-left-color: #D89D00;
}

.task-create-form[data-priority-tone="p3"] .task-priority-fields {
    background: #F0F6FD;
    border-left-color: #2767B1;
}

.task-create-form[data-priority-tone="p1"] .task-field-priority select {
    border-color: #B42318;
    box-shadow: inset 3px 0 #B42318;
}

.task-create-form[data-priority-tone="p2"] .task-field-priority select {
    border-color: #D89D00;
    box-shadow: inset 3px 0 #D89D00;
}

.task-create-form[data-priority-tone="p3"] .task-field-priority select {
    border-color: #2767B1;
    box-shadow: inset 3px 0 #2767B1;
}

@media (max-width: 760px) {
    .agenda-create-options,
    .appointment-recurrence-row {
        grid-template-columns: 1fr;
    }

    .agenda-create-option {
        min-height: 76px;
    }
}

/* Gate 7F: compact, guided creation flows. */
.task-create-page,
.appointment-create-page {
    max-width: 900px;
}

.task-create-main,
.appointment-create-main {
    padding: 0 12px;
}

.task-primary-grid {
    border-bottom: 0;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr);
    padding: 10px 0;
}

.task-primary-grid .task-create-section {
    border: 1px solid #D7E2E7;
    border-left-width: 4px;
    border-radius: 7px;
    padding: 10px 12px;
}

.task-primary-grid .task-essential-section {
    background: #F3F9FA;
    border-left-color: #0097B2;
    padding: 10px 12px;
}

.task-primary-grid .task-schedule-section {
    background: #F3F7FC;
    border-left: 4px solid #2767B1;
    padding: 10px 12px;
}

.task-create-form .task-link-box {
    background: #F3F9F6;
    border-left-color: #1F8A5B;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr);
    padding: 10px 12px;
}

.task-create-form .task-link-box > .task-section-heading {
    margin: 0 0 2px;
}

.task-create-form .task-link-box > :not(.task-section-heading):not(input[type="hidden"]) {
    grid-column: 1;
}

.task-section-title,
.appointment-section-title {
    align-items: center;
    display: flex;
    gap: 8px;
    min-width: 0;
}

.task-step-index,
.appointment-step-index {
    align-items: center;
    background: #007F96;
    border-radius: 50%;
    color: #FFFFFF;
    display: inline-flex;
    flex: 0 0 22px;
    font-size: 11px;
    font-weight: 800;
    height: 22px;
    justify-content: center;
    line-height: 1;
    width: 22px;
}

.task-schedule-section .task-step-index,
.appointment-planning-block .appointment-step-index {
    background: #2767B1;
}

.task-link-box .task-step-index {
    background: #1F8A5B;
}

.task-priority-key {
    align-items: center;
    display: flex;
    gap: 5px;
}

.task-priority-key span {
    border: 1px solid currentColor;
    border-radius: 999px;
    font-size: 10.5px;
    font-weight: 850;
    line-height: 1;
    opacity: .62;
    padding: 4px 7px;
}

.task-priority-key .priority-key-p1 {
    background: #FFF0EE;
    color: #B42318;
}

.task-priority-key .priority-key-p2 {
    background: #FFF8E5;
    color: #A66A00;
}

.task-priority-key .priority-key-p3 {
    background: #EEF5FD;
    color: #2767B1;
}

.task-create-form[data-priority-tone="p1"] .priority-key-p1,
.task-create-form[data-priority-tone="p2"] .priority-key-p2,
.task-create-form[data-priority-tone="p3"] .priority-key-p3 {
    box-shadow: 0 0 0 2px #FFFFFF, 0 0 0 3px currentColor;
    opacity: 1;
}

.appointment-core-section {
    display: grid;
    gap: 8px;
    padding: 10px 0;
}

.appointment-section-block {
    background: #F3F9FA;
    border: 1px solid #D7E2E7;
    border-left: 4px solid #0097B2;
    border-radius: 7px;
    padding: 10px 12px;
}

.appointment-planning-block {
    background: #F3F7FC;
    border-left-color: #2767B1;
}

.appointment-planning-block .appointment-plan-grid {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.appointment-create-form[data-appointment-tone="private_personal"] .appointment-identity-block {
    background: #F7F3FC;
    border-left-color: #7252B8;
}

.appointment-create-form[data-appointment-tone="private_personal"] .appointment-identity-block .appointment-step-index {
    background: #7252B8;
}

.appointment-create-form[data-appointment-tone="organizational_absence"] .appointment-identity-block {
    background: #FFF8ED;
    border-left-color: #B86A18;
}

.appointment-create-form[data-appointment-tone="organizational_absence"] .appointment-identity-block .appointment-step-index {
    background: #B86A18;
}

.appointment-create-form[data-appointment-tone="private_personal"] .appointment-field-event-scope select {
    border-color: #8C73C5;
    box-shadow: inset 3px 0 #7252B8;
}

.appointment-create-form[data-appointment-tone="organizational_absence"] .appointment-field-event-scope select {
    border-color: #CE8A42;
    box-shadow: inset 3px 0 #B86A18;
}

@media (max-width: 640px) {
    .task-primary-grid .task-create-section,
    .task-primary-grid .task-essential-section,
    .task-primary-grid .task-schedule-section,
    .task-create-form .task-link-box,
    .appointment-section-block {
        padding: 9px 10px;
    }

    .task-section-heading,
    .appointment-section-heading {
        align-items: flex-start;
        gap: 7px;
    }

    .task-priority-key {
        margin-left: auto;
    }
}

/* Gate 7D-A: commercial appointments remain compact and visually traceable. */
.appointment-create-form[data-appointment-context="commercial"] .appointment-identity-block {
    background: #F0FAFB;
    border-left-color: #0097B2;
}

.appointment-create-form[data-appointment-context="commercial"] .appointment-step-index {
    background: #0097B2;
}

.appointment-create-form[data-appointment-context="commercial"] .appointment-context-grid {
    background: #F7FBFC;
    border-color: #BFDDE3;
}

.appointment-context-grid:empty {
    display: none;
}

.calendar-event[data-task-appointment-context="commercial"] .event-commercial-secondary,
.calendar-event[data-task-appointment-context="commercial"] .event-commercial-participants {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.calendar-event[data-task-appointment-context="commercial"] .event-commercial-secondary {
    font-weight: 700;
}

.commercial-outcome-fields {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.commercial-outcome-fields[hidden],
.commercial-acceptance-confirm[hidden] {
    display: none;
}

.commercial-acceptance-confirm {
    background: #FFF8E8;
    border: 1px solid #E8CA7A;
    border-radius: 7px;
    grid-column: 1 / -1;
    padding: 8px 10px;
}

.lead-timeline .timeline-appointment {
    border-left: 3px solid #0097B2;
    padding-left: 10px;
}

.lead-timeline .timeline-appointment span {
    color: #526570;
}

.commercial-history table td {
    vertical-align: top;
}

@media (max-width: 640px) {
    .commercial-outcome-fields {
        grid-template-columns: 1fr;
    }
}

/* Gate 7G: shared contrast, interaction and popup polish. */
:root {
    --domiq-canvas-strong: #EAF0F3;
    --domiq-section: #F1F5F7;
    --domiq-section-strong: #DDE9ED;
    --domiq-field: #FFFFFF;
    --domiq-border: #CCD8DE;
    --domiq-border-soft: #E0E8EC;
    --domiq-border-strong: #B7C7CF;
    --domiq-focus-ring: rgba(0, 151, 178, .20);
    --domiq-row-hover: #E8F3F5;
}

.page-head h1,
.panel-head h2,
.compact-section-head h2,
.task-section-heading h2,
.appointment-section-heading h2 {
    color: #172E3A;
}

.page-head p,
.panel-head p,
.compact-section-head p {
    color: #586C78;
}

.panel,
.card,
.section-card,
.metric-card,
.table-wrap,
.compact-editor-panel,
.task-create-panel,
.appointment-create-panel,
.document-card,
.document-card-side,
.line-editor {
    border-color: var(--domiq-border-strong);
    box-shadow: 0 4px 14px rgba(26, 48, 61, .075);
}

.panel-head,
.compact-editor-toolbar {
    background: #E4EEF1;
    border-bottom-color: #BFD0D7;
}

form label,
fieldset legend,
.field-label {
    color: #2B414D;
    font-weight: 750;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
select,
textarea,
.input,
.select {
    background: #FFFFFF;
    border-color: #AFC0C9;
    box-shadow: inset 0 1px 1px rgba(31, 45, 56, .035);
    color: #1D303B;
    transition: border-color .14s ease, box-shadow .14s ease, background-color .14s ease;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]):hover,
select:hover,
textarea:hover {
    border-color: #7895A3;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]):focus,
select:focus,
textarea:focus {
    background: #FFFFFF;
    border-color: #007E95;
    box-shadow: 0 0 0 3px var(--domiq-focus-ring);
    outline: 0;
}

input::placeholder,
textarea::placeholder {
    color: #7A8B95;
    opacity: 1;
}

.required,
form label > .required {
    color: #B83227;
    font-weight: 850;
}

button.btn,
a.btn,
.btn {
    border-color: #AFC0C9;
    transition: background-color .14s ease, border-color .14s ease, box-shadow .14s ease, color .14s ease;
}

button.btn:hover,
a.btn:hover,
.btn:hover {
    border-color: #7895A3;
}

button.btn.primary,
a.btn.primary,
.btn.primary {
    background: #006F83;
    border-color: #006F83;
    box-shadow: 0 2px 5px rgba(0, 85, 99, .17);
    color: #FFFFFF;
}

button.btn.primary:hover,
a.btn.primary:hover,
.btn.primary:hover {
    background: #005B6C;
    border-color: #005B6C;
}

.btn.secondary {
    background: #FFFFFF;
    color: #2A3E4A;
}

.btn.secondary:hover {
    background: #EAF2F4;
    color: #005B6C;
}

.compact-filter-bar,
.filters,
.filter-bar {
    background: #F7FAFB;
    border-color: #C3D1D8;
}

th {
    background: #DDE7EC;
    border-bottom-color: #B6C6CE;
    color: #263B47;
}

tbody tr:hover > td {
    background: #E6F2F4;
}

.compact-editor-panel,
.task-create-panel,
.appointment-create-panel {
    border-top: 4px solid #007E95;
}

.compact-editor-toolbar {
    min-height: 54px;
}

.compact-form-section,
.compact-editor-fields-optional {
    background: #FFFFFF;
}

.unified-case-form .document-card,
.unified-quote-form .document-card {
    border-top-width: 3px;
}

.unified-case-form .document-card-client,
.unified-quote-form .document-card-client {
    background: #F8FCFD;
    border-top-color: #0097B2;
}

.unified-case-form .document-card-main,
.unified-quote-form .document-card-main {
    background: #F9FBFE;
    border-top-color: #2767B1;
}

.unified-case-form .document-card-side,
.unified-quote-form .document-card-side {
    background: #F8FCFA;
    border-top-color: #1F8A5B;
}

.unified-case-form .document-card-wide {
    background: #FBFCFD;
    border-top-color: #617987;
}

.unified-case-form .document-card h2,
.unified-quote-form .document-card h2 {
    color: #1E3B48;
}

.compact-section-head {
    border-bottom-color: #C8D6DC;
}

.compact-optional-section {
    background: #EDF3F5;
    border-top-color: #BFCED5;
}

.compact-optional-section > summary,
.document-card summary,
.document-card-side summary {
    color: #2D4350;
    font-weight: 800;
}

.compact-optional-section[open] > summary,
.document-card details[open] > summary,
.document-card-side details[open] > summary {
    background: #DDEBED;
    color: #005B6C;
}

.task-primary-grid .task-essential-section,
.appointment-identity-block {
    background: #E7F6F8;
    border-color: #A7D5DE;
    border-left-color: #0089A1;
}

.task-primary-grid .task-schedule-section,
.appointment-planning-block {
    background: #EAF2FB;
    border-color: #B5CAE3;
    border-left-color: #2767B1;
}

.task-create-form .task-link-box {
    background: #E9F5EE;
    border-color: #B5D8C5;
    border-left-color: #1F8A5B;
}

.task-primary-grid .task-create-section input,
.task-primary-grid .task-create-section select,
.task-primary-grid .task-create-section textarea,
.appointment-section-block input,
.appointment-section-block select,
.appointment-section-block textarea,
.task-link-box input,
.task-link-box select,
.task-link-box textarea {
    background: #FFFFFF;
}

.task-step-index,
.appointment-step-index {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, .72);
}

.duration-chip,
.task-duration-chip,
.appointment-duration-chip,
[data-duration-value] {
    background: #FFFFFF;
    border-color: #B7C7CF;
    color: #334A56;
}

.duration-chip:hover,
.task-duration-chip:hover,
.appointment-duration-chip:hover,
[data-duration-value]:hover {
    background: #E4F3F6;
    border-color: #66B8C7;
    color: #00677A;
}

.duration-chip.active,
.task-duration-chip.active,
.appointment-duration-chip.active,
[data-duration-value].active,
[data-duration-value][aria-pressed="true"] {
    background: #D6EEF2;
    border-color: #0097B2;
    color: #005B6C;
    box-shadow: inset 0 0 0 1px #0097B2;
}

.task-list-section {
    border-color: #C2D0D7;
    box-shadow: 0 2px 7px rgba(31, 45, 56, .045);
}

.task-list-section > summary {
    background: #F7FAFB;
    border-left: 4px solid #90A5B0;
}

.task-list-section[open] > summary {
    background: #E9F2F4;
    border-bottom-color: #C3D2D9;
}

.task-list-section.state-p1-overdue > summary,
.task-list-section.state-p1-due > summary,
.task-list-section.state-p1-blocked > summary {
    background: #FCEAE8;
    border-left-color: #C0392B;
}

.task-list-section.state-p2-overdue > summary,
.task-list-section.state-p2-next > summary {
    background: #FFF4D8;
    border-left-color: #D28A00;
}

.task-list-section.state-p3-review > summary {
    background: #E8F1FB;
    border-left-color: #2767B1;
}

.task-list-section.state-completate > summary {
    background: #E7F4EC;
    border-left-color: #1F8A5B;
}

.modal-backdrop {
    background: rgba(18, 34, 44, .54);
    backdrop-filter: blur(2px);
}

.modal-panel,
.task-action-modal {
    border: 1px solid #AFC0C9;
    border-top: 4px solid #007E95;
    box-shadow: 0 24px 70px rgba(14, 31, 42, .30);
}

.task-action-modal > .panel-head {
    background: #E3EEF1;
    border-bottom: 1px solid #B9CBD3;
    margin: -14px -14px 12px;
    padding: 11px 14px;
    position: static;
    z-index: 4;
}

.task-action-modal > .panel-head h2,
.task-detail-head h2 {
    color: #163541;
}

.task-modal-summary {
    background: #ECF3F5;
    border-color: #B9CBD3;
    gap: 7px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 8px;
}

.task-modal-summary > span {
    background: #FFFFFF;
    border: 1px solid #D0DCE1;
    border-radius: 6px;
    min-width: 0;
    padding: 7px 8px;
}

.task-modal-summary strong {
    color: #60747F;
    letter-spacing: 0;
}

.task-modal-summary em {
    color: #183440;
    line-height: 1.25;
    overflow-wrap: anywhere;
    white-space: normal;
}

.task-modal-summary > [data-modal-commercial-only] {
    grid-column: span 2;
}

.task-modal-actions {
    background: #F7FAFB;
    border-bottom: 1px solid #D3DEE3;
    border-top: 1px solid #D3DEE3;
    margin-left: -14px;
    margin-right: -14px;
    padding: 9px 14px;
}

.task-action-modal .task-secondary-actions[open] {
    flex: 1 0 100%;
}

.task-action-modal .task-secondary-actions > div {
    box-shadow: none;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    margin-top: 6px;
    max-width: none;
    min-width: 0;
    position: static;
    width: 100%;
}

.quick-task-form {
    background: #F7FAFB;
    border: 1px solid #C8D6DC;
    border-left: 4px solid #007E95;
    border-radius: 7px;
    margin-top: 9px;
    padding: 10px;
}

.quick-task-form .form-actions {
    background: #EDF3F5;
    border-top: 1px solid #CDD9DF;
    margin: 3px -10px -10px;
    padding: 9px 10px;
}

.task-detail-panel {
    border-color: #AFC0C9;
    border-top: 4px solid #007E95;
    box-shadow: 0 12px 32px rgba(21, 42, 54, .17);
}

.task-detail-head {
    background: #E3EEF1;
    border-bottom-color: #B9CBD3;
}

.task-detail-grid > div {
    background: #F5F8F9;
    border-color: #D0DCE1;
}

.task-detail-actions {
    background: #F7FAFB;
    border-bottom-color: #D0DCE1;
    border-top-color: #D0DCE1;
}

.agenda-create-choice .panel-head {
    background: #DDECEF;
    border-bottom-color: #B6CAD2;
}

.agenda-create-option {
    border-color: #B7C7CF;
    box-shadow: 0 2px 7px rgba(31, 45, 56, .055);
}

.agenda-create-option:first-child {
    background: #E7F6F8;
    border-left-color: #0097B2;
}

.agenda-create-option:last-child {
    background: #EAF2FB;
    border-left-color: #2767B1;
}

.agenda-create-option:hover,
.agenda-create-option:focus-visible {
    background: #FFFFFF;
    box-shadow: 0 0 0 3px var(--domiq-focus-ring);
}

.icon-btn.neutral {
    background: #FFFFFF;
    border-color: #AFC0C9;
    color: #304753;
}

.icon-btn.neutral:hover {
    background: #DCEBED;
    border-color: #71909E;
    color: #005B6C;
}

.empty-state,
.task-column-empty {
    background: #F4F8F9;
    border-color: #C9D6DC;
    color: #536873;
}

@media (max-width: 700px) {
    .modal-backdrop {
        align-items: flex-end;
        padding: 8px;
    }

    .modal-panel,
    .task-action-modal {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        margin: auto auto 0;
        max-height: 92dvh;
        max-width: 100%;
    }

    .task-action-modal > .panel-head {
        padding: 10px 12px;
    }

    .task-modal-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .task-modal-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .task-modal-actions > .btn,
    .task-modal-actions > .inline-action-form,
    .task-modal-actions > .inline-action-form > .btn,
    .task-modal-actions > details {
        width: 100%;
    }

    .compact-editor-toolbar {
        background: #DDE9ED;
    }

    input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="color"]),
    select,
    textarea,
    button.btn,
    a.btn {
        min-height: 42px;
    }
}
