:root {
  --fon: #f4f5f2; --sirt: #ffffff; --chiziq: #e1e4dd; --chiziq2: #cfd4c9;
  --matn: #1c211d; --matn2: #5d665f; --matn3: #8a928b;
  --asosiy: #0f5c4a; --asosiy2: #0b4739; --asosiy-fon: #e4f1ec;
  --yashil: #1f7a4d; --yashil-fon: #e3f3e8; --qizil: #b3382c; --qizil-fon: #fbe9e6;
  --sariq: #8a5a00; --sariq-fon: #fdf1d6; --kok: #1f5fa8; --kok-fon: #e5eef9; --kul-fon: #eceee9;
  --r: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--matn); background: var(--fon); -webkit-font-smoothing: antialiased; }
h1 { font-size: 20px; margin: 0; font-weight: 650; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0 0 10px; font-weight: 650; }
a { color: var(--asosiy); text-decoration: none; }
.son { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.xira { color: var(--matn2); } .kichik { font-size: 12px; }
.manfiy { color: var(--qizil); }

/* Qobiq */
.qobiq { display: grid; grid-template-columns: 216px 1fr; min-height: 100vh; }
.yon { background: #12261f; color: #cfdcd5; padding: 14px 10px; display: flex; flex-direction: column; gap: 2px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.yon .logo { color: #fff; font-weight: 700; font-size: 16px; padding: 6px 10px 14px; letter-spacing: -.01em; }
.yon .logo span { color: #7fd1b4; }
.yon a { color: inherit; padding: 8px 10px; border-radius: 6px; display: block; }
.yon a:hover { background: rgba(255,255,255,.07); }
.yon a.faol { background: #1e4a3c; color: #fff; font-weight: 600; }
.yon .guruh { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #7e9189; padding: 14px 10px 4px; }
.yon .foydalanuvchi { margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; }
.yon .foydalanuvchi b { color: #fff; display: block; }
.yon .foydalanuvchi button { margin-top: 8px; background: none; border: 1px solid rgba(255,255,255,.25); color: #cfdcd5;
  border-radius: 6px; padding: 5px 10px; cursor: pointer; font: inherit; font-size: 12px; margin-right: 4px; }
.asosiy { padding: 22px 26px 60px; min-width: 0; }
.sarlavha { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sarlavha .bosh { flex: 1; min-width: 180px; }
.sarlavha .bosh p { margin: 2px 0 0; color: var(--matn2); font-size: 13px; }
.asboblar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.asboblar .bosh-joy { flex: 1; }

/* Boshqaruv */
button, .tugma { font: inherit; cursor: pointer; border-radius: var(--r); border: 1px solid var(--chiziq2);
  background: var(--sirt); color: var(--matn); padding: 7px 13px; font-weight: 550; white-space: nowrap; }
button:hover { background: #f7f8f5; }
button:disabled { opacity: .5; cursor: not-allowed; }
a.tugma { display: inline-block; }
button.asos { background: var(--asosiy); border-color: var(--asosiy); color: #fff; }
button.asos:hover { background: var(--asosiy2); }
button.xavf { color: var(--qizil); border-color: #e3b9b3; }
button.kichik { padding: 3px 9px; font-size: 12px; }
button.havola { border: 0; background: none; color: var(--asosiy); padding: 0; font-weight: 550; }
input, select, textarea { font: inherit; color: inherit; border: 1px solid var(--chiziq2); border-radius: var(--r);
  padding: 7px 10px; background: var(--sirt); width: 100%; min-width: 0; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid #7fbfa9; outline-offset: 1px; }
input[type=checkbox] { width: auto; }
.asboblar input, .asboblar select { width: auto; }
label.maydon { display: block; margin-bottom: 11px; }
label.maydon > span { display: block; font-size: 12px; color: var(--matn2); margin-bottom: 4px; font-weight: 550; }
label.belgi { display: flex; gap: 8px; align-items: center; margin-bottom: 11px; }
.ikki { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* Karta va jadval */
.karta { background: var(--sirt); border: 1px solid var(--chiziq); border-radius: 10px; padding: 16px; margin-bottom: 14px; }
.kartalar { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kartalar .karta { margin: 0; }
.kartalar .nom { font-size: 12px; color: var(--matn2); }
.kartalar .qiymat { font-size: 22px; font-weight: 650; margin-top: 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.jadval-qobiq { background: var(--sirt); border: 1px solid var(--chiziq); border-radius: 10px; overflow: auto; margin-bottom: 14px; }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--chiziq); vertical-align: middle; }
th { font-size: 12px; color: var(--matn2); font-weight: 600; background: #fafbf8; white-space: nowrap; position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; }
tbody tr.bosiladi { cursor: pointer; }
tbody tr.bosiladi:hover { background: #f7f9f5; }
tfoot td { font-weight: 650; background: #fafbf8; border-top: 1px solid var(--chiziq2); }
.bosh-holat { padding: 36px 16px; text-align: center; color: var(--matn2); }
.nishon { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--kul-fon); color: var(--matn2); white-space: nowrap; }
.nishon.yashil { background: var(--yashil-fon); color: var(--yashil); }
.nishon.qizil { background: var(--qizil-fon); color: var(--qizil); }
.nishon.sariq { background: var(--sariq-fon); color: var(--sariq); }
.nishon.kok { background: var(--kok-fon); color: var(--kok); }
.ogoh { background: var(--sariq-fon); color: var(--sariq); border-radius: var(--r); padding: 9px 12px; margin-bottom: 12px; font-size: 13px; }
.amallar { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }

/* Yorliqlar */
.yorliqlar { display: flex; gap: 4px; border-bottom: 1px solid var(--chiziq2); margin-bottom: 14px; flex-wrap: wrap; }
.yorliqlar button { border: 0; background: none; border-radius: 0; padding: 8px 12px; color: var(--matn2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.yorliqlar button.faol { color: var(--asosiy); border-bottom-color: var(--asosiy); }

/* Bosqichlar */
.bosqichlar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.bosqichlar div { flex: 1; min-width: 110px; padding: 8px 10px; border-radius: var(--r); background: var(--kul-fon); color: var(--matn3); font-size: 12px; font-weight: 600; text-align: center; }
.bosqichlar div.otgan { background: var(--asosiy-fon); color: var(--asosiy); }
.bosqichlar div.joriy { background: var(--asosiy); color: #fff; }

/* Tabel */
.tabel th, .tabel td { padding: 0; text-align: center; border-right: 1px solid var(--chiziq); font-size: 12px; }
.tabel th { padding: 4px 0; min-width: 30px; }
.tabel th.dam, .tabel td.dam { background: #f1f2ee; }
.tabel td.ism, .tabel th.ism { text-align: left; padding: 6px 10px; position: sticky; left: 0; background: var(--sirt); z-index: 1; min-width: 190px; max-width: 240px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.tabel th.ism { background: #fafbf8; z-index: 2; }
.tabel td.katak { height: 30px; cursor: pointer; font-weight: 650; position: relative; }
.tabel td.katak:hover { box-shadow: inset 0 0 0 2px var(--asosiy); }
.tabel td.yoq { cursor: default; background: repeating-linear-gradient(45deg, #f4f5f2, #f4f5f2 4px, #eceee9 4px, #eceee9 8px); }
.tabel td.yoq:hover { box-shadow: none; }
.h-keldi { background: var(--yashil-fon); color: var(--yashil); }
.h-kechikdi { background: var(--sariq-fon); color: var(--sariq); }
.h-kelmadi { background: var(--qizil-fon); color: var(--qizil); }
.h-sababli, .h-tatil, .h-kasal { background: var(--kok-fon); color: var(--kok); }
.h-tekshir { background: #f6dcf1; color: #8a2a78; }
.tabel td.qolda::after { content: ""; position: absolute; top: 2px; right: 2px; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tabel td.ort::before { content: ""; position: absolute; bottom: 2px; left: 2px; right: 2px; height: 2px; background: currentColor; opacity: .55; }
.izohlar { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--matn2); margin-bottom: 12px; }
.izohlar span b { display: inline-block; width: 20px; text-align: center; border-radius: 4px; margin-right: 4px; }

/* Modal */
.parda { position: fixed; inset: 0; background: rgba(18,38,31,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 14px; overflow-y: auto; z-index: 50; }
.modal { background: var(--sirt); border-radius: 12px; width: 100%; max-width: 520px; box-shadow: 0 18px 50px rgba(0,0,0,.25); }
.modal.keng { max-width: 760px; }
.modal header { padding: 14px 18px; border-bottom: 1px solid var(--chiziq); display: flex; align-items: center; gap: 10px; }
.modal header h2 { margin: 0; flex: 1; }
.modal .tana { padding: 16px 18px; }
.modal footer { padding: 12px 18px; border-top: 1px solid var(--chiziq); display: flex; justify-content: flex-end; gap: 8px; }
.modal .xato { color: var(--qizil); font-size: 13px; margin-right: auto; align-self: center; }
#xabar-joy { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 80; }
.xabar { background: #12261f; color: #fff; padding: 10px 14px; border-radius: var(--r); box-shadow: 0 6px 20px rgba(0,0,0,.2); max-width: 380px; }
.xabar.xato { background: var(--qizil); }

/* Kirish */
.kirish { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.kirish form { background: var(--sirt); border: 1px solid var(--chiziq); border-radius: 14px; padding: 28px; width: 100%; max-width: 360px; }
.kirish h1 { margin-bottom: 4px; } .kirish h1 span { color: var(--asosiy); }
.kirish p { color: var(--matn2); margin: 0 0 18px; }
.kirish button { width: 100%; padding: 10px; margin-top: 6px; }
.kirish .xato { color: var(--qizil); min-height: 20px; margin-top: 10px; font-size: 13px; }

/* Varaqa */
.varaqa table td, .varaqa table th { padding: 6px 8px; }
.varaqa .yakun td { font-weight: 700; font-size: 15px; border-top: 2px solid var(--matn); }
.varaqa .bolim-sarlavha td { background: #fafbf8; font-size: 12px; color: var(--matn2); font-weight: 600; }

@media (max-width: 860px) {
  .qobiq { grid-template-columns: 1fr; }
  .yon { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px; }
  .yon .guruh { display: none; } .yon .logo { padding: 6px 10px; width: 100%; }
  .yon .foydalanuvchi { margin: 0; border: 0; padding: 6px 10px; width: 100%; }
  .yon .foydalanuvchi b { display: inline; }
  .asosiy { padding: 16px 12px 50px; }
  .ikki { grid-template-columns: 1fr; }
}
@media print {
  .yon, .asboblar, .modal header button, .modal footer, #xabar-joy { display: none !important; }
  .parda { position: static; background: none; padding: 0; }
  .modal { box-shadow: none; max-width: none; }
  body:has(.parda) > #app { display: none; }
}
