@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap");

:root {
    --bg: #f4f6fb;
    --panel: #ffffff;
    --line: #e6ecf4;
    --text: #0f2850;
    --muted: #6e7f98;
    --accent: #2d73ff;
    --danger: #b42318;
    --chip: #f2f4f7;
    --shadow: 0 16px 30px rgba(17, 40, 77, 0.08);
    --shadow-soft: 0 6px 18px rgba(17, 40, 77, 0.06);
    --radius: 16px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--text);
    background: linear-gradient(180deg, #f7f9fd 0%, #f0f4fa 100%);
    font-family: "Manrope", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    overflow-x: hidden;
}

.layout-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 250px 1fr;
    transition: grid-template-columns 0.22s ease;
}

.layout-shell.sidebar-collapsed {
    grid-template-columns: 84px 1fr;
}

.sidebar {
    background: #ffffff;
    border-right: 1px solid #e8eef6;
    padding: 18px 12px;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 4px 0 14px rgba(17, 40, 77, 0.04);
    overflow: hidden;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 2px 6px 14px;
}

.sidebar-toggle {
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 10px;
    border: 1px solid #d7e3f4;
    background: #f4f8ff;
    color: #2a4f89;
    font-weight: 800;
    box-shadow: none;
}

.brand {
    font-size: 1.25rem;
    font-weight: 800;
    color: #1f4b8f;
    margin: 0;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

.side-caption {
    font-size: 0.72rem;
    color: #95a4b9;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    font-weight: 700;
    margin: 10px 10px 8px;
}

.side-links {
    display: grid;
    gap: 8px;
}

.side-link {
    border: 1px solid #e8edf6;
    background: #ffffff;
    color: #41536d;
    border-radius: 13px;
    padding: 10px 11px;
    text-align: left;
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.side-link.active {
    background: linear-gradient(180deg, #eef4ff, #e4edff);
    color: #14478f;
    border-color: #d0def6;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.side-icon {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: #2c64b5;
    background: #edf4ff;
    font-size: 0.86rem;
    border: 1px solid #d9e7fb;
}

.side-link.active .side-icon {
    background: #dce9ff;
    border-color: #c5daf8;
}

.layout-shell.sidebar-collapsed .side-caption,
.layout-shell.sidebar-collapsed .brand,
.layout-shell.sidebar-collapsed .side-link .side-label {
    display: none;
}

.layout-shell.sidebar-collapsed .sidebar {
    padding-left: 10px;
    padding-right: 10px;
}

.layout-shell.sidebar-collapsed .sidebar-head {
    justify-content: center;
    margin-bottom: 12px;
}

.layout-shell.sidebar-collapsed .side-link {
    justify-content: center;
    gap: 0;
    padding-left: 0;
    padding-right: 0;
}

.main-area {
    display: grid;
    grid-template-rows: auto 1fr;
    min-width: 0;
    overflow: hidden;
}

.topbar {
    min-height: 72px;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid #e8edf5;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 8px 20px 8px 24px;
    backdrop-filter: blur(8px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.topbar-title-wrap {
    display: grid;
    gap: 2px;
}

.topbar-title {
    font-size: 1.02rem;
    color: #2d4361;
    font-weight: 800;
}

.topbar-sub {
    font-size: 0.78rem;
    color: #8a99ad;
    font-weight: 700;
}

.app {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    margin: 0;
    padding: 20px 22px;
    overflow-x: auto;
    overflow-y: auto;
}

.top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 14px;
    background: #ffffff;
    border: 1px solid #e8edf5;
    box-shadow: var(--shadow-soft);
    border-radius: 16px;
    padding: 12px 16px;
}

h1 {
    margin: 0;
    font-size: 1.4rem;
    letter-spacing: -0.02em;
    font-weight: 800;
    color: #203551;
}

.sub {
    color: var(--muted);
    margin-top: 4px;
    font-size: 0.9rem;
    font-weight: 600;
}

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

button {
    border: 1px solid transparent;
    background: var(--accent);
    color: white;
    padding: 9px 13px;
    border-radius: 11px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 6px 16px rgba(45, 115, 255, 0.22);
}

button.ghost {
    background: #fff;
    border-color: var(--line);
    color: var(--text);
}

button.danger {
    background: #fff;
    border-color: #f2c6c2;
    color: var(--danger);
}

a {
    box-shadow: none !important;
    text-shadow: none;
    filter: none;
}

.filters {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
    padding: 14px;
    display: grid;
    grid-template-columns: 1.2fr repeat(6, minmax(110px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

input,
select {
    width: 100%;
    padding: 10px 11px;
    border: 1px solid var(--line);
    border-radius: 11px;
    background: #fff;
    font: inherit;
    color: inherit;
    font-size: 0.9rem;
    font-weight: 600;
}

.filters input {
    border-color: #cad6e6;
    background: #fbfdff;
}

.filters select {
    border-color: #cfd8e4;
    background: #f7fafc;
    color: #263447;
}

.filters select option,
.filters select optgroup {
    background: #f7fafc;
    color: #263447;
}

#fStatus,
#fStatusGroup {
    background: #f6f7ff;
    border-color: #cfd3f2;
}

#fPriority {
    background: #fff9f1;
    border-color: #eadfc9;
}

#fScadenza {
    background: #f4f8ff;
    border-color: #cfdcf2;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.table-wrap {
    overflow: auto;
    max-height: 68vh;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1180px;
}

th,
td {
    border-bottom: 1px solid var(--line);
    padding: 11px 12px;
    text-align: left;
    white-space: nowrap;
    font-size: 0.9rem;
}

td.next-action {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-date {
    display: block;
    margin-top: 2px;
    color: #7b8fa9;
    font-size: 0.74rem;
    font-weight: 700;
}

.task-note-sub {
    display: block;
    margin-top: 2px;
    color: #7b8fa9;
    font-size: 0.72rem;
    font-weight: 500;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

th.task-title-col,
td.task-title-cell {
    width: 360px;
    min-width: 360px;
    max-width: 360px;
}

td.task-title-cell {
    white-space: normal;
}

th.backlog-note-col,
td.backlog-note-cell {
    width: 460px;
    min-width: 460px;
    max-width: 460px;
    white-space: normal;
    overflow-wrap: anywhere;
    vertical-align: top;
    line-height: 1.28;
}

td.backlog-note-cell strong {
    display: block;
    margin-bottom: 4px;
}

th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #f6f9ff;
    color: #476081;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.74rem;
}

th.sortable {
    cursor: pointer;
    user-select: none;
}

.sort-arrow {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.76rem;
    color: #9aa7ba;
    min-width: 10px;
    text-align: center;
}

th.sortable.active .sort-arrow {
    color: #2e4868;
}

.company-cell {
    font-weight: 700;
    color: #24374f;
}

.chip {
    display: inline-block;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.84rem;
    border: 1px solid #dbe1ea;
    background: var(--chip);
}

.chip.status-trattativa {
    background: #f8eecf;
    border-color: #ecdca4;
    color: #6b4d00;
}

.chip.status-preventivo {
    background: #efe4ff;
    border-color: #decafd;
    color: #5d3a9b;
}

.chip.status-avviare {
    background: #ffe9d6;
    border-color: #ffd0a9;
    color: #8d4c10;
}

.chip.status-lavorazione {
    background: #ddeeff;
    border-color: #c0ddff;
    color: #134f98;
}

.chip.status-bloccato {
    background: #ffe1e1;
    border-color: #ffc1c1;
    color: #9f1b1b;
}

.chip.status-chiuso {
    background: #daf2e3;
    border-color: #b8e7c8;
    color: #146c43;
}

.chip.status-perso {
    background: #efefef;
    border-color: #dddddd;
    color: #555;
}

.chip.type-trattativa {
    background: #f8eecf;
    border-color: #ecdca4;
    color: #6b4d00;
}

.chip.type-delivery {
    background: #ffe9d6;
    border-color: #ffd0a9;
    color: #8d4c10;
}

.chip.type-assistenza {
    background: #ddeeff;
    border-color: #c0ddff;
    color: #134f98;
}

.chip.type-upgrade {
    background: #efe4ff;
    border-color: #decafd;
    color: #5d3a9b;
}

.priority-bars {
    display: inline-flex;
    align-items: flex-end;
    gap: 3px;
    height: 14px;
    vertical-align: middle;
}

.priority-bars i {
    display: block;
    width: 4px;
    border-radius: 2px;
    background: #d1d5db;
}

.priority-bars i:nth-child(1) {
    height: 6px;
}

.priority-bars i:nth-child(2) {
    height: 10px;
}

.priority-bars i:nth-child(3) {
    height: 14px;
}

.priority-bars.p-low i:nth-child(1) {
    background: #9ca3af;
}

.priority-bars.p-medium i:nth-child(1),
.priority-bars.p-medium i:nth-child(2) {
    background: #6b7280;
}

.priority-bars.p-high i:nth-child(1),
.priority-bars.p-high i:nth-child(2),
.priority-bars.p-high i:nth-child(3) {
    background: #374151;
}

.summary {
    display: flex;
    justify-content: space-between;
    padding: 12px 14px;
    color: #334155;
    font-size: 0.85rem;
    font-weight: 700;
    background: linear-gradient(180deg, #ffffff, #f7faff);
}

.bottom-tools {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #d8dfeb;
}

.bottom-tools button {
    font-size: 0.82rem;
    font-weight: 500;
    padding: 6px 10px;
    background: #f8fbff;
    color: #516175;
    border-color: #d6e0ef;
}

.bottom-tools button.danger {
    color: #8f1d1d;
    border-color: #f1d1d1;
    background: #fff8f8;
}

.right {
    text-align: right;
}

.hidden {
    display: none !important;
}

.auth-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.topbar-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    min-width: 360px;
}

.topbar-user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 22px;
    font-size: 0.72rem;
    font-weight: 500;
    color: #607592;
    padding-bottom: 6px;
    margin-bottom: 8px;
    border-bottom: 1px solid #dde7f5;
    width: 100%;
    justify-content: flex-end;
}

.topbar-user-menu .auth-name {
    color: #2e4668;
    font-weight: 500;
}

.topbar-user-menu .logout-icon {
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    border-radius: 0;
    font-size: 0.9rem;
    line-height: 1;
    color: #c83232;
    cursor: pointer;
    box-shadow: none;
    text-shadow: none;
}

.topbar-user-menu .logout-icon:hover {
    color: #a61f1f;
}

.topbar-quick-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 36px;
    margin-top: 2px;
}

.topbar-quick-menu .menu-link {
    border: 1px solid #cfe0f7;
    background: #f6faff;
    padding: 9px 13px;
    margin: 0;
    border-radius: 11px;
    font-size: 0.94rem;
    font-weight: 800;
    color: #2d5ea7;
    text-decoration: none;
    cursor: pointer;
    line-height: 1;
    box-shadow: none;
    text-shadow: none;
}

.topbar-quick-menu .menu-link:hover {
    background: #edf4ff;
    text-decoration: none;
}

.topbar-quick-menu .quick-create-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 86px;
    text-align: center;
}

.topbar-quick-menu .quick-create-link::before {
    content: "+";
    width: 15px;
    height: 15px;
    border-radius: 999px;
    background: #eaf2ff;
    border: 1px solid #c8daf7;
    color: #2f6de0;
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 14px;
    text-align: center;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    box-shadow: none;
}

.topbar-quick-menu .menu-link.clients-link {
    min-width: 78px;
}

.topbar-quick-menu .menu-link.hidden-link {
    display: none !important;
}

.map-wrap {
    display: grid;
    gap: 8px;
}

.map-company {
    padding: 4px 0;
}

.map-company-head {
    font-weight: 800;
    color: #233a58;
    margin-bottom: 4px;
}

.map-project {
    padding-left: 14px;
    margin-top: 2px;
}

.map-project-head {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.map-project-title {
    font-weight: 700;
    color: #2b4669;
}

.map-task-list {
    display: grid;
    gap: 2px;
    padding-left: 16px;
}

.map-task-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
}

.map-link {
    border: 0;
    background: transparent;
    color: #1f4faa;
    text-decoration: underline;
    padding: 0;
    margin: 0;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.84rem;
    box-shadow: none;
    text-shadow: none;
    filter: none;
}

#mappaPage.admin-clienti-links .map-link {
    box-shadow: none !important;
    filter: none !important;
    outline: none;
}

.deal-project-shortcut {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 6px;
    padding: 0;
    margin-top: 3px;
    border: 1px solid #cfe0f7;
    background: #f4f8ff;
    color: #2f5f9b;
    box-shadow: none;
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1;
    display: inline-grid;
    place-items: center;
}

.project-deal-shortcut {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border-radius: 6px;
    padding: 0;
    margin-top: 3px;
    border: 1px solid #cfe0f7;
    background: #f4f8ff;
    color: #2f5f9b;
    box-shadow: none;
    font-size: 0.66rem;
    font-weight: 800;
    line-height: 1;
    display: inline-grid;
    place-items: center;
}

.map-muted {
    color: #6f819a;
    font-size: 0.78rem;
    font-weight: 600;
}

.task-layout-toggle {
    font-size: 0.82rem;
    padding: 6px 10px;
    border-radius: 10px;
}

.task-board {
    display: grid;
    grid-template-columns: repeat(3, minmax(220px, 1fr));
    gap: 10px;
    align-items: start;
}

.task-board-col {
    border: 1px solid #d9e5f6;
    border-radius: 12px;
    background: #f7fbff;
    min-height: 220px;
    padding: 8px;
    display: grid;
    grid-template-rows: auto 1fr;
    gap: 8px;
}

.task-board-col[data-board-status="todo"] {
    background: #fff5eb;
    border-color: #ffd9b8;
}

.task-board-col[data-board-status="doing"] {
    background: #eef6ff;
    border-color: #cfe2ff;
}

.task-board-col[data-board-status="done"] {
    background: #eefaf3;
    border-color: #caead9;
}

.task-board-col.drag-over {
    border-color: #2d73ff;
    box-shadow: 0 0 0 2px rgba(45, 115, 255, 0.15) inset;
    background: #f0f6ff;
}

.task-board-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    font-weight: 800;
    color: #274266;
    border-bottom: 1px dashed #d6e2f4;
    padding-bottom: 6px;
}

.task-board-col[data-board-status="todo"] .task-board-head {
    border-bottom-color: #f0c89f;
    color: #8a4e16;
}

.task-board-col[data-board-status="doing"] .task-board-head {
    border-bottom-color: #b9d7ff;
    color: #1d4f95;
}

.task-board-col[data-board-status="done"] .task-board-head {
    border-bottom-color: #bfe2cf;
    color: #1b6a43;
}

.task-board-list {
    display: grid;
    gap: 8px;
    align-content: start;
    min-height: 150px;
}

.task-card {
    border: 1px solid #d8e4f6;
    border-radius: 10px;
    background: #fff;
    padding: 8px;
    box-shadow: 0 3px 10px rgba(38, 63, 97, 0.06);
    display: grid;
    gap: 5px;
}

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

.task-card[draggable="true"] {
    cursor: grab;
}

.task-card-title {
    font-size: 0.88rem;
    font-weight: 800;
    color: #1f3655;
    line-height: 1.25;
}

.task-card-note {
    font-size: 0.78rem;
    color: #617796;
    line-height: 1.3;
    white-space: normal;
    overflow-wrap: anywhere;
}

.task-card-meta {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
    font-size: 0.76rem;
    color: #567092;
    font-weight: 700;
}

.task-card-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.project-board-col[data-proj-status="in-progress"] {
    background: #eef6ff;
    border-color: #cfe2ff;
}

.project-board-col[data-proj-status="blocked"] {
    background: #fff1f1;
    border-color: #ffd4d4;
}

.project-board-col[data-proj-status="closed"] {
    background: #eefaf3;
    border-color: #caead9;
}

.project-board-col[data-proj-status="in-progress"] .task-board-head {
    border-bottom-color: #b9d7ff;
    color: #1d4f95;
}

.project-board-col[data-proj-status="blocked"] .task-board-head {
    border-bottom-color: #f0bebe;
    color: #a02c2c;
}

.project-board-col[data-proj-status="closed"] .task-board-head {
    border-bottom-color: #bfe2cf;
    color: #1b6a43;
}

.project-board .task-card {
    cursor: default;
}

.project-board .task-card[draggable="true"] {
    cursor: grab;
}

.auth-badge {
    font-size: 0.78rem;
    color: #4a5f7c;
    font-weight: 700;
    background: #f3f7ff;
    border: 1px solid #d5e0f4;
    border-radius: 999px;
    padding: 6px 10px;
}

.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(18, 30, 48, 0.56);
    backdrop-filter: blur(4px);
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 18px;
}

.auth-card {
    width: min(420px, 94vw);
    background: #fff;
    border: 1px solid #dce6f4;
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 18px 44px rgba(19, 34, 58, 0.2);
}

.auth-card h2 {
    margin: 0 0 2px 0;
    font-size: 1.1rem;
    color: #243a57;
}

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

.dash-groups {
    display: grid;
    grid-template-columns: repeat(4, minmax(240px, 1fr));
    gap: 8px;
}

.dash-group {
    --group-accent: #2d73ff;
    background: #fff;
    border: 1px solid #dfe8f5;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    padding: 8px;
}

.dash-group-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
    padding: 0 2px;
}

.dash-group-title {
    font-size: 0.78rem;
    font-weight: 800;
    color: #2b425f;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dash-group-note {
    font-size: 0.72rem;
    color: #7f90a8;
    font-weight: 700;
}

.kpis {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.kpi {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;
    box-shadow: var(--shadow-soft);
    padding: 10px 12px;
    text-align: left;
    width: 100%;
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    column-gap: 10px;
    row-gap: 6px;
    align-items: start;
    min-height: 84px;
}

.kpi::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, color-mix(in srgb, var(--group-accent) 35%, #ffffff), var(--group-accent));
}

button.kpi {
    cursor: pointer;
    color: inherit;
    box-shadow: var(--shadow-soft);
}

.kpi .label {
    grid-column: 1 / 3;
    grid-row: 1;
    font-size: 0.86rem;
    color: #6b7a8f;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.15;
    margin: 0;
    font-weight: 800;
    min-height: 2.1em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.kpi .value {
    grid-column: 1;
    grid-row: 2;
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    color: #1f2f45;
    line-height: 1;
    white-space: nowrap;
    text-align: left;
}

.kpi .sub {
    grid-column: 2;
    grid-row: 2;
    margin: 0;
    font-size: 1rem;
    color: #5c7393;
    font-weight: 700;
    line-height: 1.15;
    text-align: right;
    white-space: nowrap;
    max-width: none;
    align-self: end;
}

.dash-group-vendite {
    --group-accent: #2d73ff;
}

.dash-group-backlog {
    --group-accent: #6a6f7d;
}

.dash-group-progetti {
    --group-accent: #2f8f62;
}

.dash-group-task {
    --group-accent: #d17f22;
}

.dash-group-decision {
    --group-accent: #c23a3a;
}

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

.charts {
    display: grid;
    grid-template-columns: repeat(2, minmax(320px, 1fr));
    gap: 10px;
}

.chart-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-soft);
    padding: 12px 12px 10px;
}

.chart-title {
    font-size: 0.86rem;
    font-weight: 800;
    color: #2d4665;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

canvas.chart {
    width: 100%;
    height: 260px;
    display: block;
    background: linear-gradient(180deg, #fcfdff 0%, #f6f9ff 100%);
    border: 1px solid #e8edf7;
    border-radius: 12px;
    cursor: pointer;
}

.chart-tooltip {
    position: fixed;
    z-index: 50;
    pointer-events: none;
    background: rgba(17, 37, 64, 0.96);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 9px;
    padding: 6px 8px;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    max-width: min(92vw, 620px);
    box-shadow: 0 10px 22px rgba(7, 20, 38, 0.32);
    display: none;
    white-space: pre-line;
}

.chart-tooltip .tooltip-title {
    font-size: 0.8rem;
    font-weight: 800;
    margin-bottom: 6px;
    color: #d8e8ff;
}

.chart-tooltip .tooltip-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
    line-height: 1.3;
}

.chart-tooltip .tooltip-table td {
    padding: 2px 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.14);
    vertical-align: top;
}

.chart-tooltip .tooltip-table .section-row td {
    color: #d8e8ff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.24);
    padding-top: 7px;
    padding-bottom: 4px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.chart-tooltip .tooltip-table tr:last-child td {
    border-bottom: 0;
}

.chart-tooltip .tooltip-table td:first-child {
    color: #a9c2e9;
    font-weight: 700;
    padding-right: 12px;
    white-space: nowrap;
}

.chart-tooltip .tooltip-table td:last-child {
    color: #ffffff;
    font-weight: 700;
    text-align: right;
}

.chart-tooltip .jobs-wrap {
    max-height: min(42vh, 260px);
    overflow: auto;
    margin-top: 2px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
}

.chart-tooltip .jobs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.7rem;
    line-height: 1.1;
    white-space: normal;
    table-layout: fixed;
    min-width: 520px;
}

.chart-tooltip .jobs-table th,
.chart-tooltip .jobs-table td {
    border-bottom: 1px dashed rgba(255, 255, 255, 0.12);
    padding: 4px 5px;
    text-align: left;
    vertical-align: top;
}

.chart-tooltip .jobs-table th {
    position: sticky;
    top: 0;
    background: rgba(14, 34, 58, 0.98);
    color: #a9c2e9;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-size: 0.64rem;
    z-index: 1;
}

.chart-tooltip .jobs-table td {
    color: #e8f1ff;
    font-weight: 600;
    white-space: nowrap;
}

.chart-tooltip .jobs-table tr:last-child td {
    border-bottom: 0;
}

.chart-tooltip .jobs-table th:nth-child(1),
.chart-tooltip .jobs-table td:nth-child(1) {
    width: 27%;
}

.chart-tooltip .jobs-table th:nth-child(2),
.chart-tooltip .jobs-table td:nth-child(2) {
    width: 35%;
}

.chart-tooltip .jobs-table th:nth-child(3),
.chart-tooltip .jobs-table td:nth-child(3) {
    width: 20%;
}

.chart-tooltip .jobs-table th:nth-child(4),
.chart-tooltip .jobs-table td:nth-child(4) {
    width: 18%;
    text-align: right;
    min-width: 120px;
    overflow: visible;
    text-overflow: clip;
    color: #ffffff;
    font-weight: 800;
}

.chart-tooltip .jobs-table td:nth-child(1),
.chart-tooltip .jobs-table td:nth-child(2),
.chart-tooltip .jobs-table td:nth-child(3) {
    overflow: hidden;
    text-overflow: ellipsis;
}

.action-list {
    display: grid;
    gap: 8px;
}

.action-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    border: 1px solid #e3ebf7;
    border-radius: 10px;
    padding: 8px 10px;
    background: #fbfdff;
}

.action-meta {
    font-size: 0.8rem;
    color: #6b7c94;
    margin-top: 2px;
    font-weight: 600;
}

.action-open {
    border: 1px solid #d4e2f6;
    background: #f3f8ff;
    color: #2d5f9f;
    border-radius: 8px;
    padding: 5px 8px;
    font-size: 0.76rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
}

.dash-table-wrap {
    border: 1px solid #e3ebf7;
    border-radius: 10px;
    overflow: hidden;
    background: #fbfdff;
}

.dash-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.dash-table th,
.dash-table td {
    border-bottom: 1px solid #edf2fb;
    padding: 7px 8px;
    text-align: left;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-table th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #6b7c94;
    background: #f6f9ff;
    font-weight: 800;
}

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

.dash-table td.right {
    text-align: right;
    font-weight: 700;
}

.dash-link {
    color: #2d5f9f;
    font-weight: 700;
    text-decoration: none;
}

.dash-link:hover {
    text-decoration: underline;
}

.dash-hint {
    font-size: 0.84rem;
    color: #607186;
    margin-top: -2px;
}

.role-hidden {
    display: none !important;
}

.dash-section-title {
    margin: 10px 0 6px;
    font-size: 0.78rem;
    font-weight: 800;
    color: #506784;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.vendite-title {
    margin: 8px 0 8px;
    font-size: 1.12rem;
    color: #253c57;
}

.focus-banner {
    margin: 4px 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    background: #edf4ff;
    border: 1px solid #d3e2fa;
    color: #1d4278;
    border-radius: 12px;
    padding: 8px 10px;
    font-size: 0.84rem;
    font-weight: 700;
}

.focus-banner button {
    border: 1px solid #c6d9f7;
    background: #fff;
    color: #325983;
    box-shadow: none;
    font-size: 0.78rem;
    padding: 6px 8px;
    border-radius: 8px;
    font-weight: 700;
}

.focus-banner a {
    border: 1px solid #c6d9f7;
    background: #fff;
    color: #325983;
    font-size: 0.78rem;
    padding: 6px 8px;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
}

dialog {
    border: none;
    border-radius: 14px;
    width: min(820px, calc(100% - 24px));
    padding: 0;
    box-shadow: var(--shadow);
}

dialog::backdrop {
    background: rgba(2, 6, 23, 0.45);
}

.modal {
    padding: 14px;
    display: grid;
    gap: 10px;
}

dialog.side-drawer {
    margin: 0 0 0 auto;
    width: min(760px, 56vw);
    max-width: calc(100% - 10px);
    height: 100vh;
    max-height: 100vh;
    border-radius: 16px 0 0 16px;
    box-shadow: 0 22px 48px rgba(12, 28, 52, 0.24);
    transform: translateX(28px);
    opacity: 0;
    transition: transform 0.18s ease, opacity 0.18s ease;
    overflow: hidden;
}

dialog.side-drawer[open] {
    transform: translateX(0);
    opacity: 1;
}

.modal.side-drawer-modal {
    height: 100%;
    overflow-y: auto;
    align-content: start;
    padding: 0;
    gap: 0;
}

.task-drawer-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #e6edf7;
    padding: 12px 14px 10px;
    display: grid;
    gap: 8px;
}

.task-drawer-topline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.task-drawer-title {
    font-size: 1.02rem;
    font-weight: 800;
    color: #213957;
    letter-spacing: -0.01em;
}

.task-drawer-close {
    width: 30px;
    height: 30px;
    min-width: 30px;
    border-radius: 8px;
    padding: 0;
    border: 1px solid #dce6f5;
    background: #f7faff;
    color: #39557a;
    box-shadow: none;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
}

.task-drawer-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.task-drawer-chip {
    font-size: 0.74rem;
    font-weight: 800;
    color: #2d5a96;
    background: #edf4ff;
    border: 1px solid #d4e3fb;
    border-radius: 999px;
    padding: 3px 8px;
}

#taskAutosaveHint,
#salesAutosaveHint,
#backlogAutosaveHint,
#projectAutosaveHint {
    font-size: 0.74rem;
    font-weight: 700;
    color: #7488a5;
}

.task-drawer-body {
    padding: 12px 14px 18px;
    display: grid;
    gap: 12px;
}

.task-section {
    border: 1px solid #e4ecf8;
    border-radius: 12px;
    background: #fbfdff;
    padding: 10px;
    display: grid;
    gap: 8px;
}

.task-section .project-info-card,
.task-section .note-log-list,
.task-section .note-log-item,
.task-section .compact-links,
.task-section .dynamic-row,
.task-section .attachment-drop,
.task-section #projectTaskKpi,
.task-section #projectTasksList .note-log-item,
.task-section #projectNoteLogList .note-log-item {
    background: transparent !important;
}

.task-section.entry-section {
    border-color: #cfe0fb;
    background: linear-gradient(180deg, #f4f8ff, #fbfdff 46%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.task-section.entry-section .task-section-title {
    font-size: 1.02rem;
    color: #375a88;
}

.task-section-title {
    font-size: 0.88rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.045em;
    color: #4f6685;
    display: flex;
    align-items: center;
    gap: 6px;
}

.task-section-icon {
    width: 20px;
    height: 20px;
    display: inline-grid;
    place-items: center;
    color: #2d5ea7;
    font-size: 1rem;
    line-height: 1;
    font-weight: 800;
}

#taskDlg .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

#taskDlg .field.full {
    grid-column: 1 / -1;
}

#taskDlg .label {
    font-size: 0.78rem;
    color: #60728a;
    font-weight: 700;
}

#taskDlg input,
#taskDlg select {
    height: 40px;
    border-radius: 10px;
    border: 1px solid #dbe5f4;
    background: #fff;
    box-shadow: none;
    font-size: 0.94rem;
}

#taskDlg input:focus,
#taskDlg select:focus {
    border-color: #9dbbf6;
    box-shadow: 0 0 0 3px rgba(45, 115, 255, 0.12);
    outline: none;
}

#taskTitolo {
    font-size: 1.05rem !important;
    font-weight: 700;
}

#taskNote {
    min-height: 86px;
    height: 86px;
    resize: vertical;
    padding-top: 10px;
    padding-bottom: 10px;
    font-size: 1.02rem !important;
    line-height: 1.45;
}

#taskNote::placeholder {
    font-size: 1.02rem;
}

#dlg .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

#dlg .field.full {
    grid-column: 1 / -1;
}

#dlg .label {
    font-size: 0.78rem;
    color: #60728a;
    font-weight: 700;
}

#dlg input,
#dlg select {
    height: 40px;
    border-radius: 10px;
    border: 1px solid #dbe5f4;
    background: #fff;
    box-shadow: none;
    font-size: 0.94rem;
}

#dlg input:focus,
#dlg select:focus {
    border-color: #9dbbf6;
    box-shadow: 0 0 0 3px rgba(45, 115, 255, 0.12);
    outline: none;
}

#dlg .task-section {
    gap: 12px;
    padding: 12px;
}

#dlg .section-sales-data {
    background: linear-gradient(180deg, #eef5ff 0%, #f8fbff 100%);
    border-color: #bfd4f3;
}

#dlg .section-sales-assets {
    background: linear-gradient(180deg, #f3f8ff 0%, #fbfdff 100%);
    border-color: #cadcf5;
}

#dlg .section-sales-followup {
    background: linear-gradient(180deg, #f6f4ff 0%, #fbfaff 100%);
    border-color: #d8d1f6;
}

#dlg .section-sales-tasks {
    background: linear-gradient(180deg, #f2f9f6 0%, #fbfefd 100%);
    border-color: #cde7dc;
}

#dlg #noteLogList,
#dlg #dealTasksList {
    max-height: 190px;
    border: 1px solid #d9e6f8;
    border-radius: 10px;
    padding: 10px;
    gap: 8px;
    background: transparent;
}

#dlg #noteLogList .note-log-item,
#dlg #dealTasksList .note-log-item {
    border: 1px solid #dce8f8;
    border-radius: 9px;
    padding: 8px 9px;
    border-bottom: 1px solid #dce8f8;
    background: transparent;
}

#dlg #noteLogList .note-log-item:last-child,
#dlg #dealTasksList .note-log-item:last-child {
    border-bottom: 1px solid #dce8f8;
    padding-bottom: 8px;
}

#dlg #dealTasksList .project-task-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f3250;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

#dlg #dealTasksList .project-task-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

#dlg #dealTasksList .note-date {
    font-size: 0.82rem;
    color: #5f7697;
    margin-top: 3px;
}

#noteText {
    height: 44px !important;
    font-size: 0.98rem !important;
    font-weight: 600;
    padding: 10px 12px;
    border: 1px solid #cfe0f7 !important;
    background: #fff !important;
}

#noteText::placeholder {
    color: #8fa1b8;
    font-size: 0.94rem;
    font-weight: 500;
}

#lavoro {
    font-size: 1.05rem !important;
    font-weight: 700;
}

#backlogDialogGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

#backlogDialogGrid .field.full {
    grid-column: 1 / -1;
}

#backlogDlg .label {
    font-size: 0.78rem;
    color: #60728a;
    font-weight: 700;
}

#backlogDlg input,
#backlogDlg select {
    height: 40px;
    border-radius: 10px;
    border: 1px solid #dbe5f4;
    background: #fff;
    box-shadow: none;
    font-size: 0.94rem;
}

#backlogDlg input:focus,
#backlogDlg select:focus {
    border-color: #9dbbf6;
    box-shadow: 0 0 0 3px rgba(45, 115, 255, 0.12);
    outline: none;
}

#backlogNotaField {
    font-size: 1rem !important;
    font-weight: 700;
}

#projectDialogGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

#projectDialogGrid .field.full {
    grid-column: 1 / -1;
}

#projectDlg .label {
    font-size: 0.78rem;
    color: #60728a;
    font-weight: 700;
}

#projectDlg .task-section {
    gap: 12px;
    padding: 12px;
}

#projectDlg .section-project-data {
    background: linear-gradient(180deg, #eef5ff 0%, #f8fbff 100%);
    border-color: #bfd4f3;
}

#projectDlg .section-project-assets {
    background: linear-gradient(180deg, #f3f8ff 0%, #fbfdff 100%);
    border-color: #cadcf5;
}

#projectDlg .section-project-notes {
    background: linear-gradient(180deg, #f6f4ff 0%, #fbfaff 100%);
    border-color: #d8d1f6;
}

#projectDlg .section-project-tasks {
    background: linear-gradient(180deg, #f2f9f6 0%, #fbfefd 100%);
    border-color: #cde7dc;
}

#projectDlg input,
#projectDlg select {
    height: 40px;
    border-radius: 10px;
    border: 1px solid #dbe5f4;
    background: #fff;
    box-shadow: none;
    font-size: 0.94rem;
}

#projectDlg input:focus,
#projectDlg select:focus {
    border-color: #9dbbf6;
    box-shadow: 0 0 0 3px rgba(45, 115, 255, 0.12);
    outline: none;
}

#projectNome {
    font-size: 1rem !important;
    font-weight: 700;
}

#projectDialogGrid .project-inline-info {
    gap: 2px;
    align-content: start;
    padding-top: 2px;
}

#projectDialogGrid .project-inline-info .label {
    margin-bottom: 0;
}

.project-inline-value {
    min-height: 28px;
    padding: 2px 0 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: #314a6b;
    line-height: 1.25;
    word-break: break-word;
    border: 0;
    background: transparent;
}

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

.project-info-card {
    border: 1px solid #d9e6f8;
    border-radius: 10px;
    background: transparent;
    padding: 9px 10px;
    min-height: 62px;
    display: grid;
    align-content: start;
    gap: 4px;
}

.project-info-label {
    font-size: 0.72rem;
    font-weight: 800;
    color: #6f8199;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.project-info-value {
    font-size: 0.98rem;
    font-weight: 800;
    color: #304b6b;
    line-height: 1.25;
    word-break: break-word;
}

#projectTaskKpi {
    border: 0;
    background: transparent;
    border-radius: 0;
    padding: 0;
    font-size: 0.84rem;
    color: #4b6689;
    font-weight: 800;
}

#projectTasksList {
    max-height: 210px;
    gap: 8px;
    padding: 9px;
}

#projectNoteLogList {
    max-height: 190px;
    background: transparent;
    border: 1px solid #d9e6f8;
    border-radius: 10px;
    padding: 10px;
    gap: 8px;
}

#projectNoteLogList .note-log-item {
    background: transparent;
    border: 1px solid #dce8f8;
    border-radius: 9px;
    padding: 8px 9px;
    border-bottom: 1px solid #dce8f8;
}

#projectNoteLogList .note-log-item:last-child {
    border-bottom: 1px solid #dce8f8;
    padding-bottom: 8px;
}

#projectNoteLogList .note-log-item>div:first-child {
    font-size: 0.9rem;
    font-weight: 600;
    color: #243a59;
    line-height: 1.4;
}

#projectNoteText {
    height: 44px !important;
    font-size: 0.98rem !important;
    font-weight: 600;
    padding: 10px 12px;
    border: 1px solid #cfe0f7 !important;
    background: #fff !important;
}

#projectNoteText::placeholder {
    color: #8fa1b8;
    font-size: 0.94rem;
    font-weight: 500;
}

.project-note-help {
    font-size: 0.76rem;
    font-weight: 700;
    color: #6f839f;
    margin-top: 4px;
}

#projectTasksList .note-log-item {
    background: transparent;
    border: 1px solid #dbe5f3;
    border-radius: 10px;
    padding: 8px 9px;
    border-bottom: 1px solid #dbe5f3;
    font-weight: 500;
}

#projectTasksList .note-log-item:last-child {
    border-bottom: 1px solid #dbe5f3;
    padding-bottom: 8px;
}

.project-task-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 2px;
}

.project-task-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1f3250;
    line-height: 1.4;
    letter-spacing: 0.01em;
}

.project-task-meta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

#projectTasksList .note-date {
    font-size: 0.82rem;
    color: #5f7697;
    margin-top: 3px;
}

#projectDlg .row-actions {
    margin-top: 2px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.field {
    display: grid;
    gap: 5px;
}

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

.label {
    font-size: 0.82rem;
    color: #4a5668;
    font-weight: 600;
}

.row-actions {
    display: flex;
    gap: 6px;
}

.row-actions button {
    font-size: 0.78rem;
    padding: 6px 8px;
    border-radius: 8px;
}

.icon-btn.trash {
    color: #c62828;
    border-color: #efc5c5;
    background: #fff5f5;
}

.icon-btn.trash:hover {
    background: #ffeaea;
    border-color: #e6aaaa;
}

.icon-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    box-shadow: none;
}

.icon-btn svg {
    width: 14px;
    height: 14px;
    display: block;
}

.work-links {
    margin-top: 3px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.work-links a {
    font-size: 0.75rem;
    font-weight: 700;
    color: #2c5ea3;
    text-decoration: underline;
    box-shadow: none !important;
    text-shadow: none;
    filter: none;
}

.note-log-list {
    max-height: 150px;
    overflow: auto;
    border: 1px solid #dbe4f1;
    border-radius: 10px;
    padding: 8px;
    background: #f8fbff;
    display: grid;
    gap: 6px;
}

.note-log-item {
    border-bottom: 1px dashed #d5dfed;
    padding-bottom: 5px;
    font-size: 0.84rem;
    color: #24364d;
    font-weight: 600;
}

.note-log-item:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.compact-links {
    display: grid;
    gap: 6px;
    border: 1px solid #dbe4f1;
    border-radius: 10px;
    padding: 8px;
    background: transparent;
}

.link-row {
    display: grid;
    grid-template-columns: 1.25fr 0.9fr;
    gap: 6px;
    align-items: center;
}

.link-row .mini-label {
    color: #70829c;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 2px;
}

.compact-inline {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 8px;
}

.dynamic-list {
    display: grid;
    gap: 6px;
    margin-top: 6px;
}

.dynamic-row {
    display: grid;
    grid-template-columns: 1.2fr 0.95fr auto;
    gap: 6px;
    align-items: start;
    border: 1px solid #dce5f2;
    border-radius: 10px;
    background: transparent;
    padding: 6px;
}

.dynamic-field {
    display: grid;
    grid-template-rows: auto auto 18px;
    align-content: start;
}

.dynamic-row.attachment-row {
    grid-template-columns: 1.25fr 0.9fr auto;
}

.dynamic-row .mini-label {
    color: #70829c;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 2px;
}

.dynamic-controls {
    display: inline-flex;
    gap: 4px;
    align-self: center;
}

.dynamic-preview {
    margin-top: 4px;
    min-height: 18px;
}

.dynamic-preview.placeholder {
    visibility: hidden;
}

.dynamic-preview a {
    font-size: 0.76rem;
    font-weight: 700;
    color: #2c5ea3;
    text-decoration: underline;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    max-width: 100%;
    box-shadow: none !important;
    text-shadow: none;
    filter: none;
}

.dynamic-add-mini,
.dynamic-remove {
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 6px;
    box-shadow: none;
    font-weight: 800;
    line-height: 1;
    font-size: 0.9rem;
}

.dynamic-add-mini {
    border: 1px solid #c9ddf8;
    background: #f3f8ff;
    color: #2d5d96;
}

.dynamic-remove {
    border: 1px solid #f1caca;
    background: #fff7f7;
    color: #a02929;
}

.attachment-drop {
    border: 1px dashed #bfd5f3;
    border-radius: 8px;
    background: transparent;
    min-height: 34px;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.attachment-drop.dragover {
    border-color: #5b8ecf;
    background: #eef6ff;
}

.attach-pick {
    border: 1px solid #cddff8;
    background: #fff;
    color: #305889;
    border-radius: 6px;
    padding: 4px 7px;
    font-size: 0.72rem;
    font-weight: 700;
    box-shadow: none;
    white-space: nowrap;
}

.attach-file {
    font-size: 0.72rem;
    color: #2d4669;
    font-weight: 700;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.backlog-capture,
.backlog-board {
    padding: 12px;
    margin-bottom: 10px;
}

.backlog-capture .grid {
    grid-template-columns: 1fr;
    align-items: end;
}

.backlog-capture-row {
    display: grid;
    grid-template-columns: minmax(280px, 720px) auto;
    gap: 10px;
    align-items: end;
    margin-top: 8px;
}

#backlogNotaInput {
    height: 52px;
    padding: 12px 12px;
    font-size: 1rem;
    line-height: 1.2;
    border-radius: 12px;
}

.quick-add-btn {
    border: 1px solid #cfe0f7;
    background: #f6faff;
    color: #2d5ea7;
    border-radius: 11px;
    padding: 9px 13px;
    font-size: 0.92rem;
    font-weight: 800;
    box-shadow: none;
    white-space: nowrap;
}

.quick-add-btn:hover {
    background: #edf4ff;
}

.backlog-capture textarea {
    width: 100%;
    min-height: 40px;
    max-height: 90px;
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 9px 11px;
    font: inherit;
    resize: vertical;
}

.backlog-toolbar {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
}

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

.backlog-views button {
    background: #f3f8ff;
    color: #365983;
    border: 1px solid #d6e4f7;
    box-shadow: none;
    font-size: 0.8rem;
    padding: 7px 10px;
    border-radius: 9px;
}

.backlog-views button.active {
    background: #2d73ff;
    color: #fff;
    border-color: #2d73ff;
}

.backlog-filters {
    grid-template-columns: 1.2fr repeat(6, minmax(110px, 1fr));
}

#backlogClearFiltersBtn {
    width: 100%;
    min-width: 0;
    height: auto;
    padding: 10px 11px;
    white-space: nowrap;
}

.small-muted {
    color: #7588a1;
    font-size: 0.8rem;
    font-weight: 700;
}

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

    .layout-shell.sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .sidebar {
        height: auto;
        position: static;
        border-right: 0;
        border-bottom: 1px solid #e4ebf7;
        overflow: visible;
    }

    .layout-shell.sidebar-collapsed .side-caption,
    .layout-shell.sidebar-collapsed .brand,
    .layout-shell.sidebar-collapsed .side-link .side-label {
        display: inline;
    }

    .layout-shell.sidebar-collapsed .side-link {
        justify-content: flex-start;
        gap: 10px;
        padding-left: 11px;
        padding-right: 11px;
    }

    .layout-shell.sidebar-collapsed .sidebar-head {
        justify-content: space-between;
    }

    .topbar {
        height: auto;
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .topbar-actions {
        min-width: 0;
        width: 100%;
        align-items: flex-start;
    }

    .topbar-user-menu,
    .topbar-quick-menu {
        flex-wrap: wrap;
        row-gap: 6px;
    }

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

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

    .backlog-capture .grid {
        grid-template-columns: 1fr;
    }

    .backlog-filters {
        grid-template-columns: 1fr;
    }

    .backlog-capture-row {
        grid-template-columns: 1fr;
    }

    .link-row {
        grid-template-columns: 1fr;
    }

    .compact-inline {
        grid-template-columns: 1fr;
    }

    .dynamic-row {
        grid-template-columns: 1fr;
    }

    .dash-groups {
        grid-template-columns: repeat(2, minmax(240px, 1fr));
    }

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

    .decision-kpis {
        grid-template-columns: 1fr;
    }

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

    .top {
        flex-wrap: wrap;
    }

    .bottom-tools {
        justify-content: stretch;
    }

    .bottom-tools button {
        width: 100%;
    }
}

@media (max-width: 760px) {
    .dash-groups {
        grid-template-columns: 1fr;
    }

    .kpi {
        min-height: 76px;
        padding: 9px 10px;
    }

    .kpi .label {
        font-size: 0.78rem;
        min-height: 2em;
    }

    .kpi .value {
        font-size: 1.65rem;
    }

    .kpi .sub {
        font-size: 0.92rem;
    }

    dialog.side-drawer {
        width: 100vw;
        max-width: 100vw;
        border-radius: 0;
    }

    #taskDlg .grid {
        grid-template-columns: 1fr;
    }

    #backlogDialogGrid {
        grid-template-columns: 1fr;
    }

    .project-info-grid {
        grid-template-columns: 1fr;
    }
}