/* Davomat paneli — Bitrix24 uslubidagi ish stoli.
   Ranglar bitta joyda: brendni o'zgartirsangiz shu blokni tahrirlang. */

:root {
  --asos:        #0b8ee8;   /* asosiy ko'k */
  --asos-quyuq:  #0a6fb5;
  --yon-fon:     #1e2a3a;   /* chap panel */
  --yon-tanla:   #2b3b52;
  --fon:         #eef1f6;
  --karta:       #ffffff;
  --matn:        #1b2430;
  --matn-och:    #6b7b8f;
  --chiziq:      #dde3ec;
  --yashil:      #1faa5f;
  --sariq:       #e2a03f;
  --qizil:       #e04b4b;
  --radius:      10px;
  --soya:        0 1px 3px rgba(16, 30, 54, .08), 0 6px 20px rgba(16, 30, 54, .05);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--fon);
  color: var(--matn);
  font: 15px/1.5 -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--asos); text-decoration: none; }
h1, h2, h3 { margin: 0 0 4px; font-weight: 600; line-height: 1.25; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }

/* ---------- Umumiy karkas ---------- */

.qobiq { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }

.yon {
  background: var(--yon-fon);
  color: #cfd8e5;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.yon__nom {
  padding: 18px 20px;
  font-size: 17px;
  font-weight: 600;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  display: flex;
  align-items: center;
  gap: 10px;
}

.yon__nom span { font-size: 22px; }

.yon nav { padding: 10px 8px; flex: 1; overflow-y: auto; }

.yon nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  margin-bottom: 2px;
  border-radius: 8px;
  color: #cfd8e5;
  font-size: 14.5px;
  transition: background .12s, color .12s;
}

.yon nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.yon nav a.tanlangan { background: var(--yon-tanla); color: #fff; font-weight: 500; }
.yon nav a i { font-style: normal; width: 20px; text-align: center; font-size: 16px; }

.yon__pastki {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: 13px;
  color: #93a3b8;
}

.yon__pastki button {
  background: none;
  border: 0;
  color: #93a3b8;
  cursor: pointer;
  padding: 6px 0 0;
  font-size: 13px;
}
.yon__pastki button:hover { color: #fff; }

.asosiy { display: flex; flex-direction: column; min-width: 0; }

.tepa {
  background: #fff;
  border-bottom: 1px solid var(--chiziq);
  padding: 14px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.tepa__izoh { color: var(--matn-och); font-size: 13.5px; }
.maydon { padding: 22px 26px 40px; }

/* ---------- Kartalar ---------- */

.karta {
  background: var(--karta);
  border: 1px solid var(--chiziq);
  border-radius: var(--radius);
  box-shadow: var(--soya);
  margin-bottom: 18px;
  overflow: hidden;
}

.karta__bosh {
  padding: 14px 18px;
  border-bottom: 1px solid var(--chiziq);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.karta__ich { padding: 18px; }

.plitkalar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.plitka {
  background: var(--karta);
  border: 1px solid var(--chiziq);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--soya);
}

.plitka b { display: block; font-size: 30px; font-weight: 600; line-height: 1.15; }
.plitka span { color: var(--matn-och); font-size: 13px; }
.plitka--yashil b { color: var(--yashil); }
.plitka--sariq b { color: var(--sariq); }
.plitka--qizil b { color: var(--qizil); }
.plitka--kok b { color: var(--asos); }

/* ---------- Jadval ---------- */

.jadval-oyna { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }

th {
  text-align: left;
  padding: 11px 14px;
  background: #f7f9fc;
  color: var(--matn-och);
  font-weight: 600;
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: .03em;
  border-bottom: 1px solid var(--chiziq);
  white-space: nowrap;
}

td { padding: 11px 14px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
tbody tr:hover { background: #fafbfd; }
tbody tr:last-child td { border-bottom: 0; }
td.son, th.son { text-align: right; font-variant-numeric: tabular-nums; }

.bosh-harf {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--asos);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  margin-right: 9px;
  flex: 0 0 auto;
}

.odam { display: flex; align-items: center; gap: 7px; }
.bosh-harf.sonik { background: var(--matn-och); }

/* ---------- Belgilar ---------- */

.belgi {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
}

.belgi--keldi     { background: #e3f6ec; color: #147a45; }
.belgi--ichkarida { background: #e2f0fd; color: #0a6fb5; }
.belgi--kech      { background: #fdf1de; color: #a5701c; }
.belgi--kelmadi   { background: #fdeaea; color: #b93636; }
/* Taxminiy — chiqish yozilmagan, standart kun qabul qilingan. Rangi
   ataylab betaraf: bu na yaxshi, na yomon holat, lekin u O'LCHOV EMAS
   va shuni ko'rib turish kerak. */
.belgi--taxminiy  { background: #eef1f6; color: #5a6b80; border: 1px dashed #b6c2d2; }
.belgi--tatil, .belgi--kasallik, .belgi--ruxsat, .belgi--komandirovka {
  background: #eee9fb; color: #5b41a8;
}
.belgi--kulrang   { background: #eef1f6; color: var(--matn-och); }

/* ---------- Tugmalar va formalar ---------- */

.tugma {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border: 1px solid var(--chiziq);
  background: #fff;
  color: var(--matn);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}

.tugma:hover { background: #f5f7fa; }
.tugma:disabled { opacity: .55; cursor: not-allowed; }
.tugma--asosiy { background: var(--asos); border-color: var(--asos); color: #fff; }
.tugma--asosiy:hover { background: var(--asos-quyuq); border-color: var(--asos-quyuq); }
.tugma--xavf { color: var(--qizil); border-color: #f3c9c9; }
.tugma--xavf:hover { background: #fdeaea; }
.tugma--kichik { padding: 6px 11px; font-size: 13px; }

label { display: block; font-size: 13px; color: var(--matn-och); margin-bottom: 5px; }

input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--chiziq);
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--matn);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--asos);
  box-shadow: 0 0 0 3px rgba(11, 142, 232, .13);
}

.maydonchalar { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.qator { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.qator > div { flex: 1 1 150px; }

/* ---------- Modal ---------- */

.oyna {
  position: fixed;
  inset: 0;
  background: rgba(16, 26, 40, .55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.oyna.ochiq { display: flex; }

.oyna__quti {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(10, 20, 40, .3);
}

.oyna__bosh {
  padding: 16px 20px;
  border-bottom: 1px solid var(--chiziq);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.oyna__ich { padding: 20px; }
.oyna__past { padding: 14px 20px; border-top: 1px solid var(--chiziq); display: flex; gap: 10px; justify-content: flex-end; }
.yopish { background: none; border: 0; font-size: 24px; line-height: 1; cursor: pointer; color: var(--matn-och); }

/* ---------- Xabarlar ---------- */

.xabarlar { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }

.xabar {
  background: #1e2a3a;
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(10, 20, 40, .28);
  font-size: 14px;
  max-width: 380px;
  animation: kirish .18s ease-out;
}

.xabar--xato { background: var(--qizil); }
.xabar--yaxshi { background: var(--yashil); }

@keyframes kirish { from { opacity: 0; transform: translateY(8px); } }

.bosh { text-align: center; padding: 40px 20px; color: var(--matn-och); }
.izoh { color: var(--matn-och); font-size: 13px; }
.kichik { font-size: 12.5px; color: var(--matn-och); }

/* ---------- Kirish sahifasi ---------- */

.kirish-sahifa {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(150deg, #1e2a3a, #0b4d7a);
  padding: 20px;
}

.kirish-quti {
  background: #fff;
  border-radius: 14px;
  padding: 32px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
}

.kirish-quti h1 { text-align: center; margin-bottom: 6px; }
.kirish-quti p.izoh { text-align: center; margin: 0 0 22px; }
.kirish-quti .maydon-blok { margin-bottom: 14px; }
.kirish-quti .tugma { width: 100%; justify-content: center; margin-top: 6px; }

/* ---------- Terminal (kiosk) ----------
   Kamera butun ekranni egallaydi, qolgan hamma narsa uning USTIDA
   turadi. Shu sababli har bir yozuv o'z foni bilan keladi: tasvir
   ochiq ham, qorong'i ham bo'lishi mumkin, matn ikkalasida ham
   o'qilishi kerak. `dvh` — Android manzil satri hisobga olinsin. */

.kiosk {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #000;
  color: #fff;
  cursor: pointer;              /* bo'sh joyga tegish — to'liq ekran */
}

.kiosk video,
.kiosk canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

/* Qatlam kameraga tegishni to'smasin: o'zi shaffof, bolalari esa
   bosiladigan bo'lib qoladi. */
.qatlam {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  pointer-events: none;
}

.qatlam__tepa,
.qatlam__past { pointer-events: auto; }

.qatlam__tepa {
  display: block;
  padding: 24px 20px 34px;
  background: linear-gradient(rgba(0, 0, 0, .45), transparent);
}

.qatlam__markaz {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  min-height: 0;
}

.qatlam__past {
  padding: 40px 20px 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .6));
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* --- natija: tepada, ORQA FONSIZ ---
   Quti yo'q. O'qilishni fon emas, MATN KONTURI ta'minlaydi: har bir
   harf atrofida qora halqa bo'ladi, shuning uchun matn oq devorda ham,
   qorong'i koridorda ham ajralib turadi. Kamera esa hech narsa bilan
   yopilmaydi — odam o'zini to'liq ko'radi. */
.kiosk__natija {
  text-align: center;
  max-width: 92%;
  margin: 0 auto;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
  /* To'rt tomonga qora soya — kontur vazifasini bajaradi */
  text-shadow:
     0  2px 6px rgba(0, 0, 0, .95),
     0 -2px 6px rgba(0, 0, 0, .95),
     2px 0  6px rgba(0, 0, 0, .95),
    -2px 0  6px rgba(0, 0, 0, .95),
     0  0  22px rgba(0, 0, 0, .8);
}

.kiosk__natija h2 {
  font-size: clamp(28px, 6vw, 48px);
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
  line-height: 1.1;
}

.kiosk__natija p {
  margin: 0;
  color: #fff;
  font-size: clamp(15px, 2.4vw, 20px);
  line-height: 1.45;
}

/* Holat rangi endi fonda emas, MATNDA */
.kiosk__natija.yaxshi h2 { color: #6ef0a5; }
.kiosk__natija.kech  h2 { color: #ffc861; }
.kiosk__natija.xato  h2 { color: #ff9a9a; }

.kiosk__yonalish { font-size: clamp(17px, 3vw, 26px); font-weight: 600; }

.kiosk__natija .jarima {
  margin-top: 10px;
  font-size: clamp(20px, 4vw, 32px);
  font-weight: 700;
  color: #ffc861;
}
.kiosk__natija .jarima span {
  display: block;
  font-size: clamp(12px, 1.8vw, 15px);
  font-weight: 400;
  color: #f0dcbc;
  margin-top: 2px;
}

/* --- soat: endi pastda, kichikroq --- */
.soat-quti {
  display: flex;
  align-items: baseline;
  gap: 10px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .95), 0 0 4px rgba(0, 0, 0, .8);
}
.kiosk__soat { font-size: 30px; font-weight: 300; line-height: 1;
               font-variant-numeric: tabular-nums; }
.kiosk__sana { color: #dbe6f2; font-size: 13px; }

/* --- yumaloq tugmalar ---
   Pastda, holat satrining o'ng chekkasida. Tepada turganda ular uzun
   ismli xodimda matn bilan ustma-ust tushardi. */
.tugmalar {
  display: flex;
  gap: 8px;
  margin-left: auto;
  pointer-events: auto;
}
.yumaloq {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .3);
  background: rgba(0, 0, 0, .4);
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.yumaloq:hover { background: rgba(0, 0, 0, .7); }

/* --- pastki qator --- */
.past-qator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.kiosk__holat { color: #cfdcec; font-size: 13px; display: flex; align-items: center;
                gap: 8px; text-shadow: 0 1px 6px rgba(0, 0, 0, .9); }
.nuqta { width: 9px; height: 9px; border-radius: 50%; background: #7e93ad; flex: 0 0 auto; }
.nuqta.jonli { background: #1faa5f; box-shadow: 0 0 0 0 rgba(31, 170, 95, .7); animation: puls 2s infinite; }

@keyframes puls {
  70%  { box-shadow: 0 0 0 9px rgba(31, 170, 95, 0); }
  100% { box-shadow: 0 0 0 0 rgba(31, 170, 95, 0); }
}

/* Oxirgi qaydlar — ro'yxat emas, bir qator. Kameraning ustini
   yopmasligi kerak. */
.kiosk__oxirgi { display: flex; gap: 14px; flex-wrap: wrap; justify-content: flex-end; }
.kiosk__oxirgi .qator-log {
  background: rgba(255, 255, 255, .12);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 13px;
  color: #e4ecf5;
  white-space: nowrap;
}
.kiosk__oxirgi .qator-log b { color: #7fe0a6; }
.kiosk__oxirgi .vaqt { color: #a8bbd0; font-variant-numeric: tabular-nums; }

/* --- sozlamalar (yashirin) --- */
.kiosk .qator {
  background: rgba(13, 21, 32, .88);
  border-radius: 12px;
  padding: 12px 14px;
}
.kiosk label { color: #9db0c8; }
.kiosk select {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .25);
  color: #fff;
}
.kiosk select option { background: #1e2a3a; color: #fff; }

/* Baland emas, keng ekranda natija juda kattalashib ketmasin */
@media (min-width: 1100px) {
  .kiosk__natija { max-width: 560px; }
  .kiosk__soat { font-size: 56px; }
}

/* ---------- Yuzni ro'yxatga olish ---------- */

.olish { display: grid; grid-template-columns: 1fr 190px; gap: 16px; }
@media (max-width: 620px) { .olish { grid-template-columns: 1fr; } }

.olish__video {
  position: relative;
  background: #0d1520;
  border-radius: 10px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
}
.olish__video video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.olish__video .yorliq {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, .8));
  color: #fff; padding: 22px 14px 12px; font-size: 14px; text-align: center;
}
.olish__kadrlar { display: flex; flex-direction: column; gap: 8px; }
.olish__kadrlar img { width: 100%; border-radius: 8px; border: 2px solid var(--yashil); transform: scaleX(-1); }
.olish__bosh { display: grid; place-items: center; height: 54px; border: 2px dashed var(--chiziq); border-radius: 8px; color: var(--matn-och); font-size: 12.5px; }

@media (max-width: 780px) {
  .qobiq { grid-template-columns: 1fr; }
  .yon { position: static; height: auto; }
  .yon nav { display: flex; flex-wrap: wrap; }
  .maydon, .tepa { padding-left: 16px; padding-right: 16px; }
}

/* ---------- Teginishli ekran ----------
   Devorga osilgan planshetda sichqoncha yo'q. 29 px balandlikdagi tugma
   10 dyuymli panelda ~5 mm bo'ladi — barmoq uchi uchun ikki barobar kam
   (Apple 44 pt, Material 48 dp talab qiladi). `pointer: coarse` faqat
   teginishli qurilmada ishlaydi, HR ning sichqonchali kompyuteriga
   tegmaydi. */
@media (pointer: coarse) {
  .tugma, .tugma--kichik {
    min-height: 48px;
    padding-top: 0;
    padding-bottom: 0;
  }
  input, select, textarea { min-height: 48px; }
  .javoblar .tugma { min-height: 56px; }   /* sinov sahifasidagi javob tugmalari */
}
