:root{--navy:#0A2340;--gold:#F5B83D;--bg:#EEF2F7;--line:#D5DDE8;--err:#B3261E;--ok:#1B7F4B}
*{box-sizing:border-box}
body{margin:0;font:16px/1.45 "Segoe UI",system-ui,Arial,sans-serif;background:var(--bg);color:#16202e}
.top{background:var(--navy);color:#fff;padding:10px 14px}
.brand{display:flex;gap:10px;align-items:center}
.brand .logo{width:42px;height:42px;border-radius:8px;background:#fff;flex:none}
.brand small{display:block;opacity:.75;font-size:11px;line-height:1.2;max-width:60ch}
form.inline{display:inline}

/* ---- chap yon panel ---- */
.shell{display:flex;min-height:100vh}
.content{flex:1;min-width:0;display:flex;flex-direction:column}
.content main{flex:1;width:100%}
.side{width:260px;flex:none;background:var(--navy);color:#fff;position:sticky;top:0;height:100vh;overflow-y:auto;
  display:flex;flex-direction:column;padding:14px 0;transition:margin-left .2s,transform .2s}
.side .brand{padding:0 14px 14px;border-bottom:1px solid rgba(255,255,255,.12)}
.side .brand small{max-width:none;font-size:10.5px}
.menu{flex:1;padding:8px 0}
.menu .grp{font-size:11px;letter-spacing:.08em;text-transform:uppercase;opacity:.55;padding:14px 16px 4px}
.side a{display:block;color:#fff;text-decoration:none;font-size:15px;padding:10px 16px 10px 12px;border-left:4px solid transparent;opacity:.88}
.side a:hover{background:rgba(255,255,255,.08);opacity:1}
.side a.active{background:rgba(245,184,61,.18);color:var(--gold);border-left-color:var(--gold);font-weight:700;opacity:1}
.side .me{border-top:1px solid rgba(255,255,255,.12);padding-top:8px}
.side .who{padding:6px 16px;font-weight:600;font-size:14px}
.side .who small{display:block;font-weight:400;opacity:.65;font-size:12px}
.alpha{margin:6px 12px 0;width:calc(100% - 24px);padding:8px;border:1px dashed rgba(255,255,255,.35);border-radius:8px;
  background:none;color:#fff;cursor:pointer;font:inherit;font-size:13px;opacity:.85}
.alpha:hover{background:rgba(255,255,255,.08);opacity:1}
.logout{margin:8px 12px 4px;width:calc(100% - 24px);padding:9px;border:1px solid rgba(255,255,255,.35);border-radius:8px;
  background:none;color:var(--gold);cursor:pointer;font:inherit;font-size:14px}
.logout:hover{background:rgba(255,255,255,.08)}
.topbar{display:flex;align-items:center;gap:12px;padding:8px 14px;background:#fff;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:5}
.menubtn{width:42px;height:42px;border:1px solid var(--line);border-radius:10px;background:#fff;cursor:pointer;display:flex;
  flex-direction:column;justify-content:center;gap:5px;padding:0 10px}
.menubtn:hover{background:#F0F4F9}
.menubtn span{display:block;height:3px;border-radius:2px;background:var(--navy)}
.where{color:var(--navy);font-size:17px}
.backdrop{display:none}
html.side-closed .side{margin-left:-260px}
@media(max-width:899px){
  .side{position:fixed;left:0;top:0;bottom:0;z-index:30;margin-left:0!important;transform:translateX(-100%);box-shadow:0 0 30px rgba(0,0,0,.35)}
  html.side-open .side{transform:none}
  html.side-open .backdrop{display:block;position:fixed;inset:0;background:rgba(0,0,0,.45);z-index:25}
}
main{max-width:1100px;margin:0 auto;padding:14px}
footer{text-align:center;color:#6b7a8f;font-size:12px;padding:18px}
.card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:14px;margin:10px 0}
.card.narrow,.narrow{max-width:420px;margin:30px auto}
.scroll{overflow-x:auto}
label{display:block;margin:8px 0;font-size:14px;color:#41526b}
input,select,textarea{width:100%;padding:10px;border:1px solid var(--line);border-radius:8px;font:inherit;background:#fff}
td input,td select{padding:6px}
input.sm{width:80px}
.btn{display:inline-block;padding:9px 14px;border:1px solid var(--navy);background:#fff;color:var(--navy);border-radius:8px;cursor:pointer;text-decoration:none;font:inherit;font-size:14px}
.btn.primary{background:var(--navy);color:#fff}
.btn.big{width:100%;padding:16px;font-size:18px;margin-top:14px}
.bar{display:flex;flex-wrap:wrap;gap:10px;align-items:end;margin:8px 0}
.bar label{margin:0}.bar input,.bar select{width:auto}
.flash{padding:10px 14px;border-radius:8px;margin:8px 0;font-weight:600}
.flash.ok{background:#DDF3E6;color:var(--ok)}.flash.err{background:#FBE3E1;color:var(--err)}
.note{color:#5b6b82;font-size:14px}
.grid2{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px}
.routes{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.field{background:#F6F8FB;border:1px solid var(--line);border-radius:10px;padding:8px}
.field>span{display:block;font-size:13px;margin-bottom:6px;color:#41526b}
.stepper{display:flex;gap:6px}
.stepper input{text-align:center;font-size:22px;font-weight:700;padding:8px 2px;min-width:0;-moz-appearance:textfield}
.stepper input::-webkit-outer-spin-button,.stepper input::-webkit-inner-spin-button{-webkit-appearance:none}
.st{width:52px;flex:none;font-size:26px;border:1px solid var(--navy);background:var(--navy);color:#fff;border-radius:10px;cursor:pointer}
.st:disabled{opacity:.35}
.total{font-size:20px;margin:14px 0;padding:10px;background:#FDE9B8;border-radius:10px;text-align:center}
table{border-collapse:collapse;width:100%}
th,td{padding:8px 10px;border-bottom:1px solid var(--line);text-align:center;white-space:nowrap}
th{background:var(--navy);color:#fff;font-weight:600;font-size:14px}
td.l{text-align:left}tr.sum td{background:#FDE9B8;font-weight:700}tr.missing td{opacity:.55}
table.small td{font-size:12px;white-space:normal}.mono{font-family:Consolas,monospace;word-break:break-all}
.acts{white-space:normal}.acts .btn{margin:2px}
.seg{display:flex;border:1px solid var(--navy);border-radius:8px;overflow:hidden}
.seg a{padding:9px 12px;text-decoration:none;color:var(--navy);font-size:14px}.seg a.on{background:var(--navy);color:#fff}
.badge{background:var(--err);color:#fff;border-radius:6px;padding:2px 8px;font-size:12px}
.badge.ok{background:var(--ok)}
.dayclose{padding:10px 14px}.who-closed{font-size:15px}
.switch{display:flex;gap:12px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line);cursor:pointer;font-size:16px;color:#16202e}
.switch input{position:absolute;opacity:0;width:0}
.slider{flex:none;width:48px;height:26px;background:#B8C3D3;border-radius:26px;position:relative;transition:.2s}
.slider:before{content:"";position:absolute;width:20px;height:20px;left:3px;top:3px;background:#fff;border-radius:50%;transition:.2s}
.switch input:checked+.slider{background:var(--ok)}.switch input:checked+.slider:before{transform:translateX(22px)}
@media(max-width:600px){main{padding:8px}.brand small{display:none}h2{font-size:20px}
 .routes{gap:8px}.field{padding:6px}.stepper{gap:4px}.st{width:40px;font-size:22px}
 .stepper input{font-size:20px;padding:6px 0;flex:1 1 0;min-width:0}
 th,td{padding:8px 6px}}

/* ---- ish jadvali va tabel ---- */
.jt{border-collapse:collapse;width:auto;min-width:100%}
.jt th,.jt td{padding:4px 6px;font-size:12px;white-space:nowrap;text-align:center;border:1px solid #b9c2cf}
.jt th{background:var(--navy);color:#fff;position:sticky;top:0}
.jt td.we{background:#FFFF80;font-weight:600}
.jt td.c.ed{cursor:pointer}.jt td.c.ed:hover{outline:2px solid var(--navy);outline-offset:-2px}
.jt.tb td.c{min-width:26px}.jt td.nm{position:sticky;left:0;background:#fff;font-weight:600}
.legend{display:flex;flex-wrap:wrap;gap:6px 16px;padding:10px 14px}.lg{display:inline-flex;align-items:center;gap:6px;font-size:13px}
.lg i{display:inline-block;width:16px;height:16px;border:1px solid #888;border-radius:3px}
.cellmenu{position:absolute;z-index:60;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.25);padding:4px;min-width:230px}
.cellmenu button{display:block;width:100%;text-align:left;padding:8px 10px;border:0;background:none;cursor:pointer;font:inherit;font-size:14px;border-radius:6px}
.cellmenu button:hover{background:#EEF2F7}

/* jadval: 12 inspektor + boshliq (13 ustun) ixcham sigadi; chap ikki ustun aylantirishda joyida qoladi */
.jt.jd th,.jt.jd td{padding:3px 3px;font-size:11px;line-height:1.25}
.jt.jd th{font-size:10.5px}
.jt.jd th:nth-child(1),.jt.jd td:nth-child(1){position:sticky;left:0;z-index:2;min-width:40px;background-clip:padding-box}
.jt.jd th:nth-child(2),.jt.jd td:nth-child(2){position:sticky;left:40px;z-index:2;min-width:74px;background-clip:padding-box}
.jt.jd th:nth-child(3),.jt.jd td:nth-child(3){position:sticky;left:114px;z-index:2;min-width:42px;background-clip:padding-box}
.jt.jd td:nth-child(1):not(.we):not(.hol),.jt.jd td:nth-child(2):not(.we):not(.hol),.jt.jd td.wc:not(.we):not(.hol){background:#fff}
.jt.jd td.wc{font-size:13px}
.jt.jd tr.sumrow td{background:#EEF2F7 !important;font-weight:700;font-size:12px;border-bottom:2px solid #000}
.jt.jd tr.sumrow td.lbl{text-align:left;position:sticky;left:0;z-index:2}
.jt.jd tr.sumrow td.bad{color:#B3261E}
.jt.jd th:nth-child(1),.jt.jd th:nth-child(2){background:var(--navy)}
.jt.jd td.c{min-width:66px}

/* tabel: 31 kun + jamilar ixcham; xodim nomi aylantirishda joyida qoladi */
.jt.jd2 th,.jt.jd2 td{padding:3px 2px;font-size:11px}
.jt.jd2 td.c{min-width:22px}
.jt.jd2 td.nm{min-width:96px;text-align:left;padding-left:6px}

/* xabarnoma */
.cnt{display:inline-block;min-width:20px;margin-left:8px;padding:0 6px;border-radius:10px;background:#E5484D;color:#fff;font-size:12px;font-weight:700;text-align:center}
.flash.pend{background:#FFF1CC;color:#6B4200;border:1px solid #F2C94C}.flash.pend a{color:#6B4200;font-weight:700}

/* ruxsatlar jadvali */
table.perm th,table.perm td{padding:8px 10px;white-space:normal}
table.perm td:not(.l){text-align:center;min-width:92px}
.switch.sm{display:inline-block;padding:0;border:0;margin:0}.switch.sm .slider{margin:0 auto}

/* keng sahifalar (jadval, tabel, jurnal, hisobotlar): ekran kengligidan to'liq foydalanadi */
main.wide{max-width:none;padding:14px 24px}
.wide .card{max-width:none}
@media(min-width:1500px){
  .wide table{font-size:15px}
  .wide .jt th,.wide .jt td{font-size:14px;padding:7px 6px}
  .wide .jt.jd th:nth-child(1),.wide .jt.jd td:nth-child(1){min-width:56px}
  .wide .jt.jd th:nth-child(2),.wide .jt.jd td:nth-child(2){left:56px;min-width:92px}
  .wide .jt.jd th:nth-child(3),.wide .jt.jd td:nth-child(3){left:148px;min-width:52px}
  .wide .jt.jd th{font-size:13px}
  .wide .jt.jd td.c{min-width:92px}
  .wide .jt.jd2 th,.wide .jt.jd2 td.c{min-width:32px}
  .wide .jt.jd2 td.nm{min-width:150px}
  .wide .chk th,.wide .chk td{font-size:14px;padding:7px 10px}
}
@media(min-width:1900px){
  .wide .jt th,.wide .jt td{font-size:15px;padding:8px 7px}
  .wide .jt.jd td.c{min-width:104px}
  .wide .jt.jd2 th,.wide .jt.jd2 td.c{min-width:36px}
}
.chk th,.chk td{padding:6px 8px;text-align:center;border-bottom:1px solid var(--line);white-space:nowrap}
.chk th{background:var(--navy);color:#fff}

/* tabel: oxirgi 13 ustun (jamilar) torayib qolmasin: Reja kun | Reja soat | Ish kun | Ish soat | K T S U N L D O | Otgul qoldiq */
.jt.jd2 th:nth-last-child(-n+13),.jt.jd2 td:nth-last-child(-n+13){padding:6px 8px;min-width:44px;font-size:13px}
.jt.jd2 th:nth-last-child(-n+13){font-size:12.5px;line-height:1.25}
.jt.jd2 th:nth-last-child(n+10):nth-last-child(-n+13),.jt.jd2 td:nth-last-child(n+10):nth-last-child(-n+13){min-width:58px}
.jt.jd2 th:nth-last-child(1),.jt.jd2 td:nth-last-child(1){min-width:70px}
@media(min-width:1500px){
  .wide .jt.jd2 th:nth-last-child(-n+13),.wide .jt.jd2 td:nth-last-child(-n+13){min-width:52px;padding:8px 10px;font-size:15px}
  .wide .jt.jd2 th:nth-last-child(n+10):nth-last-child(-n+13),.wide .jt.jd2 td:nth-last-child(n+10):nth-last-child(-n+13){min-width:66px}
  .wide .jt.jd2 th:nth-last-child(1),.wide .jt.jd2 td:nth-last-child(1){min-width:80px}
}

/* ===== TABEL USTUNLARI (yakuniy kengliklar). Tartib: Xodim | 1..31 kun | Reja kun, Reja soat, Ish kun, Ish soat | K T S U N L D O | Otgul qoldiq ===== */
.jt.jd2 th:first-child,.jt.jd2 td.nm{min-width:100px !important;text-align:left}
.jt.jd2 td.c,.jt.jd2 th:not(:first-child):not(:nth-last-child(-n+13)){min-width:23px !important;padding:5px 2px !important}
.jt.jd2 th:nth-last-child(-n+13),.jt.jd2 td:nth-last-child(-n+13){min-width:36px !important;padding:6px 5px !important;font-size:13px !important}
.jt.jd2 th:nth-last-child(n+10):nth-last-child(-n+13),.jt.jd2 td:nth-last-child(n+10):nth-last-child(-n+13){min-width:52px !important}
.jt.jd2 th:nth-last-child(1),.jt.jd2 td:nth-last-child(1){min-width:62px !important}
@media(min-width:1500px){
  .jt.jd2 th:first-child,.jt.jd2 td.nm{min-width:122px !important}
  .jt.jd2 td.c,.jt.jd2 th:not(:first-child):not(:nth-last-child(-n+13)){min-width:25px !important}
  .jt.jd2 th:nth-last-child(-n+13),.jt.jd2 td:nth-last-child(-n+13){min-width:38px !important;font-size:14px !important}
  .jt.jd2 th:nth-last-child(n+10):nth-last-child(-n+13),.jt.jd2 td:nth-last-child(n+10):nth-last-child(-n+13){min-width:54px !important}
  .jt.jd2 th:nth-last-child(1),.jt.jd2 td:nth-last-child(1){min-width:66px !important}
}
@media(min-width:1900px){
  .jt.jd2 th:first-child,.jt.jd2 td.nm{min-width:124px !important}
  .jt.jd2 td.c,.jt.jd2 th:not(:first-child):not(:nth-last-child(-n+13)){min-width:26px !important}
  .jt.jd2 th:nth-last-child(-n+13),.jt.jd2 td:nth-last-child(-n+13){min-width:40px !important;font-size:14.5px !important}
  .jt.jd2 th:nth-last-child(n+10):nth-last-child(-n+13),.jt.jd2 td:nth-last-child(n+10):nth-last-child(-n+13){min-width:56px !important}
  .jt.jd2 th:nth-last-child(1),.jt.jd2 td:nth-last-child(1){min-width:68px !important}
}

/* tasdiqlashga yuborilgandan keyin özgartirilgan jadval kataklari */
.jt td.chg{outline:2px dashed #E5484D;outline-offset:-2px}

/* özgarişlar tarixi */
table.hist th,table.hist td{padding:6px 10px;font-size:13.5px;white-space:normal;border-bottom:1px solid var(--line);vertical-align:top}
table.hist th{background:var(--navy);color:#fff}

/* jadval: ochroq sarlavha, qora çiziqli kataklar */
.jt th{background:#8591A0 !important;color:#0A2340 !important;border:1px solid #000}
.jt td{border:1px solid #000}
.jt.jd th:nth-child(1),.jt.jd th:nth-child(2){background:#8591A0 !important}

/* bayram kuni sanasi */
.jt td.hol{background:#F2A3A6 !important;color:#111;font-weight:700}
.jt td.hol small{font-size:9.5px;font-weight:500;white-space:normal;line-height:1.1;display:block}
.jt td.bh{color:#111;font-weight:600;white-space:normal;line-height:1.15}

table.chk th[title]{cursor:help}
.jt.jd td.wc.hol,.jt.jd td.wc.we{font-weight:700}
.jt.jd td.wc b{font-size:inherit}

/* 1-smena / 2-smena guruhlari */
.jt.jd th.gS1{border-top:5px solid #5AA9F0 !important}
.jt.jd th.gS2{border-top:5px solid #F0B33C !important}
.jt.jd th.gfirst,.jt.jd td.gfirst{border-left:3px solid #000 !important}

/* xodim jadvalini almaştiriş oynasi */
.swapbox{width:320px;padding:12px;white-space:normal;max-height:none}
.swapbox label{display:block;margin:6px 0;font-size:13px}
.swapbox select,.swapbox input[type=date]{width:100%;margin-top:2px}
.swapbox .btn{margin:6px 6px 0 0}
.jt.jd th.swp:hover{filter:brightness(1.08);text-decoration:underline}
.cellmenu.swapbox .btn{display:inline-block;width:auto;text-align:center;padding:7px 14px;border:1px solid var(--line);background:#fff}
.cellmenu.swapbox .btn.primary{background:var(--navy);color:#fff;border-color:var(--navy)}

/* Mening ish kunlarim: oy taqvimi */
table.cal{border-collapse:separate;border-spacing:6px;width:100%;table-layout:fixed}
table.cal th{background:#8591A0;color:#0A2340;padding:6px;border-radius:6px;font-size:13px}
table.cal th.wk{background:#FFFF80}
table.cal td{height:86px;vertical-align:top;border:1px solid #000;border-radius:8px;padding:6px 8px;position:relative;text-align:left}
table.cal td.empty{border:0;background:transparent}
table.cal td .dn{display:block;font-weight:700;font-size:15px}
table.cal td .lb{display:block;margin-top:6px;font-size:13px;line-height:1.2}
table.cal td .lb.wkh{font-size:15px;font-weight:700}
table.cal td.today{outline:4px solid var(--navy);outline-offset:-2px}
table.cal td{overflow:hidden}
table.cal td .lb .nv{display:block;font-weight:500;font-size:11px;margin-top:2px}
table.cal td .lb .tbr{display:none}
@media (max-width:700px){table.cal{border-spacing:3px}table.cal th{padding:4px 1px;font-size:11px}table.cal td{height:64px;padding:3px 3px}table.cal td .lb{font-size:10.5px;margin-top:3px}table.cal td .lb.wkh{font-size:11.5px}table.cal td .dn{font-size:13px}
  table.cal td .lb .tsep{display:none}table.cal td .lb .tbr{display:inline}table.cal td .lb .nv{font-size:9.5px}}

/* Jadval yaratiş oynasi */
.genbox{border:0;border-radius:12px;padding:0;width:min(560px,94vw);box-shadow:0 12px 40px rgba(10,35,64,.35)}
.genbox::backdrop{background:rgba(10,35,64,.45)}
.genbox form{padding:16px 18px;display:flex;flex-direction:column;gap:12px}
.genbox .gb-head{display:flex;justify-content:space-between;align-items:center;font-size:17px}
.genbox .gb-x{border:0;background:none;font-size:26px;line-height:1;cursor:pointer;color:#555}
.genbox fieldset{border:1px solid #d5dbe3;border-radius:8px;padding:8px 12px 10px;margin:0}
.genbox fieldset.off{opacity:.45}
.genbox legend{font-weight:700;font-size:13px;color:#0A2340;padding:0 4px}
.genbox .gb-r{display:flex;gap:8px;align-items:flex-start;padding:5px 0;cursor:pointer}
.genbox .gb-r.dis{opacity:.55;cursor:not-allowed}
.genbox .gb-r small,.genbox .gb-c small,.genbox .gb-l small{display:block;color:#5b6675;font-size:12px;font-weight:400}
.genbox .gb-c small{display:inline}
.genbox .gb-l{display:block;margin:6px 0}
.genbox .gb-l select{margin-left:6px;max-width:100%}
.genbox .gb-days{display:flex;gap:10px;flex-wrap:wrap;margin-top:4px}
.genbox .gb-days label{background:#F4F6F9;border:1px solid #d5dbe3;border-radius:6px;padding:4px 10px;cursor:pointer}
.genbox .gb-warn{background:#FFF4E5;border:1px solid #F0B35A;border-radius:8px;padding:8px 10px;font-size:13px}
.genbox .gb-foot{display:flex;justify-content:flex-end;gap:8px}
.genbox input[type=radio],.genbox input[type=checkbox]{width:auto;padding:0;margin:3px 0 0;flex:none}
.genbox .gb-r,.genbox .gb-c{display:flex;flex-direction:row;align-items:flex-start;gap:8px;margin:0;text-align:left;color:#1d2b3a}
.genbox .gb-c{align-items:center}
.genbox .gb-days label{display:flex;align-items:center;gap:6px;margin:0}
.genbox .gb-days input{margin:0}
.genbox .gb-l select{width:auto;padding:6px 8px}
.genbox .gb-l input[type=number]{width:64px;padding:6px 8px;display:inline-block}
.genbox .gb-warn{display:flex;gap:8px;align-items:flex-start;color:#6b3d00}
.genbox .gb-same{background:#FFF4E5;border:1px solid #F0B35A;border-radius:6px;padding:6px 10px;margin-top:6px;font-size:13px;color:#6b3d00}
.genbox .gb-rot{margin-top:4px;color:#1f6b3a}
.genbox .gb-same small{display:block;margin-top:3px}
table.stime td,table.stime th{text-align:center}table.stime tr.own td{font-weight:700}
.stime-form .tt{display:flex;align-items:center;gap:4px}.stime-form .tt input{width:auto;padding:6px}
