:root {
  --bg: #f6f4ef;
  --surface: #ffffff;
  --surface-2: #f3f0e7;
  --text: #1c1912;
  --muted: #6f6a5b;
  --border: #e5e0d3;
  --primary: #8f6d1f;
  --primary-2: #a78028;
  --on-primary: #ffffff;
  --gold: #c9a24a;
  --good: #14804a;
  --bad: #c0392b;
  --warn: #b7791f;
  --shadow: 0 1px 2px rgba(10, 40, 30, .06), 0 8px 24px rgba(10, 40, 30, .06);
  --radius: 14px;
  --c1: #0f7a62; --c2: #c9a24a; --c3: #3b82c4; --c4: #d0624a; --c5: #8a6bbd; --c6: #4aa3a0;
}
[data-theme="dark"] {
  --bg: #0d0c0a;
  --surface: #171612;
  --surface-2: #211f19;
  --text: #e6efeb;
  --muted: #8ea39b;
  --border: #2e2b22;
  --primary: #d4af5a;
  --primary-2: #e3c274;
  --on-primary: #1a1405;
  --gold: #e0b95a;
  --good: #3ecf8e;
  --bad: #f06a5a;
  --warn: #e0a64a;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.45;
}
.hidden { display: none !important; }
h1, h2, h3 { margin: 0; }
a { color: var(--primary); }

/* ---------- login ---------- */
.login {
  min-height: 100vh; display: grid; place-items: center; padding: 20px;
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(201,162,74,.25), transparent 60%),
    radial-gradient(800px 500px at 90% 90%, rgba(201,162,74,.16), transparent 60%),
    linear-gradient(160deg, #050504, #1a160b);
}
.login-card {
  width: 100%; max-width: 360px; background: var(--surface); padding: 32px 28px;
  border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,.35); text-align: center;
  display: flex; flex-direction: column; gap: 12px;
}
.login-card h1 { font-family: 'Playfair Display', serif; font-size: 30px; color: var(--primary); letter-spacing: .08em; }
.login-card img { width: 120px; height: 120px; border-radius: 50%; margin: 0 auto; box-shadow: 0 0 0 3px var(--gold), 0 10px 30px rgba(0,0,0,.25); }
.login-card .sub { margin: -6px 0 8px; color: var(--muted); }
.logo-big { font-size: 54px; line-height: 1; }
.err { color: var(--bad); min-height: 1.2em; margin: 0; font-size: 13px; }

/* ---------- layout ---------- */
.app { display: grid; grid-template-columns: 250px 1fr; min-height: 100vh; }
.sidebar {
  background: linear-gradient(180deg, #0a0907, #1a1710);
  border-right: 1px solid rgba(201,162,74,.25);
  color: #efe9d8; padding: 18px 14px; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 6px 8px 20px; }
.brand .logo { font-size: 32px; }
.brand b { font-family: 'Playfair Display', serif; font-size: 20px; display: block; color: #e6c777; letter-spacing: .06em; }
.brand small { color: #b9ae92; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.brand img { width: 52px; height: 52px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(201,162,74,.55); }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.sidebar nav a {
  color: #d8d0ba; text-decoration: none; padding: 10px 12px; border-radius: 10px;
  display: flex; align-items: center; gap: 10px; font-weight: 500;
}
.sidebar nav a i { font-style: normal; width: 22px; text-align: center; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); }
.sidebar nav a.active { background: rgba(201,162,74,.16); color: #f1d98f; box-shadow: inset 3px 0 0 var(--gold); }
.side-foot { display: grid; gap: 8px; }
.side-foot .btn { background: rgba(255,255,255,.06); color: #efe9d8; border-color: rgba(201,162,74,.25); }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px;
  padding: 14px 24px; background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--border);
}
.topbar h2 { font-family: 'Playfair Display', serif; font-size: 24px; flex: 1; }
.top-actions { display: flex; gap: 8px; }
.menu { display: none; }
.view { padding: 22px 24px 60px; max-width: 1280px; margin: 0 auto; }

/* ---------- controls ---------- */
.btn {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 9px 14px; border-radius: 10px; cursor: pointer; font: inherit; font-weight: 600;
  transition: transform .06s, background .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-2); }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.icon-btn { border: 0; background: transparent; font-size: 22px; cursor: pointer; color: var(--text); }

input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 45%, transparent); border-color: var(--primary); }
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
textarea { resize: vertical; min-height: 64px; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.card h3 { font-size: 15px; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.grid { display: grid; gap: 16px; }
.kpis { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); margin-bottom: 16px; }
.kpi { position: relative; overflow: hidden; }
.kpi .lbl { color: var(--muted); font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .val { font-size: 27px; font-weight: 700; margin: 6px 0 2px; letter-spacing: -.01em; }
.kpi .hint { color: var(--muted); font-size: 12.5px; }
.kpi::after { content: ''; position: absolute; right: -24px; top: -24px; width: 90px; height: 90px; border-radius: 50%; background: var(--accent, var(--primary)); opacity: .1; }
.kpi.profit { background: linear-gradient(135deg, #0a0907, #26210f); color: #f1d98f; border: 1px solid rgba(201,162,74,.45); }
.kpi.profit .lbl, .kpi.profit .hint { color: #c9bd97; }
.kpi.profit .pos { color: #7ee2ae; }
.kpi.profit::after { background: var(--gold); opacity: .3; }
.pos { color: var(--good); } .neg { color: var(--bad); } .warn { color: var(--warn); }
.kpi.profit .neg { color: #ffb4a8; }

.row2 { grid-template-columns: 2fr 1fr; margin-bottom: 16px; }
.row3 { grid-template-columns: 1fr 1fr; margin-bottom: 16px; }
.chart-box { position: relative; height: 280px; }
.chart-box.sm { height: 230px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin-bottom: 16px; }
.toolbar .grow { flex: 1; min-width: 180px; }
.toolbar > div { min-width: 140px; }
.toolbar .btn { height: 41px; }
.toolbar .spacer { flex: 1; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; min-width: 640px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); position: sticky; top: 0; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: 0; }
tfoot td { font-weight: 700; background: var(--surface-2); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.wrap { white-space: normal; min-width: 160px; }
.muted { color: var(--muted); }
.empty { text-align: center; color: var(--muted); padding: 36px 12px; }

.badge { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.badge.umrah { background: #dff3ea; color: #0b5d4b; } .badge.hajj { background: #f7ecd0; color: #8a6a14; }
.badge.ticket { background: #dcebf8; color: #1f5f99; } .badge.visa { background: #ebe3f6; color: #5e3f94; }
.badge.hotel { background: #fbe3dd; color: #a8412b; } .badge.tour, .badge.other { background: #e6ecea; color: #4a5c56; }
.badge.confirmed { background: #dcebf8; color: #1f5f99; } .badge.travelled { background: #dff3ea; color: #0b5d4b; }
.badge.pending { background: #fdeccd; color: #92600c; } .badge.cancelled { background: #fbdcd7; color: #a3321f; }
.badge.income { background: #dff3ea; color: #0b5d4b; } .badge.expense { background: #fbdcd7; color: #a3321f; }
[data-theme="dark"] .badge { filter: brightness(.9) saturate(.9); }

.progress { height: 6px; background: var(--surface-2); border-radius: 9px; overflow: hidden; min-width: 70px; margin-top: 4px; }
.progress span { display: block; height: 100%; background: var(--primary); }

/* list items */
.list { display: grid; gap: 4px; }
.li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 4px; border-bottom: 1px dashed var(--border); }
.li:last-child { border-bottom: 0; }
.li small { color: var(--muted); display: block; }

/* day summary */
.day-sum { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 16px; }

/* ---------- modal ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(5, 20, 15, .55); z-index: 50; display: grid; place-items: start center; overflow-y: auto; padding: 4vh 14px; }
.modal { background: var(--surface); border-radius: 18px; width: 100%; max-width: 760px; box-shadow: 0 30px 80px rgba(0,0,0,.45); animation: pop .15s ease-out; }
.modal.narrow { max-width: 460px; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font-family: 'Playfair Display', serif; font-size: 20px; }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.preview-box { background: var(--surface-2); border-radius: 12px; padding: 12px 14px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.preview-box b { font-size: 17px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: #14211d; color: #fff; padding: 10px 18px; border-radius: 99px; z-index: 99; transition: .25s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--bad); }

.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; background: var(--surface); color: var(--muted); padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--primary); color: var(--on-primary); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.45); }
  .menu { display: block; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .topbar { padding: 12px 14px; }
  .topbar h2 { font-size: 19px; }
  .view { padding: 16px 14px 60px; }
  #quickExpense { display: none; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .kpi .val { font-size: 23px; }
  .top-actions .btn { padding: 8px 10px; font-size: 13px; }
}

@media print {
  .sidebar, .topbar, .toolbar, .btn, .toast { display: none !important; }
  .app { display: block; }
  body { background: #fff; }
  .card, .table-wrap { box-shadow: none; }
}

/* ---------- avatar / attachments / album ---------- */
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; vertical-align: middle; margin-right: 8px; border: 2px solid var(--gold); background: var(--surface-2); }
.avatar.ph { display: inline-grid; place-items: center; font-weight: 700; color: var(--primary); font-size: 13px; }
.avatar.lg { width: 76px; height: 76px; margin: 0; font-size: 26px; }
.det-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.gallery.big { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.thumb { position: relative; border-radius: 12px; overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); aspect-ratio: 1; cursor: pointer; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.thumb:hover img { transform: scale(1.05); }
.thumb .tag { position: absolute; left: 6px; top: 6px; background: rgba(0,0,0,.65); color: #f1d98f; font-size: 11px; padding: 2px 8px; border-radius: 99px; }
.thumb .x { position: absolute; right: 6px; top: 6px; background: rgba(0,0,0,.65); color: #fff; border: 0; border-radius: 50%; width: 26px; height: 26px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.thumb:hover .x, .thumb:focus-within .x { opacity: 1; }
@media (hover: none) { .thumb .x { opacity: 1; } }
.thumb .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 8px 6px; font-size: 12px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.75)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb.pdf { display: grid; place-items: center; font-size: 38px; }
.upload-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; margin-top: 10px; }
.upload-row > div { flex: 1; min-width: 130px; }
.album-card { padding: 0; overflow: hidden; cursor: pointer; transition: transform .15s; }
.album-card:hover { transform: translateY(-3px); }
.album-card .cover { aspect-ratio: 16/10; background: linear-gradient(135deg, #0a0907, #2a2312); display: grid; place-items: center; font-size: 46px; overflow: hidden; }
.album-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.album-card .meta { padding: 12px 14px; }
.album-card .meta b { display: block; }
.albums-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.share-box { background: var(--surface-2); border: 1px dashed var(--gold); border-radius: 12px; padding: 12px; display: grid; gap: 8px; margin-bottom: 14px; }
.share-box .row { display: flex; gap: 8px; }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 80; display: grid; place-items: center; }
.lightbox img { max-width: 94vw; max-height: 84vh; border-radius: 8px; }
.lightbox .lb-cap { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #eee; padding: 0 60px; }
.lightbox button { position: absolute; background: rgba(255,255,255,.12); color: #fff; border: 0; width: 44px; height: 44px; border-radius: 50%; font-size: 22px; cursor: pointer; }
.lightbox .lb-x { top: 16px; right: 16px; } .lightbox .lb-p { left: 14px; top: 50%; } .lightbox .lb-n { right: 14px; top: 50%; }
.wa { background: #1fa855; border-color: #1fa855; color: #fff; text-decoration: none; display: inline-block; }
.wa:hover { background: #178c46; color: #fff; }
.upload-prog { color: var(--muted); font-size: 13px; margin-top: 6px; }

/* =====================================================
   Responsive + compact pass (no side scroll, one-screen dashboard)
   ===================================================== */
:root { --top: 58px; }
html, body { overflow-x: hidden; }
img { max-width: 100%; }
.main, .view, .card, .toolbar > div { min-width: 0; }

.topbar { height: var(--top); padding: 0 20px; }
.topbar h2 { font-size: 21px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.view.wide { max-width: 1760px; }

/* tables: wrap instead of side-scroll */
table { min-width: 0; }
th, td { padding: 9px 10px; white-space: normal; vertical-align: middle; }
th { white-space: nowrap; }
td.num, td.nw, td.act { white-space: nowrap; }
td.wrap { min-width: 0; }
td small, .cust small { display: block; font-size: 12px; }
.cust { display: inline-block; vertical-align: middle; }
tr.click { cursor: pointer; }
td .progress { min-width: 60px; }
.table-wrap { overflow-x: auto; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px 12px; display: flex; gap: 8px; align-items: baseline; }
.chip span { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.chip b { font-size: 15px; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; padding: 14px 0 0; flex-wrap: wrap; }
.btn:disabled { opacity: .45; cursor: default; }

/* dashboard (mobile first) */
.dash { display: flex; flex-direction: column; gap: 12px; }
.dash-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.dash-head > div { display: flex; align-items: center; gap: 8px; }
.dash-head label { margin: 0; }
.dash-head input { width: 170px; padding: 7px 10px; }
.kpi-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.kpi-row .kpi { padding: 12px 14px; }
.kpi-row .kpi.profit { grid-column: 1 / -1; }
.kpi-row .kpi .val { font-size: 20px; margin: 4px 0 0; }
.dash-mid, .dash-bot { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
.chart-card .chart-box { height: 230px; }
.scroll-list { max-height: 280px; overflow-y: auto; }
.li-main { display: flex; align-items: center; min-width: 0; flex: 1; }
.li-main > span { min-width: 0; }
.li-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li-end { text-align: right; flex: none; }
.li-end small { display: block; }

@media (min-width: 700px) {
  .kpi-row { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpi-row .kpi.profit { grid-column: span 2; }
  .dash-mid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-mid .wide2 { grid-column: 1 / -1; }
  .dash-bot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* PC: poora dashboard ek screen mein */
@media (min-width: 1100px) and (min-height: 640px) {
  .app { grid-template-columns: 220px 1fr; }
  .view.wide { padding: 12px 18px; }
  .dash {
    height: calc(100vh - var(--top) - 24px); height: calc(100dvh - var(--top) - 24px);
    display: grid; grid-template-rows: auto auto minmax(0, 1.25fr) minmax(0, 1fr); gap: 10px;
  }
  .kpi-row { grid-template-columns: 1.5fr repeat(6, minmax(0, 1fr)); }
  .kpi-row .kpi.profit { grid-column: auto; }
  .kpi-row .kpi { padding: 10px 12px; }
  .kpi-row .kpi .val { font-size: clamp(15px, 1.4vw, 22px); white-space: nowrap; margin: 3px 0 0; }
  .kpi-row .kpi .lbl { font-size: 10.5px; }
  .kpi-row .kpi .hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
  .kpi::after { width: 60px; height: 60px; right: -18px; top: -18px; }
  .dash-mid { grid-template-columns: 2fr 1fr 1fr; min-height: 0; }
  .dash-mid .wide2 { grid-column: auto; }
  .dash-bot { grid-template-columns: repeat(3, minmax(0, 1fr)); min-height: 0; }
  .dash .card { padding: 12px 14px; display: flex; flex-direction: column; min-height: 0; }
  .dash .card h3 { margin-bottom: 6px; font-size: 14px; }
  .chart-card .chart-box { flex: 1; height: auto; min-height: 0; }
  .scroll-list { flex: 1; max-height: none; min-height: 0; }
  .dash .empty { padding: 14px 8px; }
}
@media (min-width: 901px) and (max-width: 1099px) { .app { grid-template-columns: 210px 1fr; } }

/* tablet / phone */
@media (max-width: 900px) {
  .topbar { padding: 0 12px; }
  .toolbar > div { flex: 1 1 140px; }
  .toolbar .grow { flex-basis: 100%; }
  .toolbar .spacer { display: none; }
  .toolbar .btn { flex: 1 1 auto; }
}

@media (max-width: 760px) {
  .table-wrap { border: 0; background: transparent; box-shadow: none; overflow: visible; border-radius: 0; }
  .rt, .rt tbody, .rt tfoot, .rt tr, .rt td { display: block; width: 100%; }
  .rt thead { display: none; }
  .rt tr { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; padding: 8px 12px; box-shadow: var(--shadow); }
  .rt tfoot tr { background: var(--surface-2); }
  .rt tbody tr:hover { background: var(--surface); }
  .rt td { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 5px 0; border: 0; text-align: right; white-space: normal; }
  .rt td::before { content: attr(data-label); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; flex: none; }
  .rt td > .v { text-align: right; min-width: 0; }
  .rt td.main { display: block; text-align: left; font-size: 15px; padding: 2px 0 8px; margin-bottom: 4px; border-bottom: 1px dashed var(--border); }
  .rt td.main::before { display: none; }
  .rt td.act { justify-content: flex-end; padding-top: 8px; }
  .rt td.act::before { display: none; }
  .rt td[colspan] { display: block; text-align: center; }
  .rt td[colspan]::before { display: none; }
  .rt .progress { width: 100%; }
  .rt td.num { white-space: normal; }
}

@media (max-width: 640px) {
  .view { padding: 12px 12px 70px; }
  .modal-bg { padding: 20px 0 0; }
  .modal { max-width: none; border-radius: 18px 18px 0 0; }
  .modal.narrow { max-width: none; }
  .modal-body { padding: 14px; }
  .modal-foot { padding: 12px 14px; }
  .modal-foot .btn { flex: 1 1 auto; text-align: center; }
  .gallery { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
  .gallery.big { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
  .albums-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .share-box .row { flex-wrap: wrap; }
  .share-box .row input { flex: 1 1 100%; }
  .top-actions .btn { padding: 7px 10px; font-size: 13px; }
  .chip b { font-size: 14px; }
  .dash-head input { width: 150px; }
  .day-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .row3 { grid-template-columns: 1fr; }
}

/* fixes after visual check */
.brand b { font-size: 17px; letter-spacing: .04em; white-space: nowrap; }
.brand small { font-size: 10px; letter-spacing: .1em; white-space: nowrap; }
.brand { gap: 8px; padding: 6px 4px 18px; }
@media (min-width: 1100px) and (min-height: 640px) {
  .kpi-row .kpi .val { font-size: clamp(13px, 1.08vw, 20px); letter-spacing: -.02em; }
  .kpi-row .kpi.profit .val { font-size: clamp(16px, 1.5vw, 24px); }
}
