:root { --fg:#111; --muted:#666; --bg:#fafafa; --card:#fff; --ok:#1a7f37; --err:#c62828; --brand:#0b66c3; }
* { box-sizing: border-box; }
html, body { margin:0; padding:0; background:var(--bg); color:var(--fg); font:15px/1.4 system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; }

.topbar { display:flex; justify-content:space-between; align-items:center; padding:10px 14px; background:#fff; border-bottom:1px solid #eee; position:sticky; top:0; z-index:10; }
.userbox { display:flex; align-items:center; gap:8px; }
.userbox .avatar { font-size:20px; }
.userbox .name { font-weight:600; }
.userbox .role { color:var(--muted); font-size:12px; }
.topbar .logout { color:#fff; background:var(--brand); padding:8px 12px; border-radius:10px; text-decoration:none; }

.container { max-width:1100px; margin:16px auto; padding:0 12px; }
h1 { margin:8px 0 10px; font-size:20px; }
.hint { color:var(--muted); margin:8px 0 16px; }

/* Desktop table */
.grid { width:100%; border-collapse:collapse; background:var(--card); border:1px solid #eee; }
.grid th, .grid td { padding:8px; border-bottom:1px solid #eee; vertical-align:middle; }
.grid thead th { background:#f6f7f9; text-align:left; }
.grid tfoot td { background:#f6f7f9; }

input[type="number"], input[type="text"], select { width:100%; padding:10px 10px; border:1px solid #ddd; border-radius:10px; font-size:16px; }
button { padding:10px 14px; border:0; border-radius:12px; background:#e9eef6; cursor:pointer; font-size:16px; }
button.primary { background:var(--brand); color:#fff; }
button.remove { background:#eee; font-size:18px; width:42px; height:38px; line-height:0; }

.total-box { float:right; margin-right:8px; font-weight:600; }

.actions { margin-top:14px; display:flex; gap:12px; align-items:center; }
#status { color:var(--muted); }

.toast { position:fixed; left:50%; bottom:24px; transform:translateX(-50%); background:#333; color:#fff; padding:10px 14px; border-radius:12px; opacity:0; pointer-events:none; transition:.2s; }
.toast.show { opacity:1; }
.toast.ok { background:var(--ok); }
.toast.err { background:var(--err); }

/* Auth */
body.auth { display:grid; place-items:center; min-height:100vh; }
.card { width:min(420px, 94vw); background:#fff; padding:18px; border-radius:16px; box-shadow:0 2px 8px rgba(0,0,0,.06); }
.card h1 { margin:0 0 12px; }
.card label { display:block; margin:10px 0; }
.card input { width:100%; padding:12px; border:1px solid #ddd; border-radius:12px; font-size:16px; }
.card .error { color:var(--err); margin:8px 0; }

/* Mobile layout */
.mobile-list { display:none; }
.mcard { background:var(--card); border:1px solid #eee; border-radius:16px; padding:12px; margin-bottom:12px; box-shadow:0 2px 6px rgba(0,0,0,.03); }
.mcard .row { display:flex; gap:10px; }
.mcard .field { flex:1; display:flex; flex-direction:column; gap:6px; margin-bottom:10px; }
.mcard .field.small { flex:0.8; }
.mcard label { color:var(--muted); font-size:12px; }
.mcard .dash { padding:10px; border:1px dashed #ddd; border-radius:10px; background:#fcfcfc; }
.mcard .actions { display:flex; justify-content:flex-end; }

/* Responsive rules */
@media (max-width: 860px) {
  .grid { display:none; }
  .mobile-list { display:block; }
  .topbar { padding:8px 10px; }
  button, input[type="number"], input[type="text"], select { font-size:16px; }
}
