/* Mandi Munim — app styles. Mobile first, large touch targets, Hindi-friendly fonts. */
:root {
  --green: #1B7A3D;
  --green-dark: #135C2D;
  --green-soft: #E3F1E7;
  --saffron: #F4A300;
  --saffron-soft: #FFF3D6;
  --red: #D93025;
  --red-soft: #FCE8E6;
  --ink: #23262A;
  --muted: #5F6670;
  --line: #DDD8CC;
  --bg: #F7F5EF;
  --card: #FFFFFF;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 14px rgba(0, 0, 0, .05);
  --font: "Noto Sans Devanagari", "Noto Sans", "Mangal", "Nirmala UI", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font); font-size: 17px; line-height: 1.45;
  padding-bottom: env(safe-area-inset-bottom);
}
h1 { font-size: 1.35rem; margin: 0 0 .75rem; }
h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
p { margin: .25rem 0; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.hi { color: var(--muted); }

/* Environment banner: demo orange, practice blue, staging grey */
.env-banner { position: sticky; top: 0; z-index: 30; padding: .45rem 1rem; text-align: center; font-weight: 700; color: #fff; letter-spacing: .02em; }
.env-demo .env-banner { background: #E65100; }
.env-practice .env-banner { background: #1565C0; }
.env-staging .env-banner { background: #455A64; }
body.env-demo { background: #FFF6EC; }
body.env-practice { background: #EEF4FC; }

/* Header */
.top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem 1rem; background: var(--green); color: #fff; }
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-weight: 800; font-size: 1.2rem; }
.brand-by { font-size: .72rem; opacity: .85; }
.top-actions { display: flex; gap: .5rem; }
.top .chip { background: rgba(255, 255, 255, .16); color: #fff; border-color: rgba(255, 255, 255, .35); }

main { max-width: 760px; margin: 0 auto; padding: 1rem; outline: none; }
.loading { text-align: center; color: var(--muted); padding: 3rem 0; }

/* Cards and notices */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem; margin-bottom: 1rem; }
.notice { background: var(--saffron-soft); border: 1px solid #F1D48A; padding: .6rem .9rem; border-radius: 10px; margin-bottom: 1rem; }
.notice.bad { background: var(--red-soft); border-color: #F3B7B1; color: #8A1C14; }
.note { background: var(--green-soft); padding: .55rem .8rem; border-radius: 8px; font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 1.5rem 0; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  min-height: 48px; padding: .6rem 1.1rem; border-radius: 12px; border: 2px solid transparent;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; color: inherit; background: none;
}
.btn.block { width: 100%; margin-top: .6rem; }
.btn.primary { background: var(--green); color: #fff; }
.btn.primary:active { background: var(--green-dark); }
.btn.accent { background: var(--saffron); color: #2B1D00; }
.btn.ghost { background: var(--card); border-color: var(--line); }
.btn.link { background: none; color: var(--green); padding-left: 0; padding-right: 0; text-decoration: underline; }
.btn.whatsapp { background: #25D366; color: #06371A; }
.btn:disabled, .btn.busy { opacity: .6; cursor: progress; }
.btn:focus-visible, .chip:focus-visible, .tile:focus-visible, .list-row:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--saffron); outline-offset: 2px;
}
.row { display: flex; gap: .6rem; justify-content: flex-end; margin-top: 1rem; flex-wrap: wrap; }
.actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }

.chip { min-height: 40px; padding: .35rem .9rem; border-radius: 999px; border: 2px solid var(--line); background: var(--card); font: inherit; font-size: .92rem; font-weight: 600; cursor: pointer; color: var(--ink); }
.chip.on { background: var(--green); border-color: var(--green); color: #fff; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; margin: .5rem 0 .9rem; }

/* Forms */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: .9rem; }
.field label, .field .label { font-weight: 700; font-size: .95rem; }
input, select, textarea {
  font: inherit; font-size: 1.05rem; min-height: 50px; padding: .6rem .8rem;
  border: 2px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); width: 100%;
}
textarea { min-height: 80px; }
.big-input { font-size: 1.4rem; letter-spacing: .08em; text-align: center; }
.big-input.pin { letter-spacing: .5em; }
.upper { text-transform: uppercase; }
.hint { color: var(--muted); }
.field.invalid input, .field.invalid select, .field.invalid textarea, .field.invalid .chips { border-color: var(--red); }
.field-error { color: var(--red); font-weight: 700; font-size: .9rem; }
details.more { border-top: 1px solid var(--line); padding-top: .6rem; margin: .6rem 0; }
details.more > summary { cursor: pointer; font-weight: 700; color: var(--green); min-height: 44px; display: flex; align-items: center; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.seg-btn { min-height: 48px; border-radius: 12px; border: 2px solid var(--line); background: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.seg-btn.on { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); }
.seg-btn.on.dr { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); }
.seg-btn.on.cr { background: var(--red-soft); border-color: var(--red); color: #8A1C14; }
.photo-field { flex-direction: row; align-items: center; gap: 1rem; }

/* Login */
.login { max-width: 440px; margin: 1rem auto; }
.login-extras { max-width: 440px; margin: 0 auto; }
.demo-card p { margin-bottom: .4rem; }

/* Dashboard */
.hello h1 { margin-bottom: 0; }
.hello .firm { color: var(--muted); font-weight: 600; margin-bottom: 1rem; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; margin-bottom: 1.1rem; }
.stat { background: var(--card); border-radius: 12px; padding: .7rem .85rem; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stat-label { font-size: .85rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.25rem; font-weight: 800; }
.stat.dr .stat-value { color: var(--green); }
.stat.cr .stat-value { color: var(--red); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.tile {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem;
  min-height: 108px; padding: .6rem; border: 0; border-radius: 16px; background: var(--card); box-shadow: var(--shadow);
  font: inherit; font-weight: 700; color: var(--ink); cursor: pointer;
}
.tile:active { transform: scale(.98); background: var(--green-soft); }
.tile-icon { font-size: 2.3rem; line-height: 1; }
.tile-label { font-size: 1rem; text-align: center; }

/* Lists */
.bar { display: flex; align-items: center; gap: .6rem; margin-bottom: .6rem; }
.bar h1 { margin: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.back { min-height: 44px; padding: .4rem .8rem; }
.search { margin-bottom: .2rem; }
.list { display: flex; flex-direction: column; gap: .45rem; }
.list-row {
  display: flex; align-items: center; gap: .8rem; width: 100%; min-height: 64px; padding: .6rem .8rem;
  border: 0; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); font: inherit; text-align: left; cursor: pointer; color: var(--ink);
}
.row-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.row-title { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { color: var(--muted); font-size: .9rem; }
.row-amt { font-weight: 800; white-space: nowrap; }
.dr { color: var(--green); }
.cr { color: var(--red); }
.avatar {
  flex: none; width: 46px; height: 46px; border-radius: 50%; background: var(--green-soft); color: var(--green-dark);
  display: inline-flex; align-items: center; justify-content: center; font-weight: 800; object-fit: cover;
}
.avatar.big { width: 84px; height: 84px; font-size: 1.6rem; }
.fab {
  position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 20;
  min-height: 56px; padding: .8rem 1.3rem; border-radius: 999px; border: 0; background: var(--saffron); color: #2B1D00;
  font: inherit; font-weight: 800; box-shadow: 0 6px 18px rgba(0, 0, 0, .2); cursor: pointer;
}

/* Party view */
.party-head { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; align-items: center; }
.party-head > .balance, .party-head > .muted, .party-head > .actions { grid-column: 1 / -1; }
.party-head h2 { margin: 0; }
.types { font-size: .9rem; color: var(--muted); }
.balance { font-size: 1.5rem; font-weight: 800; margin-top: .5rem; }
table.ledger { width: 100%; border-collapse: collapse; font-size: .95rem; }
.ledger th, .ledger td { padding: .5rem .35rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.ledger .num { text-align: right; white-space: nowrap; }
.details { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
.details dt { color: var(--muted); font-weight: 600; }
.details dd { margin: 0; word-break: break-word; }

/* Modal and toast */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 50; }
.modal .card { width: 100%; max-width: 420px; }
.preview { white-space: pre-wrap; word-break: break-word; background: #F3F3F3; padding: .7rem; border-radius: 8px; }
#toast {
  position: fixed; left: 50%; bottom: 1.2rem; transform: translate(-50%, 150%); max-width: 92vw; z-index: 60;
  padding: .75rem 1.1rem; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700;
  transition: transform .25s ease; pointer-events: none;
}
#toast.show { transform: translate(-50%, 0); }
#toast.bad { background: var(--red); }
#toast.good { background: var(--green); }
.noscript { padding: 2rem; text-align: center; }

@media (min-width: 640px) {
  .stats { grid-template-columns: repeat(5, 1fr); }
  .tiles { grid-template-columns: repeat(5, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---- Arrival screens ---- */
.small { font-size: .85rem; }
.section-title { margin: 1.2rem 0 .5rem; color: var(--green-dark); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .7rem; }
.date-nav { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .6rem; }
.date-nav .btn { min-width: 52px; }
.date-label { font-size: 1.05rem; text-align: center; flex: 1; }
.time-badge { flex: none; min-width: 56px; padding: .35rem .4rem; border-radius: 10px; background: var(--saffron-soft); font-weight: 800; text-align: center; }
.row-go { font-size: 1.6rem; color: var(--muted); }
.list-row.cancelled { opacity: .65; }
.tag { display: inline-block; margin-top: .2rem; padding: .05rem .5rem; border-radius: 6px; font-size: .78rem; font-weight: 800; width: fit-content; }
.tag.bad { background: var(--red-soft); color: #8A1C14; }
.picker {
  display: flex; align-items: center; gap: .7rem; width: 100%; min-height: 58px; padding: .6rem .8rem;
  border: 2px dashed var(--green); border-radius: 12px; background: var(--green-soft); font: inherit; font-weight: 700; color: var(--ink); cursor: pointer; text-align: left;
}
.picker-icon { font-size: 1.5rem; }
.picked-name { flex: 1; }
.picker-go { font-size: 1.6rem; color: var(--green); }
.field.invalid .picker { border-color: var(--red); background: var(--red-soft); }
.subcard { border: 1px solid var(--line); border-radius: 12px; padding: .8rem; margin: -.4rem 0 .9rem; background: #FBFAF6; }
.lots { display: flex; flex-direction: column; gap: .7rem; }
.card-inner { border: 2px solid var(--line); border-radius: 14px; padding: .8rem; background: #FFFDF8; }
.lot-head { display: flex; align-items: center; gap: .5rem; margin-bottom: .4rem; }
.lot-title { flex: 1; font-weight: 800; font-size: 1.1rem; }
.lot-head .btn.link { min-height: 36px; }
.com-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .45rem; }
.com-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .15rem; min-height: 78px;
  padding: .35rem; border: 2px solid var(--line); border-radius: 12px; background: #fff; font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; color: var(--ink);
}
.com-btn:active { background: var(--green-soft); border-color: var(--green); }
.com-icon { font-size: 1.8rem; line-height: 1; }
.field.invalid .com-grid { outline: 2px solid var(--red); outline-offset: 4px; border-radius: 12px; }
.thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.slip-img { width: 100%; border-radius: 10px; }
.big-vehicle { font-size: 1.6rem; font-weight: 900; letter-spacing: .06em; margin: 0; }
.arrival-head .list-row { margin-top: .6rem; box-shadow: none; border: 1px solid var(--line); }
.btn.danger { background: var(--red); color: #fff; }
.modal .card.tall { max-height: 88vh; display: flex; flex-direction: column; }
.pick-list { overflow-y: auto; flex: 1; margin: .5rem 0; }
@media (min-width: 640px) { .com-grid { grid-template-columns: repeat(5, 1fr); } }

/* ---- Sale, patti, settings ---- */
.top-gap { margin-top: .9rem; }
.small-icon { font-size: 1.6rem; width: 46px; text-align: center; }
.day-total { font-weight: 800; text-align: center; margin: -.2rem 0 .6rem; }
.tag.paid { background: var(--green-soft); color: var(--green-dark); }
.tag.unpaid { background: var(--saffron-soft); color: #7A4F00; }
.tag.partial { background: #E8F0FE; color: #174EA6; }
.totals-wrap { margin: .4rem 0 .6rem; }
.totals { border-top: 2px solid var(--line); margin-top: .6rem; padding-top: .4rem; }
.trow { display: flex; justify-content: space-between; gap: 1rem; padding: .25rem 0; }
.trow.grand { font-size: 1.25rem; font-weight: 900; border-top: 2px solid var(--ink); margin-top: .3rem; padding-top: .45rem; }
.line-total { text-align: right; margin: .2rem 0 0; }
.line-amount { font-size: 1.15rem; }
.words { font-style: italic; color: var(--muted); margin-top: .6rem; }
.party-link { margin: .5rem 0; box-shadow: none; border: 1px solid var(--line); }
.charge-card h3 { margin: 0 0 .5rem; font-size: 1.05rem; }
.charge-card .seg { grid-template-columns: repeat(4, 1fr); }
.charge-card .seg-btn { font-size: .85rem; padding: .3rem; }
.pick-list .com-icon { font-size: 1.7rem; width: 46px; text-align: center; }

/* ---- Payments, cash book, day closing ---- */
.pay-info { margin: -.2rem 0 .8rem; }
.bills { border: 1px solid var(--line); border-radius: 12px; padding: .4rem .6rem; background: #FBFAF6; }
.bills-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.bill-row { display: flex; align-items: center; gap: .6rem; padding: .45rem .2rem; border-top: 1px solid var(--line); }
.bill-row.will-pay { background: var(--green-soft); }
.bill-row.will-part { background: var(--saffron-soft); }
.bill-due { display: flex; flex-direction: column; align-items: flex-end; }
.alloc-input { width: 110px; min-height: 42px; }
.cash-stats { grid-template-columns: repeat(2, 1fr); }
.account-card .acc-head { display: flex; align-items: center; gap: .6rem; }
.acc-bal { font-size: 1.2rem; }
.diff { font-weight: 800; font-size: 1.1rem; }
.aging { display: grid; grid-template-columns: repeat(4, 1fr); gap: .4rem; margin-bottom: .7rem; }
.age-box { border-radius: 10px; padding: .45rem; text-align: center; display: flex; flex-direction: column; background: var(--green-soft); }
.age-box.age-15_30 { background: var(--saffron-soft); }
.age-box.age-30_60 { background: #FDE7D4; }
.age-box.age-60_plus { background: var(--red-soft); color: #8A1C14; }
.modal .card.scroll { overflow-y: auto; }
@media (min-width: 640px) { .cash-stats { grid-template-columns: repeat(4, 1fr); } }

/* Tappable dashboard boxes */
button.stat { border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; position: relative; width: 100%; }
button.stat:active { transform: scale(.98); }
button.stat:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; }
.stat-go { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); font-size: 1.6rem; color: var(--muted); line-height: 1; }
button.stat .stat-value { padding-right: 1.2rem; }
/* Dues list */
.dues-head .balance { font-size: 1.8rem; margin: 0; }
.age-other { grid-column: 1 / -1; }
.row-sub.late { color: var(--red); font-weight: 600; }

/* Purchase bill */
.check-row { display: flex; align-items: center; gap: .6rem; padding: .8rem .2rem; font-weight: 600; font-size: 1.05rem; }
.check-row input[type=checkbox] { width: 1.6rem; height: 1.6rem; accent-color: var(--green); flex: none; }
.btn.link.small { font-size: .9rem; padding: .2rem 0; }
.list-row[disabled] { opacity: .6; }

/* Purchase bill: charge rows — name on top, rate box and amount below (no overflow at large text sizes) */
.charge-box { border: 1px solid var(--line, #e3ded2); border-radius: 12px; padding: .8rem; margin-top: .9rem; }
.charge-box.levy { background: #f4f9f4; }
.charge-box h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.charge-row { padding: .55rem 0; border-top: 1px dashed var(--line, #e3ded2); min-width: 0; }
.charge-box h3 + p + .charge-row { border-top: 0; }
.charge-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .45rem; font-weight: 700; overflow-wrap: anywhere; }
.charge-name small { font-weight: 400; }
.charge-line { display: flex; align-items: center; gap: .5rem; margin-top: .3rem; min-width: 0; }
.charge-rate { flex: 0 1 8rem; min-width: 0; width: 8rem; font-size: 1.1rem; padding: .55rem .6rem; text-align: right; }
.charge-eq { color: var(--muted); }
.charge-amt { flex: 1 1 auto; min-width: 0; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.charge-warn { margin: .3rem 0 0; color: var(--red); font-size: .9rem; font-weight: 600; }
.charge-row.invalid .charge-rate { border-color: var(--red); }
.charge-row .field-error { display: block; margin-top: .25rem; }
/* Lot cards (sale, purchase): side-by-side boxes drop to one per line when text is large or the phone narrow */
.lot-card .two { grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr)); }
.lot-card .big-input { min-width: 0; width: 100%; font-size: 1.35rem; }
.lot-card select { min-width: 0; width: 100%; }
.totals .trow.grand span:first-child { flex: 1 1 auto; min-width: 0; padding-right: .5rem; }
.totals .trow.grand .num { white-space: nowrap; }

/* Stock */
.big-stock { font-size: 1.7rem; font-weight: 800; margin: .1rem 0 .3rem; overflow-wrap: anywhere; }
.stock-row.is-low { border-left: 5px solid var(--red); }
.stock-qty { font-weight: 700; color: var(--ink); }
.row-sub.age-warn, .age-line.age-warn { color: #a16207; font-weight: 600; }
.row-sub.age-alert, .age-line.age-alert { color: var(--red); font-weight: 700; }
.age-badge { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 3.2rem; height: 3.2rem; border-radius: 50%; background: #e8f3e8; line-height: 1.05; }
.age-badge strong { font-size: 1.15rem; }
.age-badge small { font-size: .7rem; }
.age-badge.age-warn { background: #fdf0c4; }
.age-badge.age-alert { background: #fbd5d2; color: var(--red); }
.row-amt small { display: block; font-size: .8rem; font-weight: 400; }
.tag.own { background: #e3ecfb; color: #1d4ea8; }
.tag.comm { background: #efe7f8; color: #6b3fa0; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.ledger.moves td small { color: var(--muted); }
.ledger.moves tr.cancelled td { text-decoration: line-through; opacity: .6; }
.danger-text { color: var(--red) !important; }
details.card > summary { cursor: pointer; font-weight: 700; padding: .2rem 0; }
details.card[open] > summary { margin-bottom: .6rem; }
.seg.seg-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); display: grid; }
.seg.seg-3 .seg-btn { padding-left: .3rem; padding-right: .3rem; }

/* Reports */
.range-bar { margin: .2rem 0 .6rem; }
.range-bar .chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .4rem; }
.range-bar input[type=date] { width: 100%; min-width: 0; }
.type-totals { display: flex; flex-wrap: wrap; gap: .4rem; margin: .5rem 0; }
.chip-static { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .3rem .7rem; font-size: .9rem; }
.ledger.report tr.tap { cursor: pointer; }
.ledger.report tr.tap:active { background: var(--green-soft); }
.ledger.report tr.cancelled td { text-decoration: line-through; opacity: .55; }
.ledger.report tfoot td { font-weight: 800; border-top: 2px solid var(--ink); }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin-top: .6rem; }
.ledger.register { min-width: 34rem; }
.pnl-result.good .big-stock { color: var(--green); }
.pnl-result.bad .big-stock { color: var(--red); }
.muted.block, small.block { display: block; }
.lot-profit .row-amt strong.dr { color: var(--green); }
.lot-profit .row-amt strong.cr { color: var(--red); }
.cash-stats .stat small { display: block; }
.print-only { display: none; }
@media print {
  body { background: #fff !important; }
  .env-banner, header.top, .bar button, .date-nav button, .range-bar, .report-actions, .fab, #toast, .notice:not(.bad), .seg, nav.tiles { display: none !important; }
  .print-only { display: block !important; }
  .print-title { font-weight: 800; font-size: 1.1rem; margin: 0 0 .5rem; }
  .card, .stat { box-shadow: none !important; border: 1px solid #bbb; break-inside: avoid; }
  .table-scroll { overflow: visible; }
  .ledger.register { min-width: 0; }
  a[href]::after { content: none; }
}
/* Mandi Munim logo */
.brand { flex-direction: row; align-items: center; gap: .55rem; min-width: 0; }
.brand-logo { width: 44px; height: 44px; flex: none; border-radius: 10px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.login-brand { text-align: center; margin: .6rem 0 1rem; }
.login-logo { width: 150px; height: 150px; display: block; margin: 0 auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,.12)); }
.login-by { margin: .4rem 0 0; color: var(--muted); font-weight: 600; font-size: .9rem; }
@media (max-width: 360px) { .brand-logo { width: 38px; height: 38px; } .brand-by { display: none; } }
.stat-value { white-space: nowrap; font-size: clamp(1rem, 4.6vw, 1.25rem); }
.stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
button.stat .stat-value { padding-right: 1rem; }
@media (max-width: 340px) { .stat { padding: .6rem .6rem; } .stat-go { right: .35rem; } }

/* Users & staff */
.avatar.owner { background: #fdf0c4; color: #8a5a00; }
.device-row { cursor: default; }
.device-actions { display: flex; flex-direction: column; align-items: flex-end; gap: .2rem; flex: none; }
.perm-group { border: 1px solid var(--line); border-radius: 12px; padding: .4rem .8rem .6rem; margin: 0 0 .7rem; }
.perm-group legend { font-weight: 800; padding: 0 .3rem; }
.check-row.perm { padding: .45rem .1rem; font-size: 1rem; font-weight: 600; border-top: 1px dashed var(--line); }
.check-row.perm:first-of-type { border-top: 0; }
.check-row.perm.locked { opacity: .55; }
.check-row.perm small { font-weight: 400; }

/* Today's rates */
.rate-card .rate-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .3rem; }
.rate-card .rate-head small { display: block; }
.rate-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .6rem; align-items: center; padding: .45rem 0; border-top: 1px dashed var(--line); }
.rate-line.edit { grid-template-columns: minmax(0, 1fr); }
.rate-label { font-weight: 700; }
.rate-value { text-align: right; }
.rate-inputs { display: flex; flex-wrap: wrap; gap: .4rem .8rem; align-items: center; }
.rate-main { display: flex; align-items: center; gap: .3rem; font-weight: 700; }
.rate-modal { width: 8.5rem; font-size: 1.35rem; font-weight: 800; text-align: right; padding: .5rem .6rem; }
.rate-range { display: flex; align-items: center; gap: .3rem; }
.rate-range input { width: 5.6rem; text-align: right; padding: .45rem .5rem; }
.rate-line.invalid .rate-modal { border-color: var(--red); }
.trend { font-size: .85rem; font-weight: 700; }
.trend.up { color: var(--green); }
.trend.down { color: var(--red); }
.trend.same { color: var(--muted); }
.sticky-actions { position: sticky; bottom: 0; background: var(--bg, #F7F5EF); padding: .6rem 0; z-index: 2; }
.today-rate-tag { margin: .1rem 0 .3rem; font-size: .9rem; font-weight: 700; color: var(--green); }
.rate-hints { display: flex; flex-direction: column; align-items: flex-start; }
