:root {
  --ink: #1e3030;
  --muted: #718181;
  --surface: #ffffff;
  --canvas: #f6f7f3;
  --line: #e4e8e2;
  --deep: #0d3b37;
  --deep-2: #075d54;
  --lime: #cce86e;
  --lime-soft: #eff8cc;
  --sand: #fff5dc;
  --coral: #d45e51;
  --shadow: 0 10px 30px rgba(21, 52, 47, .06);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--canvas); }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 14px; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(80, 147, 119, .35); outline-offset: 2px; }

.app-shell { min-height: 100vh; display: grid; grid-template-columns: 246px minmax(0, 1fr); }
.sidebar { padding: 24px 14px 16px; background: var(--deep); color: #e9f3ef; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; padding: 0 9px 32px; }
.brand-mark { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--lime); color: var(--deep); font-weight: 800; font-size: 20px; font-family: Georgia, serif; }
.brand strong, .brand span { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.2px; }
.brand span { color: #9fb9b3; font-size: 11px; margin-top: 2px; }
.nav-list { display: grid; gap: 4px; }
.nav-item { width: 100%; display: flex; align-items: center; gap: 12px; color: #b7ccc7; text-align: left; padding: 11px 12px; border: none; border-radius: 10px; background: transparent; font-weight: 600; }
.nav-item span { font-size: 19px; width: 19px; line-height: 1; opacity: .95; }
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { color: var(--deep); background: var(--lime); }
.sidebar-bottom { margin-top: auto; }
.storage-badge { color: #a8c0ba; margin: 18px 10px 4px; font-size: 10px; line-height: 1.5; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #9ce0b6; margin-right: 5px; }

.main-content { min-width: 0; padding: 0 46px 44px; max-width: 1550px; width: 100%; margin: 0 auto; }
.topbar { min-height: 104px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.topbar h1 { margin: 4px 0 0; font-size: 21px; letter-spacing: -.6px; }
.eyebrow { color: #80908d; font-size: 10px; font-weight: 800; letter-spacing: .12em; margin: 0; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.avatar { color: #fff; background: #c06d50; border: 3px solid #fff; box-shadow: 0 2px 5px rgba(0,0,0,.08); width: 36px; height: 36px; border-radius: 50%; font-size: 11px; font-weight: 800; }
.mobile-menu { display: none; }

.view { display: none; padding-top: 34px; }
.view.active-view { display: block; }
.intro-row, .section-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.intro-row h2, .section-toolbar h2 { font-size: 25px; letter-spacing: -1.05px; margin: 0 0 7px; }
.intro-row p, .section-toolbar p { margin: 0; color: var(--muted); }
.compact-select { color: var(--muted); font-size: 11px; font-weight: 700; display: grid; gap: 4px; }
.compact-select select { min-width: 143px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 8px 10px; color: var(--ink); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 30px 0 18px; }
.stat-card { position: relative; background: var(--surface); box-shadow: var(--shadow); border-radius: 14px; padding: 18px 18px 16px; min-height: 130px; overflow: hidden; }
.stat-card.lime { background: var(--lime); }.stat-card.dark { background: var(--deep); color: #fff; }.stat-card.sand { background: var(--sand); }
.stat-card .stat-label { font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: #6e7b72; }.stat-card.dark .stat-label { color: #b7cbc5; }
.stat-card .stat-value { display: block; font-size: 27px; letter-spacing: -1.2px; font-weight: 800; margin: 14px 0 6px; }.stat-card .stat-note { color: #74827b; font-size: 11px; }.stat-card.dark .stat-note { color: #b7cbc5; }
.trend { font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; gap: 2px; }.trend.up { color: #18826b; }.trend.neutral { color: #7a8580; }.stat-card.dark .trend { color: var(--lime); }
.stat-accent { position: absolute; width: 72px; height: 72px; right: -20px; bottom: -28px; border-radius: 50%; background: rgba(255,255,255,.22); }

.dashboard-grid { display: grid; grid-template-columns: 1.8fr 1fr; gap: 18px; }
.panel { background: var(--surface); box-shadow: var(--shadow); border-radius: 14px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 19px 21px 14px; }.panel-heading h3 { margin: 0; font-size: 15px; letter-spacing: -.35px; }.panel-heading p { color: var(--muted); font-size: 11px; margin: 4px 0 0; }
.legend { display: flex; gap: 12px; color: var(--muted); font-size: 10px; white-space: nowrap; }.legend span { display: flex; align-items: center; gap: 4px; }.legend i { width: 8px; height: 8px; border-radius: 2px; }.legend-pale { background: #d7e7bd; }.legend-dark { background: var(--deep); }
.revenue-chart { height: 240px; display: flex; align-items: flex-end; gap: clamp(10px, 3vw, 30px); padding: 14px 28px 25px; position: relative; border-top: 1px solid #f4f4f1; }.revenue-chart::before, .revenue-chart::after { content: ""; height: 1px; background: #edf0eb; position: absolute; left: 18px; right: 18px; }.revenue-chart::before { top: 33%; }.revenue-chart::after { top: 66%; }
.chart-month { z-index: 1; flex: 1; height: 100%; min-width: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; align-items: end; position: relative; padding-bottom: 18px; }.chart-bar { min-height: 2px; border-radius: 5px 5px 2px 2px; transition: height .3s; }.chart-bar.expected { background: #d9e9b2; }.chart-bar.paid { background: var(--deep); }.chart-label { position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); color: #8b9791; font-size: 10px; }
.donut-area { min-height: 240px; display: grid; grid-template-columns: 145px 1fr; align-items: center; gap: 10px; padding: 7px 20px 21px; }.donut { width: 132px; height: 132px; border-radius: 50%; display: grid; place-content: center; text-align: center; position: relative; background: conic-gradient(#dceeb0 0deg 120deg, #0d3b37 120deg 230deg, #e0a379 230deg 360deg); }.donut::after { content: ""; position: absolute; inset: 20px; border-radius: inherit; background: #fff; }.donut span, .donut small { position: relative; z-index: 1; }.donut span { font-weight: 800; letter-spacing: -.6px; font-size: 15px; }.donut small { font-size: 9px; color: var(--muted); }.composition-legend { display: grid; gap: 12px; }.composition-item { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; }.composition-item span:first-child { display: flex; gap: 6px; align-items: center; color: #52625e; }.composition-dot { width: 8px; height: 8px; border-radius: 50%; }.composition-item strong { font-size: 11px; }
.upcoming-panel { margin-top: 18px; }.table-wrap { width: 100%; overflow-x: auto; } table { border-collapse: collapse; width: 100%; min-width: 720px; } th { text-align: left; color: #88958f; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; padding: 11px 21px; border-bottom: 1px solid var(--line); white-space: nowrap; } td { padding: 15px 21px; border-bottom: 1px solid #edf0eb; vertical-align: middle; font-size: 12px; } tr:last-child td { border-bottom: none; }.client-cell strong, .person-cell strong { display: block; font-size: 12px; }.client-cell small, .person-cell small { color: var(--muted); font-size: 10px; display: block; margin-top: 2px; }.amount-cell { font-weight: 800; white-space: nowrap; }.amount-cell small { display: block; color: var(--muted); font-size: 10px; margin-top: 2px; font-weight: 500; }.empty-table { text-align: center; color: var(--muted); padding: 32px; }

.button { border: 1px solid transparent; border-radius: 9px; padding: 9px 13px; font-size: 12px; font-weight: 750; transition: transform .15s, background .15s, border-color .15s; }.button:hover { transform: translateY(-1px); }.button-primary { color: #fff; background: var(--deep); box-shadow: 0 4px 10px rgba(13,59,55,.15); }.button-primary:hover { background: var(--deep-2); }.button-secondary { color: var(--deep); background: #fff; border-color: #cfdad4; }.button-secondary:hover { border-color: var(--deep); }.button-quiet { background: transparent; color: var(--muted); border-color: #dfe5df; }.button-danger { color: #a12e24; border-color: #edc6c1; background: #fff7f6; }.text-button { color: var(--deep-2); background: transparent; border: 0; font-weight: 800; font-size: 11px; padding: 3px; }.text-button span { font-size: 16px; vertical-align: -1px; }

.section-toolbar { margin-bottom: 25px; }.filter-bar { background: #fff; border: 1px solid var(--line); padding: 10px; border-radius: 12px; display: flex; gap: 9px; align-items: center; margin-bottom: 16px; }.filter-bar select { height: 36px; border: 1px solid var(--line); background: #fff; border-radius: 7px; color: #596864; padding: 0 28px 0 9px; font-size: 11px; }.search-input { position: relative; min-width: 255px; flex: 1; }.search-input span { position: absolute; left: 10px; top: 7px; color: #8a9792; font-size: 18px; }.search-input input { width: 100%; height: 36px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px 0 31px; color: var(--ink); }.table-panel { box-shadow: none; border: 1px solid var(--line); }.practice-table td { padding-top: 14px; padding-bottom: 14px; }.product-pill, .status-pill { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; border-radius: 20px; padding: 5px 8px; font-size: 10px; font-weight: 800; }.product-pill.mutuo { color: #126354; background: #e2f5e6; }.product-pill.cqs { color: #895317; background: #fff1cc; }.product-pill.polizza { color: #715187; background: #f0e6f6; }.status-pill { color: #596864; background: #f0f3ef; }.status-pill.pagata { color: #167157; background: #daf2e5; }.status-pill.erogata { color: #1c6386; background: #e1f1fb; }.status-pill.deliberata { color: #78589a; background: #f0e8f6; }.status-pill.annullata { color: #9a453d; background: #fce6e3; }.row-actions { display: flex; gap: 3px; justify-content: flex-end; }.action-button { color: #60716b; border: 0; background: transparent; width: 27px; height: 27px; border-radius: 6px; font-size: 16px; }.action-button:hover { color: var(--deep); background: #edf3ee; }.action-button.delete:hover { color: var(--coral); background: #fff0ee; }

.info-callout { background: var(--lime-soft); color: #476139; border-radius: 11px; padding: 12px 15px; display: flex; gap: 10px; align-items: center; margin-bottom: 18px; }.info-callout span { color: #799923; font-size: 17px; }.info-callout p { margin: 0; font-size: 12px; }
.bank-layout { display: grid; grid-template-columns: minmax(220px, .75fr) minmax(0, 2fr); gap: 18px; }.bank-list-panel { min-height: 410px; }.bank-list { border-top: 1px solid #edf0eb; padding: 9px; }.bank-row { width: 100%; border: 1px solid transparent; background: transparent; border-radius: 10px; text-align: left; padding: 11px; display: flex; align-items: center; gap: 10px; color: var(--ink); }.bank-row:hover { background: #f5f8f5; }.bank-row.selected { background: #edf7e7; border-color: #dcebcf; }.bank-logo { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; background: #e5eeec; color: var(--deep); font-weight: 900; }.bank-row.selected .bank-logo { background: var(--lime); }.bank-row strong { font-size: 12px; }.bank-row small { display: block; color: var(--muted); margin-top: 2px; font-size: 10px; }.bank-row .bank-more { margin-left: auto; color: #9da9a3; }.rule-panel { min-height: 410px; }.rules-container { border-top: 1px solid #edf0eb; }.rule-card { margin: 12px 16px; padding: 15px; border: 1px solid var(--line); border-radius: 11px; display: grid; grid-template-columns: 1.05fr 1fr 1fr 1fr auto; align-items: center; gap: 11px; }.rule-product { font-weight: 800; font-size: 12px; }.rule-product span { display: block; color: var(--muted); font-weight: 500; font-size: 10px; margin-top: 3px; }.rule-number { font-size: 14px; font-weight: 800; }.rule-number span { color: var(--muted); display: block; text-transform: uppercase; letter-spacing: .05em; font-size: 9px; font-weight: 700; margin-bottom: 3px; }.empty-state { min-height: 290px; display: grid; place-content: center; text-align: center; color: var(--muted); padding: 25px; }.empty-state h3 { color: var(--ink); font-size: 14px; margin: 10px 0 4px; }.empty-state p { margin: 0; font-size: 12px; }.empty-icon { font-size: 33px; color: #a4c270; }

.team-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }.team-metric { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 15px 17px; }.team-metric span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; font-weight: 800; letter-spacing: .05em; }.team-metric strong { font-size: 21px; letter-spacing: -.7px; display: block; margin-top: 7px; }.team-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }.member-card { border: 1px solid var(--line); box-shadow: none; padding: 18px; }.member-top { display: flex; align-items: center; gap: 10px; }.member-avatar { width: 40px; height: 40px; display: grid; place-content: center; border-radius: 50%; color: #fff; font-size: 12px; font-weight: 800; }.member-top h3 { margin: 0; font-size: 14px; }.member-top p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }.member-actions { margin-left: auto; }.member-stats { display: grid; grid-template-columns: 1fr 1fr; margin: 17px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }.member-stat { padding: 11px 0; }.member-stat + .member-stat { border-left: 1px solid var(--line); padding-left: 14px; }.member-stat span { color: var(--muted); font-size: 10px; display: block; }.member-stat strong { display: block; margin-top: 4px; font-size: 14px; }.member-footer { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 11px; }.commission-badge { color: var(--deep); background: var(--lime-soft); border-radius: 20px; padding: 5px 8px; font-weight: 800; }

.reports-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }.report-card { padding: 23px; min-height: 192px; }.report-card h3 { font-size: 15px; margin: 12px 0 7px; }.report-card p { color: var(--muted); font-size: 12px; line-height: 1.55; margin: 0 0 19px; max-width: 480px; }.report-icon { width: 34px; height: 34px; background: var(--lime-soft); border-radius: 9px; display: grid; place-items: center; color: var(--deep); font-size: 19px; }.file-label { display: inline-flex; align-items: center; }.file-label input { display: none; }.danger-zone { background: #fff7f6; border: 1px solid #f3d3ce; border-radius: 12px; display: flex; align-items: center; justify-content: space-between; padding: 17px 20px; gap: 15px; margin-top: 18px; }.danger-zone h3 { margin: 0 0 4px; color: #78342d; font-size: 13px; }.danger-zone p { color: #9b615a; margin: 0; font-size: 11px; }

.modal-backdrop { position: fixed; z-index: 10; inset: 0; background: rgba(10, 32, 29, .48); display: grid; place-items: center; padding: 20px; }.modal-backdrop[hidden] { display: none; }.modal { width: min(700px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: #fff; border-radius: 15px; box-shadow: 0 24px 70px rgba(0,0,0,.25); }.modal-header { display: flex; justify-content: space-between; align-items: flex-start; padding: 21px 24px 17px; border-bottom: 1px solid var(--line); }.modal-header h2 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.6px; }.icon-button { width: 30px; height: 30px; border: 0; border-radius: 7px; font-size: 24px; line-height: 1; color: #64736e; background: transparent; }.icon-button:hover { background: #f0f3ef; color: var(--ink); }.form-body { padding: 21px 24px 5px; }.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px 17px; }.form-grid.three { grid-template-columns: repeat(3, 1fr); }.field { display: grid; gap: 6px; }.field.full { grid-column: 1 / -1; }.field label, .field-label { color: #60716b; font-weight: 800; font-size: 11px; }.field input, .field select { height: 38px; border: 1px solid #d7dfd9; border-radius: 7px; color: var(--ink); padding: 0 10px; background: #fff; }.field input:focus, .field select:focus { border-color: #6da990; outline: none; }.field small { color: var(--muted); font-size: 10px; }.form-section { border-top: 1px solid var(--line); padding-top: 17px; margin-top: 19px; }.form-section h3 { margin: 0 0 5px; font-size: 13px; }.form-section p { color: var(--muted); margin: 0 0 15px; font-size: 11px; }.toggle-row { display: flex; align-items: center; gap: 8px; color: #53625e; font-size: 12px; }.toggle-row input { accent-color: var(--deep); }.form-preview { background: #f4f8ef; border-radius: 9px; margin-top: 17px; padding: 12px 14px; display: flex; gap: 12px; }.form-preview div { flex: 1; }.form-preview span { display: block; color: var(--muted); font-size: 10px; }.form-preview strong { display: block; margin-top: 4px; font-size: 15px; color: var(--deep); }.form-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 18px 24px 22px; }.form-error { color: #b23d34; font-size: 11px; min-height: 14px; padding: 0 24px; }.modal .inline-actions { display: flex; gap: 6px; }
.toast { position: fixed; z-index: 20; right: 22px; bottom: 22px; background: var(--deep); color: #fff; border-radius: 9px; box-shadow: 0 10px 35px rgba(0,0,0,.2); padding: 12px 15px; font-size: 12px; font-weight: 700; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .25s; }.toast.show { opacity: 1; transform: translateY(0); }.toast.error { background: #a43d34; }

@media (max-width: 1050px) { .main-content { padding: 0 25px 35px; }.stats-grid { grid-template-columns: repeat(2, 1fr); }.dashboard-grid, .bank-layout { grid-template-columns: 1fr; }.team-grid { grid-template-columns: repeat(2, 1fr); } .bank-list-panel { min-height: auto; }.bank-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(180px,1fr)); }.rule-card { grid-template-columns: 1fr 1fr 1fr auto; }.rule-product { grid-column: span 1; }}
@media (max-width: 760px) { .app-shell { display: block; }.sidebar { z-index: 5; position: fixed; transform: translateX(-100%); width: 246px; transition: transform .25s; }.sidebar.open { transform: translateX(0); }.main-content { padding: 0 16px 30px; }.topbar { min-height: 84px; }.mobile-menu { display: block; border: none; background: transparent; color: var(--deep); font-size: 22px; margin-right: 10px; }.topbar > div:first-of-type { flex: 1; }.topbar h1 { font-size: 17px; }.topbar-actions .button { display: none; }.intro-row, .section-toolbar { align-items: flex-start; flex-direction: column; }.intro-row h2, .section-toolbar h2 { font-size: 22px; }.compact-select { width: 100%; }.compact-select select { width: 100%; }.stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }.stat-card { min-height: 116px; padding: 14px; }.stat-card .stat-value { font-size: 21px; margin: 10px 0 4px; }.stat-card .stat-label { font-size: 9px; }.stat-card .stat-note { font-size: 9px; }.donut-area { grid-template-columns: 140px 1fr; }.filter-bar { align-items: stretch; flex-wrap: wrap; }.search-input { min-width: 100%; }.filter-bar select { flex: 1; min-width: 130px; }.filter-bar .button { flex: 1; }.team-summary, .team-grid, .reports-grid { grid-template-columns: 1fr; }.rule-card { grid-template-columns: 1fr 1fr; }.rule-card .action-button { justify-self: end; }.danger-zone { align-items: flex-start; flex-direction: column; }.form-grid, .form-grid.three { grid-template-columns: 1fr; }.modal { max-height: 92vh; }.topbar { gap: 0; }.sidebar + .main-content { width: 100%; } }
@media print { .sidebar, .topbar-actions, .mobile-menu, .compact-select, .upcoming-panel .text-button { display: none !important; }.app-shell { display: block; }.main-content { padding: 0; max-width: none; }.topbar { min-height: 60px; }.view:not(#dashboard) { display: none !important; }.view#dashboard { display: block !important; padding-top: 20px; }.panel, .stat-card { box-shadow: none; border: 1px solid #ddd; }.dashboard-grid { grid-template-columns: 1.8fr 1fr; }.stats-grid { grid-template-columns: repeat(4,1fr); }.revenue-chart { height: 180px; } }
