:root {
  /* Light blue theme (owner 2026-11-10). */
  --bg: #eef6fd; --card: #ffffff; --ink: #17324d; --muted: #5a6f85; --line: #cfe1f2;
  --brand: #1769b3; --brand-2: #3b93dd; --brand-soft: #dceefc;
  --top-1: #bfe2fb; --top-2: #8fcaf3; --top-ink: #0d3a63; --ok: #2f7d4f; --ok-soft: #e1f2e7;
  --warn: #a86a00; --warn-soft: #fbefd5; --bad: #b3261e; --bad-soft: #f9e0de; --info: #2d5f8a; --info-soft: #e3edf6;
  --female: #b04a7a; --female-soft: #f7e3ec; --male: #2d5f8a; --male-soft: #e3edf6;
  --radius: 10px; --shadow: 0 1px 2px rgba(20, 40, 70, .06), 0 2px 8px rgba(20, 40, 70, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "Noto Sans", "Segoe UI", system-ui, -apple-system, sans-serif; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.45rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* top bar */
.topbar { background: linear-gradient(90deg, var(--top-1), var(--top-2)); color: var(--top-ink); border-bottom: 1px solid #8cc4ec; position: sticky; top: 0; z-index: 30; box-shadow: 0 2px 6px rgba(0,0,0,.15); }
.topbar-inner { max-width: none; margin: 0; display: flex; align-items: center; gap: 16px; padding: 0 16px; min-height: 56px; }
.brand { color: var(--top-ink); font-weight: 700; font-size: 1.1rem; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.brand:hover { text-decoration: none; }
.dayno { background: linear-gradient(180deg, #f6d27a, #d9a43a); color: #3a2a05; font-weight: 700; border-radius: 999px; padding: 4px 12px; white-space: nowrap; font-size: .9rem; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.course-running td { background: #e6f6ea; } .course-running td:first-child { box-shadow: inset 4px 0 0 #2e9b4f; font-weight: 600; }
.course-upcoming td { background: #eaf2fd; } .course-upcoming td:first-child { box-shadow: inset 4px 0 0 #3b7dd8; }
.course-cancelled td { color: #9aa0a6; text-decoration: line-through; }
.badge.phase-running { background: #2e9b4f; color: #fff; } .badge.phase-upcoming { background: #3b7dd8; color: #fff; }
.namecell { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; font-weight: 600; }
.verify-box { margin: 0 0 10px; padding: 6px 10px; border-radius: 10px; background: var(--bad-soft); border: 1px solid #eab8b3; font-size: .9rem; }
.verify-box.ok { background: #e6f6ea; border-color: #b6dfc2; color: #2e7d46; }
.verify-box a.issue { display: inline-block; margin: 2px 4px 2px 0; padding: 1px 8px; border-radius: 999px; background: #fff; color: var(--bad); font-size: .8rem; font-weight: 600; border: 1px solid #eab8b3; }
.avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.avatar-link { text-decoration: none !important; flex: none; }
.avatar-link:hover .avatar { outline: 2px solid var(--brand-2); }
.avatar.none { display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; background: #e3ecf8; color: #2c5a97; }
.avatar.none.F { background: #fbe4ee; color: #a63a6b; }
img[data-zoom] { cursor: zoom-in; }
.zoombox { position: fixed; inset: 0; z-index: 2000; background: rgba(10,15,25,.85); display: flex; align-items: center; justify-content: center; cursor: zoom-out; padding: 16px; }
.zoombox img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 8px 30px rgba(0,0,0,.5); background: #fff; }
.zoombox button { position: absolute; top: 12px; right: 16px; background: rgba(255,255,255,.2); color: #fff; border: 0; border-radius: 50%; width: 40px; height: 40px; font-size: 1.2rem; cursor: pointer; }
a.dayno:hover { text-decoration: none; filter: brightness(1.05); }
.brand .wheel { width: 34px; height: 34px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--top-ink); font-weight: 600; padding: 7px 8px; font-size: .93rem; border-radius: 8px; opacity: .92; white-space: nowrap; }
.nav a:hover, .nav a.active { background: rgba(255,255,255,.65); text-decoration: none; opacity: 1; }
.userbox { display: flex; align-items: center; gap: 8px; white-space: nowrap; font-size: .9rem; }
.userbox button { background: #fff; color: var(--top-ink); border: 1px solid #8cc4ec !important; border: 0; padding: 6px 10px; border-radius: 8px; cursor: pointer; }
.menu-toggle { display: none; background: none; border: 0; color: var(--top-ink); font-size: 24px; cursor: pointer; }

.page { max-width: none; margin: 0; padding: 20px 20px 48px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.card-head h2 { margin: 0; }

.grid { display: grid; gap: 14px; }
.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span-2 { grid-column: span 2; }
.span-all { grid-column: 1 / -1; }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.stat .num { font-size: 1.7rem; font-weight: 700; line-height: 1.1; }
.stat .label { color: var(--muted); font-size: .85rem; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: #fff; color: var(--ink); padding: 8px 14px; border-radius: 8px; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; min-height: 38px; }
.btn:hover { text-decoration: none; border-color: #a9bbd1; background: #f4f8fd; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: #125a9b; }
.btn.danger { color: var(--bad); border-color: #e7b7b2; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { padding: 4px 10px; min-height: 30px; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* forms */
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 4px; }
.field { margin-bottom: 4px; }
.field .hint { color: var(--muted); font-size: .8rem; margin-top: 2px; }
input[type=text], input[type=search], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=password], select, textarea {
  width: 100%; border: 1px solid #c4d1e0; border-radius: 8px; padding: 8px 10px; font: inherit; background: #fff; color: var(--ink); min-height: 38px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--brand-soft); border-color: var(--brand-2); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 18px; height: 18px; }
.req::after { content: " *"; color: var(--bad); }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }
.error-text { color: var(--bad); font-size: .82rem; margin-top: 2px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { min-width: 150px; }

/* alerts */
.alert { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; border: 1px solid; }
.alert.ok { background: var(--ok-soft); border-color: #b9dcc6; color: #1f5a37; }
.alert.bad { background: var(--bad-soft); border-color: #eab8b3; color: #7d1a14; }
.alert.warn { background: var(--warn-soft); border-color: #ecd29e; color: #6d4700; }

/* tables */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th { text-align: left; background: #eef3f9; color: #45556a; font-weight: 600; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data td { padding: 8px 10px; border-bottom: 1px solid #e6edf5; vertical-align: top; }
table.data tr:hover td { background: #f4f8fd; }
table.data td.num, table.data th.num { text-align: right; }
table.data tr.row-left td { background: #fdf0ee; }
table.data tr.row-waiting td { background: #f4f8fc; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: .78rem; font-weight: 600; background: #eee; color: #555; white-space: nowrap; }
.badge.waiting { background: var(--info-soft); color: var(--info); }
.badge.present { background: var(--warn-soft); color: var(--warn); }
.badge.completed { background: var(--ok-soft); color: var(--ok); }
.badge.left { background: var(--bad-soft); color: var(--bad); }
.badge.F { background: var(--female-soft); color: var(--female); }
.badge.M { background: var(--male-soft); color: var(--male); }
.badge.old { background: var(--brand-soft); color: var(--brand); }
.badge.new { background: #e3f5e8; color: #1d6b34; }

/* tabs */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 16px; scrollbar-width: thin; }
.tabs a { padding: 9px 13px; border-radius: 8px 8px 0 0; color: var(--muted); white-space: nowrap; font-weight: 600; font-size: .9rem; border: 1px solid transparent; border-bottom: 0; }
.tabs a:hover { color: var(--ink); text-decoration: none; background: #eef4fb; }
.tabs a.active { color: var(--brand); background: var(--card); border-color: var(--line); margin-bottom: -1px; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.steps a { flex: 1; min-width: 130px; padding: 10px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-weight: 600; font-size: .88rem; }
.steps a .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #dde7f3; color: var(--brand); margin-right: 6px; font-size: .8rem; }
.steps a.active { border-color: var(--brand-2); color: var(--brand); background: var(--brand-soft); }
.steps a.done .n { background: var(--ok); color: #fff; }
.steps a:hover { text-decoration: none; }

/* status radios */
.status-group { display: inline-grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.status-group label { text-align: center; border-bottom: 1px solid var(--line); }
.status-group label:nth-child(2n) { border-right: 0 !important; }
.status-group label:nth-last-child(-n+2) { border-bottom: 0; }
.status-group label { margin: 0; padding: 4px 9px; font-size: .78rem; cursor: pointer; border-right: 1px solid var(--line); background: #fff; font-weight: 600; color: var(--muted); white-space: nowrap; }
.status-group label:last-child { border-right: 0; }
.status-group input { display: none; }
.status-group input:checked + span { color: inherit; }
.status-group label.on-waiting { background: var(--info-soft); color: var(--info); }
.status-group label.on-present { background: var(--warn-soft); color: var(--warn); }
.status-group label.on-completed { background: var(--ok-soft); color: var(--ok); }
.status-group label.on-left { background: var(--bad-soft); color: var(--bad); }

.toast { position: fixed; right: 16px; bottom: 16px; background: #1e2a38; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); z-index: 100; opacity: 0; transform: translateY(10px); transition: .2s; pointer-events: none; }
.toast.show { opacity: 1; transform: none; }
.toast.bad { background: var(--bad); }

dialog { border: 0; border-radius: 12px; padding: 0; width: min(480px, calc(100vw - 32px)); box-shadow: 0 10px 40px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(30,20,10,.45); }
dialog .dlg-body { padding: 18px; }

.pagination { display: flex; gap: 4px; flex-wrap: wrap; padding: 12px 18px; align-items: center; }
.pagination a, .pagination span { padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-size: .88rem; }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.pagination .disabled { color: #bbb; }

.empty { padding: 30px; text-align: center; color: var(--muted); }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 4px 12px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(circle at 20% 10%, #d6e6fa, transparent 50%), radial-gradient(circle at 80% 90%, #c7dbf3, transparent 50%), var(--bg); }
.login-card { width: min(400px, 100%); background: #fff; border-radius: 16px; box-shadow: 0 12px 40px rgba(20, 50, 100, .18); padding: 28px; }
.login-card .logo { width: 92px; height: 92px; display: block; margin: 0 auto 8px; filter: drop-shadow(0 3px 6px rgba(10,50,110,.3)); }
.login-photo { background: linear-gradient(rgba(8,25,55,.45), rgba(8,25,55,.55)), url('../img/centre.jpg') center 35% / cover no-repeat fixed; }
.login-photo .login-card { background: rgba(255,255,255,.95); backdrop-filter: blur(4px); }
.login-card h1 { text-align: center; }

/* hall chart */
.hall { display: flex; flex-direction: column; gap: 22px; }
.hall-side { overflow-x: auto; padding: 12px; min-width: 0; background: #fff; border: 1px solid var(--line, #dde3ea); border-radius: 12px; }
.hall-head { display: flex; justify-content: center; align-items: center; gap: 12px; margin-bottom: 10px; position: relative; }
.hall-head h3 { margin: 0; font-weight: 800; letter-spacing: .5px; }
.hall-head .js-save { position: absolute; right: 0; }
.hall-side.F .hall-head h3 { color: var(--female); }
.hall-side.M .hall-head h3 { color: var(--male); }
.hall-row { display: grid; grid-template-columns: 26px repeat(var(--cols), minmax(150px, 1fr)); min-width: max-content; }
.hall-side.F .hall-row { grid-template-columns: repeat(var(--cols), minmax(150px, 1fr)) 26px; }
.hall-row .rl { align-self: center; text-align: center; font-weight: 800; font-size: 1.2rem; }
.seat { min-height: 96px; border: 1.5px solid #222; margin: 0 -1.5px -1.5px 0; background: #fff; padding: 2px 3px 16px; position: relative; }
.seat-none { min-height: 96px; }
.seat .sl { position: absolute; bottom: 1px; right: 4px; font-size: .9rem; color: #000; font-weight: 700; }
.seat.blocked { background: repeating-linear-gradient(45deg, #eee, #eee 6px, #f8f8f8 6px, #f8f8f8 12px); }
.seat.over { background: var(--brand-soft); outline: 3px solid var(--brand-2); z-index: 1; }
.seat:has(.chip.old) { background: #eaeaea; }
.chip { padding: 2px 3px; font-size: .9rem; line-height: 1.15; cursor: grab; user-select: none; touch-action: none; background: transparent; }
.chip .top { display: flex; justify-content: space-between; gap: 4px; }
.chip .top > span { display: flex; flex-direction: column; }
.chip .k { font-size: .68rem; font-weight: 700; letter-spacing: .2px; }
.chip .v { font-size: 1.05rem; font-weight: 700; }
.chip .nm { text-align: center; font-weight: 800; display: block; text-transform: uppercase; font-size: .98rem; margin-top: 3px; }
.chip .v.up { color: #5b2ea6; background: #e6d9fb; border-radius: 4px; padding: 0 3px; }
.chip.u35 .nm { color: #1546c7; } /* under 35: name in blue ink */
.chip .old-name { text-decoration: underline; text-underline-offset: 2px; }
.chip .meta { display: block; text-align: center; color: #3d4652; font-size: .84rem; line-height: 1.25; }
.chip.picked { outline: 3px solid var(--brand-2); border-radius: 4px; }
.chip.dragging { opacity: .4; }
.chip.ghost { position: fixed; pointer-events: none; z-index: 200; width: 165px; opacity: .95; background: #fff; border: 1.5px solid #222; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.chip.ghost.old { background: #eaeaea; }
.hall .front { text-align: center; font-weight: 800; letter-spacing: 3px; border-top: 3px double #000; margin-top: 10px; padding-top: 4px; }
.basket-title { margin-top: 14px; }
.basket { min-height: 70px; border: 2px dashed var(--brand-2); border-radius: 10px; padding: 8px; display: flex; flex-wrap: wrap; gap: 6px; background: #f4f8fd; }
.basket .chip { width: 165px; border: 1.5px solid #222; background: #fff; }
.basket .chip.old { background: #eaeaea; }
.basket.over { background: var(--brand-soft); }

/* printing */
.print-only { display: none; }
@media print {
  @page { margin: 10mm; }
  body { background: #fff; font-size: 12px; }
  .avatar, .topbar, .no-print, .tabs, .actions, .pagination, .filters, .menu-toggle, .toast { display: none !important; }
  .print-only { display: block; }
  .page { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; padding: 0; }
  table.data th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  table.data td, table.data th { padding: 4px 6px; border: 1px solid #ccc; }
  .page-break { page-break-after: always; }
  a { color: inherit; }
}

@media screen and (max-width: 900px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .menu-toggle { display: block; margin-left: auto; }
  .topbar-inner { flex-wrap: wrap; }
  .nav { display: none; width: 100%; flex-direction: column; padding-bottom: 10px; order: 3; }
  .nav.open { display: flex; }
  .userbox { order: 2; }
}
@media screen and (max-width: 600px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .kv { grid-template-columns: 1fr; }
  .page { padding: 14px 12px 40px; }
  .userbox span { display: none; }
}

/* payment modes: light colours so cash / online / cheque are easy to tell apart */
.mode-cash { background: #d3efdc !important; border-color: #8fd0a6 !important; }
.mode-online { background: #d3e4f7 !important; border-color: #8db5e3 !important; }
.mode-cheque { background: #fae6b3 !important; border-color: #e3b955 !important; }
.stat.mode-cash .num { color: #1f6b3d; }
.stat.mode-online .num { color: #24588f; }
.stat.mode-cheque .num { color: #8a5a00; }
table.data td.mode-cash, table.data th.mode-cash { background: #f0faf3 !important; }
table.data td.mode-online, table.data th.mode-online { background: #eff5fc !important; }
table.data td.mode-cheque, table.data th.mode-cheque { background: #fdf8ea !important; }
table.data tr.row-mode-cash td { background: #f4fbf6; }
table.data tr.row-mode-online td { background: #f3f8fd; }
table.data tr.row-mode-cheque td { background: #fdf8ea; }
table.data tr.row-mode-cash:hover td { background: #e3f4e9; }
table.data tr.row-mode-online:hover td { background: #e2edf9; }
table.data tr.row-mode-cheque:hover td { background: #faefd0; }
table.data tr.row-mode-cash td:first-child { box-shadow: inset 4px 0 0 #2f8a52; }
table.data tr.row-mode-online td:first-child { box-shadow: inset 4px 0 0 #2d6db0; }
table.data tr.row-mode-cheque td:first-child { box-shadow: inset 4px 0 0 #c08a10; }
/* Grey helper text inside a selected (blue) button stays readable. */
.btn.primary .muted { color: #fff; opacity: .9; font-weight: 700; }

/* Course summary under the course title: confirmed count always in view, Female / Male, old / new. */
table.course-sum { border-collapse: collapse; margin-top: 6px; font-size: .85rem; }
table.course-sum th, table.course-sum td { border: 1px solid var(--line); padding: 2px 8px; text-align: center; }
table.course-sum th { background: #f3f6fa; font-weight: 600; }
table.course-sum th.F { color: var(--female); } table.course-sum th.M { color: var(--male); }
table.course-sum .conf { background: #e6f6ea; color: #1f6b38; }
table.course-sum td.conf b { font-size: 1.05rem; }

/* Course pages: compact header, no empty space above the tabs. */
.course-head { align-items: center; margin-bottom: 8px; gap: 8px; }
.course-head .ch-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.course-head h1 { font-size: 1.2rem; margin: 0; }
.course-head .actions { gap: 6px; }
.course-head .actions .btn { padding: 5px 10px; }
.course-head + .tabs, .course-head ~ .tabs { margin-bottom: 10px; }

/* Typed dd-mm-yyyy date boxes (see app.js): the real date box stays hidden behind the 📅 button. */
.dmy { position: relative; display: inline-flex; align-items: center; gap: 4px; width: 100%; }
.dmy > input[type="text"] { flex: 1; min-width: 0; }
.dmy-pick { border: 1px solid var(--line, #ccd); background: #fff; border-radius: 8px; padding: 4px 8px; cursor: pointer; line-height: 1.2; }
.dmy-native { position: absolute; right: 0; bottom: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; border: 0; padding: 0; }

/* ---- New look (owner 2026-11-19: "task app jayada accha lag raha hai, aisa hi baki ke purane pages ko kar do").
   The Kitchen / Tasks look for every page: clean top bar with section pills, rounded cards, big touch targets, phone first.
   Screen only; print keeps its own rules above. ---- */
:root { --top-h: 61px; --sticky-top: 61px; --line-strong: #c3d8ec; }
@media screen {
  body { background: var(--bg); }

  /* top bar: white bar, brand, the main menu as pills in one scrolling row */
  .topbar { background: rgba(255, 255, 255, .96); color: var(--ink); border-bottom: 1px solid var(--line); box-shadow: 0 1px 2px rgba(20, 50, 90, .05), 0 4px 14px rgba(20, 50, 90, .06); backdrop-filter: saturate(1.4) blur(8px); }
  .topbar-inner { min-height: var(--top-h); gap: 14px; padding: 0 18px; }
  .brand { color: #0f3f6e; font-size: 1.12rem; }
  .brand .wheel { width: 36px; height: 36px; }
  .nav { flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 10px 2px; min-width: 0; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: none; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); padding: 7px 14px; border-radius: 999px; border: 1px solid transparent; font-size: .93rem; opacity: 1; }
  .nav a:hover { background: var(--brand-soft); text-decoration: none; }
  .nav a.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 2px 8px rgba(23, 105, 179, .25); }
  .userbox { gap: 8px; }
  .userbox > a, .userbox > span { display: inline-block; max-width: 160px; overflow: hidden; text-overflow: ellipsis; padding: 6px 12px; border-radius: 999px; background: var(--brand-soft); font-weight: 600; }
  .userbox > a:hover { text-decoration: none; background: #cde5fa; }
  .userbox button { border: 1px solid var(--line) !important; border-radius: 999px; padding: 6px 13px; font-weight: 600; font: inherit; font-size: .88rem; background: #fff; color: var(--ink); }
  .userbox button:hover { border-color: #efc1bd !important; background: var(--bad-soft); color: var(--bad); }

  /* page */
  .page { padding: 18px 18px 72px; }
  .page-head { align-items: center; margin-bottom: 14px; }
  .page-head h1 { font-size: 1.6rem; color: var(--ink); line-height: 1.2; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .page-head h1 .k-emoji { font-size: 1.7rem; }
  .page-head .muted { margin-top: 2px; }

  /* cards */
  .card { border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow); padding: 16px 18px; margin-bottom: 14px; }
  .card.flush { padding: 0; }
  .card-head { background: none; padding: 14px 18px; border-bottom: 1px solid #e6eff8; }
  .card-head h2 { color: var(--ink); font-size: 1.12rem; }
  .card > h2:first-child, .card > h3:first-child { display: flex; align-items: center; gap: 8px; }

  /* buttons */
  .btn { border-radius: 12px; min-height: 42px; padding: 9px 16px; font-weight: 700; border-color: var(--line); box-shadow: var(--shadow); transition: background .12s, border-color .12s, filter .12s; }
  .btn:hover { border-color: var(--brand-2); background: var(--brand-soft); box-shadow: var(--shadow); }
  .btn:active { transform: translateY(1px); }
  .btn.primary { background: linear-gradient(180deg, var(--brand-2), var(--brand)); border-color: var(--brand); color: #fff; }
  .btn.primary:hover { background: linear-gradient(180deg, var(--brand-2), var(--brand)); filter: brightness(1.06); }
  .btn.danger { background: #fff; color: var(--bad); border-color: #efc1bd; }
  .btn.danger:hover { background: var(--bad-soft); border-color: #e7a9a3; }
  .btn.small { min-height: 34px; padding: 5px 12px; border-radius: 10px; font-size: .86rem; }

  /* fields */
  label { font-size: .9rem; margin-bottom: 6px; }
  input[type=text], input[type=search], input[type=email], input[type=tel], input[type=number], input[type=date], input[type=password], input[type=url], input[type=time], input[type=month], select, textarea {
    border: 1px solid var(--line-strong); border-radius: 12px; padding: 10px 12px; min-height: 44px; font-size: 1rem; }
  textarea { min-height: 96px; }
  input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(59, 147, 221, .2); }
  input[type=file] { max-width: 100%; }
  .check input { width: 20px; height: 20px; }
  .form-actions { margin-top: 18px; }
  .filters { gap: 10px; }
  .filters .field { flex: 1 1 160px; min-width: 0; }
  .filters.card { padding: 14px 16px; }

  /* alerts */
  .alert { border-radius: 14px; padding: 12px 16px; display: block; }

  /* tables: light header, roomy rows, rounded inside cards */
  table.data { font-size: .93rem; }
  table.data th { background: #f3f8fd; color: var(--muted); font-size: .8rem; font-weight: 700; letter-spacing: .2px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
  table.data td { padding: 10px 12px; border-bottom: 1px solid #e9f0f7; vertical-align: middle; }
  table.data tbody tr:not([class]):nth-child(even) td { background-color: #fbfdff; }
  table.data tr:not([class]):hover td { background: #f1f7fd; }
  table.data tbody tr:last-child td { border-bottom: 0; }

  /* badges */
  .badge { padding: 3px 10px; font-weight: 700; font-size: .78rem; }

  /* sub-page tabs: the same pill row as the Kitchen / Tasks sections */
  .tabs { gap: 8px; border-bottom: 0; padding: 4px 2px 10px; margin: 0 -2px 12px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: none; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: .92rem; box-shadow: var(--shadow); }
  .tabs a:hover { background: #fff; border-color: var(--brand-2); }
  .tabs a.active { background: var(--brand); border-color: var(--brand); color: #fff; margin-bottom: 0; box-shadow: 0 2px 8px rgba(23, 105, 179, .25); }

  .steps a { border-radius: 14px; padding: 11px 13px; box-shadow: var(--shadow); }

  /* number tiles (old .stat): the Tasks desk tiles */
  .stat { border-radius: 16px; border: 1px solid var(--line); padding: 12px 14px; box-shadow: var(--shadow); }
  a.stat:hover { border-color: var(--brand-2); text-decoration: none; }
  .stat .num { font-size: 1.7rem; color: var(--ink); font-variant-numeric: tabular-nums; }
  .stat .label { font-weight: 600; font-size: .82rem; }

  /* dialogs: rounded, bottom sheet on phones */
  dialog { border-radius: 22px; box-shadow: 0 20px 60px rgba(13, 58, 99, .3); }
  dialog::backdrop { background: rgba(13, 40, 70, .45); }
  dialog .dlg-body { padding: 20px; }

  .pagination { gap: 6px; }
  .pagination a, .pagination span { border-radius: 999px; padding: 6px 13px; }
  .empty { padding: 36px 12px; }
  .toast { border-radius: 14px; padding: 12px 18px; }

  /* login */
  .login-card { border-radius: 22px; padding: 28px 24px; }
  .login-card .btn { width: 100%; min-height: 48px; font-size: 1.02rem; }
}

@media screen {
  /* Brand row (brand, day, user), then the main menu as a pill row: it wraps on a computer, scrolls sideways on a phone (no hidden ☰ menu).
     The bar scrolls away; section pills below it stay at the top. */
  :root { --sticky-top: 0px; }
  .topbar { position: static; }
  .topbar-inner { flex-wrap: wrap; gap: 8px 12px; padding: 8px 18px 0; min-height: 0; }
  .brand { flex: 1; min-width: 0; }
  .menu-toggle { display: none !important; }
  .nav, .nav.open { display: flex; flex-direction: row; order: 3; flex: 0 0 100%; width: 100%; padding: 2px 0 10px; }
  .userbox { order: 2; }
}
/* The main menu wraps on any PC-sized window (it was 901px+, so a smaller Windows app window hid the rest off the right). */
@media screen and (min-width: 601px) {
  .nav, .nav.open { flex-wrap: wrap; overflow: visible; }
}
@media screen and (max-width: 900px) {
  .topbar-inner { padding: 8px 14px 0; }
}
@media screen and (max-width: 600px) {
  .page { padding: 12px 12px 72px; }
  .brand > .muted { display: none; }
  .brand { overflow: hidden; gap: 6px; font-size: 1rem; }
  .brand .wheel { width: 32px; height: 32px; }
  .dayno { padding: 3px 10px; font-size: .82rem; }
  .userbox { gap: 5px; }
  .userbox button { padding: 5px 10px; font-size: .82rem; }
  .userbox > a, .userbox > span { display: inline-block; max-width: 96px; padding: 5px 10px; font-size: .85rem; }
  .page-head h1 { font-size: 1.35rem; }
  .page-head > .actions, .page-head > div { width: 100%; }
  .card { padding: 14px; border-radius: 16px; }
  .card.flush { padding: 0; }
  .card-head { padding: 12px 14px; }
  dialog { margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: 22px 22px 0 0; }
  .form-actions .btn { flex: 1 1 auto; }
}

/* Data tables on phones: each row becomes a small card with the column name before each value
   (app.js copies the header names into data-label). Tables marked .no-stack (printed lists) stay tables. */
@media screen and (max-width: 700px) {
  table.data.stack, table.data.stack tbody, table.data.stack tfoot, table.data.stack tfoot tr { display: block; width: 100%; }
  table.data.stack thead { display: none; }
  table.data.stack tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table.data.stack tbody tr { margin: 0 0 10px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #fff; box-shadow: var(--shadow); }
  .card.flush table.data.stack tbody tr { margin: 10px; }
  table.data.stack td { display: block; text-align: left !important; padding: 7px 12px; border-bottom: 1px solid #edf3f9; min-width: 0; overflow-wrap: anywhere; }
  table.data.stack td::before { content: attr(data-label); display: block; color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .2px; }
  table.data.stack td:not([data-label])::before, table.data.stack td[data-label=""]::before { content: none; }
  table.data.stack td:first-child, table.data.stack td[data-label=""], table.data.stack td[colspan], table.data.stack td:has(.status-group, form, select, textarea, .actions) { grid-column: 1 / -1; }
  table.data.stack td:first-child { font-weight: 700; background: #f7fbff; }
  table.data.stack td:empty { display: none; }
  table.data.stack td[colspan] { text-align: center !important; }
  table.data.stack tr[hidden], table.data.stack tr[style*="display: none"], table.data.stack tr[style*="display:none"] { display: none; }
  .table-wrap:has(table.data.stack) { overflow: visible; }
}

/* ---- Shared building blocks (k-*): first made for the Kitchen and Tasks pages, now used by every section. ---- */
.k { max-width: 1120px; margin: 0 auto; }
.k-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 12px; }
.k-head h1 { margin: 0; font-size: 1.6rem; display: flex; align-items: center; gap: 10px; }
.k-head h1 .k-emoji { font-size: 1.7rem; }
.k-lang { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .9rem; }
.k-lang:hover { text-decoration: none; background: var(--brand-soft); }

/* section tabs: one scrolling row, sticky under the site's top bar */
.k-tabs { position: sticky; top: var(--sticky-top); z-index: 20; display: flex; gap: 8px; overflow-x: auto; padding: 8px 2px 10px; margin: 0 -2px 12px; background: var(--bg); scrollbar-width: none; }
.k-tabs::-webkit-scrollbar { display: none; }
.k-tab { flex: none; display: flex; align-items: center; gap: 7px; padding: 9px 15px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: .95rem; white-space: nowrap; box-shadow: var(--shadow); }
.k-tab:hover { text-decoration: none; border-color: var(--brand-2); }
.k-tab.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.k-tab span { font-size: 1.1rem; }
/* Owner 2026-11-22 ("Task tab me button andar chup rahe hai right side", kitchen too): the Tasks / Kitchen tabs ran off the
   right edge in a hidden scroll row. On a PC they wrap onto more lines; a phone keeps the swipe row with a thin visible bar. */
@media screen and (min-width: 601px) {
  .k-tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 8px; }
}
@media screen and (max-width: 600px) {
  .k-tabs { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  .k-tabs::-webkit-scrollbar { display: block; height: 4px; }
  .k-tabs::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
}

.k-notice { background: var(--warn-soft); color: #6b4500; border: 1px solid #f0d49a; border-radius: 14px; padding: 12px 16px; margin-bottom: 14px; display: flex; gap: 10px; align-items: flex-start; }

/* segmented group switch */
.k-seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 6px; box-shadow: var(--shadow); }
.k-seg a { text-align: center; padding: 12px 6px; border-radius: 12px; color: var(--ink); font-weight: 700; font-size: 1.02rem; line-height: 1.2; }
.k-seg a small { display: block; font-weight: 500; font-size: .78rem; color: var(--muted); margin-top: 2px; }
.k-seg a:hover { text-decoration: none; background: var(--brand-soft); }
.k-seg a.on { background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: #fff; }
.k-seg a.on small { color: #e3f1ff; }

.k-tools { display: flex; gap: 10px; align-items: center; margin: 12px 0; flex-wrap: wrap; }
.k-search { flex: 1 1 260px; position: relative; }
.k-search input { width: 100%; padding: 12px 14px 12px 40px; border: 1px solid var(--line); border-radius: 14px; font-size: 1rem; background: #fff; }
.k-search:before { content: "🔍"; position: absolute; left: 13px; top: 50%; transform: translateY(-50%); font-size: .95rem; opacity: .7; }
.k-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.k-chips::-webkit-scrollbar { display: none; }
.k-chip { flex: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: .88rem; font-weight: 600; white-space: nowrap; }
.k-chip:hover { text-decoration: none; border-color: var(--brand-2); }
.k-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.k-label { font-size: .8rem; color: var(--muted); font-weight: 600; margin: 0 2px 6px; }

.k-summary { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }
.k-pill { padding: 5px 11px; border-radius: 999px; font-size: .85rem; font-weight: 700; background: #fff; border: 1px solid var(--line); }
.k-pill.bad { background: var(--bad-soft); color: var(--bad); border-color: #efc1bd; }
.k-pill.warn { background: var(--warn-soft); color: var(--warn); border-color: #f0d49a; }
.k-pill.ok { background: var(--ok-soft); color: var(--ok); border-color: #bfe0c9; }

/* item cards */
.k-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
.k-card { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px 14px 20px; box-shadow: var(--shadow); cursor: pointer; display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; font: inherit; color: inherit; }
.k-card:hover { border-color: var(--brand-2); }
.k-card:before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 5px; border-radius: 0 4px 4px 0; background: var(--ok); }
.k-card.low:before { background: var(--bad); }
.k-card.need:before { background: var(--warn); }
.k-card.none:before { background: #c9d6e2; }
.k-card .k-main { flex: 1; min-width: 0; }
.k-name { font-size: 1.08rem; font-weight: 700; line-height: 1.25; }
.k-sub { color: var(--muted); font-size: .85rem; }
.k-meta { color: var(--muted); font-size: .78rem; margin-top: 5px; }

.k-empty { text-align: center; color: var(--muted); padding: 40px 10px; background: #fff; border-radius: 16px; border: 1px dashed var(--line); }

/* floating add button */
.k-fab { position: fixed; right: 18px; bottom: 20px; z-index: 25; width: 58px; height: 58px; border-radius: 50%; border: 0; background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: #fff; font-size: 30px; line-height: 58px; text-align: center; box-shadow: 0 6px 18px rgba(23,105,179,.35); cursor: pointer; }

/* dialogs (bottom sheet on phones) */
dialog.k-sheet { border: 0; border-radius: 22px; padding: 0; width: min(520px, calc(100vw - 20px)); box-shadow: 0 20px 60px rgba(13,58,99,.3); }
dialog.k-sheet::backdrop { background: rgba(13,40,70,.45); }
.k-sheet-in { padding: 20px 20px 18px; }
.k-sheet h2 { margin: 0 0 2px; font-size: 1.35rem; }
.k-sheet .k-close { position: absolute; right: 12px; top: 10px; border: 0; background: var(--brand-soft); color: var(--ink); width: 36px; height: 36px; border-radius: 50%; font-size: 18px; cursor: pointer; }
.k-field { margin: 14px 0 0; }
.k-field label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.k-field input, .k-field select { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; font-size: 1.05rem; background: #fff; }
.k-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.k-actions { display: flex; gap: 10px; margin-top: 18px; }
.k-btn { flex: 1; border: 0; border-radius: 14px; padding: 14px; font-size: 1.05rem; font-weight: 700; cursor: pointer; text-align: center; background: linear-gradient(180deg, var(--brand-2), var(--brand)); color: #fff; }
.k-btn:hover { text-decoration: none; filter: brightness(1.05); }
.k-btn.light { background: var(--brand-soft); color: var(--ink); }
.k-btn.danger { background: var(--bad-soft); color: var(--bad); flex: none; padding: 14px 16px; }
.k-hint { color: var(--muted); font-size: .8rem; margin-top: 8px; }

@media (max-width: 640px) {
  .k-head h1 { font-size: 1.35rem; }
  .k-grid { grid-template-columns: 1fr; }
  dialog.k-sheet { margin: auto auto 0; width: 100vw; max-width: 100vw; border-radius: 22px 22px 0 0; }
  .k-seg a { font-size: .95rem; padding: 10px 4px; }
}

/* cards and panels */
.k-panel { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 12px; }
.k-panel h2 { margin: 0 0 10px; font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.k-select { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; font-size: 1rem; background: #fff; font-weight: 600; }
.k-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.k-bar > * { flex: 1 1 220px; }
.k-small-btn { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 10px; padding: 6px 10px; font-weight: 700; cursor: pointer; font-size: .95rem; line-height: 1; }
.k-small-btn:hover { border-color: var(--brand-2); background: var(--brand-soft); }
.k-small-btn.danger { color: var(--bad); }
.k-small-btn.danger:hover { background: var(--bad-soft); border-color: #efc1bd; }
.k-btn.inline { flex: none; padding: 11px 16px; font-size: .98rem; }
.k-btn.outline-danger { background: #fff; color: var(--bad); border: 1px solid #efc1bd; flex: none; }

.k-dayhead { display: flex; align-items: baseline; gap: 10px; margin: 18px 2px 10px; }
.k-dayhead h2 { margin: 0; font-size: 1.25rem; }
.k-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.k-tile { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 12px; color: var(--ink); font-weight: 800; text-align: center; box-shadow: var(--shadow); line-height: 1.2; }
.k-tile span { display: block; font-size: 1.5rem; margin-bottom: 4px; }
.k-tile small { display: block; color: var(--muted); font-weight: 500; font-size: .75rem; margin-top: 3px; }
.k-tile:hover { text-decoration: none; border-color: var(--brand-2); background: var(--brand-soft); }
.k-list { display: grid; gap: 8px; }
.k-row { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow); color: var(--ink); }
.k-row:hover { text-decoration: none; border-color: var(--brand-2); }
.k-row .k-main { flex: 1; min-width: 0; }
.k-date { flex: none; width: 54px; text-align: center; background: var(--brand-soft); border-radius: 12px; padding: 6px 0; line-height: 1.1; }
.k-date b { display: block; font-size: 1.3rem; }
.k-date small { font-size: .72rem; color: var(--muted); }
.k-status { flex: none; font-size: .8rem; font-weight: 800; padding: 5px 10px; border-radius: 999px; }
.k-status.s0 { background: #eef2f6; color: #4a5b6c; }
.k-status.s1 { background: var(--info-soft); color: var(--info); }
.k-status.s2 { background: var(--ok-soft); color: var(--ok); }
.k-status.s3 { background: #efe5fb; color: #5b2f94; }
.k-savebar { position: sticky; bottom: 0; z-index: 15; background: linear-gradient(180deg, transparent, var(--bg) 30%); padding: 18px 0 12px; display: flex; gap: 10px; }
/* progress bar */
.t-progress { height: 8px; background: #e8f0f8; border-radius: 999px; overflow: hidden; margin-top: 7px; }
.t-progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand-2), var(--brand)); border-radius: 999px; }
.t-progress.done > i { background: var(--ok); }
.t-big-progress { height: 14px; }
/* key numbers */
.t-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-bottom: 12px; }
.t-stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); color: var(--ink); }
.t-stat:hover { text-decoration: none; border-color: var(--brand-2); }
.t-stat b { display: block; font-size: clamp(1.2rem, 2.4vw, 1.7rem); overflow-wrap: anywhere; line-height: 1.1; font-variant-numeric: tabular-nums; }
.t-stat small { color: var(--muted); font-weight: 600; font-size: .8rem; }
.t-stat.bad b { color: var(--bad); } .t-stat.warn b { color: var(--warn); } .t-stat.ok b { color: var(--ok); }
/* no horizontal scroll at 375px: grid cells and inputs may shrink */
.t-form .k-row2 > *, .t-line .k-row2 > *, .k-sheet .k-row2 > * { min-width: 0; }
.k .k-field input, .k .k-field select, .k input[type=file] { min-width: 0; max-width: 100%; }
.k input[type=file] { width: 100%; }
@media (max-width: 640px) {
  .t-stats { grid-template-columns: repeat(2, 1fr); }
  .k-row { flex-wrap: wrap; }
  .k-row .k-main { flex-basis: 60%; }
}
.k-running { border-color: #9fd4b0; background: #f3fbf5; }
.k-head .muted { margin-top: 2px; }
.k-actions { flex-wrap: wrap; }
.k-actions .k-btn { flex: 1 1 150px; }
.k-row .k-side { flex: none; text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.k-row .k-side b { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.k-rowlinks { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.k-rowlinks a { font-size: .85rem; font-weight: 700; padding: 5px 11px; border-radius: 999px; background: var(--brand-soft); color: var(--info); }
.k-rowlinks a:hover { text-decoration: none; background: #cde5fa; }
.k-row.t-edge.e-ok:before { background: var(--ok); } .k-row.t-edge.e-info:before { background: var(--brand-2); }
.k-row.t-edge.e-warn:before { background: var(--warn); } .k-row.t-edge.e-bad:before { background: var(--bad); } .k-row.t-edge.e-muted:before { background: #c9d6e2; }
.k-row.t-edge, .k-panel.t-edge { position: relative; padding-left: 20px; }
.k-row.t-edge:before, .k-panel.t-edge:before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 5px; border-radius: 0 4px 4px 0; background: #c9d6e2; }
.k-row.dim { opacity: .65; } .k-row.dim .k-name { text-decoration: line-through; }
.k-filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.k-filters .k-field { margin: 0; flex: 1 1 170px; min-width: 0; }
.k-filters .k-btn { flex: none; }
.k-panel > .k-sub:first-child { margin-bottom: 2px; }
.k .pagination { padding: 12px 0; }
.k-head { flex-wrap: wrap; }
.k-head .k-lang { white-space: nowrap; }
@media screen and (max-width: 900px) { .nav a:not(.active) { background: #fff; border-color: var(--line); } }

/* Course pages: header card and the sub-page pills (sticky under the top bar). */
@media screen {
  .course-head.k-panel { display: block; margin-bottom: 10px; }
  .course-head .ch-line { margin-top: 2px; }
  .course-head h1 { font-size: 1.35rem; line-height: 1.25; }
  .course-head .ch-meta { margin-top: 8px; }
  .course-head .ch-meta .k-pill { font-weight: 600; font-size: .83rem; }
  .course-head .actions { margin-top: 12px; }
  .course-head .actions .btn { padding: 8px 13px; }
  .tabs.k-tabs-sticky { position: sticky; top: var(--sticky-top); z-index: 20; background: var(--bg); padding-top: 8px; }
  .tabs a { display: inline-flex; align-items: center; gap: 6px; }
}
/* Owner 2026-11-22: in the Windows app the course pills ran off the right edge (a hidden scroll row); on a PC they wrap onto
   a second line instead, and only phones keep the one swipeable row. */
@media screen and (min-width: 601px) {
  .tabs.k-tabs-sticky { flex-wrap: wrap; overflow-x: visible; row-gap: 6px; }
}
@media print {
  .course-head.k-panel { border: 0; box-shadow: none; padding: 0; margin: 0 0 6px; background: none; }
  .course-head .k-pill { border: 0; padding: 0; background: none; }
}
@media screen and (max-width: 600px) {
  .course-head .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .course-head .actions form, .course-head .actions form .btn { width: 100%; }
  .course-head .actions > .btn:first-child { grid-column: 1 / -1; }
}
@media screen and (max-width: 700px) {
  table.data.stack td.idx { display: none; }
  table.data.stack td.idx + td { background: #f7fbff; }
  table.data.stack .status-group label { padding: 7px 12px; font-size: .82rem; }
}
.k-line { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid #edf3f9; }
.k-line:first-child { border-top: 0; }
.k-line .k-main { flex: 1; min-width: 0; }
.k-line input[type=number] { width: 104px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; font-size: 1.05rem; font-weight: 700; text-align: center; }
.k-line .k-unit { width: 52px; color: var(--muted); font-size: .85rem; }
.k-panel .k-savebar { background: linear-gradient(180deg, rgba(255,255,255,0), #fff 30%); margin: 0 -4px -6px; padding: 18px 4px 6px; }
@media screen and (max-width: 700px) {
  table.data.stack tr.row-waiting { background: #f4f8fc; } table.data.stack tr.row-left { background: #fdf0ee; }
  table.data.stack tr.row-waiting td:not(:first-child), table.data.stack tr.row-left td:not(:first-child) { background: transparent; }
}
.form-actions.k-savebar { justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-top: 8px; }
@media screen and (max-width: 600px) {
  .steps { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
  .steps a { flex: none; min-width: 0; }
}
@media (max-width: 640px) {
  .k-row:has(> .k-side) { flex-wrap: nowrap; }
  .k-row:has(> .k-side) .k-main { flex-basis: auto; }
  .k-row .k-side { max-width: 34%; }
  .k-row .k-side small { font-size: .7rem; line-height: 1.1; }
  .k-row { gap: 10px; padding: 12px 12px 12px 18px; }
}
.k-row .avatar-link { flex: none; }
@media screen and (max-width: 600px) { .kv { gap: 0; } .kv dt { font-size: .78rem; font-weight: 700; margin-top: 6px; } .kv dd { font-weight: 600; } }
@media screen and (max-width: 600px) { .form-actions.k-savebar .btn { flex: 1 1 0; padding: 8px 6px; white-space: nowrap; font-size: .9rem; } .form-actions.k-savebar .check { flex: 1 0 100%; margin: 0 !important; } }
.k-more > summary { cursor: pointer; font-weight: 700; color: var(--info); font-size: .9rem; padding: 4px 2px; }
a.k-card:hover { text-decoration: none; } a.k-card .k-sub { margin-top: 2px; }
.k-tag { display: inline-block; font-size: .72rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; background: var(--brand-soft); color: var(--info); }
/* Users page: one panel per login, its settings in a grid */
.u-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 140px), 1fr)); gap: 0 10px; }
.u-grid .k-field { margin-top: 10px; min-width: 0; }
.k-panel.t-edge:before { background: var(--brand-2); }
.k-panel.u-off { opacity: .6; } .k-panel.u-off:before { background: #c9d6e2; }
.k-sheet-in { max-height: 88vh; overflow: auto; position: relative; }
/* card lists side by side on a computer screen (owner: one card per full-width line left big white spaces) */
@media (min-width: 900px) {
  .k-list.k-cols { grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); align-items: stretch; }
}

/* Medicine guide and requirements (owner 2026-11-22). */
.med-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.med-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; box-shadow: var(--shadow); min-width: 0; }
.med-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; flex-wrap: wrap; }
.med-top h2 { margin: 0 0 6px; font-size: 1.12rem; }
.med-lines { margin: 4px 0 0; padding-left: 20px; }
.med-lines li { padding: 5px 0; border-top: 1px dashed var(--line); overflow-wrap: anywhere; }
.med-lines li:first-child { border-top: 0; }
.med-how { display: block; color: #1d5f8a; font-size: .92rem; }
.med-lines small { display: block; }
.med-row { display: grid; grid-template-columns: 1.2fr 1.4fr 1fr auto; gap: 8px; align-items: end; padding: 8px 0; border-top: 1px dashed var(--line); }
@media (max-width: 640px) { .med-row { grid-template-columns: 1fr; } }
.req-course { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.req-course select { flex: 1 1 260px; min-width: 0; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); font: inherit; }
.req-give { margin-bottom: 8px; }
.req-give select, .req-give input { width: 100%; }
.req-btns { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.req-btns form { margin: 0; }
.req-line.back { opacity: .6; }
.req-inline { display: inline-flex; gap: 4px; }
.req-inline input { width: 82px; padding: 6px 8px; border-radius: 10px; border: 1px solid var(--line); }
.req-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.req-sum div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; text-align: center; }
.req-sum small { display: block; color: var(--muted, #667); }
.req-sum b { font-size: 1.25rem; }
.req-sum .due b, .req-due { color: #b3261e; font-weight: 700; }
.req-due.ok { color: #2e7d32; }
.req-check { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.req-check[hidden], .k-field[hidden] { display: none; }
.req-slip h1 { font-size: 1.3rem; }

/* Requirements by side (owner 2026-11-22: ladies aur gents ka saman alag). */
.req-table-wrap { overflow-x: auto; padding: 6px 10px; }
.req-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.req-table th, .req-table td { padding: 8px 6px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.req-table th:first-child, .req-table td:first-child { text-align: left; white-space: normal; min-width: 120px; }
.req-table thead th { border-top: 0; color: var(--muted, #667); font-weight: 600; }
.req-table .req-zero { color: #b3261e; font-weight: 700; }
.req-acts { display: flex; gap: 4px; justify-content: flex-end; flex-wrap: wrap; }
.req-other { margin-top: 6px; }
/* Phone: each item a card (name, then price and the two stores, then the buttons). */
@media (max-width: 640px) {
  .req-table thead { display: none; }
  .req-table, .req-table tbody { display: block; }
  .req-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 6px; padding: 10px 0; border-top: 1px solid var(--line); }
  .req-table td { border: 0; padding: 0; text-align: left; white-space: normal; }
  .req-table td:first-child { grid-column: 1 / -1; font-size: 1.05rem; }
  .req-table td[data-l]::before { content: attr(data-l); display: block; font-size: .75rem; color: var(--muted, #667); }
  .req-table td.req-acts-td { grid-column: 1 / -1; }
  .req-acts { justify-content: flex-start; }
}
.req-other summary { cursor: pointer; color: #1d5f8a; font-size: .92rem; }
.req-other input[type=text] { width: 100%; margin-top: 6px; }

/* Requirements: medicines (what for) and notes. */
.req-purpose { color: #6a3d9a; font-size: .9rem; margin-top: 2px; overflow-wrap: anywhere; }
.req-table td .med-how { font-size: .85rem; }
.req-note-new textarea, .req-note textarea { width: 100%; padding: 9px 12px; border-radius: 12px; border: 1px solid var(--line); font: inherit; }
.req-note-body { white-space: pre-wrap; overflow-wrap: anywhere; }

.req-give .req-find { margin-bottom: 6px; }

/* Charama's camps in their own colour (owner 2026-11-23). */
.badge.charama { background: #f3e3c7; color: #8a4b00; border: 1px solid #e2b877; }
.k-row.k-charama { background: #fff8ec; border-left-color: #d98a1c !important; }

/* Users page sub-tabs (owner 2026-11-23). */
.u-tabs { margin-bottom: 12px; }
.u-tabs small { font-weight: 700; opacity: .7; margin-left: 2px; }

/* Owner 2026-11-24: the top menu in Hindi and English, Hindi small above the English word. */
.nav .nav-t { display: inline-flex; flex-direction: column; line-height: 1.1; font-weight: inherit; }
.nav .nav-t i { font-style: normal; font-size: .78em; font-weight: 600; opacity: .8; }
