/* BetonPro — iOS uslubidagi dizayn tizimi. Hamma panel shu sinflardan foydalanadi.
   Ranglar: ko'k — asosiy/ijobiy, olov (to'q sariq) — diqqat/yo'qotish. Qizil-yashil ishlatilmaydi. */
:root {
  --bg: #F2F2F7; --karta: #FFFFFF; --karta2: #F7F7FA;
  --matn: #1C1C1E; --ikkinchi: #6B6B70; --uchinchi: #A3A3AA;
  --chiziq: rgba(60, 60, 67, .13);
  --kok: #0062CC; --kok-och: rgba(0, 98, 204, .10);
  --olov: #B93A00; --olov-och: rgba(185, 58, 0, .10);
  --kul: #8E8E93; --kul-och: rgba(118, 118, 128, .12);
  --soya: 0 1px 2px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .05);
  --r: 16px; --r-k: 12px;
  --tez: cubic-bezier(.32, .72, 0, 1);
  --past: env(safe-area-inset-bottom, 0px); --tepa: env(safe-area-inset-top, 0px);
  --shrift: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000; --karta: #1C1C1E; --karta2: #2C2C2E;
    --matn: #FFFFFF; --ikkinchi: #A1A1A8; --uchinchi: #6B6B70;
    --chiziq: rgba(84, 84, 88, .55);
    --kok: #4DA3FF; --kok-och: rgba(77, 163, 255, .16);
    --olov: #FF8A4C; --olov-och: rgba(255, 138, 76, .16);
    --kul-och: rgba(118, 118, 128, .24);
    --soya: 0 0 0 1px rgba(255, 255, 255, .04);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--matn);
  font: 16px/1.35 var(--shrift); -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; text-align: inherit; }
a { color: var(--kok); text-decoration: none; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
svg.ik { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Karkas ---------- */
.ilova { min-height: 100%; display: flex; flex-direction: column; }
.ust {
  position: sticky; top: 0; z-index: 20; padding: calc(var(--tepa) + 10px) 16px 8px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  display: flex; align-items: center; gap: 10px;
}
.ust .joy { flex: 1; min-width: 0; }
.ust .kichik { font-size: 12px; color: var(--ikkinchi); font-weight: 600; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ust h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dumaloq {
  width: 38px; height: 38px; border-radius: 50%; background: var(--karta); box-shadow: var(--soya);
  display: grid; place-items: center; flex: none; color: var(--kok); font-weight: 700; font-size: 14px; position: relative;
  transition: transform .15s var(--tez);
}
.dumaloq:active { transform: scale(.92); }
.dumaloq .nuqta { position: absolute; top: 1px; right: 1px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--olov); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.mazmun { flex: 1; padding: 6px 16px calc(96px + var(--past)); max-width: 760px; width: 100%; margin: 0 auto; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around;
  padding: 6px 6px calc(6px + var(--past));
  background: color-mix(in srgb, var(--karta) 86%, transparent);
  backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px);
  border-top: .5px solid var(--chiziq);
}
.tabbar button { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 5px 2px; color: var(--kul); font-size: 10.5px; font-weight: 600; border-radius: 12px; transition: color .2s, transform .15s var(--tez); }
.tabbar button svg { width: 25px; height: 25px; }
.tabbar button.faol { color: var(--kok); }
.tabbar button:active { transform: scale(.9); }
.tabbar .panel-nom, .tabbar .ajrat { display: none; }

@media (min-width: 900px) {
  .ilova { padding-left: 248px; }
  .tabbar { top: 0; right: auto; width: 248px; flex-direction: column; justify-content: flex-start; gap: 2px; padding: 18px 12px; border-top: 0; border-right: .5px solid var(--chiziq); background: var(--karta); }
  .tabbar .panel-nom { display: block; font-size: 20px; font-weight: 800; letter-spacing: -.02em; padding: 4px 10px 14px; }
  .tabbar .panel-nom small { display: block; font-size: 12px; font-weight: 600; color: var(--ikkinchi); letter-spacing: 0; margin-top: 2px; }
  .tabbar button { flex: none; max-width: none; flex-direction: row; gap: 12px; padding: 10px; font-size: 15px; justify-content: flex-start; }
  .tabbar button.faol { background: var(--kok-och); }
  .mazmun { max-width: 1080px; padding: 6px 28px 48px; }
  .ust { padding: 22px 28px 10px; max-width: 1136px; width: 100%; margin: 0 auto; }
  .ikki { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; align-items: start; }
  .uch { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 20px; align-items: start; }
}

/* ---------- Bo'lim, karta, ro'yxat ---------- */
.bolim { margin-top: 22px; }
.bolim > .bn { display: flex; align-items: baseline; justify-content: space-between; padding: 0 4px 8px; gap: 10px; }
.bolim > .bn h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.bolim > .bn .kichik-nom { font-size: 13px; font-weight: 600; color: var(--ikkinchi); text-transform: uppercase; letter-spacing: .03em; }
.bolim > .bn button, .bolim > .bn a { font-size: 15px; color: var(--kok); font-weight: 500; white-space: nowrap; }
.karta { background: var(--karta); border-radius: var(--r); box-shadow: var(--soya); padding: 16px; position: relative; overflow: hidden; }
.karta + .karta { margin-top: 12px; }
.karta.bosiladi { display: block; width: 100%; transition: transform .18s var(--tez); }
.karta.bosiladi:active { transform: scale(.975); }
.karta.kok { background: linear-gradient(135deg, #0062CC, #0A84FF); color: #fff; box-shadow: 0 10px 28px rgba(0, 98, 204, .28); }
.karta.kok .ikkinchi, .karta.kok .kn { color: rgba(255, 255, 255, .78); }
.karta.olov { background: var(--olov-och); box-shadow: none; }
.kn { font-size: 13px; font-weight: 600; color: var(--ikkinchi); letter-spacing: .01em; }
.katta { font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; margin-top: 4px; }
.katta small, .orta small { font-size: .5em; font-weight: 600; letter-spacing: 0; margin-left: 4px; opacity: .75; }
.orta { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.ikkinchi { color: var(--ikkinchi); } .kichik { font-size: 13px; } .qalin { font-weight: 600; }
.kok-m { color: var(--kok); } .olov-m { color: var(--olov); }
.ong { text-align: right; } .orta-j { text-align: center; }

.royxat { background: var(--karta); border-radius: var(--r); box-shadow: var(--soya); overflow: hidden; }
.qator { display: flex; align-items: center; gap: 12px; padding: 12px 16px; width: 100%; position: relative; min-height: 52px; background: var(--karta); }
.qator + .qator::before { content: ''; position: absolute; top: 0; left: 16px; right: 0; height: .5px; background: var(--chiziq); }
.qator.ikonli + .qator.ikonli::before { left: 62px; }
button.qator { transition: background .15s; }
button.qator:active { background: var(--kul-och); }
.qator .q-ik { width: 34px; height: 34px; border-radius: 9px; background: var(--kok-och); color: var(--kok); display: grid; place-items: center; flex: none; font-weight: 700; font-size: 13px; }
.qator .q-ik.olov { background: var(--olov-och); color: var(--olov); }
.qator .q-ik.kul { background: var(--kul-och); color: var(--ikkinchi); }
.qator .q-ik svg { width: 19px; height: 19px; }
.qator .q-m { flex: 1; min-width: 0; }
.qator .q-s { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qator .q-t { font-size: 13px; color: var(--ikkinchi); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.qator .q-o { text-align: right; flex: none; max-width: 48%; }
.qator .q-o .q-s { font-weight: 600; }
.qator .strelka { color: var(--uchinchi); width: 16px; height: 16px; flex: none; }

.belgi { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--kul-och); color: var(--ikkinchi); white-space: nowrap; }
.belgi.kok { background: var(--kok-och); color: var(--kok); }
.belgi.olov { background: var(--olov-och); color: var(--olov); }
.belgi.tola { background: var(--kok); color: #fff; }

/* Metrikalar to'ri */
.tor { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tor .karta + .karta { margin-top: 0; }
.tor.uchta { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 900px) { .tor.kop { grid-template-columns: repeat(4, 1fr); } }
.metrika .qiymat { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-top: 4px; white-space: nowrap; }
.metrika .qiymat small { font-size: 12px; font-weight: 600; opacity: .7; margin-left: 3px; }
.metrika .tagi { font-size: 12px; margin-top: 4px; color: var(--ikkinchi); }

/* Progress va ustunlar */
.yol { height: 8px; border-radius: 4px; background: var(--kul-och); overflow: hidden; margin-top: 8px; }
.yol > i { display: block; height: 100%; width: 0; border-radius: 4px; background: var(--kok); transition: width .9s var(--tez); }
.yol > i.olov { background: var(--olov); }
.yol.ingichka { height: 5px; }

/* Segment */
.segment { display: flex; background: var(--kul-och); border-radius: 10px; padding: 2px; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.segment::-webkit-scrollbar { display: none; }
.segment button { flex: 1; padding: 7px 12px; border-radius: 8px; font-size: 13.5px; font-weight: 600; color: var(--matn); white-space: nowrap; text-align: center; transition: background .2s, box-shadow .2s; }
.segment button.faol { background: var(--karta); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); }
.chiplar { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chiplar::-webkit-scrollbar { display: none; }
.chip { padding: 7px 14px; border-radius: 999px; background: var(--karta); box-shadow: var(--soya); font-size: 14px; font-weight: 600; white-space: nowrap; color: var(--matn); }
.chip.faol { background: var(--kok); color: #fff; }

/* Tugmalar */
.tugma { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 50px; padding: 12px 18px; border-radius: 14px; background: var(--kok); color: #fff; font-size: 17px; font-weight: 600; text-align: center; transition: transform .15s var(--tez), opacity .2s; }
.tugma:active { transform: scale(.97); }
.tugma:disabled { opacity: .45; pointer-events: none; }
.tugma.ikkinchi-t { background: var(--kok-och); color: var(--kok); }
.tugma.olov { background: var(--olov); }
.tugma.olov-och { background: var(--olov-och); color: var(--olov); }
.tugma.kul { background: var(--kul-och); color: var(--matn); }
.tugma.kichik-t { min-height: 36px; padding: 6px 14px; font-size: 14px; border-radius: 10px; width: auto; }
.tugmalar { display: flex; gap: 10px; margin-top: 12px; }
.tugmalar > * { flex: 1; }
.suzuvchi { position: fixed; right: 18px; bottom: calc(84px + var(--past)); z-index: 25; width: 58px; height: 58px; border-radius: 50%; background: var(--kok); color: #fff; display: grid; place-items: center; box-shadow: 0 10px 26px rgba(0, 98, 204, .4); transition: transform .18s var(--tez); }
.suzuvchi:active { transform: scale(.9); }
.suzuvchi svg { width: 28px; height: 28px; }
@media (min-width: 900px) { .suzuvchi { bottom: 32px; right: 32px; } }

/* Forma */
.maydon { display: block; margin-top: 12px; }
.maydon > span { display: block; font-size: 13px; font-weight: 600; color: var(--ikkinchi); margin: 0 4px 5px; }
.maydon input, .maydon select, .maydon textarea, .kirit {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px; border: 1px solid transparent;
  background: var(--kul-och); font-size: 17px; outline: none; appearance: none; -webkit-appearance: none;
  transition: border-color .2s, background .2s;
}
.maydon textarea { min-height: 84px; resize: vertical; }
.maydon input:focus, .maydon select:focus, .maydon textarea:focus, .kirit:focus { border-color: var(--kok); background: var(--karta); }
.maydon .izoh { font-size: 12px; color: var(--ikkinchi); margin: 5px 4px 0; }
.maydon.xato input, .maydon.xato select { border-color: var(--olov); }
.qidiruv { position: relative; }
.qidiruv input { padding-left: 40px; }
.qidiruv svg { position: absolute; left: 12px; top: 13px; color: var(--kul); }
.almash { width: 51px; height: 31px; border-radius: 16px; background: var(--kul-och); position: relative; flex: none; transition: background .25s; }
.almash::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .25); transition: transform .25s var(--tez); }
.almash.yoq { background: var(--kok); }
.almash.yoq::after { transform: translateX(20px); }

/* Varaq (pastdan chiqadigan oyna) */
.parda { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .38); opacity: 0; transition: opacity .3s; display: flex; align-items: flex-end; justify-content: center; }
.parda.ochiq { opacity: 1; }
.varaq { width: 100%; max-width: 620px; max-height: 92vh; background: var(--bg); border-radius: 22px 22px 0 0; transform: translateY(100%); transition: transform .42s var(--tez); display: flex; flex-direction: column; padding-bottom: var(--past); }
.parda.ochiq .varaq { transform: none; }
.varaq .tutqich { width: 38px; height: 5px; border-radius: 3px; background: var(--uchinchi); margin: 8px auto 2px; flex: none; opacity: .6; }
.varaq .v-bosh { display: flex; align-items: center; padding: 8px 16px 10px; gap: 10px; flex: none; }
.varaq .v-bosh h3 { flex: 1; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.varaq .v-bosh button { color: var(--kok); font-size: 16px; font-weight: 600; }
.varaq .v-tana { overflow-y: auto; padding: 0 16px 18px; -webkit-overflow-scrolling: touch; }
@media (min-width: 900px) { .parda { align-items: center; } .varaq { border-radius: 22px; max-height: 86vh; transform: translateY(24px) scale(.97); opacity: 0; transition: transform .3s var(--tez), opacity .25s; } .parda.ochiq .varaq { opacity: 1; } .varaq .tutqich { display: none; } .varaq .v-bosh { padding-top: 18px; } }

/* Ichki sahifa (o'ngdan kiradi) */
.sahifa { position: fixed; inset: 0; z-index: 40; background: var(--bg); transform: translateX(100%); transition: transform .4s var(--tez); display: flex; flex-direction: column; overflow-y: auto; }
.sahifa.ochiq { transform: none; }
.sahifa .ust h1 { font-size: 19px; font-weight: 700; text-align: center; }
.sahifa .orqaga { color: var(--kok); display: flex; align-items: center; font-size: 17px; min-width: 70px; }
.sahifa .orqaga svg { width: 24px; height: 24px; margin-left: -6px; }
.sahifa .ust .ong-joy { min-width: 70px; display: flex; justify-content: flex-end; color: var(--kok); font-weight: 600; }
.sahifa .mazmun { padding-bottom: calc(32px + var(--past)); }
@media (min-width: 900px) { .sahifa { left: 248px; } }

/* Xabar */
.xabar { position: fixed; left: 50%; top: calc(var(--tepa) + 12px); z-index: 90; transform: translate(-50%, -150%); background: var(--matn); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-size: 15px; font-weight: 600; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); transition: transform .45s var(--tez); max-width: calc(100% - 32px); text-align: center; }
.xabar.ochiq { transform: translate(-50%, 0); }
.xabar.olov { background: var(--olov); color: #fff; }

/* Bo'sh holat, yuklanish */
.bosh { text-align: center; padding: 36px 20px; color: var(--ikkinchi); }
.bosh svg { width: 44px; height: 44px; color: var(--uchinchi); margin-bottom: 8px; stroke-width: 1.4; }
.bosh b { display: block; color: var(--matn); font-size: 17px; margin-bottom: 4px; }
.suyak { border-radius: var(--r); height: 92px; margin-top: 12px; background: linear-gradient(90deg, var(--kul-och) 25%, transparent 50%, var(--kul-och) 75%); background-size: 200% 100%; animation: suyak 1.3s linear infinite; }
@keyframes suyak { to { background-position: -200% 0; } }

/* Jonlanish */
.kir > * { animation: kir .5s var(--tez) both; }
.kir > *:nth-child(2) { animation-delay: .04s; } .kir > *:nth-child(3) { animation-delay: .08s; }
.kir > *:nth-child(4) { animation-delay: .12s; } .kir > *:nth-child(5) { animation-delay: .16s; }
.kir > *:nth-child(n+6) { animation-delay: .2s; }
@keyframes kir { from { opacity: 0; transform: translateY(14px); } }
.puls { animation: puls 1.8s ease-in-out infinite; }
@keyframes puls { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Diagramma */
.diagramma { width: 100%; display: block; overflow: visible; }
.diagramma text { font: 600 10px var(--shrift); fill: var(--ikkinchi); }
.diagramma .ustun { fill: var(--kok); transform-origin: bottom; transform-box: fill-box; animation: os .8s var(--tez) both; }
.diagramma .ustun.olov { fill: var(--olov); } .diagramma .ustun.och { fill: var(--kok-och); } .diagramma .ustun.tanlangan { fill: var(--kok); }
@keyframes os { from { transform: scaleY(0); } }
.diagramma .chiziq { fill: none; stroke: var(--kok); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 1; animation: chiz 1.2s var(--tez) forwards; }
.diagramma .chiziq.olov { stroke: var(--olov); } .diagramma .chiziq.uzuq { stroke-dasharray: 4 5; animation: none; stroke-dashoffset: 0; opacity: .7; }
@keyframes chiz { to { stroke-dashoffset: 0; } }
.diagramma .maydon-t { fill: var(--kok-och); opacity: .7; }
.halqa { transform: rotate(-90deg); }
.halqa circle { fill: none; stroke-width: 10; stroke-linecap: round; }
.halqa .iz { stroke: var(--kul-och); }
.halqa .tola { stroke: var(--kok); transition: stroke-dashoffset 1.1s var(--tez); }
.halqa .tola.olov { stroke: var(--olov); }

/* Jadval (kompyuterda va sverkada) */
.jadval-o { overflow-x: auto; border-radius: var(--r); background: var(--karta); box-shadow: var(--soya); }
table.jadval { width: 100%; border-collapse: collapse; font-size: 14px; }
.jadval th { text-align: left; font-size: 12px; font-weight: 600; color: var(--ikkinchi); text-transform: uppercase; letter-spacing: .03em; padding: 10px 14px; white-space: nowrap; border-bottom: .5px solid var(--chiziq); }
.jadval td { padding: 10px 14px; border-bottom: .5px solid var(--chiziq); vertical-align: top; }
.jadval tr:last-child td { border-bottom: 0; }
.jadval .son { text-align: right; white-space: nowrap; }
.jadval tfoot td { font-weight: 700; background: var(--karta2); }

/* Yo'l-yo'riq chizig'i (bosqichlar) */
.bosqich { display: flex; gap: 4px; margin-top: 10px; }
.bosqich i { flex: 1; height: 5px; border-radius: 3px; background: var(--kul-och); }
.bosqich i.otdi { background: var(--kok); } .bosqich i.hozir { background: var(--kok); animation: puls 1.6s infinite; }

/* Hisob varag'i (oylik: nima uchun) */
.hisob-q { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 15px; }
.hisob-q + .hisob-q { border-top: .5px solid var(--chiziq); }
.hisob-q .sabab { font-size: 12.5px; color: var(--ikkinchi); display: block; margin-top: 1px; }
.hisob-q b { white-space: nowrap; }
.hisob-q.jami { font-weight: 700; font-size: 17px; border-top: 1.5px solid var(--matn); margin-top: 4px; }

/* Imzo maydoni */
.imzo-m { background: #fff; border-radius: 14px; border: 1.5px dashed var(--uchinchi); height: 200px; width: 100%; touch-action: none; display: block; }

@media print {
  .tabbar, .ust, .suzuvchi, .chopsiz { display: none !important; }
  body { background: #fff; } .ilova { padding: 0; } .karta, .royxat, .jadval-o { box-shadow: none; }
}
