:root{--navy:#071b3a;--blue:#004cff;--green:#078a1b;--red:#ff1616;--orange:#ff4a00;--purple:#4600ff;--cyan:#0085b4;--border:#d7e0ef;--text:#071b3a;--muted:#60708f}*{box-sizing:border-box}body{margin:0;font-family:Inter,Arial,Helvetica,sans-serif;background:#fff;color:var(--text);font-size:14px}.app-shell{display:flex;min-height:100vh}.sidebar{width:250px;background:linear-gradient(180deg,#061a39,#041327);color:#fff;position:fixed;left:0;top:0;bottom:0;padding:22px 16px;display:flex;flex-direction:column}.brand{display:flex;align-items:center;gap:12px;margin-bottom:34px}.brand-icon{width:48px;height:48px;border:4px solid #fff;border-radius:12px;display:grid;place-items:center;font-size:22px}.brand h1{font-size:18px;margin:0;font-weight:900}.brand p{font-size:12px;margin:4px 0 0}.nav{border:0;background:transparent;color:#fff;display:flex;align-items:center;gap:13px;font-weight:800;font-size:15px;text-align:left;padding:13px 12px;border-radius:8px;margin-bottom:8px;cursor:pointer}.nav.active,.nav:hover{background:#0457ff}.nav:first-letter{font-size:22px}.exit{margin-top:auto;border-top:1px solid rgba(255,255,255,.12);padding-top:20px;font-weight:800}.main{margin-left:250px;width:calc(100% - 250px);min-height:100vh;padding:24px 22px 18px}.header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:20px}.header h2{font-size:44px;line-height:1;margin:0;font-weight:950;letter-spacing:-1px}.top-actions{display:flex;align-items:center;gap:18px;font-weight:900}.user{margin-left:8px}.section{display:none}.section.active{display:block}.top-summary{width:min(1030px,70%);margin:12px auto 24px;display:grid;grid-template-columns:repeat(3,1fr);border:1px solid var(--border);border-radius:8px;background:#fff}.top-card{height:125px;display:flex;flex-direction:column;justify-content:center;align-items:center;border-right:1px solid var(--border)}.top-card:last-child{border-right:0}.top-card span{font-weight:900;font-size:16px;margin-bottom:17px}.top-card strong{font-size:28px}.red{color:var(--red)}.blue{color:var(--blue)}.green{color:var(--green)}.orange{color:var(--orange)}.purple{color:var(--purple)}.cyan{color:var(--cyan)}.dashboard-grid{display:grid;grid-template-columns:1.05fr 1.06fr 1.06fr 1.08fr 1.05fr .86fr 1.05fr;gap:14px;align-items:stretch}.panel,.mini-panel,.card{border:1px solid var(--border);border-radius:8px;background:#fff;box-shadow:0 1px 4px rgba(8,27,58,.04);overflow:hidden}.panel{height:660px;display:flex;flex-direction:column}.stack-col{height:660px;display:grid;grid-template-rows:1fr 176px;gap:12px}.refill-col{grid-template-rows:1fr 1fr}.refill-panel{height:324px;display:flex;flex-direction:column}.panel-cf{height:auto}.gioco-box{display:flex;flex-direction:column}.panel-title,.mini-title{height:64px;display:flex;align-items:center;justify-content:center;gap:10px;font-size:22px;font-weight:950;text-align:center}.table-head{display:grid;gap:5px;padding:0 14px 10px;border-bottom:1px solid #dce4ef;font-size:11px;font-weight:950}.three{grid-template-columns:1.35fr .72fr .9fr}.two{grid-template-columns:1fr 1fr}.rows{padding:10px 14px;display:flex;flex-direction:column;gap:13px;min-height:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin}.row{display:grid;gap:5px;align-items:center;font-size:12px;font-weight:800;min-height:18px;flex:0 0 auto}.row.three{grid-template-columns:1.35fr .72fr .9fr}.row.two{grid-template-columns:1fr 1fr}.row span:last-child{text-align:right}.row span:nth-child(2){text-align:center}.panel-total{margin-top:auto;min-height:52px;padding:10px 14px;display:flex;align-items:center;justify-content:space-between;font-size:12px;font-weight:950}.panel-total strong{font-size:18px}.one-line span{white-space:nowrap;font-size:11px}.blue-bg{background:#eef5ff;color:var(--blue)}.green-bg{background:#eff9ef;color:var(--green)}.red-bg{background:#fff0ef;color:var(--red)}.orange-bg{background:#fff3e9;color:var(--orange)}.purple-bg{background:#f2efff;color:var(--purple)}.cyan-bg{background:#effaff;color:var(--cyan)}.only-total{height:58px}.bottom-summary{width:min(930px,72%);margin:28px auto 0;display:grid;grid-template-columns:1fr 1fr .85fr;gap:16px}.bottom-card{height:118px;border:1px solid var(--border);border-radius:8px;background:#fff;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;font-weight:950}.bottom-card span{font-size:17px}.bottom-card strong{font-size:25px}.self-card{max-width:330px}footer{text-align:center;color:#4770aa;font-weight:800;margin:24px 0 0}.card{padding:22px}.form-card{max-width:900px;margin:auto}.movement-form{display:grid;grid-template-columns:repeat(2,1fr);gap:16px}.movement-form label{font-weight:900}.movement-form input,.movement-form select,.search{width:100%;margin-top:7px;padding:12px;border:1px solid var(--border);border-radius:8px;font-size:15px}.full{grid-column:1/-1}.movement-form button{grid-column:1/-1;background:#0457ff;color:#fff;border:0;border-radius:8px;padding:14px;font-weight:950;font-size:16px}.archive-head{display:flex;justify-content:space-between;align-items:center}#exportBtn{border:0;background:#071b3a;color:#fff;border-radius:8px;padding:11px 16px;font-weight:900}.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse}th,td{border-bottom:1px solid #e6edf6;padding:11px;text-align:left;white-space:nowrap}.cards-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:14px}.conto-card{border:1px solid var(--border);border-radius:8px;padding:18px}.conto-card strong{font-size:22px;color:var(--blue)}.ok{color:var(--green);font-weight:900}.error{color:var(--red);font-weight:900}@media(max-width:1250px){.dashboard-grid{grid-template-columns:repeat(3,1fr)}.panel,.stack-col{height:620px}.top-summary,.bottom-summary{width:100%}}@media(max-width:850px){.sidebar{position:relative;width:100%;height:auto}.main{margin-left:0;width:100%;padding:14px}.app-shell{display:block}.header{flex-direction:column;gap:10px}.header h2{font-size:32px}.dashboard-grid,.bottom-summary,.top-summary{grid-template-columns:1fr;width:100%}.panel,.stack-col{height:auto;min-height:560px}.refill-panel{height:320px}.movement-form{grid-template-columns:1fr}.full,.movement-form button{grid-column:auto}}
.hidden-field{display:none}.hidden-field.visible{display:block}

.delete-btn{
  border:0;
  background:#fee2e2;
  color:#991b1b;
  padding:7px 10px;
  border-radius:8px;
  font-weight:700;
  cursor:pointer;
}
.delete-btn:hover{ background:#fecaca; }

.cliente-line{display:grid;grid-template-columns:1fr auto;gap:8px;align-items:end}
.cliente-line select{margin-top:7px}
.small-danger{border:0;background:#fee2e2;color:#991b1b;border-radius:8px;padding:12px 11px;font-weight:900;cursor:pointer;white-space:nowrap}
.small-danger:hover{background:#fecaca}
.small-danger:disabled{opacity:.45;cursor:not-allowed}

.vlt-title{position:relative;gap:12px;flex-wrap:wrap}
.mini-action{border:0;background:#fff3e9;color:#b93600;border-radius:8px;padding:8px 10px;font-size:11px;font-weight:950;cursor:pointer;box-shadow:inset 0 0 0 1px #ffd3b8}
.mini-action:hover{background:#ffe6d4}

.readonly{background:#f1f5f9;color:#5b6b86;cursor:not-allowed}

.rows::-webkit-scrollbar{width:7px}.rows::-webkit-scrollbar-thumb{background:#c8d3e3;border-radius:8px}.rows::-webkit-scrollbar-track{background:#f4f7fb}

/* Icone Lucide */
.panel-title .lucide, .mini-title .lucide{
  width:28px;
  height:28px;
  stroke-width:2.6;
  flex:0 0 auto;
}
.bottom-card .lucide, .top-actions .lucide{
  width:24px;
  height:24px;
  stroke-width:2.5;
  vertical-align:middle;
}
.bottom-card span{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.top-actions .user{
  display:flex;
  align-items:center;
  gap:6px;
}


/* Login e permessi */
.hidden-app{display:none}
.login-screen{min-height:100vh;display:grid;place-items:center;background:linear-gradient(135deg,#061a39,#0b4cff);padding:20px}
.login-card{width:min(430px,100%);background:#fff;border-radius:16px;padding:34px;box-shadow:0 24px 80px rgba(0,0,0,.24);text-align:center}
.login-logo{width:64px;height:64px;border:5px solid #071b3a;border-radius:16px;display:grid;place-items:center;margin:0 auto 14px;font-size:28px;color:#071b3a;font-weight:950}
.login-card h1{margin:0;font-size:28px;font-weight:950;color:#071b3a}.login-card p{margin:8px 0 24px;color:#60708f;font-weight:800}
.login-card form{display:grid;gap:14px;text-align:left}.login-card label{font-weight:900;color:#071b3a}.login-card input{width:100%;margin-top:7px;padding:13px;border:1px solid var(--border);border-radius:9px;font-size:15px}.login-card button{border:0;background:#0457ff;color:#fff;border-radius:9px;padding:14px;font-weight:950;font-size:16px;cursor:pointer}.login-message{margin-top:14px;font-weight:900;color:#ff1616;min-height:20px}.exit{border:0;background:transparent;color:#fff;text-align:left;font:inherit;cursor:pointer}.permission-note{margin-top:10px;padding:10px;border-radius:8px;background:#fff7ed;color:#9a3412;font-weight:900}.utenti-list{display:grid;gap:10px;margin-top:18px}.utente-row{display:grid;grid-template-columns:1.2fr 1fr .8fr;gap:12px;border:1px solid var(--border);border-radius:10px;padding:12px;font-weight:800}.role-badge{display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:5px 10px;background:#eef5ff;color:#004cff;font-weight:950}.nav[disabled]{display:none}.delete-btn[disabled]{display:none}
