:root {
  --ink:#0b1428;
  --muted:#586780;
  --line:#d7e3f2;
  --blue:#315efb;
  --bg:#f3f7fc;
  font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--ink);
  background:var(--bg);
  font-size:14px;
}

* {
  box-sizing:border-box;
}

body {
  margin:0;
}

.shell {
  min-height:100vh;
  display:grid;
  grid-template-columns:224px minmax(0,1fr);
}

.icon {
  width:19px;
  height:19px;
  flex:none;
  vertical-align:middle;
}

a {
  color:var(--blue);
  text-decoration:none;
}

a:hover {
  text-decoration:underline;
}

button,a.quiet,a.primary {
  font:inherit;
  font-weight:600;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 14px;
  border:1px solid #c7d6eb;
  border-radius:7px;
  color:var(--ink);
  background:white;
  cursor:pointer;
}

button:hover,.quiet:hover {
  background:#edf4ff;
  text-decoration:none;
}

button:disabled {
  opacity:.5;
  cursor:default;
}

.primary,a.primary {
  background:var(--blue);
  color:white;
  border-color:var(--blue);
}

.primary:hover {
  background:#244be1;
}

.icon+span {
  min-width:0;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible {
  outline:3px solid #4b94ff;
  outline-offset:2px;
}

aside {
  background:linear-gradient(165deg,#0b2e63 0%,#123d86 43%,#0a2857 100%);
  color:#f8fbff;
  position:sticky;
  top:0;
  height:100vh;
  display:flex;
  flex-direction:column;
  padding:27px 14px;
  z-index:3;
}

.brand,.loginbrand {
  display:flex;
  align-items:center;
  gap:10px;
  letter-spacing:-.7px;
  font-size:20px;
  font-weight:750;
  color:inherit;
}

.brand {
  margin:0 5px 30px;
}

.brand strong {
  font-weight:430;
}

.brand:hover {
  text-decoration:none;
}

.logo {
  background:#152953;
  color:#b8d9ff;
  width:34px;
  height:34px;
  border-radius:10px;
  display:inline-grid;
  place-items:center;
}

.logo .icon {
  width:23px;
  height:23px;
}

.workspace {
  display:flex;
  align-items:center;
  gap:12px;
  border-block:1px solid #34598a;
  padding:18px 6px;
  margin-bottom:24px;
}

.workspace small,.activity a,td small,.product small {
  display:block;
  margin-top:4px;
  font-size:12px;
}

.workspace small {
  color:#c5d9f7;
}

.avatar {
  border:1px solid #4774ae;
  border-radius:8px;
  background:#1b4684;
  padding:8px 11px;
  font-weight:700;
}

.workspace b {
  font-size:13px;
  letter-spacing:.04em;
}

nav {
  display:grid;
  gap:5px;
}

nav a {
  display:flex;
  gap:12px;
  align-items:center;
  padding:12px;
  color:#e8f1ff;
  font-weight:530;
  border-radius:6px;
}

nav a:hover {
  background:#214e89;
  text-decoration:none;
}

nav a.active {
  background:#2558ab;
  color:#ffffff;
}

nav em {
  margin-left:auto;
}

.sidefoot {
  border-top:1px solid #34598a;
  margin-top:auto;
  padding:16px 5px 0;
  display:flex;
  align-items:center;
  justify-content:space-between;
}

.operator {
  display:flex;
  align-items:center;
  gap:8px;
  color:#d3e4fe;
}

.logout {
  background:transparent;
  color:white;
  border:0;
}

.logout:hover {
  background:#2558ab;
}

main {
  min-width:0;
}

header {
  height:62px;
  padding:0 clamp(20px,3.5vw,58px);
  display:flex;
  align-items:center;
  gap:14px;
  background:linear-gradient(100deg,#f1f7ff,#dfecff 60%,#f7faff);
  border-bottom:1px solid var(--line);
}

.crumb {
  color:var(--muted);
  font-size:13px;
  font-weight:550;
}

.crumb span {
  color:#9db2cf;
  padding:0 9px;
}

.sim {
  margin-left:auto;
  border:1px solid #ebd699;
  border-radius:18px;
  padding:5px 10px;
  color:#785510;
  background:#fff8de;
  display:flex;
  align-items:center;
  gap:7px;
  font-size:12px;
  font-weight:650;
}

.sim i,.badge i {
  border-radius:50%;
  width:6px;
  height:6px;
  background:currentColor;
}

.hamb {
  display:none;
}

.main-content {
  padding:32px clamp(16px,3.5vw,58px) 44px;
  max-width:1600px;
  margin:auto;
}

.kicker {
  color:#355eb3;
  font-size:10.5px;
  font-weight:750;
  letter-spacing:.15em;
  margin:0 0 9px;
}

h1,h2,h3,p {
  overflow-wrap:anywhere;
}

h1 {
  margin:0;
  letter-spacing:-.048em;
  font-size:clamp(32px,3.1vw,46px);
  font-weight:680;
  line-height:1.1;
}

h2 {
  font-size:18px;
  margin:0;
  letter-spacing:-.035em;
}

h3 {
  font-size:15px;
  margin:10px 0;
}

.subtitle {
  color:var(--muted);
  font-size:14px;
  margin:9px 0 22px;
  line-height:1.5;
}

.headrow,.panelhead,.metric-top,.flat {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.headrow {
  margin-bottom:22px;
}

.headrow .subtitle {
  margin-bottom:0;
}

.metrics {
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin-bottom:22px;
}

.metric,.panel {
  border:1px solid var(--line);
  border-radius:12px;
  background:white;
  box-shadow:0 2px 3px #10254409;
}

.metric {
  padding:17px 18px 15px;
}

.metric-top {
  color:#425b7a;
  font-size:13px;
  font-weight:560;
}

.metric strong {
  display:block;
  font-size:36px;
  font-weight:650;
  letter-spacing:-.06em;
  font-variant-numeric:tabular-nums;
}

.tile {
  border-radius:8px;
  width:32px;
  height:32px;
  display:grid;
  place-items:center;
}

.t1 {
  background:#e2edff;
  color:#315efb;
}

.t2 {
  background:#e3f3ff;
  color:#216695;
}

.t3 {
  background:#faefdc;
  color:#996b2d;
}

.t4 {
  background:#e9e8fa;
  color:#7365a4;
}

.panel {
  margin-bottom:18px;
  min-width:0;
}

.panelhead {
  padding:18px 20px;
}

.panelhead>.icon {
  color:var(--muted);
}

.panelhead h2 small,h2>small {
  font-size:12px;
  font-weight:650;
  background:#e9f0ff;
  color:#375c99;
  padding:3px 7px;
  border-radius:5px;
  margin-left:4px;
}

.filters {
  border-top:1px solid #e7eef9;
  display:flex;
  align-items:center;
  gap:8px;
  padding:14px 20px;
}

.search {
  position:relative;
  flex:1;
  max-width:375px;
}

.search .icon {
  position:absolute;
  left:11px;
  top:10px;
  color:var(--muted);
  width:16px;
}

.search input {
  width:100%;
  padding-left:35px;
}

.filters button {
  padding:8px 12px;
}

.filters select {
  margin-left:auto;
}

input,select {
  font:inherit;
  background:white;
  border:1px solid #c3d2e7;
  border-radius:6px;
  padding:9px 10px;
  color:var(--ink);
  max-width:100%;
}

input[type=checkbox] {
  width:16px;
  height:16px;
  accent-color:var(--blue);
  vertical-align:middle;
  flex:none;
}

.tablewrap {
  overflow-x:auto;
}

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

th {
  text-align:left;
  background:#f4f7fc;
  color:#526581;
  font-size:11px;
  font-weight:650;
  white-space:nowrap;
}

th,td {
  padding:13px 10px;
  border-block:1px solid #e3eaf4;
}

th:first-child,td:first-child {
  padding-left:20px;
}

td:last-child {
  padding-right:17px;
}

td small,.panelnote,time {
  color:var(--muted);
}

.orderid {
  color:#174184;
  font-weight:650;
  white-space:nowrap;
}

.badge {
  display:inline-flex;
  align-items:center;
  gap:6px;
  background:#e8f1f8;
  color:#346a8e;
  border-radius:16px;
  padding:5px 9px;
  font-size:11px;
  font-weight:650;
  white-space:nowrap;
}

.badge.confirmed,.badge.delivered,.badge.sent {
  background:#e1f4e9;
  color:#246848;
}

.badge.missing,.badge.partial,.badge.booked {
  background:#fff0d8;
  color:#866018;
}

.badge.cancelled,.badge.rejected {
  background:#fde9e4;
  color:#973f32;
}

.arrow {
  color:#4d6c9b;
}

.arrow .icon {
  width:15px;
}

.panelnote {
  font-size:12px;
  padding:12px 20px;
}

.lower {
  display:grid;
  grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);
  gap:16px;
  align-items:start;
}

.activity {
  padding:0 20px 14px;
}

.activity>div {
  display:flex;
  align-items:baseline;
  gap:10px;
  border-top:1px solid #e8edf8;
  padding:11px 0;
}

.activity i {
  background:#6da0f5;
  border-radius:50%;
  height:7px;
  width:7px;
  flex:none;
}

.activity b {
  font-size:13px;
  font-weight:580;
}

.activity a {
  color:var(--muted);
}

.activity time {
  font-size:11px;
  margin-left:auto;
  white-space:nowrap;
}

.automation {
  border-radius:12px;
  padding:21px;
  background:linear-gradient(130deg,#0b2e63,#123d86);
  color:white;
}

.autotitle {
  display:flex;
  align-items:center;
  gap:8px;
  color:#adceff;
  font-size:12px;
  font-weight:650;
}

.automation h2 {
  margin:16px 0;
  font-size:24px;
}

.automation dl {
  margin:0 0 15px;
}

.automation dl div {
  display:flex;
  justify-content:space-between;
  gap:10px;
  padding:7px 0;
}

.automation dt {
  color:#ccdefa;
  font-size:13px;
}

dd {
  margin:0;
}

.automation a {
  display:flex;
  align-items:center;
  justify-content:space-between;
  color:#c6deff;
  border-top:1px solid #456ca4;
  padding-top:13px;
  font-weight:600;
}

.inner {
  padding:20px;
}

.flat {
  padding:0;
}

.facts,.timegrid {
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(145px,1fr));
  gap:16px;
  margin:18px 0;
}

.facts dt {
  font-size:12px;
  color:var(--muted);
  margin-bottom:4px;
}

.facts dd {
  overflow-wrap:anywhere;
}

.item,.product {
  padding:15px 0;
  border-bottom:1px solid var(--line);
}

.item:last-child,.product:last-child {
  border:0;
}

.item .badge {
  margin-left:8px;
}

.back {
  display:inline-block;
  margin-bottom:16px;
}

.identifier {
  font-size:clamp(24px,3vw,36px);
}

.inner .activity {
  padding:8px 0 0;
}

.warning,.flash {
  background:#fff2d6;
  color:#6a4b16;
  padding:10px 14px;
  border-radius:6px;
}

.flash {
  margin-bottom:16px;
}

.stack {
  display:grid;
  justify-items:start;
  gap:14px;
}

.stack label,.box-row label,.timegrid label {
  display:grid;
  gap:5px;
  font-size:13px;
}

.stack .inline,.days .inline {
  display:flex;
  align-items:center;
  gap:7px;
}

.stack input:not([type=checkbox]),.stack select {
  width:100%;
}

.stack label {
  width:min(100%,450px);
}

.days {
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}

.days .inline {
  width:auto;
}

fieldset {
  border:1px solid var(--line);
  padding:12px;
  border-radius:6px;
  max-width:100%;
}

legend {
  color:var(--muted);
  font-size:12px;
}

.timegrid {
  margin:0;
}

.box-row {
  display:flex;
  align-items:end;
  gap:7px;
  margin:8px 0;
}

.box-row label {
  width:88px;
}

.box-row button {
  height:36px;
  padding:4px 10px;
}

.subtle {
  font-size:12px;
}

summary {
  cursor:pointer;
  color:var(--blue);
  padding:6px 0;
}

.product summary {
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.product summary:after {
  content:'⌄';
}

.product summary>span:nth-child(2) {
  margin-left:auto;
  font-size:13px;
}

.product small {
  color:var(--muted);
}

details form {
  margin:14px 0;
}

.login {
  min-height:100vh;
  background:radial-gradient(ellipse at 75% 16%,#123d86,#0b1428 85%);
  display:grid;
  place-items:center;
  padding:20px;
}

.login-card {
  width:min(390px,100%);
  padding:32px;
  background:#fff;
  border-radius:15px;
}

.loginbrand {
  margin-bottom:36px;
}

.login-card h1 {
  font-size:31px;
  margin-bottom:22px;
}

.login .stack button {
  width:100%;
}

@media(max-width:1150px) {
  .shell {
    grid-template-columns:195px minmax(0,1fr);
  }
  aside {
    padding-inline:10px;
  }
  .brand {
    font-size:18px;
  }
  .main-content {
    padding-inline:20px;
  }
  .metric {
    padding:12px;
  }
  .metric-top {
    font-size:12px;
  }
  .orders th,.orders td {
    padding-inline:7px;
  }
  .orders td:first-child,.orders th:first-child {
    padding-left:12px;
  }
}

@media(max-width:880px) {
  .shell {
    display:block;
  }
  aside {
    display:none;
  }
  aside.open {
    position:fixed;
    top:58px;
    left:0;
    width:240px;
    height:calc(100dvh - 58px);
    display:flex;
    box-shadow:8px 12px 24px #0003;
  }
  .hamb {
    display:inline-flex;
    padding:7px;
  }
  header {
    height:58px;
  }
  .main-content {
    padding-top:24px;
  }
  .metrics {
    gap:8px;
  }
  .orders td:nth-last-child(2) {
    max-width:110px;
  }
}

@media(max-width:640px) {
  header {
    padding:0 14px;
  }
  .main-content {
    padding:20px 12px;
  }
  .headrow {
    align-items:flex-start;
    margin-bottom:16px;
  }
  .headrow .quiet {
    font-size:12px;
    padding:8px;
  }
  .metrics {
    grid-template-columns:1fr 1fr;
    margin-bottom:15px;
  }
  .metric {
    padding:11px 13px;
  }
  .metric strong {
    font-size:29px;
  }
  .tile {
    width:25px;
    height:25px;
  }
  .tile .icon {
    width:15px;
    height:15px;
  }
  .lower {
    grid-template-columns:1fr;
  }
  .panelhead,.filters,.inner {
    padding:14px;
  }
  .panelhead h2,h2 {
    font-size:17px;
  }
  .filters {
    flex-wrap:wrap;
  }
  .search {
    flex-basis:100%;
    max-width:none;
  }
  .filters select {
    margin-left:0;
    flex:1;
  }
  .orders thead {
    display:none;
  }
  .orders tbody {
    display:block;
  }
  .orders tr {
    display:grid;
    grid-template-columns:26px minmax(0,1fr) auto;
    align-items:center;
    padding:11px 12px;
    border-top:1px solid var(--line);
    gap:5px 4px;
  }
  .orders td,.orders td:first-child,.orders td:last-child {
    padding:0;
    border:0;
  }
  .orders td:nth-child(1) {
    grid-column:1;
    grid-row:1;
  }
  .orders td:nth-child(2) {
    grid-column:2;
    grid-row:1;
  }
  .orders td:nth-child(3) {
    grid-column:2;
    grid-row:3;
    color:var(--muted);
    font-size:12px;
  }
  .orders td:nth-child(3):before {
    content:'Scadenza ';
  }
  .orders td:nth-child(3) small {
    margin-left: 3px;
    display:inline;
  }
  .orders td:nth-child(4) {
    grid-column:2;
    grid-row:2;
  }
  .orders td:nth-child(5) {
    grid-column:2/4;
    grid-row:4;
    font-size:12px;
    max-width:none;
  }
  .orders td:nth-child(6) {
    grid-column:3;
    grid-row:1;
  }
  .arrow {
    display:inline-grid;
    place-items:center;
    height:32px;
    width:32px;
    background:#edf4ff;
    border-radius:6px;
  }
  .panelnote {
    padding:10px 14px;
  }
  .activity {
    padding-inline:14px;
  }
  .panelhead .primary {
    padding:8px;
    font-size:12px;
  }
  .box-row {
    flex-wrap:wrap;
  }
  .box-row label {
    width:65px;
  }
  .timegrid {
    grid-template-columns:1fr;
  }
  .facts {
    grid-template-columns:1fr 1fr;
  }
  .product summary {
    align-items:start;
    flex-wrap:wrap;
  }
  .product summary>span:nth-child(2) {
    margin:0;
  }
  .identifier {
    font-size:23px;
  }
  .headrow:has(.identifier) {
    flex-wrap:wrap;
  }
  .activity time {
    white-space:normal;
  }
}

.brand-image {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: block;
  flex: none;
}

.brand span {
  line-height: 1.15;
}

.brand strong {
  display:block;
  color: #c5d9f7;
  font-size: 13px;
  font-weight: 550;
  letter-spacing: .02em;
}

nav a.active {
  box-shadow: inset 3px 0 #83cbff;
}

@media(max-width:640px) {
  .headrow .quiet {
    white-space: nowrap;
  }
}

.mobile-mark {
  display:none;
}

@media(max-width:880px) {
  header {
    background:linear-gradient(110deg,#0b2e63,#123d86);
    border:0;
    gap:10px;
  }
  .mobile-mark {
    display:block;
    width:28px;
    height:28px;
    border-radius:6px;
  }
  .crumb {
    color:#e5f0ff;
  }
  .hamb {
    background:#1d4781;
    border-color:#5277ac;
    color:#fff;
  }
}
