:root {
  --ink: #16241f; --muted: #566860; --paper: #f4f7f5; --surface: #fff; --line: #cfd9d3;
  --delta: #0f5c4d; --delta-ink: #0a3f34; --mist: #e3efe9; --marigold: #e4a72a; --focus: #1b6fa0;
  --danger: #a8321f; --danger-bg: #fbeae6;
  --pending: #8a5a00; --pending-bg: #fdf0d2;
  --ok: #0b5a3d; --ok-bg: #d9f0e3;
  --off: #5d5d5d; --off-bg: #ebebeb;
  --font-head: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --font-body: "Hind Siliguri", "Segoe UI", system-ui, "Noto Sans Bengali", sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.5 var(--font-body); }
[hidden] { display: none !important; }
.wrap { width: min(1200px, 100% - 2rem); margin: 0 auto; padding: 1.5rem 0 4rem; }
.muted { color: var(--muted); }

.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 1.25rem; background: var(--delta); color: #fff; }
.topbar h1 { margin: 0; font: 700 1.5rem var(--font-head); }
.topbar .btn-quiet { color: #fff; border-color: rgba(255,255,255,.6); }
.topbar .btn-quiet:hover { background: rgba(255,255,255,.12); }

.btn { display: inline-block; padding: .55rem 1rem; font: 600 .95rem var(--font-body); border-radius: 7px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--delta); color: #fff; }
.btn-primary:hover { background: var(--delta-ink); }
.btn-quiet { background: transparent; color: var(--delta); border-color: var(--delta); }
.btn-quiet:hover { background: var(--mist); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-sm { padding: .3rem .65rem; font-size: .88rem; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }

/* Tabs */
.tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.tabs button { font: 600 .95rem var(--font-body); padding: .45rem .9rem; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink); }
.tabs button.is-active { background: var(--delta); border-color: var(--delta); color: #fff; }
.count { display: inline-block; min-width: 1.4em; margin-left: .25rem; padding: 0 .35em; border-radius: 999px; background: rgba(0,0,0,.08); font-size: .85em; text-align: center; }
.tabs button.is-active .count { background: rgba(255,255,255,.22); }

.filters { display: flex; flex-wrap: wrap; gap: .75rem 1rem; margin-bottom: .75rem; }
.field-inline { display: grid; gap: .2rem; font-weight: 500; font-size: .9rem; }
.field-inline.grow { flex: 1 1 260px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="time"], input[type="number"], input[type="search"], input[type="password"], select, textarea {
  width: 100%; padding: .5rem .65rem; font: inherit; color: inherit; background: #fff; border: 1.5px solid var(--line); border-radius: 6px;
}
.status { min-height: 1.4em; margin: .25rem 0 .5rem; color: var(--muted); }
.status.is-error { color: var(--danger); font-weight: 500; }

/* Table */
.table-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; min-width: 820px; }
th, td { padding: .7rem .85rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { font-weight: 600; background: var(--mist); font-size: .92rem; }
tbody tr:last-child td { border-bottom: 0; }
td small { display: block; color: var(--muted); }
.actions-col { width: 1%; white-space: nowrap; }
.row-actions { display: flex; flex-wrap: nowrap; gap: .35rem; }
.pill { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .85rem; font-weight: 600; }
.pill-pending   { background: var(--pending-bg); color: var(--pending); }
.pill-confirmed { background: var(--ok-bg);      color: var(--ok); }
.pill-cancelled { background: var(--off-bg);     color: var(--off); }
tr.is-cancelled td { color: var(--muted); }
.empty { padding: 2rem 0; text-align: center; color: var(--muted); }

/* Edit dialog */
dialog { width: min(640px, 100% - 1.5rem); border: 0; border-radius: 12px; padding: 1.5rem; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(22,36,31,.55); }
dialog h2 { margin: 0 0 .25rem; font: 700 1.4rem var(--font-head); }
dialog label { display: block; font-weight: 500; margin-top: .75rem; }
dialog input, dialog textarea { margin-top: .25rem; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0 1rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: .6rem; margin-top: 1.25rem; }
.alert { margin: 1rem 0 0; padding: .65rem .85rem; background: var(--danger-bg); border-left: 4px solid var(--danger); color: #6f1f12; border-radius: 4px; }

/* Login */
.login-body { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login-card { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-top: 6px solid var(--marigold); border-radius: 10px; padding: 1.75rem; }
.login-card h1 { margin: 0 0 .25rem; font: 700 1.8rem var(--font-head); }
.login-card label { display: block; margin-top: 1rem; font-weight: 500; }
.login-card input { margin-top: .25rem; }
.login-card .btn { width: 100%; margin-top: 1.4rem; padding: .7rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* new */

.pill-pay-unpaid  { background:#fde8e8; color:#9b1c1c; }
.pill-pay-partial { background:#fef3c7; color:#92400e; }
.pill-pay-paid    { background:#dcfce7; color:#166534; }
a.btn { text-decoration:none; display:inline-block; }
.check { display:flex; gap:.5rem; align-items:center; margin:1rem 0; }
.check input { width:auto; }
dialog::backdrop { background:rgba(0,0,0,.45); }