@import url('brand.css');

body { background: var(--night); min-height: 100vh; }
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.side { background: var(--graphite); border-right: 1px solid var(--line); padding: 20px 14px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; text-decoration: none; color: var(--white); }
.side .brand img { width: 44px; height: 44px; border-radius: 10px; }
.side .brand b { font-family: var(--f-display); font-size: 16px; letter-spacing: .02em; }
.side .brand small { display: block; color: var(--steel); font-size: 11px; }
.side a.nav { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--steel); text-decoration: none; font-weight: 600; font-size: 14px; }
.side a.nav:hover { background: var(--graphite-2); color: var(--white); }
.side a.nav.on { background: rgba(0, 212, 255, .12); color: var(--cyan); }
.side .sep { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: #5c6375; margin: 14px 12px 4px; }
.side .foot { margin-top: auto; font-size: 13px; color: var(--steel); padding: 8px 12px; }
.side .foot a { color: var(--steel); }

main { padding: 28px 32px 60px; max-width: 1280px; width: 100%; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.top h1 { font-family: var(--f-display); text-transform: uppercase; font-size: 26px; margin: 0; letter-spacing: .01em; }
.top h1 small { display: block; font-family: var(--f-body); text-transform: none; font-size: 13px; color: var(--steel); font-weight: 500; margin-top: 4px; letter-spacing: 0; }

.card { background: var(--graphite); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card h2 { font-size: 15px; margin: 0 0 14px; text-transform: uppercase; letter-spacing: .06em; color: var(--steel); }
.cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 16px; }
.stat .v { font-family: var(--f-num); font-size: 34px; font-weight: 700; }
.stat .l { color: var(--steel); font-size: 13px; margin-top: 4px; }
.stat.accent .v { color: var(--cyan); }
.stat.gold .v { color: var(--gold); }
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--steel); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 10px; border-bottom: 1px solid var(--line); }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
.thumb { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--graphite-2); }
.muted { color: var(--steel); }
.small { font-size: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--cyan); color: var(--night); border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 800; font-size: 14px; cursor: pointer; text-decoration: none; font-family: var(--f-body); }
.btn:hover { filter: brightness(1.1); }
.btn.ghost { background: transparent; color: var(--white); border: 1px solid var(--line); }
.btn.gold { background: var(--gold); }
.btn.danger { background: transparent; color: var(--red); border: 1px solid rgba(255, 59, 59, .4); }
.btn.sm { padding: 6px 10px; font-size: 12px; border-radius: 8px; }

form.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
form.grid .full { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--steel); }
input, select, textarea { background: var(--night); border: 1px solid var(--line); color: var(--white); border-radius: 10px; padding: 11px 12px; font-size: 15px; font-family: var(--f-body); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--cyan); border-color: transparent; }
label.check { flex-direction: row; align-items: center; gap: 10px; color: var(--white); font-weight: 500; }
label.check input { width: 18px; height: 18px; accent-color: var(--cyan); }
.hint { font-weight: 400; font-size: 12px; color: #6b7386; }

.pill { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.st-nuovo { background: rgba(0, 212, 255, .15); color: var(--cyan); }
.st-preparazione { background: rgba(255, 184, 28, .15); color: var(--gold); }
.st-pronto { background: rgba(46, 229, 157, .15); color: var(--green); }
.st-consegnato { background: var(--graphite-2); color: var(--steel); }
.st-annullato { background: rgba(255, 59, 59, .12); color: var(--red); }

.switch { position: relative; width: 44px; height: 24px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #3a3a48; border-radius: 99px; transition: .2s; cursor: pointer; }
.switch span::after { content: ''; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }

.flash { background: rgba(46, 229, 157, .12); border: 1px solid rgba(46, 229, 157, .35); color: var(--green); padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 600; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 160px; padding-top: 10px; }
.bars .b { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b i { display: block; width: 100%; background: linear-gradient(var(--cyan), var(--cyan-deep)); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bars .b span { font-size: 11px; color: var(--steel); }
.bars .b em { font-style: normal; font-size: 11px; font-family: var(--f-num); }
.screens { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.screens a { display: block; background: var(--graphite-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; color: var(--white); text-decoration: none; font-weight: 700; font-size: 14px; }
.screens a small { display: block; color: var(--steel); font-weight: 500; font-size: 12px; margin-top: 4px; }
.screens a:hover { border-color: var(--cyan); }
.cat-head { display: flex; align-items: center; justify-content: space-between; margin: 26px 0 10px; }
.cat-head h3 { font-family: var(--f-display); text-transform: uppercase; margin: 0; font-size: 18px; }
.preview-img { width: 160px; height: 160px; border-radius: 14px; object-fit: cover; background: var(--graphite-2); border: 1px solid var(--line); }

/* login / install */
body.auth { display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 50% 0%, rgba(0, 212, 255, .14), transparent 60%), var(--night); }
.auth-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; }
.auth-card h1 { font-family: var(--f-display); text-transform: uppercase; margin: 0; font-size: 22px; text-align: center; }
.auth-logo { width: 190px; margin: 0 auto -6px; mix-blend-mode: lighten; }
.err { color: var(--red); margin: 0; font-weight: 600; font-size: 14px; }
.ok { color: var(--green); font-weight: 700; margin: 0; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; }
  .side .sep, .side .foot { display: none; }
  .two, form.grid { grid-template-columns: 1fr; }
  main { padding: 20px 16px; }
}
