:root{
  --bg:#ffffff;
  --muted:#555555;
  --text:#222222;
  --accent:#22c55e;
  --danger:#d32f2f;
  --radius:12px;
  --font-xl:48px;
  --font-lg:28px; 
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font:16px/1.4 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,'Helvetica Neue',Arial;
  color:var(--text);
  background:radial-gradient(1200px 600px at 10% -10%,#ffffff 0, #f5f5f5 60%, #ebebeb 100%);
}

.app-header{
  display:flex;align-items:center;justify-content:space-between;
  padding:16px 24px;
  background:linear-gradient(180deg,#f5f5f5,#eaeaea);
  border-bottom:1px solid #cccccc;
  position:sticky;top:0;z-index:2;
}
.status{color:var(--muted)}
.separator{opacity:.4;margin:0 8px}

.layout{
  display:grid;
  grid-template-columns: 420px 1fr;
  gap:16px;
  padding:16px;
  max-width:1400px;
  margin:auto;
}
.left-pane, .right-pane{
  background:#ffffff;
  border:1px solid #cccccc;
  border-radius:var(--radius);
  padding:16px;
  box-shadow:0 10px 30px rgba(0,0,0,.05);
}
.left-pane{position:sticky; top:84px; height:fit-content}

.scanner label{display:block;margin-bottom:8px;color:var(--muted)}
#barcode{
  width:100%; padding:14px 16px; border-radius:10px; border:1px solid #cccccc;
  background:#ffffff; color:var(--text);
  outline:none;
}
#barcode:focus{border-color:#3b82f6; box-shadow:0 0 0 3px rgba(59,130,246,.2)}

.scanner-actions{display:flex; gap:8px; margin-top:10px}

.last-item{
  margin-top:16px; padding:12px; border-radius:10px; background:#f7f7f7;
}
.last-item h2{margin:0 0 8px 0; font-size:14px; color:var(--muted)}
#last-item-info{font-size:var(--font-lg); font-weight:600}

.totals{
  margin-top:12px; display:flex; align-items:center; justify-content:space-between;
  background:#f7f7f7; padding:12px; border-radius:10px;
}
.totals span{color:var(--muted)}
.totals strong{font-size:var(--font-xl)}

.payment-actions{margin-top:12px; display:flex; gap:8px}

.right-pane h2{margin:0 0 8px 0}
.table-wrap{overflow:auto; max-height:65vh; border-radius:10px; border:1px solid #cccccc}
table{width:100%; border-collapse:collapse; background:#ffffff}
th,td{padding:10px 12px; border-bottom:1px solid #cccccc}
thead th{position:sticky; top:0; background:#f5f5f5; z-index:1}
tfoot td{background:#f0f0f0; font-weight:700}
.align-right{text-align:right}

.items input[type="number"]{
  width:80px; padding:6px 8px; border-radius:8px; border:1px solid #cccccc; background:#ffffff; color:var(--text);
}

.btn{border:none; padding:10px 14px; border-radius:10px; cursor:pointer; background:#e0e0e0; color:var(--text)}
.btn:hover{filter:brightness(0.95)}
.btn.success{background:var(--accent); color:#ffffff; font-weight:700}
.btn.secondary{background:#d0d0d0}
.btn.danger{background:var(--danger); color:#ffffff}
.btn.icon{padding:6px 10px; border-radius:8px}

dialog{border:none; border-radius:12px; padding:0; background:#ffffff; color:var(--text); width:min(760px,95vw)}
.modal header{padding:14px 16px; border-bottom:1px solid #cccccc}
.modal .modal-body{padding:16px}
.modal footer{display:flex; justify-content:flex-end; gap:8px; padding:12px 16px; border-top:1px solid #cccccc}
.modal .grid{display:grid; grid-template-columns:repeat(2,1fr); gap:12px}
.hidden{display:none}

.modal input, .modal select{
  width:100%; padding:10px 12px; border-radius:10px; border:1px solid #cccccc; background:#ffffff; color:var(--text);
}

.list{list-style:none; margin:12px 0 0 0; padding:0; max-height:50vh; overflow:auto; border:1px solid #cccccc; border-radius:10px}
.list li{display:flex; justify-content:space-between; align-items:center; gap:12px; padding:10px 12px; border-bottom:1px solid #eeeeee}
.list li:last-child{border-bottom:none}
.list .meta{color:var(--muted); font-size:12px}
.list button{white-space:nowrap}

@media (max-width:1100px){
  .layout{grid-template-columns:1fr}
  .left-pane{position:static}
}

.method-grid{
  display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:12px;
}
.method-grid .method{background:#e0e0e0}
.method-grid .method.active{outline:3px solid rgba(34,197,94,.5)}
.kbd{
  display:inline-block; padding:2px 6px; border-radius:6px; border:1px solid #bbb;
  background:#fff; font-size:12px; margin-right:6px;
}
.method-current{margin:6px 0 12px 0; color:var(--muted)}

.items tr.selected { outline: 2px solid #3b82f6; background: rgba(59,130,246,.08); }

.app-header h1 {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.app-header .authors {
  font-size: 0.5em;
  font-weight: normal;
  font-style: italic;
  color: #555555a2;
}