/* Abdulloh Stroy Console — Apple uslubi (shrift, ranglar, yumaloq kartalar) + Firebase konsoli tuzilishi (chap menyu, mahsulot oynalari) */
:root {
  --bg: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fbfbfd;
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --blue-soft: #e8f2fd;
  --green: #1d8b3a;
  --green-soft: #e3f5e8;
  --red: #d70015;
  --red-soft: #fde8ea;
  --orange: #c25e00;
  --orange-soft: #fdf0e1;
  --glass: rgba(251, 251, 253, 0.8);
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 18px;
  --r-sm: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #161617;
    --text: #f5f5f7;
    --text-2: #a1a1a6;
    --text-3: #86868b;
    --line: #424245;
    --line-soft: #2c2c2e;
    --blue: #2997ff;
    --blue-hover: #47a6ff;
    --blue-soft: #0b2a4a;
    --green: #30d158;
    --green-soft: #0f2e18;
    --red: #ff453a;
    --red-soft: #3a1210;
    --orange: #ff9f0a;
    --orange-soft: #3a2608;
    --glass: rgba(22, 22, 23, 0.8);
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text); font-family: var(--font);
  font-size: 15px; line-height: 1.47; letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* ---------- Layout ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100%; }
.side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--surface-2); border-right: 1px solid var(--line-soft);
  padding: 18px 12px 24px; display: flex; flex-direction: column; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand b { font-size: 15px; font-weight: 600; display: block; line-height: 1.2; }
.brand small { color: var(--text-3); font-size: 12px; }
.nav { display: grid; gap: 2px; }
.nav h6 { margin: 0 0 4px; padding: 0 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); }
.nav a {
  display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-radius: 8px;
  color: var(--text); font-size: 14px; text-decoration: none;
}
.nav a svg { width: 18px; height: 18px; flex: none; color: var(--text-2); }
.nav a:hover { background: var(--line-soft); }
.nav a.on { background: var(--blue-soft); color: var(--blue); font-weight: 600; }
.nav a.on svg { color: var(--blue); }
.nav a.soon { color: var(--text-3); pointer-events: none; }
.nav a.soon svg { color: var(--text-3); }
.nav a .badge { margin-left: auto; font-size: 10px; font-weight: 600; color: var(--text-3); border: 1px solid var(--line); border-radius: 999px; padding: 0 6px; white-space: nowrap; }
.side .grow { flex: 1; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 52px;
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--line-soft);
}
.crumbs { font-size: 13px; color: var(--text-2); display: flex; gap: 6px; align-items: center; min-width: 0; }
.crumbs b { color: var(--text); font-weight: 600; }
.topbar .spacer { flex: 1; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); }
.status-dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.status-dot.down::before { background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #5e5ce6, #0071e3); color: #fff; font-size: 13px; font-weight: 600;
}
.menu-btn { display: none; }

.page { padding: 36px 28px 80px; max-width: 1180px; width: 100%; margin: 0 auto; display: grid; gap: 28px; }
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head > div { flex: 1; min-width: 240px; }
.eyebrow { font-size: 13px; font-weight: 600; color: var(--orange); margin: 0 0 4px; }
h1 { font-size: 40px; line-height: 1.1; font-weight: 700; letter-spacing: -0.025em; margin: 0; }
h2 { font-size: 21px; line-height: 1.2; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
h3 { font-size: 15px; font-weight: 600; margin: 0; }
.sub { color: var(--text-2); font-size: 17px; margin: 6px 0 0; max-width: 62ch; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 18px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--blue); color: #fff; font-size: 14px; font-weight: 500; white-space: nowrap;
}
.btn:hover { background: var(--blue-hover); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.ghost { background: transparent; color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.btn.ghost:hover { background: var(--blue-soft); }
.btn.plain { background: var(--line-soft); color: var(--text); }
.btn.plain:hover { background: var(--line); }
.btn.danger { background: var(--red); }
.btn.danger.ghost { background: transparent; color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.btn.sm { height: 30px; padding: 0 14px; font-size: 13px; }
.link-btn { background: none; border: 0; color: var(--blue); cursor: pointer; padding: 0; font-size: 14px; }
.link-btn:hover { text-decoration: underline; }
.link-btn.red { color: var(--red); }

.field { display: grid; gap: 6px; }
.field label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.input, select.input {
  height: 44px; padding: 0 14px; border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); width: 100%; min-width: 0;
}
.input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px color-mix(in srgb, var(--blue) 18%, transparent); }
.input.sm { height: 36px; border-radius: 10px; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 380px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }
.search .input { padding-left: 36px; height: 36px; border-radius: 10px; background: var(--line-soft); border-color: transparent; }
.search .input:focus { background: var(--surface); }

.segmented { display: inline-flex; background: var(--line-soft); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented a, .segmented button {
  border: 0; background: transparent; padding: 6px 16px; border-radius: 8px; font-size: 13px; font-weight: 500;
  color: var(--text); cursor: pointer; text-decoration: none;
}
.segmented .on { background: var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12); }

.switch { position: relative; width: 51px; height: 31px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; position: absolute; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--line); transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.25); transition: transform .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--blue) 55%, transparent); outline-offset: 2px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 24px; min-width: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 20px 24px; border-bottom: 1px solid var(--line-soft); }
.card-head h2 { flex: 1; font-size: 17px; }
.grid { display: grid; gap: 20px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.stat { display: grid; gap: 4px; }
.stat .label { font-size: 13px; color: var(--text-2); font-weight: 500; }
.stat .value { font-size: 34px; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat .hint { font-size: 13px; color: var(--text-3); }
.stat .hint.up { color: var(--green); }

.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.red { background: var(--red-soft); color: var(--red); }
.pill.orange { background: var(--orange-soft); color: var(--orange); }
.pill.gray { background: var(--line-soft); color: var(--text-2); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-2); padding: 10px 24px; background: var(--surface-2); border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
td { padding: 13px 24px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover td { background: var(--surface-2); }
.empty { padding: 56px 24px; text-align: center; color: var(--text-2); display: grid; gap: 8px; justify-items: center; }
.empty svg { width: 44px; height: 44px; color: var(--text-3); }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 12px 24px; font-size: 13px; color: var(--text-2); border-top: 1px solid var(--line-soft); }

/* ---------- Chart ---------- */
.chart { width: 100%; height: 200px; display: block; }
.chart .bar { fill: var(--blue); }
.chart .bar.today { fill: var(--orange); }
.chart .grid-line { stroke: var(--line-soft); stroke-width: 1; }
.chart text { fill: var(--text-3); font-size: 11px; font-family: var(--font); }

/* ---------- Activity list ---------- */
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: grid; grid-template-columns: 32px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.feed li:last-child { border-bottom: 0; }
.feed .ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--line-soft); color: var(--text-2); }
.feed .ic svg { width: 16px; height: 16px; }
.feed .ic.blue { background: var(--blue-soft); color: var(--blue); }
.feed .ic.red { background: var(--red-soft); color: var(--red); }
.feed .ic.green { background: var(--green-soft); color: var(--green); }
.feed time { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.feed .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Settings rows (iOS Settings kabi) ---------- */
.rows { display: grid; }
.row { display: flex; align-items: center; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.row:last-child { border-bottom: 0; }
.row > div:first-child { flex: 1; min-width: 200px; }
.row .t { font-weight: 500; }
.row .d { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.row .input { width: 110px; height: 36px; text-align: right; }
.method { display: flex; gap: 14px; align-items: center; }
.method .ic { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--green-soft); color: var(--green); flex: none; }
.method .ic svg { width: 22px; height: 22px; }

/* ---------- Drawer / Sheet ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.32); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .2s; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 51; width: min(520px, 100%);
  background: var(--surface); box-shadow: var(--shadow-lg); overflow-y: auto; animation: slide .28s cubic-bezier(.2,.8,.2,1);
  padding: 0 0 40px; display: flex; flex-direction: column;
}
.drawer-head { position: sticky; top: 0; background: var(--glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); padding: 16px 24px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line-soft); z-index: 1; }
.drawer-head h2 { flex: 1; font-size: 17px; }
.drawer section { padding: 20px 24px; display: grid; gap: 14px; border-bottom: 1px solid var(--line-soft); }
.drawer section:last-child { border-bottom: 0; }
.close { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--line-soft); color: var(--text-2); cursor: pointer; display: grid; place-items: center; }
.close svg { width: 14px; height: 14px; }
.sheet {
  position: fixed; z-index: 51; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(440px, calc(100% - 32px)); background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-lg);
  padding: 28px; display: grid; gap: 18px; animation: pop .22s cubic-bezier(.2,.8,.2,1);
}
.sheet h2 { font-size: 21px; }
.sheet .actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.error-text { color: var(--red); font-size: 13px; min-height: 18px; }
.person { display: flex; gap: 14px; align-items: center; }
.person .big-avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg, #a1a1a6, #6e6e73); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 600; flex: none; }

#toast {
  position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 11px 20px; border-radius: 999px; font-size: 14px; font-weight: 500;
  opacity: 0; pointer-events: none; transition: all .25s; z-index: 100; box-shadow: var(--shadow-lg); max-width: calc(100% - 32px);
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.err { background: var(--red); color: #fff; }

/* ---------- Login (Apple ID uslubida) ---------- */
.login { min-height: 100%; display: grid; place-items: center; padding: 40px 16px; }
.login-card { width: min(400px, 100%); display: grid; gap: 22px; text-align: center; }
.login-card img { width: 72px; height: 72px; border-radius: 18px; margin: 0 auto; box-shadow: var(--shadow); }
.login-card h1 { font-size: 32px; }
.login-card form { display: grid; gap: 12px; text-align: left; }
.login-card .input { height: 52px; font-size: 17px; }
.login-card .btn { height: 48px; font-size: 16px; margin-top: 6px; }
.login-card .foot { font-size: 12px; color: var(--text-3); }

.skeleton { background: linear-gradient(90deg, var(--line-soft), var(--surface-2), var(--line-soft)); background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: 8px; height: 16px; }

@keyframes fade { from { opacity: 0; } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
@keyframes pop { from { transform: translate(-50%, -48%) scale(.96); opacity: 0; } }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Phone ---------- */
@media (max-width: 1000px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; z-index: 60; width: 270px; transform: translateX(-100%); transition: transform .25s; box-shadow: var(--shadow-lg); }
  .shell.nav-open .side { transform: none; }
  .menu-btn { display: grid; place-items: center; width: 32px; height: 32px; border: 0; background: none; color: var(--text); cursor: pointer; margin-left: -6px; }
  .menu-btn svg { width: 20px; height: 20px; }
  .topbar { padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
  .page { padding: 24px max(16px, env(safe-area-inset-right, 0px)) 64px max(16px, env(safe-area-inset-left, 0px)); }
  h1 { font-size: 32px; }
  th, td { padding-left: 16px; padding-right: 16px; }
  .card-head, .row, .drawer section { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 480px) {
  .g4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card { padding: 18px; }
  .stat .value { font-size: 28px; }
  .status-dot span { display: none; }
}

/* ---------- 2-bosqich: brendlar, firmalar ---------- */
.brands { display: inline-flex; gap: 4px; }
.brand-ic { width: 22px; height: 22px; border-radius: 6px; display: inline-grid; place-items: center; background: var(--line-soft); color: var(--text); flex: none; }
.brand-ic svg { width: 13px; height: 13px; }
.brand-ic.phone { color: var(--green); background: var(--green-soft); }
.brand-ic.big { width: 40px; height: 40px; border-radius: 10px; }
.brand-ic.big svg { width: 22px; height: 22px; }
.feed .ic.brand-ic svg { width: 16px; height: 16px; }
.firm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.firm-card { display: grid; gap: 14px; color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.firm-card:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.firm-card .top { display: flex; gap: 12px; align-items: center; }
.firm-logo { width: 44px; height: 44px; border-radius: 12px; background: linear-gradient(135deg, #1d1d1f, #48484a); color: #f5f5f7; display: grid; place-items: center; font-weight: 700; font-size: 16px; flex: none; }
.firm-card .meta { display: flex; gap: 16px; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.firm-card .meta b { color: var(--text); font-variant-numeric: tabular-nums; }
.back { font-size: 14px; display: inline-flex; align-items: center; gap: 4px; }
select.inline { height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); padding: 0 8px; font-size: 13px; }
tr.left td { opacity: .55; }
.method .ic.brand-ic { background: var(--line-soft); color: var(--text); }
.method .ic.brand-ic.phone { background: var(--green-soft); color: var(--green); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g5 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) { .g5 { grid-template-columns: 1fr 1fr; gap: 12px; } }
.segmented#sf-days button { padding: 6px 12px; }
.compact th, .compact td { padding-left: 14px; padding-right: 14px; }
/* ---------- 4-bosqich: fayllar ---------- */
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; padding: 20px 24px; }
.file { display: grid; gap: 8px; align-content: start; min-width: 0; }
.thumb { aspect-ratio: 1; max-width: 100%; width: 100%; border-radius: 14px; overflow: hidden; border: 0; padding: 0; background: var(--line-soft); cursor: zoom-in; display: grid; place-items: center; color: var(--text-2); text-decoration: none; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.icon { cursor: pointer; gap: 4px; align-content: center; }
.thumb.icon svg { width: 34px; height: 34px; }
.file-meta { display: grid; gap: 1px; min-width: 0; }
.file-meta b, .file-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .link-btn { justify-self: start; font-size: 13px; }
.tcell { display: inline-flex; align-items: center; gap: 8px; }
.selfie { width: 30px; height: 30px; border-radius: 50%; overflow: hidden; border: 0; padding: 0; cursor: zoom-in; flex: none; background: var(--line-soft); }
.selfie img { width: 100%; height: 100%; object-fit: cover; display: block; }
.danger-zone { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; box-shadow: none; border: 1px solid color-mix(in srgb, var(--red) 35%, transparent); }
@media (max-width: 820px) { .file-grid { padding: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

/* Moliya: jami qatori */
tr.total td { background: var(--line-soft); border-top: 1px solid var(--line); }
.money-stats .stat .value { font-size: 26px; white-space: nowrap; }
@media (max-width: 1100px) { .money-stats .stat .value { font-size: 22px; } }
@media (max-width: 640px) { .money-stats .stat .value { font-size: 19px; white-space: normal; } }

/* Chat */
.grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chat-split { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.rooms { max-height: 640px; overflow: auto; }
.room { display: flex; gap: 12px; align-items: center; width: 100%; padding: 12px 20px; border: 0; background: none; text-align: left; cursor: pointer; border-top: 1px solid var(--line-soft); color: inherit; font: inherit; }
.room:hover { background: var(--line-soft); }
.room.on { background: var(--blue-soft, rgba(0,113,227,.08)); }
.room-t { display: grid; gap: 2px; flex: 1; min-width: 0; }
.room-t b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.room-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--line-soft); }
.room-ic svg { width: 18px; height: 18px; }
.room-ic.blue { color: var(--blue); } .room-ic.green { color: var(--green); } .room-ic.gray { color: var(--text-2); }
.msg-list { max-height: 560px; overflow: auto; padding: 8px 0; }
.msg { display: flex; gap: 12px; padding: 10px 24px; align-items: flex-start; }
.msg:hover { background: var(--line-soft); }
.msg.deleted .msg-text { text-decoration: line-through; color: var(--text-3); }
.msg-body { flex: 1; min-width: 0; display: grid; gap: 4px; }
.msg-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.msg-text { white-space: pre-wrap; word-break: break-word; }
.msg-reply { border-left: 3px solid var(--blue); padding: 2px 10px; font-size: 13px; color: var(--text-2); }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font-weight: 600; }
.selfie.big img { width: 220px; height: auto; max-height: 220px; object-fit: cover; border-radius: 12px; }
.selfie.big { width: auto; height: auto; }
@media (max-width: 900px) { .chat-split { grid-template-columns: minmax(0, 1fr); } .rooms { max-height: 320px; } .grid.g3 { grid-template-columns: minmax(0, 1fr); } }
.selfie.big { border-radius: 12px; }
.selfie.big { justify-self: start; width: fit-content; background: none; }

/* ---------- Bildirishnomalar ---------- */
th.r, td.r { text-align: right; }
.red-text { color: var(--red); }
.danger-text { color: var(--red) !important; }
td.ellipsis { max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
td.nowrap { white-space: nowrap; }
.push-mode { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.push-mode .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--orange-soft); color: var(--orange); flex: none; }
.push-mode.on .ic { background: var(--green-soft); color: var(--green); }
.push-mode .ic svg { width: 22px; height: 22px; }
.casts { list-style: none; margin: 0; padding: 0; }
.casts li { display: flex; align-items: center; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--line-soft); }
.casts li:last-child { border-bottom: 0; }
.casts .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--blue-soft); color: var(--blue); flex: none; }
.casts .ic svg { width: 18px; height: 18px; }
.c-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.c-main > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.c-num { display: grid; text-align: right; min-width: 64px; }
.c-num b { font-size: 17px; font-variant-numeric: tabular-nums; }
.c-num span { font-size: 12px; color: var(--text-2); }
.steps { margin: -6px 0 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); }
.drop { display: flex; align-items: center; gap: 12px; padding: 18px; border: 1.5px dashed var(--line); border-radius: 14px; cursor: pointer; color: var(--text-2); }
.drop:hover { border-color: var(--blue); color: var(--blue); }
.drop svg { width: 22px; height: 22px; }
.phone-preview { background: var(--surface-2); border-radius: 18px; padding: 12px 14px; display: grid; gap: 2px; font-size: 14px; box-shadow: inset 0 0 0 1px var(--line-soft); }
.phone-preview b, .phone-preview span:last-child { overflow-wrap: anywhere; }
.pp-app { display: flex; align-items: center; gap: 6px; font-size: 11px; letter-spacing: .04em; color: var(--text-2); margin-bottom: 4px; }
.pp-app time { margin-left: auto; letter-spacing: 0; }
.pp-logo { width: 18px; height: 18px; border-radius: 5px; background: var(--text); color: var(--surface); font-size: 8px; font-weight: 700; display: grid; place-items: center; letter-spacing: 0; }
@media (max-width: 640px) {
  .casts li { flex-wrap: wrap; }
  .c-main { flex-basis: calc(100% - 52px); }
  .c-num { text-align: left; }
}

/* ---------- Yuzni tanish ---------- */
.fm { width: 100%; } .fm button { flex: 1; }
.flags, .frefs { display: grid; gap: 10px; }
.flag, .fref { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 14px; background: var(--surface-2); flex-wrap: wrap; }
.flag .pair { display: flex; gap: 6px; }
.flag .pair img, .flag .noimg { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; background: var(--line-soft); display: grid; place-items: center; font-size: 11px; color: var(--text-2); text-align: center; }
.fmeta { display: grid; gap: 4px; flex: 1; min-width: 150px; justify-items: start; }
.fref .fav { width: 40px; height: 40px; border-radius: 50%; overflow: hidden; background: var(--line-soft); display: grid; place-items: center; font-weight: 600; font-size: 13px; color: var(--text-2); flex: none; }
.fref .fav img { width: 100%; height: 100%; object-fit: cover; }
label.btn { cursor: pointer; }
.fstats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.fstats > div { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.fstats b { font-size: 22px; font-variant-numeric: tabular-nums; }
@media (max-width: 520px) { .fstats { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Telegram bot ---------- */
.reply-bar { display: flex; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line-soft); }
.reply-bar .input { flex: 1; }
.msg.out .msg-text { color: var(--blue); }
.notice { background: var(--orange-soft); color: var(--text); border-radius: 12px; padding: 10px 14px; }

/* ---------- Ma'lumotlar oynasi ---------- */
.dbx { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 20px; align-items: start; }
.dbx-side { padding: 8px 0 12px; position: sticky; top: 76px; max-height: calc(100vh - 100px); overflow: auto; }
.dbx-side h6 { margin: 14px 16px 4px; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.dbx-side a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 16px; font-size: 13.5px; font-family: var(--mono); color: var(--text); }
.dbx-side a small { color: var(--text-3); font-family: inherit; }
.dbx-side a:hover { background: var(--surface-2); }
.dbx-side a.on { background: color-mix(in srgb, var(--blue) 12%, transparent); color: var(--blue); font-weight: 600; }
table.dbt th, table.dbt td { padding: 10px 14px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.th-btn { all: unset; cursor: pointer; display: grid; gap: 1px; font-weight: 600; font-size: 12px; }
.th-btn:disabled { cursor: default; }
.th-btn small { font-weight: 400; color: var(--text-3); font-size: 11px; }
a.fk { color: var(--blue); font-family: var(--mono); font-size: 13px; }
.chip { all: unset; cursor: pointer; padding: 3px 10px; border-radius: 999px; background: var(--line-soft); font-size: 12px; font-family: var(--mono); }
.dbform { display: grid; gap: 12px; max-height: 58vh; overflow: auto; padding: 2px; }
.dbform .ro { padding: 8px 12px; border-radius: 10px; background: var(--line-soft); word-break: break-all; font-size: 13px; }
.dbform textarea.input { height: auto; padding-top: 10px; resize: vertical; }
@media (max-width: 860px) { .dbx { grid-template-columns: 1fr; } .dbx-side { position: static; max-height: 220px; } }

/* ---------- Til tanlagich ---------- */
select.lang { width: auto; padding-right: 28px; font-size: 13px; }
.login-lang { position: fixed; top: 16px; right: 16px; z-index: 5; }
