/* ===== Design tokens (Apple HIG–inspired, light + dark) ===== */
@font-face {
  font-family: 'App Arabic';
  src: url('/fonts/NotoSansArabic.ttf') format('truetype');
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F;
}

:root {
  color-scheme: light;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'SF Arabic', 'App Arabic', 'Segoe UI', 'Inter', system-ui, sans-serif;
  --bg: #f2f2f7;
  --bg-2: #ffffff;
  --bg-3: #f2f2f7;
  --label: #1c1c1e;
  --label-2: rgba(60, 60, 67, .62);
  --label-3: rgba(60, 60, 67, .36);
  --sep: rgba(60, 60, 67, .16);
  --fill: rgba(120, 120, 128, .12);
  --fill-2: rgba(120, 120, 128, .2);
  --material: rgba(249, 249, 251, .78);
  --sidebar: rgba(242, 242, 247, .92);
  --tint: #8a6844;
  --tint-soft: rgba(138, 104, 68, .14);
  --on-tint: #ffffff;
  --shadow-sheet: 0 20px 60px rgba(0, 0, 0, .18);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300;
  --muted-mark: #aeaeb2;
  --s1-track: #cde2fb;
  --good: #0ca30c; --good-text: #006300; --warning: #fab219; --serious: #ec835a; --critical: #d03b3b; --critical-text: #c0392b;
  --grid: #e5e5ea; --axis: #c7c7cc;
  --radius: 14px;
  --radius-sm: 10px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #000000; --bg-2: #1c1c1e; --bg-3: #2c2c2e;
    --label: #ffffff; --label-2: rgba(235, 235, 245, .62); --label-3: rgba(235, 235, 245, .32);
    --sep: rgba(84, 84, 88, .55); --fill: rgba(120, 120, 128, .24); --fill-2: rgba(120, 120, 128, .36);
    --material: rgba(28, 28, 30, .78); --sidebar: rgba(22, 22, 24, .94);
    --shadow-sheet: 0 20px 60px rgba(0, 0, 0, .6);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #0ca30c;
    --muted-mark: #636366; --s1-track: rgba(57, 135, 229, .2);
    --good-text: #30d158; --critical-text: #ff6961;
    --grid: #2c2c2e; --axis: #48484a;
    --tint: #c8a27a; --tint-soft: rgba(200, 162, 122, .18); --on-tint: #1c1c1e;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--label);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.ic { flex: none; display: block; }
[dir="rtl"] .flip { transform: scaleX(-1); }
.num { font-variant-numeric: tabular-nums; direction: ltr; unicode-bidi: isolate; }
.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.muted { color: var(--label-2); }
.small { font-size: 13px; }
.boot { min-height: 100vh; display: grid; place-items: center; color: var(--label-2); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--tint) 55%, transparent); outline-offset: 2px; border-radius: 8px; }

/* ===== App shell ===== */
.app { min-height: 100vh; }
.sidebar { display: none; }
.content { min-width: 0; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--sep);
  padding: calc(6px + env(safe-area-inset-top)) 8px 6px;
  display: flex; align-items: center; gap: 4px;
}
.topbar .grow { flex: 1; min-width: 0; display: flex; justify-content: center; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 22px; border: 0; background: transparent; color: var(--tint);
  display: inline-grid; place-items: center; flex: none;
}
.icon-btn:hover { background: var(--fill); }
.icon-btn.filled { background: var(--tint); color: var(--on-tint); width: 36px; height: 36px; margin: 4px; }
.icon-btn.filled:hover { filter: brightness(1.08); background: var(--tint); }

.page-head { padding: 14px 16px 6px; max-width: 1160px; margin: 0 auto; display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; line-height: 1.15; font-weight: 700; margin: 0; letter-spacing: -.01em; flex: 1; min-width: 160px; }
.page-head .brand-sub { display: block; font-size: 13px; font-weight: 600; color: var(--label-2); letter-spacing: 0; margin-bottom: 2px; }
.page-head .actions { display: flex; gap: 8px; align-items: center; }
.page { padding: 8px 16px 24px; max-width: 1160px; margin: 0 auto; }

.tabbar {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
  background: var(--material);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--sep);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 48px; justify-content: center;
  text-decoration: none; color: var(--label-2); font-size: 10.5px; font-weight: 600;
}
.tabbar a.on { color: var(--tint); }

.seg {
  display: inline-flex; background: var(--fill); border-radius: 9px; padding: 2px; max-width: 100%;
  overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 7px; font-size: 13px; font-weight: 600;
  color: var(--label); white-space: nowrap; min-height: 32px; transition: background .2s, box-shadow .2s;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.seg button.on { background: var(--bg-2); box-shadow: 0 1px 3px rgba(0, 0, 0, .12), 0 0 0 .5px rgba(0, 0, 0, .04); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button.on { background: #636366; } }
.seg.brand button { min-width: 84px; }

.filters { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 4px 0 14px; }
.range-pop { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: -4px 0 14px; }
.range-pop input { width: auto; min-height: 36px; padding: 6px 10px; font-size: 14px; background: var(--bg-2); }

/* ===== Cards & grids ===== */
.card { background: var(--bg-2); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { font-size: 17px; font-weight: 600; margin: 0; flex: 1; min-width: 140px; }
.card-head .sub { color: var(--label-2); font-size: 13px; }
.grid { display: grid; gap: 12px; }
.stack > * + * { margin-top: 12px; }
.g-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-2, .g-hero { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 760px) {
  .g-kpi { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
}

.hero .label { font-size: 15px; font-weight: 600; color: var(--label-2); }
.hero .figure { font-size: 52px; font-weight: 700; letter-spacing: -.02em; line-height: 1.05; margin: 6px 0 8px; overflow-wrap: anywhere; }
.hero .figure .cur { font-size: 22px; font-weight: 600; color: var(--label-2); margin-inline-start: 6px; letter-spacing: 0; }
@media (max-width: 380px) { .hero .figure { font-size: 44px; } }
.delta { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; color: var(--label-2); }
.delta.good { color: var(--good-text); }
.delta.bad { color: var(--critical-text); }
.delta .ic { width: 14px; height: 14px; }

.tile { display: flex; flex-direction: column; gap: 4px; }
.tile .label { font-size: 13px; color: var(--label-2); font-weight: 600; }
.tile .value { font-size: 24px; font-weight: 700; letter-spacing: -.01em; line-height: 1.15; overflow-wrap: anywhere; }
.tile .value .cur { font-size: 14px; color: var(--label-2); font-weight: 600; margin-inline-start: 3px; }
.tile .foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; margin-top: auto; min-height: 28px; }
.spark { flex: none; }
.spark-line { fill: none; stroke: var(--muted-mark); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.spark-dot { fill: var(--tint); stroke: var(--bg-2); stroke-width: 2; }

.meter { height: 8px; border-radius: 4px; background: var(--s1-track); overflow: hidden; }
.meter > span { display: block; height: 100%; border-radius: 4px; background: var(--s1); transition: width .5s cubic-bezier(.2, .8, .2, 1); }
.meter.warn { background: color-mix(in srgb, var(--warning) 28%, var(--bg-2)); }
.meter.warn > span { background: var(--warning); }
.meter.crit { background: color-mix(in srgb, var(--critical) 22%, var(--bg-2)); }
.meter.crit > span { background: var(--critical); }
.meter-line { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--label-2); margin-top: 6px; flex-wrap: wrap; }
.meter-line b { color: var(--label); font-weight: 600; }

.segbar { display: flex; gap: 2px; height: 28px; }
.segbar > span {
  display: flex; align-items: center; padding-inline: 8px; font-size: 12px; font-weight: 700; color: #fff;
  border-radius: 4px; min-width: 3px; white-space: nowrap; overflow: hidden;
}
.segbar > span.dark-text { color: #0b0b0b; }
.segbar.thin { height: 8px; }
.segbar.thin > span { padding: 0; border-radius: 0; }
.segbar.thin > span:first-child { border-start-start-radius: 4px; border-end-start-radius: 4px; }
.segbar.thin > span:last-child { border-start-end-radius: 4px; border-end-end-radius: 4px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 13px; color: var(--label-2); }
.legend .k { display: inline-flex; align-items: center; gap: 6px; }
.legend .k b { color: var(--label); font-weight: 600; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.sw-line { width: 14px; height: 2px; border-radius: 1px; display: inline-block; flex: none; }

.rbars { display: flex; flex-direction: column; gap: 12px; }
.rbar .top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; margin-bottom: 5px; }
.rbar .top .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rbar .top .vl { color: var(--label-2); white-space: nowrap; font-size: 13px; }
.rbar .top .vl b { color: var(--label); font-weight: 600; }
.rbar .fill { height: 8px; border-radius: 0 4px 4px 0; background: var(--s1); min-width: 3px; }
[dir="rtl"] .rbar .fill { border-radius: 4px 0 0 4px; }
.rbar.s2 .fill { background: var(--s2); }

.srow { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: .5px solid var(--sep); font-size: 14px; }
.srow:last-child { border-bottom: 0; }
.srow .nm { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.srow .ct { color: var(--label-2); font-size: 13px; white-space: nowrap; }

/* ===== Charts ===== */
.chart { width: 100%; min-height: 180px; position: relative; }
.viz { display: block; max-width: 100%; height: auto; overflow: visible; direction: ltr; }
.viz-grid { stroke: var(--grid); stroke-width: 1; }
.viz-base { stroke: var(--axis); stroke-width: 1; }
.viz-axis { fill: var(--label-2); font-size: 11px; font-variant-numeric: tabular-nums; }
.viz-axis-sub { font-size: 10px; fill: var(--label-3); }
.viz-value { fill: var(--label); font-size: 12px; font-weight: 700; }
.viz-s1 { fill: var(--s1); } .viz-s2 { fill: var(--s2); }
.viz-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.viz-line-s1 { stroke: var(--s1); } .viz-line-s3 { stroke: var(--s3); }
.viz-area-s1 { fill: var(--s1); opacity: .1; }
.viz-dot { stroke: var(--bg-2); stroke-width: 2; }
.viz-dot-s1 { fill: var(--s1); } .viz-dot-s3 { fill: var(--s3); }
.viz-hit { fill: transparent; outline: none; }
.viz-band { outline: none; }
.viz-band.hot .viz-hit, .viz-band:focus-visible .viz-hit { fill: var(--fill); }
.viz-cross { stroke: var(--axis); stroke-width: 1; opacity: 0; }
.viz-cross.on { opacity: 1; }
.viz-hidden { display: none; }
.viz-tip {
  position: fixed; z-index: 90; pointer-events: none; opacity: 0; transition: opacity .12s;
  background: var(--bg-2); color: var(--label); border-radius: 10px; padding: 8px 10px; min-width: 120px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .16), 0 0 0 .5px var(--sep); font-size: 13px;
}
.viz-tip.show { opacity: 1; }
.viz-tip-title { color: var(--label-2); font-size: 12px; margin-bottom: 4px; }
.viz-tip-row { display: flex; align-items: center; gap: 8px; line-height: 1.6; }
.viz-tip-row b { font-weight: 700; font-variant-numeric: tabular-nums; }
.viz-tip-row span { color: var(--label-2); }
.viz-key-line { width: 12px; height: 2px; border-radius: 1px; display: inline-block; }

details.tablev { margin-top: 10px; }
details.tablev summary { list-style: none; cursor: pointer; color: var(--tint); font-size: 13px; font-weight: 600; display: inline-flex; gap: 6px; align-items: center; min-height: 32px; }
details.tablev summary::-webkit-details-marker { display: none; }

/* ===== Tables & lists ===== */
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: start; font-size: 12px; font-weight: 600; color: var(--label-2); padding: 8px 10px; border-bottom: .5px solid var(--sep); white-space: nowrap; }
table.t td { padding: 11px 10px; border-bottom: .5px solid var(--sep); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.n, table.t th.n { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: var(--fill); }
table.t .clip { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table-wrap { overflow-x: auto; }
.card.flush { padding: 6px 6px; }

.list { background: var(--bg-2); border-radius: var(--radius); overflow: hidden; }
.row {
  display: flex; align-items: center; gap: 12px; padding: 11px 16px; min-height: 56px; position: relative;
  border: 0; background: transparent; width: 100%; text-align: start; color: inherit; font: inherit;
}
.row + .row::before { content: ''; position: absolute; top: 0; inset-inline-start: 16px; inset-inline-end: 0; border-top: .5px solid var(--sep); }
button.row:hover { background: var(--fill); }
.row .main { flex: 1; min-width: 0; }
.row .title { font-weight: 600; display: flex; align-items: center; gap: 6px; min-width: 0; }
.row .title > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .meta { font-size: 13px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .amt { font-weight: 600; text-align: end; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row .amt .small { display: block; font-weight: 500; }
.row .chev { color: var(--label-3); }
.avatar { width: 40px; height: 40px; border-radius: 20px; display: grid; place-items: center; font-weight: 700; color: #fff; flex: none; font-size: 16px; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--fill); color: var(--label-2); white-space: nowrap; }
.badge .ic { width: 12px; height: 12px; }
.badge.good { color: var(--good-text); background: color-mix(in srgb, var(--good) 14%, transparent); }
.badge.warn { color: #8a5a00; background: color-mix(in srgb, var(--warning) 22%, transparent); }
.badge.crit { color: var(--critical-text); background: color-mix(in srgb, var(--critical) 14%, transparent); }
.badge.tint { color: var(--tint); background: var(--tint-soft); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .badge.warn { color: #ffd60a; } }

.section-title { font-size: 13px; font-weight: 600; color: var(--label-2); margin: 20px 16px 6px; }
.footnote { font-size: 12.5px; color: var(--label-2); margin: 10px 4px 0; line-height: 1.55; }
.empty { text-align: center; color: var(--label-2); padding: 40px 16px; }
.empty .ic { margin: 0 auto 10px; color: var(--label-3); }
.empty h3 { color: var(--label); font-size: 17px; margin: 0 0 4px; }
.empty .btn { margin-top: 14px; }
.callout { background: var(--tint-soft); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 13.5px; display: flex; gap: 8px; align-items: flex-start; }
.callout .ic { color: var(--tint); margin-top: 1px; }
.callout.crit { background: color-mix(in srgb, var(--critical) 12%, transparent); }
.callout.crit .ic { color: var(--critical); }

/* ===== Buttons & fields ===== */
.btn {
  border: 0; border-radius: 10px; padding: 0 16px; min-height: 40px; font-weight: 600; font-size: 15px;
  background: var(--fill); color: var(--tint); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn:hover { background: var(--fill-2); }
.btn.primary { background: var(--tint); color: var(--on-tint); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.danger { color: var(--critical-text); }
.btn.plain { background: transparent; padding: 0 8px; }
.btn.plain:hover { background: var(--fill); }
.btn.sm { min-height: 32px; font-size: 13px; padding: 0 12px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: default; }
input, select, textarea {
  width: 100%; border: 0; background: var(--bg-3); border-radius: 10px; padding: 10px 12px; min-height: 44px; font-size: 16px;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; }
.search { position: relative; flex: 1; min-width: 200px; }
.search .ic { position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); color: var(--label-2); }
.search input { padding-inline-start: 36px; background: var(--fill); min-height: 36px; font-size: 15px; }
select.compact { width: auto; min-height: 36px; padding: 6px 10px; background: var(--fill); font-size: 14px; font-weight: 600; }
input[type="checkbox"].switch {
  appearance: none; -webkit-appearance: none; width: 51px; height: 31px; min-height: 0; border-radius: 16px; background: var(--fill-2);
  position: relative; padding: 0; flex: none; transition: background .2s; cursor: pointer; margin: 0;
}
input[type="checkbox"].switch::after {
  content: ''; position: absolute; top: 2px; inset-inline-start: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .2); transition: inset-inline-start .2s;
}
input[type="checkbox"].switch:checked { background: #34c759; }
input[type="checkbox"].switch:checked::after { inset-inline-start: 22px; }

.fgroup { background: var(--bg-2); border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.frow { display: flex; align-items: center; gap: 10px; padding: 0 14px; min-height: 48px; position: relative; }
.frow + .frow::before { content: ''; position: absolute; top: 0; inset-inline-start: 14px; inset-inline-end: 0; border-top: .5px solid var(--sep); }
.frow > label, .frow > .lbl { flex: none; width: 40%; max-width: 180px; font-size: 15px; }
.frow input, .frow select, .frow textarea { background: transparent; border-radius: 0; padding: 10px 0; text-align: end; flex: 1; min-width: 0; }
.frow.stack { flex-direction: column; align-items: stretch; gap: 0; padding-top: 10px; }
.frow.stack > label { width: auto; max-width: none; font-size: 13px; color: var(--label-2); }
.frow.stack textarea, .frow.stack input { text-align: start; }
.frow .end { margin-inline-start: auto; }
.fgroup-title { font-size: 13px; color: var(--label-2); margin: 0 14px 6px; font-weight: 600; }
.fgroup-foot { font-size: 12.5px; color: var(--label-2); margin: -10px 14px 16px; }
.total-row { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 6px 16px; font-size: 18px; font-weight: 700; }

/* ===== Sheets ===== */
.sheet-back {
  position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .32);
  display: flex; align-items: flex-end; justify-content: center; animation: fade .2s ease;
}
.sheet {
  background: var(--bg); width: 100%; max-width: 560px; max-height: 94vh; display: flex; flex-direction: column;
  border-radius: 14px 14px 0 0; box-shadow: var(--shadow-sheet); animation: up .3s cubic-bezier(.2, .8, .2, 1);
}
.sheet .grabber { width: 36px; height: 5px; border-radius: 3px; background: var(--label-3); margin: 6px auto 0; }
.sheet-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 6px 8px; border-bottom: .5px solid var(--sep); }
.sheet-head h3 { margin: 0; font-size: 17px; font-weight: 600; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 56vw; }
.sheet-head .btn { justify-self: start; background: transparent; }
.sheet-head .btn:hover { background: var(--fill); }
.sheet-head .btn.save { justify-self: end; font-weight: 700; }
.sheet-body { padding: 16px; overflow-y: auto; padding-bottom: calc(16px + env(safe-area-inset-bottom)); }
.sheet-err { margin-bottom: 12px; }
@media (min-width: 700px) {
  .sheet-back { align-items: center; }
  .sheet { border-radius: 14px; max-height: 86vh; }
  .sheet .grabber { display: none; }
}
@keyframes up { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

#toast {
  position: fixed; left: 50%; transform: translate(-50%, 10px); bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 95;
  background: var(--bg-2); color: var(--label); padding: 10px 16px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18), 0 0 0 .5px var(--sep); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  display: flex; gap: 6px; align-items: center; max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast .ic { color: var(--good); }

.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-box { width: 100%; max-width: 380px; text-align: center; }
.logo { border-radius: 18px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #b8956a, #7d5c3b); }
.login .logo { width: 72px; height: 72px; margin: 0 auto 14px; }
.login h1 { font-size: 28px; margin: 0; }
.login p { margin: 4px 0 22px; }
.login .frow input { text-align: start; }
.login .btn.primary { width: 100%; min-height: 50px; border-radius: 12px; margin-top: 4px; }
.login .lang { margin-top: 18px; }

@media (min-width: 900px) {
  .app { display: grid; grid-template-columns: 250px minmax(0, 1fr); }
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 18px 12px;
    background: var(--sidebar); border-inline-end: .5px solid var(--sep);
  }
  .sidebar .app-title { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 16px; padding: 4px 8px 16px; }
  .sidebar .app-title .logo { width: 30px; height: 30px; border-radius: 8px; }
  .sidebar .seg { width: 100%; margin-bottom: 18px; }
  .sidebar .seg button { flex: 1; min-width: 0; }
  .sidebar nav { display: flex; flex-direction: column; gap: 2px; }
  .sidebar nav a {
    display: flex; align-items: center; gap: 10px; padding: 0 10px; min-height: 38px; border-radius: 8px;
    color: var(--label); text-decoration: none; font-weight: 500;
  }
  .sidebar nav a .ic { color: var(--tint); }
  .sidebar nav a:hover { background: var(--fill); }
  .sidebar nav a.on { background: var(--tint); color: var(--on-tint); }
  .sidebar nav a.on .ic { color: var(--on-tint); }
  .sidebar .foot { margin-top: auto; display: flex; flex-direction: column; gap: 2px; padding-top: 12px; border-top: .5px solid var(--sep); }
  .sidebar .foot .who { font-size: 13px; color: var(--label-2); padding: 6px 10px; }
  .sidebar .foot button { justify-content: flex-start; background: transparent; color: var(--label); font-weight: 500; min-height: 36px; gap: 10px; padding: 0 10px; }
  .sidebar .foot button:hover { background: var(--fill); }
  .topbar, .tabbar { display: none; }
  .content { padding-bottom: 32px; }
  .page-head { padding: 28px 28px 8px; }
  .page-head h1 { font-size: 34px; }
  .page { padding: 8px 28px 32px; }
  #toast { bottom: 28px; }
}
@media (max-width: 899px) { .only-desktop { display: none !important; } }
@media (min-width: 900px) { .only-mobile { display: none !important; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.cur { margin-inline-start: 3px; color: var(--label-2); font-weight: inherit; }
[lang="en"] .cur { margin-inline-start: 0; margin-inline-end: 3px; }
.hero .figure .cur { margin-inline-start: 6px; }
[lang="en"] .hero .figure .cur { margin-inline-start: 0; margin-inline-end: 6px; }

@media (max-width: 899px) { .seg .seg-lbl { display: none; } }
@media (max-width: 420px) { .filters .seg button { padding: 6px 8px; font-size: 12.5px; } }
