/* Palette from the Jafran logo: saffron-flower purple, saffron orange, leaf green. */
:root {
  --bg: #f6f3f9;
  --surface: #ffffff;
  --surface-2: #f1ecf5;
  --ink: #1f1726;
  --ink-2: #54485e;
  --ink-3: #85798f;
  --line: #e7e0ee;
  --brand: #5e1a7e;
  --brand-ink: #ffffff;
  --brand-soft: #f1e4f8;
  --brand-grad: linear-gradient(135deg, #7a2aa0 0%, #5e1a7e 55%, #48106a 100%);
  /* The sidebar stays deep purple in both themes, as in the brand mockup */
  --side-grad: linear-gradient(180deg, #5f1a84 0%, #4a1069 60%, #3a0a55 100%);
  --side-ink: rgb(255 255 255 / 82%);
  --side-active: rgb(255 255 255 / 16%);
  --saffron: #e8741c;
  --topbar-h: 64px;
  --good: #2e7a1f;
  --bad: #b3261e;
  --warn: #a35a00;
  --c-sales: #8a2bb0;
  --c-cost: #e8741c;
  --c-profit: #3d8a2a;
  --radius: 12px;
  --shadow: 0 1px 2px rgb(31 23 38 / 6%), 0 4px 16px rgb(31 23 38 / 5%);
  --font: system-ui, -apple-system, "Segoe UI", "Noto Sans Bengali", "Hind Siliguri", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #120e15;
    --surface: #1c1621;
    --surface-2: #261e2c;
    --ink: #f1ebf5;
    --ink-2: #cbbfd4;
    --ink-3: #978aa2;
    --line: #362c3e;
    --brand: #d49cf0;
    --brand-ink: #ffffff;
    --brand-soft: #35203f;
    --brand-grad: linear-gradient(135deg, #8a35b2 0%, #6a2290 100%);
    --side-grad: linear-gradient(180deg, #3d0f55 0%, #2a0a3c 100%);
    --good: #8fd16f;
    --bad: #ff8a80;
    --warn: #f0a85a;
    --c-sales: #c07ae6;
    --c-cost: #f0934a;
    --c-profit: #8fd16f;
    --shadow: none;
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .brand-name { background-image: linear-gradient(90deg, #d49cf0, #f3c9ff); }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}
h1 { font-size: 1.45rem; margin: 0; font-weight: 700; }
h2 { font-size: 1rem; margin: 0 0 12px; color: var(--ink); font-weight: 700; }
.muted { color: var(--ink-3); }
[hidden] { display: none !important; }

/* Buttons & inputs */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
}
.btn:hover { border-color: var(--ink-3); }
.btn.primary { background: var(--brand-grad); border-color: transparent; color: var(--brand-ink); box-shadow: 0 2px 8px rgb(94 26 126 / 25%); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--bad); }
.btn.icon { width: 44px; padding: 0; font-size: 1.4rem; line-height: 1; }
.btn.small { min-height: 34px; padding: 4px 10px; font-size: 0.85rem; }
input, select, textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  min-height: 44px;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}
label { display: grid; gap: 4px; font-size: 0.85rem; color: var(--ink-2); font-weight: 600; }
.form-error { color: var(--bad); min-height: 1.2em; margin: 4px 0; font-size: 0.9rem; }

/* Login */
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 16px;
  background:
    radial-gradient(circle at 20% 15%, rgb(232 116 28 / 18%), transparent 45%),
    var(--side-grad);
}
.login-card {
  width: min(380px, 100%);
  background: var(--surface);
  border-radius: 18px;
  padding: 28px 24px;
  display: grid;
  gap: 12px;
  box-shadow: 0 20px 50px rgb(20 4 30 / 40%);
  text-align: center;
}
.login-logo img { display: block; width: 220px; height: auto; margin: -8px auto -12px; border-radius: 12px; }
.brand img { border-radius: 50%; }
.login-card h1 { font-size: 1.1rem; color: var(--ink-2); }
.login-card label { text-align: left; }

/* Shell: white top bar across the page, purple sidebar on wide screens,
   bottom tab bar on phones */
.shell {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  grid-template-rows: var(--topbar-h) 1fr;
  grid-template-areas: "top top" "nav main";
  min-height: 100dvh;
}
.topbar {
  grid-area: top;
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 6px rgb(31 23 38 / 5%);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-name {
  font-family: "Dancing Script", "Segoe Script", cursive;
  font-weight: 700;
  font-size: 1.65rem;
  line-height: 1;
  white-space: nowrap;
  background: linear-gradient(90deg, #6a1b8f, #a43fd0);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.user { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 0.9rem; }
.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--brand-grad);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--saffron);
}
.nav {
  grid-area: nav;
  position: sticky;
  top: var(--topbar-h);
  height: calc(100dvh - var(--topbar-h));
  background: var(--side-grad);
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 12px;
}
.nav a, .nav-logout {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  color: var(--side-ink);
  text-decoration: none;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.nav a:hover, .nav-logout:hover { background: rgb(255 255 255 / 8%); color: #fff; }
.nav a[aria-current="page"] { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--saffron); }
.nav .ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.nav-logout {
  margin-top: auto;
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.content { grid-area: main; padding: 28px; max-width: 1240px; width: 100%; min-width: 0; }

@media (max-width: 899px) {
  :root { --topbar-h: 56px; }
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; }
  .topbar { padding: 0 16px; }
  .topbar .brand img { width: 34px; height: 34px; }
  .brand-name { font-size: 1.4rem; }
  .welcome { display: none; }
  /* Phones: white bottom bar with the active tab in brand purple, like the app mockups */
  .nav {
    position: fixed;
    inset: auto 0 0 0;
    top: auto;
    height: auto;
    flex-direction: row;
    justify-content: space-around;
    background: var(--surface);
    border-top: 1px solid var(--line);
    box-shadow: 0 -2px 10px rgb(31 23 38 / 6%);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    z-index: 10;
  }
  .nav a, .nav-logout { flex-direction: column; gap: 3px; padding: 6px 4px; font-size: 0.72rem; flex: 1; color: var(--ink-3); }
  .nav a:hover, .nav-logout:hover { background: none; color: var(--brand); }
  .nav a[aria-current="page"] { background: none; color: var(--brand); box-shadow: inset 0 3px 0 var(--brand); border-radius: 0; }
  .nav-logout { margin-top: 0; text-align: center; align-items: center; }
  .nav .ico { width: 22px; height: 22px; }
  .content { padding: 16px 16px 96px; }
}

/* Views */
.view-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.period-tabs { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.period-tabs button {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--ink-2);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  min-height: 38px;
}
.period-tabs { border: 1px solid var(--line); background: var(--surface); }
.period-tabs button:hover { color: var(--brand); }
.period-tabs button[aria-selected="true"] { background: var(--brand-soft); color: var(--brand); }
.period-nav { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.period-nav input { width: auto; }
.range-label { color: var(--ink-2); font-weight: 600; }
.downloads { margin-left: auto; display: flex; gap: 8px; }
.btn.dl { display: inline-flex; align-items: center; gap: 6px; color: var(--brand); border-color: var(--brand-soft); background: var(--surface); }
.btn.dl:hover { background: var(--brand-soft); border-color: var(--brand); }
.btn.dl:disabled { opacity: .6; cursor: progress; }
.btn.dl .ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 599px) { .downloads { margin-left: 0; width: 100%; } .downloads .btn { flex: 1; justify-content: center; } }
.note { margin: -4px 0 14px; font-size: 0.88rem; }

/* PDF export: the cloned report gets a letterhead and loses the controls */
.pdf-head { display: flex; align-items: center; gap: 14px; padding: 4px 0 16px; margin-bottom: 16px; border-bottom: 3px solid var(--brand); }
.pdf-head img { border-radius: 50%; }
.pdf-title { font-family: "Dancing Script", "Segoe Script", cursive; font-size: 2rem; font-weight: 700; color: var(--brand); line-height: 1.1; }
.pdf-sub { color: var(--ink-2); font-weight: 600; }
.pdf-mode { padding: 20px; background: var(--bg); }
.pdf-mode .period-tabs, .pdf-mode .period-nav, .pdf-mode .view-head { display: none !important; }
.pdf-mode .table-scroll { overflow: visible; }
.pdf-mode .admin-only, .pdf-mode .row-actions, .pdf-mode .list-tools { display: none !important; }
/* An entry page (সম্পদ) prints only its list, not the entry form or settings */
.pdf-mode .form-card, .pdf-mode .setting-card, .pdf-mode .view-intro { display: none !important; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  min-width: 0;
}
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-2 .card { margin-bottom: 0; }
.grid-2 + .card { margin-top: 16px; }
@media (max-width: 699px) { .grid-2 { grid-template-columns: 1fr; } }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
}
.kpi .label { color: var(--ink-2); font-size: 0.85rem; font-weight: 600; }
.kpi .value { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: 6px 0 4px; }
.delta { font-weight: 700; }
.kpi .sub { font-size: 0.8rem; color: var(--ink-3); }
.kpi.profit .value { color: var(--good); }
.kpi.loss .value { color: var(--bad); }
.delta.up { color: var(--good); }
.delta.down { color: var(--bad); }

.chart-wrap { position: relative; height: 280px; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--ink-3); font-size: 0.8rem; font-weight: 600; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.pl tr.total td { font-weight: 700; border-top: 2px solid var(--line); }
.pl td.neg { color: var(--bad); }
.pl td.pos { color: var(--good); }
.table-scroll { overflow-x: auto; }
.table-scroll td:first-child { white-space: nowrap; }
.empty { color: var(--ink-3); padding: 16px 0; text-align: center; }
tr.no-data td { color: var(--ink-3); }

/* Entry views */
.entry-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 12px; }
.entry-form label { min-width: 0; }
.entry-form .wide { grid-column: 1 / -1; }
.entry-form .actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
.entry-form .hint { grid-column: 1 / -1; margin: 0; font-size: 0.85rem; color: var(--ink-3); }
.entry-form .hint.warn { color: var(--warn); }
.list-tools { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-bottom: 8px; }
.list-tools label { width: auto; }
.list-tools input { width: auto; }
.row-actions { white-space: nowrap; text-align: right; }

/* Stat chips above each list */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 4px 0 16px; }
.stats:empty { display: none; }
.stat {
  display: grid;
  gap: 2px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border-left: 3px solid var(--line);
}
.stat-label { font-size: 0.78rem; color: var(--ink-3); font-weight: 600; }
.stat-value { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat.brand { background: var(--brand-soft); border-left-color: var(--brand); }
.stat.brand .stat-value { color: var(--brand); }
.stat.warn { border-left-color: var(--saffron); }
.stat.warn .stat-value { color: var(--warn); }
.stat.ok { border-left-color: var(--good); }

/* Entity tables: month group headers, zebra-free rows with hover */
.entity-list thead th { background: var(--surface-2); padding: 10px 8px; }
.entity-list thead th:first-child { border-radius: 8px 0 0 8px; }
.entity-list thead th:last-child { border-radius: 0 8px 8px 0; }
.entity-list td { padding: 10px 8px; vertical-align: middle; }
.entity-list tbody tr:not(.group-row):hover td { background: var(--surface-2); }
.entity-list .group-row td {
  padding: 16px 8px 6px;
  font-weight: 700;
  color: var(--brand);
  border-bottom: 2px solid var(--brand-soft);
}
.entity-list .name { font-weight: 600; }
.entity-list .badge { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.entity-list .neg { color: var(--bad); }
.pill { display: inline-block; font-size: 0.78rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.pill.ok { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.pill.warn { background: color-mix(in srgb, var(--saffron) 16%, transparent); color: var(--warn); }
.pill.off { background: var(--surface-2); color: var(--ink-3); text-decoration: line-through; }
.nowrap { white-space: nowrap; }
.tel { color: var(--ink-3); font-size: 0.82rem; text-decoration: none; }

/* Conference room calendar */
.cal-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-head h2 { margin: 0; min-width: 150px; text-align: center; font-size: 1.1rem; color: var(--brand); }
.cal-legend { margin-left: auto; display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: var(--ink-3); }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-left: 6px; }
.cal-legend i.ok { background: var(--good); }
.cal-legend i.warn { background: var(--saffron); }
.cal-legend i.off { background: var(--ink-3); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { text-align: center; font-size: 0.8rem; font-weight: 700; color: var(--ink-3); padding: 4px 0; }
.cal-day {
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  cursor: pointer;
  background: var(--surface);
  min-width: 0;
  transition: border-color .15s, background .15s;
}
.cal-day:hover { border-color: var(--brand); background: var(--brand-soft); }
.cal-day.out { background: transparent; border-style: dashed; opacity: .45; cursor: default; }
.cal-day.out:hover { border-color: var(--line); background: transparent; }
.cal-day.past:not(.today) .cal-num { color: var(--ink-3); }
.cal-day.today { border: 2px solid var(--brand); }
.cal-day.today .cal-num { background: var(--brand); color: #fff; border-radius: 999px; padding: 0 7px; }
.cal-num { align-self: flex-start; font-weight: 700; font-size: 0.85rem; line-height: 1.6; }
.cal-ev {
  appearance: none;
  border: 0;
  text-align: left;
  font: inherit;
  font-size: 0.74rem;
  line-height: 1.3;
  padding: 2px 6px;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 3px solid;
}
.cal-ev.ok { background: color-mix(in srgb, var(--good) 14%, var(--surface)); border-color: var(--good); color: var(--ink); }
.cal-ev.warn { background: color-mix(in srgb, var(--saffron) 16%, var(--surface)); border-color: var(--saffron); color: var(--ink); }
.cal-ev.off { background: var(--surface-2); border-color: var(--ink-3); color: var(--ink-3); text-decoration: line-through; }
.cal-ev:hover { filter: brightness(0.95); }
.cal-tip { font-size: 0.82rem; margin: 10px 0 0; }
@media (max-width: 699px) {
  .cal-day { min-height: 58px; padding: 3px 2px; }
  .cal-ev { font-size: 0.62rem; padding: 1px 3px; border-left-width: 2px; }
  .cal-ev span { display: none; } /* phones: time only, tap for details */
  .cal-legend { margin-left: 0; width: 100%; }
}

/* A menu the user may only view (set per section from their access):
   no entry forms or row buttons, read-only hints instead of edit ones */
.readonly .form-card, .readonly .row-actions, .readonly .admin-only { display: none !important; }
.view:not(.readonly) .viewer-only { display: none !important; }
.readonly .cal-day:not(.out) { cursor: default; }
.readonly .cal-day:hover { border-color: var(--line); background: var(--surface); }
.readonly .cal-day.today:hover { border-color: var(--brand); }
.not-admin .admin-field { display: none !important; }

/* Menu access grid on the Users page */
.perm-grid { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px 14px; margin: 0; display: grid; gap: 8px; min-width: 0; }
.perm-grid legend { font-weight: 600; font-size: 0.85rem; color: var(--ink-2); padding: 0 6px; }
.perm-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.perm-row:last-child { border-bottom: 0; }
.perm-name { font-weight: 600; }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border-radius: 10px; padding: 3px; gap: 2px; }
.seg-opt { display: block; cursor: pointer; font-weight: 600; font-size: 0.85rem; color: var(--ink-2); }
.seg-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; min-height: 0; }
.seg-opt span { display: block; padding: 6px 12px; border-radius: 8px; border: 1px solid transparent; transition: background .15s, color .15s; }
.seg-opt:hover span { color: var(--ink); }
/* The chosen level is filled in its own colour, with a tick, so it reads at a glance */
.seg-opt input:checked + span { font-weight: 700; box-shadow: 0 1px 4px rgb(31 23 38 / 18%); }
.seg-opt input:checked + span::before { content: "✓ "; }
.seg-opt input[value="0"]:checked + span { background: #6b6475; color: #fff; }
.seg-opt input[value="1"]:checked + span { background: #2563c9; color: #fff; }
.seg-opt input[value="2"]:checked + span { background: #2e7a1f; color: #fff; }
.seg-opt input:focus-visible + span { outline: 2px solid var(--brand); }
.pills { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.pill.view { background: color-mix(in srgb, #2563c9 14%, transparent); color: #2563c9; }
.empty-state { text-align: center; padding: 40px 20px; display: grid; gap: 10px; }
.empty-state h1 { font-size: 1.2rem; }
.h2-note { font-size: 0.8rem; font-weight: 600; color: var(--ink-3); }
#booking-types { margin-top: 4px; }

.dialog {
  border: 0;
  border-radius: 16px;
  padding: 20px;
  width: min(440px, calc(100vw - 32px));
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 50px rgb(20 4 30 / 35%);
}
.dialog::backdrop { background: rgb(20 4 30 / 45%); }
.dialog h2 { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 1.15rem; }
.dialog th { width: 34%; white-space: nowrap; }
.dialog form { margin-top: 16px; display: flex; justify-content: flex-end; }

/* Password fields with a show/hide eye */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 46px; }
.pw-eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px; display: grid; place-items: center;
  appearance: none; border: 0; background: none; border-radius: 8px; color: var(--ink-3); cursor: pointer;
}
.pw-eye:hover { color: var(--brand); background: var(--surface-2); }
.pw-eye:focus-visible { outline: 2px solid var(--brand); }
.pw-eye .ico, .icon-btn .ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Key button in the top bar */
.icon-btn { appearance: none; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { color: var(--brand); border-color: var(--brand); }

/* .dialog .pw-form outranks the booking dialog's ".dialog form" button row */
.dialog .pw-form { display: grid; gap: 12px; margin-top: 0; }
.pw-form .actions { display: flex; justify-content: flex-end; gap: 8px; }
.dialog .pw-form p.muted { margin: -4px 0 4px; font-size: 0.88rem; }

/* Partner accounts */
.statement-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.statement-head h2 { margin: 0; }
.statement-head .list-tools { margin: 0; }
.statement-head select { width: auto; min-width: 160px; }
.entity-list tfoot td { font-weight: 700; border-top: 2px solid var(--line); background: var(--surface-2); }
.entity-list tr.pick { cursor: pointer; }
.entity-list .neg { color: var(--bad); }

/* Logout lives in the top bar on phones (the bottom bar has no room) */
.logout-top { display: none; appearance: none; border: 0; background: none; color: var(--ink-3); padding: 6px; cursor: pointer; }
.logout-top .ico { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 899px) {
  .logout-top { display: grid; place-items: center; }
  .nav .nav-logout { display: none; }
  .nav a { min-width: 0; }
  .nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
}
.badge { display: inline-block; font-size: 0.72rem; padding: 1px 6px; border-radius: 6px; background: var(--surface-2); color: var(--ink-3); }
.due { color: var(--warn); font-weight: 600; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 16px;
  border-radius: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 20;
  max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (min-width: 900px) { .toast { bottom: 24px; } }

/* খরচ tabs (দৈনিক / স্থির), same look as the report period tabs */
.sub-tabs { display: inline-flex; gap: 2px; border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 3px; margin-bottom: 12px; }
.sub-tabs a { font-weight: 600; color: var(--ink-2); padding: 8px 16px; border-radius: 8px; text-decoration: none; min-height: 38px; display: inline-flex; align-items: center; }
.sub-tabs a:hover { color: var(--brand); }
.sub-tabs a[aria-selected="true"] { background: var(--brand-soft); color: var(--brand); }
.view-intro { margin: 0 0 14px; max-width: 70ch; line-height: 1.55; }
.setting-card { padding: 14px 18px; }
.switch-row { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch-row input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--brand); flex: none; }
.switch-row input:disabled + span { opacity: .75; }
