:root {
  --bg: #f7f5ee; --card: #ffffff; --ink: #1d2a1f; --muted: #667063;
  --green: #2f6b3a; --green-d: #1f4d29; --green-l: #e6f0e4;
  --gold: #c8962b; --danger: #b3261e; --line: #e2ded0; --warn: #fff6dc;
  --r: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 18px/1.5 "Noto Sans Gujarati", "Shruti", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
a { color: var(--green-d); }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; }
h3 { font-size: 1.05rem; color: var(--green-d); }
.muted { color: var(--muted); }
.center { text-align: center; }
.err { color: var(--danger); font-weight: 600; }
.wrap { max-width: 720px; margin: 0 auto; padding: 12px 14px 24px; }

.topbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px;
  background: var(--green); color: #fff; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top));
}
.topbar .title { flex: 1; font-weight: 700; font-size: 1.1rem; }
.topbar .back { color: #fff; text-decoration: none; font-size: 1.5rem; padding: 0 6px; }
.topbar .lang { background: rgba(255,255,255,.18); color: #fff; border: 0; border-radius: 10px; padding: 6px 12px; font: inherit; font-weight: 700; min-height: 40px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin: 12px 0; }
.card.warn { background: var(--warn); border-color: #ecd38a; }
.card h3 { margin-bottom: .4em; }

.daynav { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.daylabel { flex: 1; text-align: center; }
.d1 { font-size: 1.25rem; font-weight: 700; }
.d2 { color: var(--muted); }

.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .mark { width: 1.2em; text-align: center; font-size: 1.2rem; color: var(--muted); flex: none; line-height: 1.5; }
.item .mark.posted { color: var(--green); font-weight: 700; }
.item .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.item.done .body { text-decoration: line-through; color: var(--muted); }
.item.cancelled .body { text-decoration: line-through; color: var(--muted); opacity: .6; }
.item .acts { display: flex; gap: 6px; flex: none; position: relative; }
.empty { color: var(--muted); padding: 8px 0; }
.tm { color: var(--green-d); }
.chip { display: inline-block; background: var(--green-l); color: var(--green-d); border-radius: 999px; padding: 0 10px; font-size: .8rem; }

.ib {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px;
  background: #f1efe6; border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: 1.2rem;
  color: var(--ink); cursor: pointer; text-decoration: none; list-style: none; padding: 0 6px;
}
.ib.ok { background: var(--green-l); border-color: #b9d3b4; color: var(--green-d); font-weight: 700; }
summary.ib::-webkit-details-marker { display: none; }
details.more { position: relative; }
details.more .menu {
  position: absolute; right: 0; top: 48px; z-index: 6; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.15); min-width: 200px; overflow: hidden;
}
.menu button { display: block; width: 100%; text-align: left; border: 0; background: #fff; padding: 12px 14px; font: inherit; min-height: 48px; }
.menu button:hover { background: #f4f2ea; }
.menu .danger { color: var(--danger); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 48px; padding: 0 18px;
  border-radius: 12px; border: 1px solid var(--line); background: #fff; font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; color: var(--ink);
}
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: .95rem; }
.btn.big { width: 100%; min-height: 54px; font-size: 1.1rem; }
.btn:disabled { opacity: .5; }
.linkbtn { background: none; border: 0; color: var(--green-d); font: inherit; text-decoration: underline; padding: 8px; }

input, select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid #cfcab7; border-radius: 12px;
  background: #fff; font: inherit; color: var(--ink);
}
textarea { min-height: 96px; }
label { display: block; margin: 10px 0 0; font-weight: 600; font-size: .95rem; }
label input, label select, label textarea { margin-top: 4px; font-weight: 400; }
input[type=checkbox], input[type=radio] { width: auto; min-height: 0; margin-right: 6px; }
.chk { font-weight: 400; display: flex; align-items: center; margin: 0; }
.chk input:disabled + * { opacity: .5; }

.addrow { display: flex; flex-wrap: wrap; gap: 8px; }
.addrow .grow { flex: 1; min-width: 0; }
.addopts { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; align-items: center; }
.addopts select { width: auto; flex: 1; min-width: 130px; }
.addopts input[type=time] { width: auto; flex: 1; min-width: 120px; }

.row2 { padding: 0; overflow: hidden; }
.linkrow {
  display: flex; justify-content: space-between; align-items: center; width: 100%; text-align: left; gap: 10px;
  padding: 14px; background: #fff; border: 0; border-bottom: 1px solid var(--line); font: inherit; color: var(--ink);
  text-decoration: none; min-height: 56px; cursor: pointer;
}
.linkrow:last-child { border-bottom: 0; }

.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; display: flex; background: #fff;
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.bottom a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 64px;
  text-decoration: none; color: var(--muted); font-size: .8rem; gap: 2px;
}
.bottom a .ic { font-size: 1.4rem; line-height: 1; }
.bottom a.on { color: var(--green-d); font-weight: 700; background: var(--green-l); }

.dlg { border: 0; border-radius: 16px; padding: 0; width: min(92vw, 520px); max-height: 92vh; overflow: auto; }
.dlg::backdrop { background: rgba(0,0,0,.45); }
.dlg-form { padding: 16px; }
.dlg-form h2 { font-size: 1.2rem; }
.dlg-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.seg { display: flex; gap: 14px; margin: 10px 0 0; }
.seg label { margin: 0; font-weight: 400; display: flex; align-items: center; }

.toast {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 30;
  background: #222; color: #fff; padding: 12px 18px; border-radius: 12px; max-width: 90vw;
}
.toast[hidden] { display: none; }
[hidden] { display: none !important; }

table.tbl { width: 100%; border-collapse: collapse; }
.tbl th, .tbl td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl th { font-size: .85rem; color: var(--muted); font-weight: 600; }
.tbl .num { text-align: right; white-space: nowrap; }
.tbl tfoot td { font-weight: 700; border-top: 2px solid var(--line); }
.pos { color: var(--green-d); } .neg { color: var(--danger); }

.loginbody { background: var(--green-l); padding-bottom: 0; }
.login { max-width: 380px; margin: 0 auto; padding: 40px 20px; text-align: center; }
.login .logo { border-radius: 22px; }
.login form { text-align: left; background: #fff; border-radius: var(--r); padding: 8px 16px 18px; border: 1px solid var(--line); }
.login .btn { margin-top: 16px; }

.pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.pills a { padding: 8px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); text-decoration: none; color: var(--ink); min-height: 40px; display: inline-flex; align-items: center; }
.pills a.on { background: var(--green); border-color: var(--green); color: #fff; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 18px 12px; text-align: center; text-decoration: none; color: var(--ink); font-weight: 600; }
.tile .ic { display: block; font-size: 1.8rem; margin-bottom: 4px; }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-grid img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: #eee; }
.bal { font-weight: 700; }
.sub { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.hint { font-size: .9rem; color: var(--muted); }

.mks { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.mk { flex: 1; min-width: 80px; min-height: 44px; border: 1px solid var(--line); background: #f1efe6; border-radius: 12px; font: inherit; color: var(--ink); cursor: pointer; }
.mk.on { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.mk.abs.on { background: #8a8d85; border-color: #8a8d85; }
.wrow { padding: 12px 0; border-bottom: 1px solid var(--line); }
.wrow:last-child { border-bottom: 0; }
.wname { font-weight: 700; text-decoration: none; color: var(--ink); }
.big-num { font-size: 1.6rem; font-weight: 700; }
.stat3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stat3 small { display: block; color: var(--muted); font-size: .8rem; }
.btn.danger { color: var(--danger); border-color: #e2b8b4; }
.fullph { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); }
.photo-grid a { text-decoration: none; color: inherit; display: block; }
.photo-grid small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.jump { position: relative; display: inline-block; cursor: pointer; margin: 0; font-weight: 700; font-size: 1.25rem; }
.jump::after { content: " ▾"; font-size: .8em; color: var(--muted); }
.jump input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; min-height: 0; cursor: pointer; }
.imp-table td { font-size: .95rem; }
.imp-table .st { white-space: nowrap; font-weight: 600; }
.st-ok { color: var(--green-d); } .st-new { color: #a26a00; } .st-dup { color: var(--muted); } .st-error { color: var(--danger); }
.imp-summary { font-weight: 700; margin: 10px 0; }
.filebtn { position: relative; margin-top: 12px; color: #fff; }
.filebtn input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; min-height: 0; cursor: pointer; }
.paste summary { cursor: pointer; color: var(--green-d); margin-top: 12px; }
.irow { padding: 10px 12px; }
.igrid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.igrid label { margin-top: 6px; font-size: .85rem; }
.igrid .wide { grid-column: 1 / -1; }
.igrid input, .igrid select { min-height: 44px; padding: 8px 10px; }
.wd { display: block; font-weight: 400; }

.photobtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.photobtns .filebtn { margin-top: 0; font-size: 1rem; padding: 0 8px; text-align: center; }
.filebtn.ghostbtn { color: var(--green-d); background: #fff; border-color: var(--green); }
