:root{--bg:#f5f7fa;--ink:#1e293b;--muted:#738095;--line:#e2e8f0;--blue:#2459e7;--sidebar:210px;--radius:8px}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font:13px/1.5 Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif}a{color:inherit;text-decoration:none}button,input,textarea,select{font:inherit}button,a,input,select,textarea,summary{outline-offset:3px}a:focus-visible,button:focus-visible,summary:focus-visible{outline:2px solid var(--blue)}button,summary{cursor:pointer}svg{width:20px;height:20px;flex-shrink:0;vertical-align:middle}button svg,.button svg{width:16px;height:16px}.sidebar{position:fixed;inset:0 auto 0 0;width:var(--sidebar);background:white;border-right:1px solid var(--line);padding:22px 14px;display:flex;flex-direction:column;z-index:10;transition:width .15s}.brandrow{display:flex;align-items:center;justify-content:space-between;margin-bottom:33px}.brand{font-size:27px;font-weight:800;letter-spacing:-1.2px}.brand span{color:var(--blue)}.iconbutton{background:white;border:1px solid var(--line);display:inline-flex;justify-content:center;align-items:center;border-radius:5px;min-width:32px;min-height:32px;padding:6px;color:#586780}.navgroup{padding-bottom:20px;margin-bottom:18px;border-bottom:1px solid var(--line)}.navlabel{display:flex;align-items:center;gap:12px;font-weight:650;padding:8px 12px;color:#29354a}.navitem{display:flex;align-items:center;gap:12px;padding:10px 12px;margin:3px 0;border-radius:5px;font-size:12px;color:#536176}.navgroup .navitem{padding-left:19px}.navgroup .navitem>svg,.navgroup .navitem>.historyicon{width:17px;height:17px}.navitem:hover{background:#f4f6fa}.navitem.active{background:#e9f0ff;color:#174fdb;font-weight:650;box-shadow:inset 3px 0 var(--blue)}.historyicon{position:relative;display:inline-flex;align-items:center;font-style:normal}.historyicon svg:last-child{position:absolute;bottom:-2px;right:-5px;width:10px;height:10px;background:white;border-radius:50%}.sidebottom{margin-top:auto;display:flex;align-items:center;gap:9px;padding-top:20px}.avatar{background:#e4eaf4;color:#495d7c;border-radius:50%;width:31px;height:31px;display:grid;place-items:center;font-size:12px}.userlabel{overflow:hidden;flex:1}.userlabel strong{font-size:11px}.userlabel small{display:block;font-size:10px;color:var(--muted)}.logout{font-size:18px;min-width:27px}.sidebar-collapsed{--sidebar:66px}.sidebar-collapsed .sidebar{padding:22px 10px}.sidebar-collapsed .brand,.sidebar-collapsed .navlabel,.sidebar-collapsed .navitem>span,.sidebar-collapsed .userlabel,.sidebar-collapsed .sidebottom .avatar{display:none}.sidebar-collapsed .brandrow{justify-content:center;margin-bottom:30px}.sidebar-collapsed #sidebar-toggle svg{transform:rotate(180deg)}.sidebar-collapsed .navitem,.sidebar-collapsed .navgroup .navitem{padding:12px;justify-content:center;min-height:43px}.sidebar-collapsed .navgroup .navitem>svg,.sidebar-collapsed .navgroup .navitem>.historyicon{width:22px;height:22px}.sidebar-collapsed .navgroup{padding-bottom:15px}.sidebar-collapsed .sidebottom{justify-content:center}main{margin-left:var(--sidebar);min-height:100vh;transition:margin-left .15s}.content{padding:30px;max-width:2200px;margin:0 auto}.eyebrow{font-size:9px;letter-spacing:1.1px;color:#7a89a0;font-weight:650;margin-bottom:7px}h1{font-size:26px;line-height:1.25;letter-spacing:-.7px;font-weight:700;margin:0 0 8px}h2{font-size:17px;letter-spacing:-.3px;margin:0 0 14px}h3{font-size:13px;margin:24px 0 10px}.page-header{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:20px}.page-header h1{margin:0}.actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:35px;padding:8px 13px;border:1px solid #d7dfeb;border-radius:5px;background:white;color:#30435e;font-size:11px;font-weight:600;white-space:nowrap}.button:hover{background:#f5f8fd}.button.primary{background:var(--blue);border-color:var(--blue);color:white}.button.primary:hover{background:#1548ca}button:disabled{opacity:.55;cursor:wait}.stock-tabs{display:flex;gap:22px;border-bottom:1px solid var(--line);margin-bottom:20px}.stock-tabs a,.history-label{padding:10px 2px;color:#76849a;font-size:12px;display:flex;align-items:center;gap:7px}.stock-tabs a.active{color:var(--blue);box-shadow:inset 0 -2px var(--blue);font-weight:650}.stock-tabs svg{width:17px;height:17px}.inventory{background:white;border:1px solid var(--line);border-radius:7px;overflow:clip}.toolbar{display:flex;align-items:end;gap:10px;padding:17px 16px}.search{flex:1;min-width:150px}.field{min-width:0}.field label,label{display:block;font-size:11px;font-weight:600;color:#54637a;margin-bottom:7px}.toolbar .field{width:180px}.toolbar .field label{font-size:9px;color:#8190a6;margin:0 0 3px}.textlink{color:#526d98;font-size:11px;white-space:nowrap}.filter-actions{border-top:1px solid #f0f3f8;display:flex;align-items:flex-start;gap:8px;padding:9px 16px}.advanced{flex:1}.advanced>summary{font-size:11px;color:#60738f;list-style:none;padding:8px 0}.advanced[open] .formgrid{padding:18px 0}.filter-actions .advanced:not([open]){padding:0}.column-picker{position:relative;flex-shrink:0}.column-picker summary{list-style:none}.popover{position:absolute;right:0;top:40px;background:white;border:1px solid var(--line);box-shadow:0 12px 35px #23304c1c;min-width:200px;padding:15px;z-index:7;border-radius:7px;max-height:65vh;overflow:auto}.popover label{display:flex;align-items:center;gap:7px;padding:4px 0;font-weight:400}.popover input{width:auto}input,select,textarea{width:100%;border:1px solid #d7dfeb;border-radius:4px;background:#fff;padding:9px 10px;color:#2b3b53;min-height:36px}input::placeholder,textarea::placeholder{color:#9aa6b8}input:focus,select:focus,textarea:focus{border-color:#7a9cf4;outline:2px solid #2459e71a}textarea{resize:vertical}input[type=checkbox]{width:16px;height:16px;min-height:0;accent-color:var(--blue);flex-shrink:0}.tablewrap{overflow-x:auto}table{width:100%;border-collapse:collapse;text-align:left;white-space:nowrap}th{background:#f7f9fc;color:#536176;font-size:9px;text-transform:uppercase;letter-spacing:.3px;padding:13px 10px;font-weight:650;border-block:1px solid var(--line);border-right:1px solid #edf1f6}.sort-icon{color:#aab5c6;margin-left:12px}td{padding:13px 10px;font-size:11px;border-bottom:1px solid #eaf0f6;border-right:1px solid #f2f5f9}tbody tr:nth-child(even){background:#fbfcfe}tr[data-href]{cursor:pointer}tr[data-href]:hover{background:#f0f5ff}tr.selected{background:#eaf0ff!important}td strong{font-weight:650}.column-filters td{padding:5px 6px;background:#fafbfd}.column-filters input,.column-filters select{padding:5px;font-size:9px;height:29px;min-height:29px;min-width:65px}.column-filters .range input{min-width:55px;max-width:100px}.column-filters input[type=date]{width:104px}.column-filters .range{display:flex;gap:3px}.column-filters input[type=number]{width:65px}.plate{font-size:11px;color:#172f58;font-weight:600}.badge{display:inline-flex;align-items:center;gap:5px;font-size:10px;line-height:1;padding:6px 7px;border-radius:5px;background:#e8f7ed;color:#287646}.badge i{width:5px;height:5px;background:currentColor;border-radius:50%}.badge.riservato{background:#e6efff;color:#335eb8}.badge.ripristino{background:#fff3dd;color:#95641d}.badge.venduto{background:#edf0f5;color:#6d7c92}.old-stock{padding:4px 6px;border-radius:4px;background:#fff1cf;color:#95611b}.pagination{display:flex;align-items:center;justify-content:space-between;padding:15px 16px;font-size:11px;color:#8090a6}.pagination>div{display:flex;align-items:center;gap:14px}.pagination .button{padding:4px 10px;min-height:28px}.empty{text-align:center;padding:58px 20px;white-space:normal}.empty h2{font-size:17px}.empty-symbol{color:#92a5c2;margin-bottom:15px}.empty-symbol svg{width:36px;height:36px}.muted{color:var(--muted)}.help{font-size:10px;line-height:1.6;color:#8390a5;margin:14px 0}.heading{margin-bottom:24px}.heading p{margin:10px 0}.panel{padding:25px;background:white;border:1px solid var(--line);border-radius:7px;margin-bottom:20px}.panel p{line-height:1.7}.panel hr{border:0;border-top:1px solid var(--line);margin:27px 0}.formgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:19px 24px}.formgrid.single{grid-template-columns:1fr}.full{grid-column:1/-1}.notice{padding:12px 15px;background:#ecf6ee;border:1px solid #cfe5d4;color:#38614a;border-radius:5px;margin-bottom:18px;font-size:12px}.notice.error,.errorpanel{background:#fff4f1;border-color:#efd0c7;color:#a04938}.notice.subtle{background:#edf3ff;color:#44689d;border-color:#d9e6ff;font-size:11px;margin-top:22px}.formfooter{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:12px}.check{display:flex;align-items:center;gap:9px;font-size:12px;font-weight:400;margin:12px 0}.settings-grid,.importlayout{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}.settings-grid .panel{margin:0}.settings-nav{display:flex;gap:10px;margin-bottom:20px}.settings-grid .formgrid{gap:15px}.tips{background:#f0f4fa}.longtext{white-space:pre-wrap;overflow-wrap:anywhere;color:#52637d}.drawer-backdrop{position:fixed;inset:0;background:#1929434d;z-index:30;backdrop-filter:blur(.5px)}.drawer{position:fixed;right:0;top:0;bottom:0;width:min(820px,73vw);background:white;box-shadow:-12px 0 50px #14274326;z-index:31;display:flex;flex-direction:column}.drawer-header{display:flex;justify-content:space-between;gap:18px;padding:25px 29px 18px;border-bottom:1px solid var(--line);flex-shrink:0}.drawer-header h2{font-size:24px;margin:3px 0 4px;letter-spacing:-.5px}.drawer-header p{color:#7e8da3;font-size:11px;margin:0}.drawer-header .iconbutton{border:0;align-self:flex-start}.drawer-scroll{padding:0 29px 25px;overflow-y:auto;flex:1;min-height:0;scrollbar-gutter:stable}.drawer-tabs{display:flex;gap:20px;border-bottom:1px solid var(--line);margin-bottom:25px;background:white;position:sticky;top:0;z-index:2}.drawer-tabs button{background:none;border:0;white-space:nowrap;font-size:11px;padding:17px 0 13px;color:#7e8ba0}.drawer-tabs button.active{color:var(--blue);box-shadow:inset 0 -2px var(--blue);font-weight:650}.drawer form#vehicle-form{display:flex;flex-direction:column;flex:1;min-height:0}.drawer-footer{display:flex;align-items:center;justify-content:flex-end;gap:10px;padding:15px 29px;border-top:1px solid var(--line);background:white;flex-shrink:0}.drawer-footer .help{margin:0 auto 0 0}.drawer-open{overflow:hidden}.details{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:24px 32px;margin:0}.details>div{min-width:0}dt{font-size:10px;color:#8995a8;margin-bottom:6px}dd{font-size:13px;font-weight:550;margin:0;overflow-wrap:anywhere}.lookup{display:flex;align-items:center;gap:14px}.lookup span{font-size:11px;color:#6b7d97}output{display:block;background:#f5f8fd;border-radius:4px;padding:9px 10px;font-weight:650;min-height:36px}.muted-field{opacity:.6}.tab-section{padding-bottom:18px}[hidden]{display:none!important}.authmain{margin:0;display:flex;min-height:100vh;flex-direction:column;background:#f3f6fc}.authmain .content{display:grid;place-items:center;flex:1;padding:30px;width:100%}.login{max-width:420px;width:100%;padding:38px;background:white;border:1px solid var(--line);border-radius:10px;box-shadow:0 18px 60px #2035530a}.login .brand{display:inline-block;margin-bottom:30px}.login h1{font-size:30px;margin:10px 0}.login>p{margin-bottom:25px}.login form>label{margin-top:16px}.login .wide{margin-top:22px;width:100%}.login .help{margin-bottom:0}.authmain footer{padding:22px;text-align:center;color:#97a2b4;font-size:10px}.narrow{max-width:650px}code{font-family:ui-monospace,monospace;word-break:break-all}p{margin:10px 0 18px}@media(min-width:1800px){.content{padding:35px 40px}.drawer{width:min(1000px,65vw)}.stock-table td{font-size:12px;padding:15px 12px}.stock-table th{font-size:10px}}@media(max-width:1100px){:root{--sidebar:180px}.content{padding:22px 18px}.toolbar{flex-wrap:wrap}.toolbar .search{flex-basis:100%}.drawer{width:80vw}.settings-grid,.importlayout{grid-template-columns:1fr}.stock-table{min-width:1140px}}@media(max-width:700px){:root{--sidebar:60px}.sidebar{padding:18px 8px}.brandrow{justify-content:center;margin-bottom:20px}.sidebar .brand,.sidebar .navlabel,.sidebar .navitem>span,.sidebar .userlabel,.sidebar .sidebottom .avatar{display:none}.sidebar .navitem,.sidebar .navgroup .navitem{padding:12px;justify-content:center}.sidebar .sidebottom{justify-content:center}.content{padding:20px 12px}.page-header{align-items:start;flex-direction:column}.page-header h1{font-size:23px}.toolbar .field{flex:1;min-width:120px}.drawer{width:calc(100vw - 12px)}.drawer-header{padding:20px}.drawer-header h2{font-size:21px}.drawer-scroll{padding:0 20px 20px}.drawer-footer{padding:13px 20px;flex-wrap:wrap}.drawer-footer .help{flex-basis:100%}.drawer-tabs{gap:15px;overflow-x:auto}.drawer-tabs button{font-size:10px}.formgrid,.details{grid-template-columns:1fr}.drawer .formgrid{gap:18px}.panel{padding:20px 16px}.settings-grid{gap:14px}.stock-tabs{gap:13px}.stock-tabs a,.history-label{font-size:10px}.filter-actions{padding:8px 12px}.pagination{gap:12px;font-size:10px}.login{padding:28px 23px}.authmain .content{padding:16px}.history-label{display:none}}
.column-filters td[data-column="registration"] .range{flex-direction:column}.column-filters td[data-column="registration"] input[type="date"]{width:102px;min-height:25px;height:25px}

.brand{font-size:16px;letter-spacing:-.5px;white-space:nowrap}.login .brand{font-size:23px}

/* Palette operativa condivisa: blu, superfici chiare e stati semantici. */
:root {
  --bg: #f2f5fb;
  --ink: #172544;
  --muted: #62738d;
  --line: #d6e1f1;
  --blue: #2458ed;
  --surface: #ffffff;
  --surface-soft: #f6f8fd;
  --table-head: #e8eef9;
  --row-base: #ffffff;
  --row-alternate: #f0f1f3;
  --row-hover: #e6e8ec;
  --row-selected: #dce7ff;
}
body { color: var(--ink); -webkit-font-smoothing: antialiased; }
.sidebar { background: #f9fbff; border-right-color: #cfdbed; }
.navlabel { color: #23395b; }
.navitem { color: #526681; }
.navitem.active { background: #e2ebff; color: #1748cb; }
.navitem:hover { background: #edf2fc; }
.navitem.active:hover { background: #d8e4ff; }
.brand { color: #192c50; }
.avatar { background: #e0e9fa; color: #31589c; }
.page-header { margin-bottom: 16px; }
.page-header h1 { color: #172847; font-size: 25px; letter-spacing: -.65px; }
.eyebrow { color: #6680a7; }
.content { padding: 26px 24px; }
.stock-tabs { gap: 8px; margin-bottom: 16px; border-bottom-color: #cddbf1; }
.stock-tabs a { padding: 10px 15px; border-radius: 6px 6px 0 0; color: #526783; }
.stock-tabs a.active { color: #1647d2; background: #e7efff; box-shadow: inset 0 -3px var(--blue); }
.inventory { border-color: #cddbf0; border-radius: 8px; box-shadow: 0 3px 12px #183b7a09; }
.toolbar { padding: 13px 15px; gap: 9px; background: var(--surface); }
.toolbar .field label { color: #5f7394; font-size: 10px; }
.toolbar .search { background: #f8faff; }
.filter-actions { background: #f8faff; border-top-color: #e4ebf7; padding: 7px 15px; }
.advanced > summary { color: #41638f; font-weight: 550; }
.button { border-color: #cbd8ed; color: #2b4368; border-radius: 5px; }
.button:hover { background: #eaf1ff; border-color: #aec3e9; }
.button.primary { background: var(--blue); border-color: var(--blue); color: white; box-shadow: 0 2px 3px #2458ed14; }
.button.primary:hover { background: #1947ce; border-color: #1947ce; }
input, select, textarea { border-color: #ccdaef; color: #253b60; }
input::placeholder { color: #7f91ad; }
input:focus, select:focus, textarea:focus { border-color: #678feb; outline-color: #2458ed26; }
.stock-table { font-variant-numeric: tabular-nums; }
.stock-table th { background: var(--table-head); color: #304c78; border-color: #cfdbed; padding: 11px 9px; font-size: 10px; letter-spacing: .25px; }
.stock-table .sort-icon { color: #7691b9; margin-left: 7px; }
.stock-table .column-filters td { background: #f3f6fc; padding: 5px; border-bottom: 1px solid #ccd9ef; }
.stock-table .column-filters input, .stock-table .column-filters select { background: white; border-color: #cbd9ee; font-size: 10px; min-width: 57px; }
.stock-table .column-filters .range { gap: 3px; }
.stock-table .column-filters .range input { min-width: 40px; max-width: 76px; }
.stock-table .column-filters input[type=number] { width: 48px; }
.stock-table .column-filters td[data-column=registration] input[type=date] { width: 100px; }
.stock-table tbody td { padding: 11px 9px; height: 44px; font-size: 11.5px; color: #213656; border-right: 1px solid #e2e9f4; border-bottom: 1px solid #dce5f2; }
.stock-table tbody tr:nth-child(odd) > td { background: var(--row-base); }
.stock-table tbody tr:nth-child(even) > td { background: var(--row-alternate); }
.stock-table tbody tr[data-href]:hover > td,
.stock-table tbody tr[data-href]:focus-within > td { background: var(--row-hover); }
.stock-table tbody tr.selected > td { background: var(--row-selected); border-bottom-color: #b9cdf3; }
.stock-table tbody tr.selected > td:first-child { box-shadow: inset 3px 0 var(--blue); }
.stock-table [data-column=model] { min-width: 135px; }
.stock-table [data-column=mileage], .stock-table [data-column=sale_price],
.stock-table [data-column=age], .stock-table [data-column=actual_sale_price] { text-align: right; }
.stock-table tbody [data-column=sale_price] { color: #172f57; }
.stock-table .plate { color: #203e72; font-size: 11px; letter-spacing: .15px; }
.stock-table .plate:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.badge { font-size: 10px; font-weight: 600; padding: 5px 8px; border: 1px solid #b9e3c8; background: #ddf5e5; color: #22643c; }
.badge.riservato { border-color: #b9cdf5; background: #e0eaff; color: #2955ab; }
.badge.ripristino { border-color: #efcf99; background: #fff0d7; color: #8b5916; }
.badge.venduto { border-color: #ced8e7; background: #e9eef5; color: #51627d; }
.old-stock { background: #fff0c5; color: #8c570b; border: 1px solid #f0d69a; font-size: 10px; font-weight: 600; }
.pagination { background: #fbfcff; border-top: 1px solid #e1e9f5; color: #617795; padding: 13px 15px; }
.pagination > div > span { color: #335a9b; font-weight: 650; }
.empty { background: #f8faff; }
.empty-symbol { color: #728fc1; }
.drawer-backdrop { background: #23385c38; backdrop-filter: blur(.6px); }
.drawer { background: var(--surface); border-left: 1px solid #c6d5ed; box-shadow: -8px 0 35px #15335e22; }
.drawer-header { background: #f8faff; padding: 23px 28px 20px; border-bottom-color: #d7e2f3; }
.drawer-header h2 { color: #172a4d; font-size: 25px; }
.drawer-header p { color: #526d96; }
.drawer-tabs { gap: 23px; border-bottom-color: #d4e0f3; padding-top: 2px; }
.drawer-tabs button { color: #5a7094; padding: 15px 0 13px; font-size: 12px; }
.drawer-tabs button.active { color: #1949d7; box-shadow: inset 0 -3px var(--blue); }
.section-title { color: #294977; margin: 0 0 18px; padding-bottom: 10px; border-bottom: 1px solid #e1e9f5; font-size: 13px; }
.details { gap: 19px 30px; }
.details > div { padding: 0 0 12px; border-bottom: 1px solid #e8eef7; }
.details dt { color: #637da1; font-size: 11px; margin-bottom: 5px; }
.details dd { color: #1c3152; font-size: 13px; line-height: 1.5; }
.drawer-footer { background: #f8faff; border-top-color: #d5e0f2; }
.drawer input, .drawer select, .drawer textarea { background: #f8faff; }
.drawer input:focus, .drawer select:focus, .drawer textarea:focus { background: white; }
.drawer .field label { color: #4e688f; }
@media(min-width:1800px) {
  .content { padding: 30px 34px; }
  .stock-table tbody td { padding: 12px 11px; font-size: 12px; }
}
@media(max-width:700px) {
  .content { padding: 20px 12px; }
  .page-header h1 { font-size: 23px; }
  .stock-tabs a { padding: 10px 9px; }
  .drawer-header { padding: 20px; }
  .drawer-header h2 { font-size: 22px; }
  .drawer-tabs { gap: 17px; }
  .drawer-tabs button { font-size: 11px; }
}
@media(prefers-reduced-motion:reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0s !important; }
}
