* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: #f4f1ea; color: #222; }
.topbar { background: #1f3a5f; color: #fff; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 17px; }
.userbox { display: flex; gap: 8px; align-items: center; font-size: 14px; }
main { max-width: 860px; margin: 0 auto; padding: 16px; }
h1, h2, h3 { color: #1f3a5f; }
.card { background: #fff; border: 1px solid #ddd; border-radius: 12px; padding: 16px; margin: 12px 0; }
.narrow { max-width: 420px; margin-top: 40px; }
label { display: block; margin: 8px 0; font-weight: 600; font-size: 14px; }
label.check { display: flex; align-items: center; gap: 8px; }
input, select, textarea { width: 100%; padding: 11px; margin-top: 4px; border: 1px solid #bbb; border-radius: 8px; font-size: 16px; background: #fff; }
input[type="checkbox"] { width: auto; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 140px; }
.between { justify-content: space-between; align-items: center; }
.btn { background: #e8e2d4; color: #222; border: 1px solid #c9c0ab; border-radius: 8px; padding: 10px 16px; font-size: 15px; cursor: pointer; }
.btn.primary { background: #1f3a5f; color: #fff; border-color: #1f3a5f; }
.btn.danger { background: #a33; color: #fff; border-color: #a33; }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn.big { width: 100%; padding: 13px; font-size: 17px; }
.btn:disabled { opacity: .5; cursor: default; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0 0; }
.tab { flex: 1; min-width: 90px; padding: 12px 6px; border: 1px solid #c9c0ab; border-bottom: none; border-radius: 10px 10px 0 0; background: #e8e2d4; font-size: 15px; cursor: pointer; }
.tab.active { background: #fff; font-weight: 700; color: #1f3a5f; }
.panel { background: #fff; border: 1px solid #c9c0ab; border-radius: 0 0 12px 12px; padding: 16px; }
.list { margin-top: 10px; }
.item { border: 1px solid #ddd; border-radius: 10px; padding: 12px; margin: 8px 0; background: #fff; }
.item .meta { color: #555; font-size: 13px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.badge.open { background: #ffe9a8; color: #7a5b00; }
.badge.closed { background: #cdeccd; color: #1e5b1e; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: #eef3f8; border: 1px solid #c9c0ab; border-radius: 20px; padding: 8px 12px; font-size: 15px; }
.chip-name { cursor: pointer; }
.chip.present { background: #cdeccd; border-color: #1e5b1e; font-weight: 700; }
.chip-x { color: #a33; font-weight: 700; cursor: pointer; padding: 0 2px; }
.muted { color: #666; font-size: 14px; }
.error { color: #a33; font-weight: 600; }
.banner { max-width: 860px; margin: 12px auto 0; padding: 12px 16px; border-radius: 10px; font-weight: 600; }
.banner.warn { background: #fff3cd; border: 1px solid #e0a800; color: #664d03; }
.totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 12px 0; }
.total-box { background: #eef3f8; border-radius: 10px; padding: 12px; text-align: center; }
.total-box .n { font-size: 20px; font-weight: 800; color: #1f3a5f; }
.total-box .l { font-size: 13px; color: #555; }
.denom { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.denom .lbl { flex: 1; font-weight: 600; }
.denom .qty { min-width: 34px; text-align: center; font-weight: 700; }
.denom button { width: 44px; height: 44px; font-size: 20px; border-radius: 8px; border: 1px solid #bbb; background: #fff; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: #222; color: #fff; padding: 12px 18px; border-radius: 10px; z-index: 50; max-width: 90%; }
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 40; }
.modal-card { background: #fff; border-radius: 12px; padding: 20px; width: 100%; max-width: 420px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
td, th { border-bottom: 1px solid #eee; padding: 8px 4px; text-align: left; }
td.num, th.num { text-align: right; }
@media (max-width: 560px) { .btn { padding: 12px 14px; } }
