:root{
  /* ===== FASL RANGLARI (kunduzi) — SaaS HR dashboard uslubida, to'yingan ===== */
  --spring-1:#e6f7ec; --spring-2:#2fbe72; --spring-3:#0e9a57; --spring-accent:#22c57d;
  --summer-1:#fff4dc; --summer-2:#ffb020; --summer-3:#d97706; --summer-accent:#f7a928;
  --autumn-1:#fdece0; --autumn-2:#f2763f; --autumn-3:#c2410c; --autumn-accent:#ef7c3d;
  --winter-1:#e9f0fd; --winter-2:#4c7ef3; --winter-3:#2952c8; --winter-accent:#4169e8;

  --season-1:var(--spring-1);
  --season-2:var(--spring-2);
  --season-3:var(--spring-3);
  --season-accent:var(--spring-accent);
  --season-glow:34,190,114;

  --bg:#f5f5fb;
  --bg-elevated:#ffffff;
  --bg-sunken:#eff0f8;
  --ink:#181826;
  --ink-soft:#68687e;
  --ink-faint:#9d9db2;
  --line:#e9e9f4;
  --line-strong:#d8d8e8;
  --good:#159862;
  --good-bg:#e3f9ed;
  --warn:#dd8a1e;
  --warn-bg:#fdf1dc;
  --bad:#e0433e;
  --bad-bg:#fdeae9;
  --shadow:0 1px 2px rgba(24,24,50,.04), 0 14px 30px -14px rgba(24,24,50,.16);
  --shadow-sm:0 1px 2px rgba(24,24,50,.05), 0 3px 8px rgba(24,24,50,.06);
  --shadow-lg:0 20px 50px -18px rgba(24,24,50,.28);
  --radius:20px;
  --radius-sm:12px;
  --font-display:'Fraunces', Georgia, serif;
  --font-body:'Inter', -apple-system, sans-serif;
  --font-mono:'JetBrains Mono', monospace;
}

[data-theme="dark"]{
  --bg:#111017;
  --bg-elevated:#1a1a24;
  --bg-sunken:#22222f;
  --ink:#f1f1f8;
  --ink-soft:#a4a4ba;
  --ink-faint:#68687e;
  --line:#2b2b3a;
  --line-strong:#3c3c4e;
  --good:#3ad38f;
  --good-bg:#153729;
  --warn:#f5a83e;
  --warn-bg:#3a2c15;
  --bad:#f2716a;
  --bad-bg:#3b201f;
  --shadow:0 1px 2px rgba(0,0,0,.3), 0 18px 38px -16px rgba(0,0,0,.6);
  --shadow-sm:0 1px 2px rgba(0,0,0,.3), 0 3px 10px rgba(0,0,0,.35);
  --shadow-lg:0 24px 60px -20px rgba(0,0,0,.65);
}

[data-season="spring"]{ --season-glow:34,190,114; }
[data-season="summer"]{ --season-1:var(--summer-1); --season-2:var(--summer-2); --season-3:var(--summer-3); --season-accent:var(--summer-accent); --season-glow:247,169,40; }
[data-season="autumn"]{ --season-1:var(--autumn-1); --season-2:var(--autumn-2); --season-3:var(--autumn-3); --season-accent:var(--autumn-accent); --season-glow:239,124,61; }
[data-season="winter"]{ --season-1:var(--winter-1); --season-2:var(--winter-2); --season-3:var(--winter-3); --season-accent:var(--winter-accent); --season-glow:65,105,232; }

/* ---- Ranglangan ikon-nishon variantlari (stat/dept ikonalari uchun,
   Werker/Franfer uslubidagi ko'p ranglilik) — QO'SHIMCHA klasslar,
   mavjud .stat-icon/.dept-icon bilan birga ishlatiladi ---- */
.c-violet{ background:#eee9ff; color:#6c5ce7; }
.c-blue{ background:#e3edff; color:#3667dd; }
.c-green{ background:var(--good-bg); color:var(--good); }
.c-orange{ background:var(--warn-bg); color:var(--warn); }
.c-rose{ background:#ffe7ee; color:#df5079; }
.c-teal{ background:#e1f7f2; color:#0f9e86; }
[data-theme="dark"] .c-violet{ background:rgba(124,108,255,.18); color:#c2b6ff; }
[data-theme="dark"] .c-blue{ background:rgba(66,120,230,.2); color:#a7c2ff; }
[data-theme="dark"] .c-rose{ background:rgba(224,80,125,.18); color:#ff9fbc; }
[data-theme="dark"] .c-teal{ background:rgba(15,158,134,.22); color:#67e2c9; }

*{box-sizing:border-box; margin:0; padding:0;}
html,body{height:100%;}
body{
  font-family:var(--font-body);
  background:var(--bg);
  color:var(--ink);
  -webkit-font-smoothing:antialiased;
  transition:background .4s ease, color .4s ease;
}

/* ============ LAYOUT ============ */
.app{ display:flex; min-height:100vh; }

/* ---- Sidebar ---- */
.sidebar{
  width:260px;
  flex-shrink:0;
  background:var(--bg-elevated);
  border-right:1px solid var(--line);
  display:flex;
  flex-direction:column;
  padding:22px 14px;
  position:sticky;
  top:0;
  height:100vh;
}
.brand{
  display:flex; align-items:center; gap:11px;
  padding:4px 10px 20px 10px;
  border-bottom:1px solid var(--line);
  margin-bottom:16px;
}
.brand-mark{
  width:86px; height:86px; border-radius:24px;
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0; overflow:hidden;
  box-shadow:0 6px 16px -4px rgba(var(--season-glow),.4);
}
.brand-mark img{ width:100%; height:100%; object-fit:contain; }
.brand-text h1{
  font-family:var(--font-display);
  font-size:16.5px; font-weight:600; letter-spacing:.2px; line-height:1.1;
}
.brand-text span{ font-size:11px; color:var(--ink-faint); }

.nav{
  display:flex; flex-direction:column; gap:2px; flex:1;
  overflow-y:auto; min-height:0;
  scrollbar-width:thin;
  scrollbar-color:var(--line-strong) transparent;
}
.nav::-webkit-scrollbar{ width:3px; }
.nav::-webkit-scrollbar-track{ background:transparent; }
.nav::-webkit-scrollbar-thumb{ background:var(--line-strong); border-radius:3px; }
.nav-label{
  font-size:10.5px; text-transform:uppercase; letter-spacing:.09em;
  color:var(--ink-faint); padding:16px 12px 7px;
  font-weight:700;
}
.nav-item{
  display:flex; align-items:center; gap:11px;
  padding:9px 11px; border-radius:12px;
  color:var(--ink-soft); text-decoration:none; cursor:pointer;
  font-size:13.5px; font-weight:500;
  border:1px solid transparent;
  transition:background .15s, color .15s;
  user-select:none;
}
.nav-item svg{ width:17px; height:17px; flex-shrink:0; opacity:.8; transition:opacity .15s; }
.nav-item:hover{ background:var(--bg-sunken); color:var(--ink); }
.nav-item.active{
  background:var(--season-1);
  color:var(--season-3);
  font-weight:600;
}
[data-theme="dark"] .nav-item.active{ color:var(--season-accent); background:rgba(255,255,255,.06); }
.nav-item.active svg{ opacity:1; }

.sidebar-foot{ border-top:1px solid var(--line); padding-top:14px; margin-top:10px; display:flex; flex-direction:column; gap:9px; }

/* season + theme switchers */
.switch-row{ display:flex; align-items:center; justify-content:space-between; padding:0 4px; }
.switch-label{ font-size:11.5px; color:var(--ink-faint); font-weight:500; }
.seasons{ display:flex; gap:5px; }
.season-dot{
  width:21px; height:21px; border-radius:50%; cursor:pointer;
  border:2px solid transparent; position:relative;
  transition:transform .15s, border-color .15s;
}
.season-dot:hover{ transform:scale(1.15); }
.season-dot.active{ border-color:var(--ink); }
.season-dot[data-s="spring"]{ background:linear-gradient(135deg,#7fe0ab,#0e9a57); }
.season-dot[data-s="summer"]{ background:linear-gradient(135deg,#ffd27a,#d97706); }
.season-dot[data-s="autumn"]{ background:linear-gradient(135deg,#f6a26c,#c2410c); }
.season-dot[data-s="winter"]{ background:linear-gradient(135deg,#9db8f5,#2952c8); }

.theme-toggle{
  display:flex; align-items:center; gap:6px;
  background:var(--bg-sunken); border-radius:20px; padding:3px;
  border:1px solid var(--line);
}
.theme-btn{
  width:28px; height:26px; border-radius:16px; border:none; background:transparent;
  display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--ink-faint);
  transition:background .15s, color .15s;
}
.theme-btn svg{ width:14px; height:14px; }
.theme-btn.active{ background:var(--bg-elevated); color:var(--season-3); box-shadow:var(--shadow-sm); }
[data-theme="dark"] .theme-btn.active{ color:var(--season-accent); }

.lang-toggle{ display:flex; gap:2px; background:var(--bg-sunken); border-radius:8px; padding:2px; }
.lang-btn{
  padding:4px 10px; border-radius:6px; border:none; background:transparent;
  color:var(--ink-faint); font-size:12px; font-weight:700; cursor:pointer;
  font-family:var(--font-body); transition:all .15s;
}
.lang-btn:hover{ color:var(--ink-soft); }
.lang-btn.active{ background:var(--bg-elevated); color:var(--season-3); box-shadow:var(--shadow-sm); }
[data-theme="dark"] .lang-btn.active{ color:var(--season-accent); }

/* ---- Mavzu (Eski/Yangi dizayn) almashtirgichi - .lang-toggle bilan bir xil ko'rinish ---- */
.design-toggle{ display:flex; gap:2px; background:var(--bg-sunken); border-radius:8px; padding:2px; }
.design-btn{
  padding:4px 10px; border-radius:6px; border:none; background:transparent;
  color:var(--ink-faint); font-size:12px; font-weight:700; cursor:pointer;
  font-family:var(--font-body); transition:all .15s;
}
.design-btn:hover{ color:var(--ink-soft); }
.design-btn.active{ background:var(--bg-elevated); color:var(--season-3); box-shadow:var(--shadow-sm); }
[data-theme="dark"] .design-btn.active{ color:var(--season-accent); }

/* ---- Main ---- */
.main{ flex:1; min-width:0; display:flex; flex-direction:column; }
.topbar{
  height:70px; flex-shrink:0;
  display:flex; align-items:center; justify-content:space-between;
  padding:0 30px;
  border-bottom:1px solid var(--line);
  background:var(--bg-elevated);
}
.mobile-menu-toggle{
  display:none; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:11px; border:1px solid var(--line);
  background:var(--bg-sunken); color:var(--ink); cursor:pointer; margin-right:6px; flex-shrink:0;
}
.mobile-menu-toggle svg{ width:18px; height:18px; }
.topbar-back{
  display:flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:11px; border:1px solid var(--line);
  background:var(--bg-sunken); color:var(--ink-soft); cursor:pointer; margin-right:12px; flex-shrink:0;
  transition:background .15s, color .15s, transform .12s;
}
.topbar-back:hover{ background:var(--season-1); color:var(--season-3); }
.topbar-back:active{ transform:scale(.93); }
.topbar-back svg{ width:17px; height:17px; }
.topbar h2{ font-family:var(--font-display); font-size:21px; font-weight:600; letter-spacing:-.01em; }
.topbar .sub{ font-size:12.5px; color:var(--ink-faint); margin-top:2px; }
.topbar-right{ display:flex; align-items:center; gap:12px; }
.live-clock{
  font-family:var(--font-mono); font-size:13px; color:var(--ink-soft);
  background:var(--bg-sunken); padding:8px 13px; border-radius:12px;
  border:1px solid var(--line);
}
.org-switch-form{ display:inline-block; }
.org-switch{
  font-family:var(--font-body); font-size:12.5px; font-weight:600; color:var(--ink);
  background:var(--bg-sunken); border:1px solid var(--line); border-radius:12px;
  padding:8px 11px; cursor:pointer;
}
.org-fixed-badge{
  font-size:11.5px; font-weight:700; color:var(--season-3); background:var(--season-1);
  padding:7px 13px; border-radius:999px; text-transform:uppercase; letter-spacing:.02em;
}
[data-theme="dark"] .org-fixed-badge{ background:rgba(255,255,255,.07); }
.avatar-chip{
  display:flex; align-items:center; gap:9px;
  background:var(--bg-sunken); border:1px solid var(--line);
  padding:5px 14px 5px 5px; border-radius:999px; cursor:default;
}
.avatar-chip .av{
  width:30px;height:30px;border-radius:50%;
  background:linear-gradient(135deg,var(--season-2),var(--season-3));
  color:#fff; font-size:12px; font-weight:700; display:flex;align-items:center;justify-content:center;
  box-shadow:0 3px 8px -2px rgba(var(--season-glow),.5);
}
.avatar-chip span{ font-size:13px; font-weight:600; }
.role-pill{
  font-size:10.5px; font-weight:700; padding:2px 9px; border-radius:999px;
  text-transform:uppercase; letter-spacing:.03em; margin-left:2px;
}
.role-pill.role-superadmin{ background:var(--bad-bg); color:var(--bad); }
.role-pill.role-kadr{ background:var(--warn-bg); color:var(--warn); }
.role-pill.role-rahbar{ background:var(--good-bg); color:var(--good); }
.user-menu{
  display:none; position:absolute; top:48px; right:0; z-index:50;
  background:var(--bg-elevated); border:1px solid var(--line); border-radius:14px;
  box-shadow:var(--shadow-lg); min-width:170px; padding:6px; overflow:hidden;
}
.user-menu.open{ display:block; }
.user-menu-item{
  display:flex; align-items:center; gap:9px; padding:9px 11px; border-radius:9px;
  font-size:13px; color:var(--ink-soft); text-decoration:none; cursor:pointer;
}
.user-menu-item:hover{ background:var(--bg-sunken); color:var(--ink); }
.user-menu-item svg{ width:15px; height:15px; }

.content{ padding:26px 30px 50px; flex:1; background:var(--bg); }
.view{ display:none; animation:fadeIn .35s ease; }
.view.active{ display:block; }
@keyframes fadeIn{ from{opacity:0; transform:translateY(6px);} to{opacity:1; transform:translateY(0);} }

/* ============ DASHBOARD ============ */
.stat-grid{
  display:grid; grid-template-columns:repeat(5,1fr); gap:16px; margin-bottom:24px;
}
@media (max-width: 1280px){
  .stat-grid{ grid-template-columns:repeat(3,1fr); }
}
.stat-card{
  background:var(--bg-elevated); border:1px solid var(--line); border-radius:var(--radius);
  padding:20px 20px 18px; box-shadow:var(--shadow-sm); position:relative; overflow:hidden;
  transition:box-shadow .2s, transform .2s;
}
.stat-top{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px;}
.stat-icon{
  width:38px; height:38px; border-radius:12px; background:var(--season-1);
  display:flex; align-items:center; justify-content:center; color:var(--season-3);
}
.stat-icon svg{ width:19px; height:19px; }
.stat-trend{ font-size:11.5px; font-weight:700; padding:4px 9px; border-radius:999px; }
.stat-trend.up{ color:var(--good); background:var(--good-bg); }
.stat-trend.down{ color:var(--bad); background:var(--bad-bg); }
.stat-num{ font-family:var(--font-body); font-size:29px; font-weight:700; line-height:1; margin-bottom:6px; letter-spacing:-0.02em;}
.stat-label{ font-size:13px; color:var(--ink-soft); font-weight:500; }

.row-2col{ display:grid; grid-template-columns:1fr 1fr; gap:16px; margin-bottom:24px; align-items:start; }
.panel{
  background:var(--bg-elevated); border:1px solid var(--line); border-radius:var(--radius);
  padding:22px 24px; box-shadow:var(--shadow-sm);
}
.panel-head{ display:flex; align-items:center; justify-content:space-between; margin-bottom:18px; gap:10px; }
.panel-head h3{ font-family:var(--font-body); font-size:15.5px; font-weight:700; letter-spacing:-.005em; }
.panel-head .pill{ font-size:11.5px; color:var(--ink-soft); background:var(--bg-sunken); padding:5px 12px; border-radius:999px; font-weight:600; white-space:nowrap; }

/* weekly bar chart (pure css) */
.bars{ display:flex; align-items:flex-end; gap:10px; height:180px; padding-top:30px; }
.bar-col{ flex:1; display:flex; flex-direction:column; align-items:center; gap:8px; height:100%; justify-content:flex-end; }
.bar-track{ width:100%; height:100%; display:flex; align-items:flex-end; justify-content:center; }
.bar{
  width:60%; border-radius:8px 8px 3px 3px;
  background:linear-gradient(180deg, var(--season-2), var(--season-3));
  position:relative; transition:height .6s ease;
  min-height:4px;
}
.bar.late{ background:linear-gradient(180deg, var(--warn), var(--bad)); }
.bar-num{
  position:absolute; top:-18px; left:50%; transform:translateX(-50%);
  font-size:10px; font-weight:700; color:var(--ink-soft); white-space:nowrap;
}
.bar-total{
  font-size:12px; font-weight:700; color:var(--ink); text-align:center;
  margin-bottom:2px; font-family:var(--font-body);
}
.bar-day{ font-size:11px; color:var(--ink-faint); font-weight:600; }
.legend{ display:flex; gap:16px; margin-top:14px; justify-content:center; }
.legend-item{ display:flex; align-items:center; gap:6px; font-size:11.5px; color:var(--ink-soft); }
.legend-dot{ width:9px; height:9px; border-radius:50%; }

.status-list{ display:flex; flex-direction:column; gap:14px; }
.status-row{ display:flex; align-items:center; gap:11px; }
.status-row .dot{ width:9px; height:9px; border-radius:50%; flex-shrink:0; }
.status-row .lbl{ font-size:13px; color:var(--ink-soft); flex:1; }
.status-row .val{ font-family:var(--font-mono); font-size:13px; font-weight:700; }
.bar-bg{ width:100%; height:7px; background:var(--bg-sunken); border-radius:999px; overflow:hidden; margin-top:6px; }
.bar-fill{ height:100%; border-radius:999px; }

.activity-feed{ display:flex; flex-direction:column; }
.feed-item{ display:flex; gap:12px; padding:12px 0; border-bottom:1px solid var(--line); }
.feed-item:last-child{ border-bottom:none; padding-bottom:0; }
.feed-av{
  width:34px;height:34px;border-radius:50%; flex-shrink:0;
  background:linear-gradient(135deg,var(--season-2),var(--season-3));
  color:#fff; font-size:12px; font-weight:700; display:flex;align-items:center;justify-content:center;
}
.feed-text{ font-size:13px; line-height:1.4; }
.feed-text b{ font-weight:600; }
.feed-time{ font-size:11.5px; color:var(--ink-faint); margin-top:2px; }
.feed-badge{ font-size:11px; font-weight:700; padding:3px 9px; border-radius:999px; margin-left:auto; align-self:center; white-space:nowrap; }

/* ============ TABLE / EMPLOYEES ============ */
.toolbar{ display:flex; align-items:center; gap:10px; margin-bottom:18px; flex-wrap:wrap; }
.search-box{
  flex:1; min-width:220px; display:flex; align-items:center; gap:8px;
  background:var(--bg-elevated); border:1.5px solid var(--line); border-radius:12px;
  padding:10px 14px; box-shadow:var(--shadow-sm); transition:border-color .15s, box-shadow .15s;
}
.search-box:hover{ border-color:var(--line-strong); }
.search-box:has(input:focus){ border-color:var(--season-3); box-shadow:0 0 0 3px var(--season-1); }
.search-box svg{ width:16px; height:16px; color:var(--ink-faint); flex-shrink:0; }
.search-box input{
  border:none; outline:none; background:transparent; width:100%;
  font-size:13.5px; color:var(--ink); font-family:var(--font-body);
}
.search-box input::placeholder{ color:var(--ink-faint); }
.filter-select{
  background:var(--bg-elevated); border:1.5px solid var(--line); border-radius:12px;
  padding:10px 36px 10px 14px; font-size:13.5px; color:var(--ink-soft); box-shadow:var(--shadow-sm);
  cursor:pointer; font-family:var(--font-body); transition:border-color .15s, box-shadow .15s, color .15s;
  appearance:none; -webkit-appearance:none; -moz-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2368687e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 11px center; background-size:15px;
}
/* input[type=date]/[type=time] uchun select kabi o'q kerak emas (brauzer o'zi taqdim etadi) */
.filter-select[type="date"], .filter-select[type="time"]{
  padding-right:14px; background-image:none;
}
.filter-select:hover{ border-color:var(--line-strong); color:var(--ink); }
.filter-select:focus{ outline:none; border-color:var(--season-3); box-shadow:0 0 0 3px var(--season-1); color:var(--ink); }
.btn-primary{
  background:linear-gradient(135deg,var(--season-2),var(--season-3));
  color:#fff; border:none; padding:10px 19px; border-radius:12px;
  font-size:13.5px; font-weight:600; cursor:pointer; box-shadow:0 6px 16px -6px rgba(var(--season-glow),.55);
  display:flex; align-items:center; gap:7px; transition:transform .12s, box-shadow .12s;
}
.btn-primary:hover{ transform:translateY(-1px); box-shadow:0 10px 22px -6px rgba(var(--season-glow),.6); }
.btn-primary:active{ transform:translateY(0); }
.btn-primary svg{ width:15px;height:15px; }

/* ============ .btn — IKKINCHI DARAJALI TUGMA ============ */
.btn{
  background:var(--bg-sunken); color:var(--ink); border:1.5px solid var(--line);
  padding:9px 16px; border-radius:12px; font-size:13.5px; font-weight:600;
  cursor:pointer; display:inline-flex; align-items:center; justify-content:center;
  gap:7px; flex-shrink:0; align-self:center; line-height:1.3;
  transition:background .15s, border-color .15s, transform .12s;
  font-family:var(--font-body);
}
.btn:hover{ background:var(--bg-elevated); border-color:var(--season-3); }
.btn:active{ transform:translateY(1px); }
.btn svg{ width:15px; height:15px; flex-shrink:0; }
.btn.btn-sm{ padding:6px 12px; font-size:12.5px; }
.btn.btn-sm svg{ width:13px; height:13px; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

.top-range-btn{
  cursor:pointer; border:1px solid var(--line); background:var(--bg-sunken);
  color:var(--ink-soft); padding:6px 15px; border-radius:999px; font-size:13px;
  font-family:var(--font-body); transition:all .15s ease;
}
.top-range-btn:hover{ border-color:var(--season-3); color:var(--ink); }
.top-range-btn.active{
  background:var(--season-3); color:#fff; border-color:var(--season-3); font-weight:600;
}
[data-theme="dark"] .top-range-btn.active{ color:#12120f; }

.table-wrap{
  background:var(--bg-elevated); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow-sm); overflow-x:auto; overflow-y:hidden;
}
table{ width:100%; border-collapse:collapse; }
thead th{
  text-align:left; font-size:11px; text-transform:uppercase; letter-spacing:.07em;
  color:var(--ink-faint); font-weight:700; padding:14px 18px;
  border-bottom:1px solid var(--line); background:var(--bg-sunken);
  white-space:nowrap;
}
tbody td{ padding:14px 18px; font-size:13.5px; border-bottom:1px solid var(--line); color:var(--ink); }
/* Uzun matnli ustunlar (ism, bo'lim, lavozim) - "..." bilan qisqartiriladi,
   to'liq matn esa title atributi/hover orqali ko'rinadi. Bu jadvalni
   SIQIQ qiladi - sizning "100% mashtabda hammasi ko'rinsin, scroll
   kerak emas" so'rovingiz bo'yicha. */
tbody td.truncate, tbody td .truncate{
  max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  display:inline-block; vertical-align:middle;
}
/* Raqam/sana/vaqt/status ustunlari - hech qachon ikki qatorga
   bo'linmasligi kerak, lekin keng emas */
tbody td.mono, tbody td .badge, tbody td .row-actions{ white-space:nowrap; }
tbody tr:last-child td{ border-bottom:none; }
tbody tr{ transition:background .12s; }
tbody tr:hover{ background:var(--bg-sunken); }
.row-actions{ display:inline-flex; gap:6px; align-items:center; }
.emp-cell{ display:flex; align-items:center; gap:10px; }
.emp-av{
  width:36px;height:36px;border-radius:50%; flex-shrink:0;
  background:linear-gradient(135deg,var(--season-2),var(--season-3));
  color:#fff; font-size:13px; font-weight:700; display:flex;align-items:center;justify-content:center;
  overflow:hidden; box-shadow:0 0 0 2px var(--bg-elevated), 0 0 0 3px var(--line);
}
.emp-av img{ width:100%;height:100%;object-fit:cover;position:absolute;inset:0;display:none; }
.emp-av{ position:relative; }
.emp-av-lg{ width:56px;height:56px;font-size:18px; }
.emp-av-lg img{ display:block !important; }
.emp-gallery-head .emp-av img{ display:block !important; }
.emp-name{ font-weight:600; }
.emp-role{ font-size:11.5px; color:var(--ink-faint); }
.mono{ font-family:var(--font-mono); font-size:12.5px; color:var(--ink-soft); }
.badge{ font-size:11.5px; font-weight:700; padding:5px 11px; border-radius:999px; display:inline-flex; align-items:center; gap:6px; }
.badge::before{ content:''; width:6px; height:6px; border-radius:50%; }
.badge.ok{ color:var(--good); background:var(--good-bg); }
.badge.ok::before{ background:var(--good); }
.badge.late{ color:var(--warn); background:var(--warn-bg); }
.badge.late::before{ background:var(--warn); }
.badge.off{ color:var(--bad); background:var(--bad-bg); }
.badge.off::before{ background:var(--bad); }
.icon-btn{
  width:31px;height:31px; border-radius:10px; border:1px solid var(--line); background:var(--bg-elevated);
  display:inline-flex; align-items:center; justify-content:center; cursor:pointer; color:var(--ink-soft);
  transition:background .15s, color .15s, border-color .15s;
}
.icon-btn svg{ width:15px;height:15px; }
.icon-btn:hover{ background:var(--season-1); color:var(--season-3); border-color:var(--season-1); }
.faceid-tag{ display:inline-flex; align-items:center; gap:6px; font-size:11.5px; color:var(--ink-faint); }
.faceid-tag-off{ color:var(--warn); cursor:help; }
.faceid-tag-off svg{ color:var(--warn); }
.faceid-tag svg{ width:13px;height:13px; color:var(--season-3); }

/* ============ ATTENDANCE DETAIL VIEW ============ */
.emp-header{
  display:flex; align-items:center; gap:18px; margin-bottom:20px;
  background:var(--bg-elevated); border:1px solid var(--line); border-radius:var(--radius);
  padding:22px 24px; box-shadow:var(--shadow-sm);
}
.emp-header .emp-av{ width:58px; height:58px; font-size:19px; }
.emp-header-info h2{ font-family:var(--font-display); font-size:19px; font-weight:600; }
.emp-header-info .meta{ font-size:12.5px; color:var(--ink-faint); margin-top:3px; display:flex; gap:14px; flex-wrap:wrap; }
.emp-header-stats{ display:flex; gap:24px; margin-left:auto; flex-wrap:wrap; justify-content:flex-end; }
.ehs{ text-align:right; }
.ehs .n{ font-family:var(--font-display); font-size:21px; font-weight:600; }
.ehs .l{ font-size:11px; color:var(--ink-faint); }

.day-list{ display:flex; flex-direction:column; gap:10px; }
.day-card{
  display:grid; grid-template-columns:90px 1fr auto auto auto; align-items:center; gap:18px;
  background:var(--bg-elevated); border:1px solid var(--line); border-radius:14px;
  padding:15px 18px; box-shadow:var(--shadow-sm);
}
.day-date{ font-size:13px; font-weight:600; }
.day-date .dow{ font-size:11px; color:var(--ink-faint); font-weight:500; display:block; margin-top:1px;}
.day-times{ display:flex; gap:22px; }
.dt{ display:flex; flex-direction:column; gap:2px; }
.dt .l{ font-size:10.5px; color:var(--ink-faint); text-transform:uppercase; letter-spacing:.04em; }
.dt .v{ font-family:var(--font-mono); font-size:13.5px; font-weight:600; }
.day-duration{ font-family:var(--font-mono); font-weight:700; font-size:14px; color:var(--season-3); }
.mini-bar{ width:90px; height:7px; background:var(--bg-sunken); border-radius:999px; overflow:hidden; }
.mini-bar-fill{ height:100%; background:linear-gradient(90deg,var(--season-2),var(--season-3)); border-radius:999px; }

/* Tushlik/Tanaffus chip'lari - day-card grid'i ichida BUTUN QATORNI egallaydi */
.day-breaks{ grid-column:1 / -1; display:flex; gap:8px; flex-wrap:wrap; margin-top:-4px; }
.day-break-reason{ grid-column:1 / -1; font-size:11.5px; margin-top:-4px; }
.break-chip{
  display:inline-flex; align-items:center; gap:5px; font-size:11px; font-weight:600;
  padding:5px 10px; border-radius:999px; white-space:nowrap;
}
.break-chip.lunch{ background:var(--good-bg); color:var(--good); }
.break-chip.other{ background:var(--bg-sunken); color:var(--ink-soft); }
.break-chip.warn{ background:var(--warn-bg); color:var(--warn); }
.break-chip.clickable{ cursor:pointer; transition:transform .12s, box-shadow .12s; }
.break-chip.clickable:hover{ transform:translateY(-1px); box-shadow:0 2px 5px rgba(24,24,50,.14); }
.break-chip-count{ opacity:.7; font-weight:500; margin-left:1px; }

.back-link{
  display:inline-flex; align-items:center; gap:6px; font-size:13px; color:var(--ink-soft);
  cursor:pointer; margin-bottom:14px; font-weight:500;
}
.back-link svg{ width:15px;height:15px; }
.back-link:hover{ color:var(--ink); }

.week-avg-banner{
  display:flex; align-items:center; gap:14px; margin-top:20px;
  background:var(--season-1); border:1px solid var(--line); border-radius:var(--radius);
  padding:17px 22px;
}
[data-theme="dark"] .week-avg-banner{ background:rgba(255,255,255,.05); }
.week-avg-banner svg{ width:26px; height:26px; color:var(--season-3); flex-shrink:0; }
.week-avg-banner .t{ font-size:13px; color:var(--ink-soft); }
.week-avg-banner .v{ font-family:var(--font-display); font-size:19px; font-weight:700; color:var(--season-3); margin-left:4px; }

/* ============ CLICKABLE STAT CARDS ============ */
.stat-card.clickable{ cursor:pointer; }
.stat-card.clickable:hover{ transform:translateY(-3px); box-shadow:var(--shadow-lg); border-color:var(--line-strong); }
.stat-card.clickable:active{ transform:translateY(-1px); }
.stat-foot{ display:flex; align-items:center; gap:5px; font-size:11px; color:var(--ink-faint); margin-top:11px; font-weight:500; }
.stat-foot svg{ width:11px; height:11px; }

/* ============ MODAL ============ */
.modal-overlay{
  position:fixed; inset:0; background:rgba(14,14,24,.55);
  display:none; align-items:center; justify-content:center;
  z-index:100; padding:24px; backdrop-filter:blur(3px);
}
.modal-overlay.open{ display:flex; animation:fadeIn .2s ease; }
.modal-box{
  background:var(--bg-elevated); border-radius:22px; border:1px solid var(--line);
  width:100%; max-width:640px; max-height:84vh; overflow-y:auto;
  box-shadow:0 24px 70px rgba(0,0,0,.3);
  animation:modalIn .25s ease;
}
@keyframes modalIn{ from{opacity:0; transform:translateY(10px) scale(.98);} to{opacity:1; transform:translateY(0) scale(1);} }
.modal-head{
  display:flex; align-items:flex-start; justify-content:space-between;
  padding:24px 26px 16px; border-bottom:1px solid var(--line);
  position:sticky; top:0; background:var(--bg-elevated);
}
.modal-head h3{ font-family:var(--font-display); font-size:18px; font-weight:600; }
.modal-head p{ font-size:12.5px; color:var(--ink-faint); margin-top:4px; }
.modal-close{
  width:31px; height:31px; border-radius:10px; border:1px solid var(--line); background:var(--bg-sunken);
  display:flex; align-items:center; justify-content:center; cursor:pointer; color:var(--ink-soft); flex-shrink:0;
  transition:background .15s, color .15s;
}
.modal-close svg{ width:14px; height:14px; }
.modal-close:hover{ color:var(--bad); background:var(--bad-bg); }
.modal-body{ padding:18px 26px 28px; }
.modal-row{
  display:flex; align-items:center; justify-content:space-between;
  padding:12px 0; border-bottom:1px solid var(--line);
}
.modal-row:last-child{ border-bottom:none; }
.modal-row .l{ font-size:13px; color:var(--ink-soft); }
.modal-row .v{ font-family:var(--font-mono); font-weight:700; font-size:13.5px; }
.modal-note{
  background:var(--season-1); border-radius:12px; padding:13px 15px; font-size:12.5px;
  color:var(--ink-soft); line-height:1.5; margin-bottom:14px;
}
[data-theme="dark"] .modal-note{ background:rgba(255,255,255,.05); }

/* ============ RANKING LIST (top-5) ============ */
.rank-list{ display:flex; flex-direction:column; gap:4px; }
.rank-row{
  display:flex; align-items:center; gap:12px; padding:10px 8px; border-radius:12px;
  cursor:pointer; transition:background .12s;
}
.rank-row:hover{ background:var(--bg-sunken); }
.rank-num{
  width:25px; height:25px; border-radius:8px; flex-shrink:0;
  display:flex; align-items:center; justify-content:center;
  font-size:11.5px; font-weight:700; font-family:var(--font-mono);
  background:var(--bg-sunken); color:var(--ink-faint);
}
.rank-row:nth-child(1) .rank-num{ background:var(--bad-bg); color:var(--bad); }
.rank-row:nth-child(2) .rank-num{ background:var(--warn-bg); color:var(--warn); }
.rank-row:nth-child(3) .rank-num{ background:var(--warn-bg); color:var(--warn); }
.rank-info{ flex:1; min-width:0; }
.rank-info .n{ font-size:13px; font-weight:600; }
.rank-info .d{ font-size:11.5px; color:var(--ink-faint); }
.rank-count{ text-align:right; flex-shrink:0; }
.rank-count .n{ font-family:var(--font-mono); font-weight:700; font-size:15px; color:var(--bad); }
.rank-count .l{ font-size:10.5px; color:var(--ink-faint); }

/* ============ DEPARTMENT COMPARISON BARS ============ */
.dept-bars{ display:flex; flex-direction:column; gap:15px; }
.dept-bar-row{ display:flex; align-items:center; gap:12px; cursor:pointer; }
.dept-bar-row:hover .dept-bar-fill{ filter:brightness(1.08); }
.dept-bar-label{ width:118px; flex-shrink:0; font-size:12.5px; font-weight:600; color:var(--ink-soft); }
.dept-bar-track{ flex:1; height:19px; background:var(--bg-sunken); border-radius:999px; overflow:hidden; position:relative; }
.dept-bar-fill{
  height:100%; border-radius:999px; display:flex; align-items:center;
  transition:width .6s ease, filter .15s;
}
.dept-bar-val{ width:34px; text-align:right; flex-shrink:0; font-family:var(--font-mono); font-size:12.5px; font-weight:700; }

/* ============ HEATMAP ============ */
.heatmap-wrap{ overflow-x:auto; }
.heatmap{ display:grid; grid-template-columns:42px repeat(10, 1fr); gap:4px; min-width:560px; }
.heatmap-corner{ }
.heatmap-hour{ font-size:10px; color:var(--ink-faint); text-align:center; font-family:var(--font-mono); padding-bottom:4px; }
.heatmap-day-label{ font-size:11px; color:var(--ink-soft); font-weight:600; display:flex; align-items:center; }
.heatmap-cell{
  aspect-ratio:1; border-radius:7px; cursor:default;
  display:flex; align-items:center; justify-content:center;
  font-size:9.5px; font-weight:700; color:transparent;
  transition:transform .1s;
}
.heatmap-cell:hover{ transform:scale(1.15); color:#fff; z-index:2; box-shadow:0 4px 12px rgba(0,0,0,.3); }
.heatmap-legend{ display:flex; align-items:center; gap:8px; margin-top:14px; font-size:11px; color:var(--ink-faint); justify-content:flex-end; }
.heatmap-legend-scale{ display:flex; gap:2px; }
.heatmap-legend-scale span{ width:14px; height:10px; border-radius:3px; }

/* ============ ALERT LIST ============ */
.alert-list{ display:flex; flex-direction:column; gap:10px; }
.alert-row{
  display:flex; align-items:center; gap:12px; padding:13px 15px; border-radius:14px;
  background:var(--bad-bg); border:1px solid transparent; cursor:pointer; transition:transform .12s;
}
.alert-row:hover{ transform:translateX(2px); }
.alert-row.warn{ background:var(--warn-bg); }
.alert-icon{
  width:33px; height:33px; border-radius:11px; flex-shrink:0; display:flex; align-items:center; justify-content:center;
  background:var(--bad); color:#fff;
}
.alert-row.warn .alert-icon{ background:var(--warn); }
.alert-icon svg{ width:16px; height:16px; }
.alert-text{ flex:1; min-width:0; }
.alert-text .n{ font-size:13px; font-weight:700; color:var(--bad); }
.alert-row.warn .alert-text .n{ color:var(--warn); }
.alert-text .d{ font-size:12px; color:var(--ink-soft); margin-top:1px; }
.alert-chev{ color:var(--ink-faint); flex-shrink:0; }
.alert-chev svg{ width:15px; height:15px; }
.empty-alert{ text-align:center; padding:24px 10px; color:var(--ink-faint); font-size:13px; }
.empty-alert svg{ width:30px; height:30px; margin-bottom:8px; opacity:.5; }

/* ============ LEAVE / ON-LEAVE LIST ============ */
.leave-list{ display:flex; flex-direction:column; gap:12px; }
.leave-row{ display:flex; align-items:center; gap:11px; }
.leave-row .emp-av{ width:32px; height:32px; font-size:12px; }
.leave-info{ flex:1; min-width:0; }
.leave-info .n{ font-size:13px; font-weight:600; }
.leave-info .d{ font-size:11.5px; color:var(--ink-faint); }
.leave-badge{ font-size:11px; font-weight:700; padding:4px 10px; border-radius:999px; flex-shrink:0; }
.leave-badge.vacation{ color:var(--season-3); background:var(--season-1); }
.leave-badge.sick{ color:var(--bad); background:var(--bad-bg); }

/* ============ TREND LINE CHART ============ */
.trend-chart{ width:100%; height:180px; }
.trend-tooltip-row{ display:flex; justify-content:space-between; margin-top:10px; padding:0 2px; }
.trend-tooltip-row span{ font-size:10.5px; color:var(--ink-faint); font-family:var(--font-mono); }

/* ============ MINI STAT ROW (overtime / erta ketish) ============ */
.mini-stat-grid{ display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.mini-stat{
  background:var(--bg-sunken); border-radius:14px; padding:17px; cursor:pointer;
  transition:background .15s;
}
.mini-stat:hover{ background:var(--bg-sunken); filter:brightness(.97); }
[data-theme="dark"] .mini-stat:hover{ filter:brightness(1.15); }
.mini-stat-top{ display:flex; align-items:center; gap:8px; margin-bottom:10px; color:var(--ink-soft); }
.mini-stat-top svg{ width:16px; height:16px; }
.mini-stat-top span{ font-size:12.5px; font-weight:600; text-transform:uppercase; letter-spacing:.03em; }
.mini-stat-num{ font-family:var(--font-body); font-size:22px; font-weight:700; letter-spacing:-0.01em; }
.mini-stat-sub{ font-size:12px; color:var(--ink-faint); margin-top:3px; }

/* ============ DEPARTMENTS VIEW ============ */
.dept-grid{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.dept-card{
  background:var(--bg-elevated); border:1px solid var(--line); border-radius:var(--radius);
  padding:21px; box-shadow:var(--shadow-sm); transition:transform .15s, box-shadow .15s;
}
.dept-card:hover{ transform:translateY(-3px); box-shadow:var(--shadow-lg); }
.dept-card-head{ display:flex; align-items:center; gap:12px; margin-bottom:16px; }
.dept-icon{
  width:42px; height:42px; border-radius:13px; background:var(--season-1); color:var(--season-3);
  display:flex; align-items:center; justify-content:center; flex-shrink:0;
}
.dept-icon svg{ width:20px; height:20px; }
.dept-card-head h4{ font-family:var(--font-display); font-size:15.5px; font-weight:600; }
.dept-card-head .c{ font-size:11.5px; color:var(--ink-faint); }
.dept-metrics{ display:flex; flex-direction:column; gap:9px; }
.dept-metric-row{ display:flex; align-items:center; justify-content:space-between; font-size:12.5px; }
.dept-metric-row .l{ color:var(--ink-soft); }
.dept-metric-row .v{ font-family:var(--font-mono); font-weight:700; }
.dept-card-foot{
  display:flex; align-items:center; justify-content:space-between; margin-top:16px; padding-top:14px;
  border-top:1px solid var(--line); font-size:11.5px; color:var(--season-3); font-weight:600;
}
.dept-card-foot svg{ width:13px; height:13px; }
.dept-card-actions{ display:flex; gap:6px; margin-top:10px; padding-top:10px; border-top:1px solid var(--line); }

@media (max-width: 980px){
  .sidebar{
    display:flex; position:fixed; top:0; left:0; height:100vh; z-index:200;
    transform:translateX(-100%); transition:transform .25s ease;
    box-shadow:0 0 40px rgba(0,0,0,.25);
  }
  .sidebar.mobile-open{ transform:translateX(0); }
  .sidebar-backdrop{
    display:none; position:fixed; inset:0; background:rgba(0,0,0,.4); z-index:199;
  }
  .sidebar-backdrop.visible{ display:block; }
  .mobile-menu-toggle{ display:flex !important; }
  .main{ width:100%; }
  .stat-grid{ grid-template-columns:repeat(2,1fr); }
  .row-2col{ grid-template-columns:1fr; }
  .day-card{ grid-template-columns:1fr; gap:10px; }
  .emp-header{ flex-wrap:wrap; }
  .emp-header-stats{ margin-left:0; width:100%; justify-content:space-between; }
  .mini-stat-grid{ grid-template-columns:1fr; }
  .dept-grid{ grid-template-columns:1fr; }
  .heatmap{ min-width:480px; }
}

@media (max-width: 640px){
  .content{ padding:16px 14px 40px; }
  .topbar{ flex-wrap:wrap; gap:10px; padding:14px 16px; }
  .topbar h2{ font-size:17px; }
  .topbar-right{ flex-wrap:wrap; gap:8px; width:100%; justify-content:flex-end; }
  .stat-grid{ grid-template-columns:1fr 1fr; gap:10px; }
  .stat-card{ padding:14px; }
  .stat-num{ font-size:22px; }
  .toolbar{ flex-wrap:wrap; }
  .search-box{ width:100%; }
  .filter-select{ width:100%; }
  .table-wrap{ overflow-x:auto; -webkit-overflow-scrolling:touch; }
  table{ min-width:560px; }
  .modal-box{ width:92vw; max-height:88vh; overflow-y:auto; }
  .term-settings-row{ grid-template-columns:1fr; }
  .live-clock{ display:none; }
  .org-switch-form{ flex:1; }
  .org-switch{ width:100%; }
  .avatar-chip span{ display:none; }
  .dept-card-foot{ flex-wrap:wrap; }
}

/* ============ LOG TABS (Tarix sahifasi) ============ */
.log-tabs{ display:flex; gap:6px; margin-bottom:18px; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.log-tab{
  display:flex; align-items:center; gap:8px; padding:11px 16px;
  font-size:13px; font-weight:600; color:var(--ink-faint); text-decoration:none;
  border-bottom:2px solid transparent; margin-bottom:-1px; transition:color .15s, border-color .15s;
}
.log-tab svg{ width:15px; height:15px; }
.log-tab:hover{ color:var(--ink-soft); }
.log-tab.active{ color:var(--season-3); border-bottom-color:var(--season-3); }

/* ============ PAGINATION ============ */
.pagination-bar{
  display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px;
  margin-top:16px; padding-top:14px; border-top:1px solid var(--line);
}
.pagination-info{ font-size:12.5px; color:var(--ink-soft); }
.pagination-info b{ color:var(--ink); font-weight:700; }
.pagination-pagesize{ display:flex; align-items:center; gap:8px; }
.pagination-pagesize label{ font-size:12px; color:var(--ink-faint); font-weight:600; }
.pagination-pagesize select{
  font-size:12.5px; padding:6px 28px 6px 10px; border-radius:10px; border:1.5px solid var(--line);
  background:var(--bg-sunken); color:var(--ink); cursor:pointer; font-family:var(--font-body);
  appearance:none; -webkit-appearance:none; -moz-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2368687e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 8px center; background-size:13px;
  transition:border-color .15s;
}
.pagination-pagesize select:hover, .pagination-pagesize select:focus{ border-color:var(--season-3); outline:none; }

.pagination{ display:flex; align-items:center; justify-content:center; gap:5px; margin-top:14px; flex-wrap:wrap; }
.page-btn{
  display:flex; align-items:center; justify-content:center; width:34px; height:34px;
  border-radius:10px; background:var(--bg-sunken); border:1px solid var(--line); color:var(--ink-soft);
  transition:background .15s, color .15s;
}
.page-btn svg{ width:15px; height:15px; }
.page-btn:hover{ background:var(--season-1); color:var(--season-3); }
.page-btn.disabled{ color:var(--ink-faint); pointer-events:none; opacity:.4; }
.page-num{
  display:flex; align-items:center; justify-content:center; min-width:34px; height:34px;
  padding:0 4px; border-radius:10px; font-size:13px; font-weight:600; color:var(--ink-soft);
  background:var(--bg-sunken); border:1px solid var(--line); transition:background .15s, color .15s;
}
.page-num:hover{ background:var(--season-1); color:var(--season-3); }
.page-num.active{
  background:linear-gradient(135deg,var(--season-2),var(--season-3)); color:#fff; border-color:transparent;
}
.page-ellipsis{ color:var(--ink-faint); padding:0 4px; font-size:13px; }
.page-info{ font-size:12.5px; color:var(--ink-faint); font-family:var(--font-mono); }

@media (max-width:640px){
  .pagination-bar{ flex-direction:column; align-items:flex-start; }
}

/* ============ ROLE-BASED UI HELPERS ============ */
.readonly-banner{
  display:flex; align-items:center; gap:10px; background:var(--accent-1, var(--season-1));
  border-radius:12px; padding:12px 17px; font-size:12.5px; color:var(--ink-soft); margin-bottom:16px;
}
[data-theme="dark"] .readonly-banner{ background:rgba(255,255,255,.05); }
.readonly-banner svg{ width:16px; height:16px; color:var(--season-3); flex-shrink:0; }

/* ============================================================
   FORMA ELEMENTLARI — input/select/textarea/checkbox uchun
   markazlashgan, professional dizayn (modal'lardagi inline
   style'lar o'rniga, sizning so'rovingiz bo'yicha).
   ============================================================ */
.field{ display:flex; flex-direction:column; gap:6px; }
.field label{
  font-size:12px; font-weight:600; color:var(--ink-soft);
  letter-spacing:.01em;
}
.field input[type="text"],
.field input[type="password"],
.field input[type="email"],
.field input[type="date"],
.field input[type="time"],
.field input[type="number"],
.field select,
.field textarea{
  width:100%; padding:10px 13px; border-radius:12px;
  border:1.5px solid var(--line); background:var(--bg-sunken);
  color:var(--ink); font-family:var(--font-body); font-size:13.5px;
  transition:border-color .15s, box-shadow .15s, background .15s;
  outline:none;
}
.field textarea{ resize:vertical; min-height:64px; line-height:1.5; }
.field input::placeholder,
.field textarea::placeholder{ color:var(--ink-faint); }

.field input:hover:not(:disabled),
.field select:hover:not(:disabled),
.field textarea:hover:not(:disabled){
  border-color:var(--line-strong);
}

.field input:focus,
.field select:focus,
.field textarea:focus{
  border-color:var(--season-3);
  box-shadow:0 0 0 3px var(--season-1);
  background:var(--bg-elevated);
}

.field input:disabled,
.field select:disabled,
.field textarea:disabled{
  opacity:.55; cursor:not-allowed; background:var(--bg-sunken);
}

.field input[readonly]{
  background:var(--bg-sunken); color:var(--ink-soft); cursor:default;
}

/* Xato holati (validatsiya muvaffaqiyatsiz bo'lganda .field-error klassi qo'shiladi) */
.field.field-error input,
.field.field-error select,
.field.field-error textarea{
  border-color:var(--bad);
}
.field.field-error input:focus,
.field.field-error select:focus,
.field.field-error textarea:focus{
  box-shadow:0 0 0 3px var(--bad-bg);
}
.field-error-msg{ font-size:11.5px; color:var(--bad); margin-top:2px; }

/* Checkbox - standart brauzer ko'rinishidan kattaroq, aksent rangli */
.field-checkbox-row{
  display:flex; align-items:center; gap:9px; cursor:pointer;
}
.field-checkbox-row input[type="checkbox"]{
  width:18px; height:18px; flex-shrink:0; cursor:pointer;
  accent-color:var(--season-3); border-radius:5px;
}
.field-checkbox-row label{
  font-size:13px; color:var(--ink); cursor:pointer; margin:0; font-weight:500;
}

/* select uchun custom oq o'q (brauzer default'ini yashirib, o'zimizniki) */
.field select{
  appearance:none; -webkit-appearance:none; -moz-appearance:none;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2368687e' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 11px center; background-size:16px;
  padding-right:36px;
}

/* Forma ichidagi tugmalar orasidagi standart bo'shliq */
.field + .field{ margin-top:0; }
form .field{ margin-bottom:14px; }
form .field:last-of-type{ margin-bottom:0; }

/* ============================================================
   KO'RINISH ALMASHTIRGICH — Galereya / Grid / Ro'yxat
   (bo'limlar va xodimlar sahifalari uchun, sizning so'rovingiz
   bo'yicha: galereya=hozirgi katta kartalar, grid=ixchamroq
   ko'p ustunli, ro'yxat=oddiy jadval qatorlari)
   ============================================================ */
.view-switcher{
  display:inline-flex; align-items:center; gap:2px; background:var(--bg-sunken);
  border-radius:12px; padding:3px; border:1px solid var(--line);
}
.view-switcher button{
  display:flex; align-items:center; justify-content:center; gap:6px;
  padding:7px 12px; border-radius:9px; border:none; background:transparent;
  color:var(--ink-faint); cursor:pointer; font-size:12px; font-weight:600;
  transition:background .15s, color .15s;
}
.view-switcher button svg{ width:15px; height:15px; }
.view-switcher button:hover{ color:var(--ink-soft); }
.view-switcher button.active{
  background:var(--bg-elevated); color:var(--season-3); box-shadow:var(--shadow-sm);
}

/* ---- Bo'limlar: RO'YXAT ko'rinishi (oddiy qator, jadvalsiz) ---- */
.dept-grid.view-mode-list{
  grid-template-columns:1fr; gap:0;
  background:var(--bg-elevated); border:1px solid var(--line); border-radius:var(--radius);
  box-shadow:var(--shadow-sm); overflow:hidden;
}
.dept-grid.view-mode-list .dept-card{
  display:flex; align-items:center; gap:14px;
  border-radius:0; border:none; box-shadow:none; background:transparent;
  padding:13px 20px; border-bottom:1px solid var(--line);
}
.dept-grid.view-mode-list .dept-card:last-child{ border-bottom:none; }
.dept-grid.view-mode-list .dept-card:hover{ background:var(--bg-sunken); transform:none; }
.dept-grid.view-mode-list .dept-card-head{ margin-bottom:0; flex:1; min-width:0; }
.dept-grid.view-mode-list .dept-card-head h4{ font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.dept-grid.view-mode-list .dept-card-head .c{ font-size:12px; }
.dept-grid.view-mode-list .dept-metrics{
  flex-direction:row; gap:20px; display:flex; flex-shrink:0;
}
.dept-grid.view-mode-list .dept-metric-row{
  flex-direction:column; gap:1px; align-items:center; min-width:65px;
}
.dept-grid.view-mode-list .dept-metric-row .v{ font-size:14px; }
.dept-grid.view-mode-list .dept-metric-row .l{ font-size:10.5px; text-align:center; }
.dept-grid.view-mode-list .dept-card-foot{ display:none; }
.dept-grid.view-mode-list .dept-card-actions{
  margin-top:0; padding-top:0; border-top:none; flex-shrink:0;
}

@media (max-width:980px){
  .dept-grid.view-mode-list .dept-card{ flex-wrap:wrap; }
  .dept-grid.view-mode-list .dept-metrics{ width:100%; justify-content:space-around; }
}
@media (max-width:640px){
  .dept-grid.view-mode-list .dept-metrics{ gap:12px; }
}

/* ---- Xodimlar: GALEREYA ko'rinishi (kartalar, jadval o'rniga) ---- */
.dept-section-header{
  grid-column:1 / -1; font-weight:700; font-size:15px; padding:14px 4px 8px;
  border-bottom:2px solid var(--season-3); color:var(--season-3); letter-spacing:0.02em;
}
.dept-section-header:not(:first-child){ margin-top:10px; }
.emp-gallery{
  display:grid; grid-template-columns:repeat(3, 1fr); gap:14px;
}
.emp-gallery-card{
  background:var(--bg-elevated); border:1px solid var(--line); border-radius:var(--radius);
  padding:19px; box-shadow:var(--shadow-sm); display:flex; flex-direction:column; gap:10px;
  transition:transform .15s, box-shadow .15s;
}
.emp-gallery-card:hover{ transform:translateY(-3px); box-shadow:var(--shadow-lg); }
.emp-gallery-head{ display:flex; align-items:center; gap:12px; }
.emp-gallery-head .emp-av{ width:135px; height:135px; font-size:40px; flex-shrink:0; }
.emp-gallery-head .emp-av img{ display:block !important; }
.emp-gallery-head .n{ font-weight:600; font-size:14px; line-height:1.3; }
.emp-gallery-head .d{ font-size:11.5px; color:var(--ink-faint); margin-top:1px; }
.emp-gallery-meta{ display:flex; flex-direction:column; gap:6px; font-size:12px; color:var(--ink-soft); }
.emp-gallery-meta .row{ display:flex; justify-content:space-between; }
.emp-gallery-foot{ display:flex; gap:8px; margin-top:4px; padding-top:10px; border-top:1px solid var(--line); }

/* ---- Xodimlar: GRID ko'rinishi (ixchamroq kartalar) ---- */

@media (max-width:980px){
  .emp-gallery{ grid-template-columns:repeat(2, 1fr); }
}
@media (max-width:640px){
  .emp-gallery{ grid-template-columns:repeat(2, 1fr); }
}

/* ============ AUTOCOMPLETE (xodim qidirish - absences.php) ============ */
.autocomplete-results{
  position:relative; margin-top:4px; max-height:200px; overflow-y:auto;
  border-radius:12px; background:var(--bg-elevated); border:1px solid var(--line);
  box-shadow:var(--shadow-sm);
}
.autocomplete-results:empty{ display:none; border:none; box-shadow:none; }
.autocomplete-item{
  padding:9px 13px; font-size:13px; cursor:pointer; border-bottom:1px solid var(--line);
  transition:background .12s;
}
.autocomplete-item:last-child{ border-bottom:none; }
.autocomplete-item:hover{ background:var(--season-1); }

/* ============ ABSENCE BADGE (taatil/komandirovka/kasallik holati) ============ */
.absence-badge{
  margin-left:6px; background:linear-gradient(135deg, var(--season-1), var(--bg-sunken));
  color:var(--season-3); border:1px dashed var(--season-3);
}

/* ============ TOAST (muvaffaqiyat/xato xabari) ============ */
.toast-container{
  position:fixed; top:20px; right:20px; z-index:9999;
  display:flex; flex-direction:column; gap:10px; max-width:380px;
}
.toast{
  display:flex; align-items:flex-start; gap:10px; padding:14px 17px;
  border-radius:14px; background:var(--bg-elevated); border:1px solid var(--line);
  box-shadow:var(--shadow-lg); font-size:13.5px; color:var(--ink);
  animation:toast-in .25s ease; opacity:0; transform:translateX(20px);
  animation-fill-mode:forwards;
}
.toast.toast-out{ animation:toast-out .2s ease forwards; }
@keyframes toast-in{ to{ opacity:1; transform:translateX(0); } }
@keyframes toast-out{ to{ opacity:0; transform:translateX(20px); } }
.toast-icon{ flex-shrink:0; width:21px; height:21px; border-radius:50%; display:flex; align-items:center; justify-content:center; }
.toast-icon svg{ width:13px; height:13px; }
.toast.success .toast-icon{ background:var(--good-bg); color:var(--good); }
.toast.error .toast-icon{ background:var(--bad-bg); color:var(--bad); }
.toast-text{ flex:1; line-height:1.4; }

/* ============ KALENDAR KO'RINISHI (davomat sahifasi va xodim portali) ============ */
.cal-toggle{ display:flex; gap:8px; margin-bottom:16px; }
.cal-toggle .btn-sm{ padding:6px 14px; font-size:13px; border-radius:10px; cursor:pointer; border:1px solid var(--line); background:var(--bg-elevated); color:var(--ink-soft); font-weight:600; transition:all .15s; }
.cal-toggle .btn-sm:hover{ background:var(--bg-sunken); }
.cal-toggle .btn-sm.active{ background:var(--season-2); color:#fff; border-color:var(--season-2); }
.cal-nav{ display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.cal-nav .cal-nav-btn{ padding:5px 11px; font-size:13px; border-radius:8px; cursor:pointer; border:1px solid var(--line); background:var(--bg-elevated); color:var(--ink-soft); font-weight:600; text-decoration:none; transition:all .15s; }
.cal-nav .cal-nav-btn:hover{ background:var(--bg-sunken); }
.cal-nav .cal-nav-title{ font-weight:700; font-size:15px; }
.cal-grid{ display:grid; grid-template-columns:repeat(7, 1fr); gap:5px; }
.cal-header{ text-align:center; font-weight:600; font-size:12px; color:var(--ink-faint); padding:8px 0; }
.cal-day{ border:1px solid var(--line); border-radius:10px; padding:6px; min-height:70px; font-size:11px; }
.cal-day.present{ background:var(--good-bg); border-color:var(--good); }
.cal-day.late{ background:var(--warn-bg); border-color:var(--warn); }
.cal-day.absent{ background:var(--bad-bg); border-color:var(--bad); }
.cal-day.rest{ background:var(--bg-sunken); color:var(--ink-faint); }
.cal-day.future{ background:none; border-color:var(--line); color:var(--ink-faint); opacity:0.5; }
.cal-day.nodata{ background:none; border-color:var(--line); border-style:dashed; color:var(--ink-faint); opacity:0.55; }
.cal-day.empty{ border:none; background:none; min-height:0; }
.cal-date{ font-weight:700; font-size:14px; margin-bottom:4px; }
.cal-time{ font-family:var(--font-mono); color:var(--ink-soft); }
.cal-worked{ font-family:var(--font-mono); font-weight:600; margin-top:2px; }

/* ============ KICHIK DESKTOP/PLANSHET (1100px gacha) — JADVAL SIQISH ============ */
/* Sidebar joy egallagani uchun, kichikroq ekranlarda jadval ustunlarini
   yanada siqamiz - gorizontal scroll kerak bo'lmasligi uchun (sizning
   "100% mashtabda hammasi ko'rinsin" so'rovingiz bo'yicha). Bu qoida
   ATAYLAB FAYL OXIRIGA qo'yilgan - CSS cascade tartibida, bir xil
   specifiklikdagi qoidalar orasida OXIRGISI g'olib chiqadi, shuning
   uchun bu yerda turishi shart (tbody td{...} asosiy qoidasidan keyin). */
@media (max-width: 1100px){
  tbody td, thead th{ padding:10px 10px !important; font-size:12.5px; }
  tbody td.truncate, tbody td .truncate{ max-width:130px; }
  .emp-av{ width:32px; height:32px; font-size:12px; }
  .emp-cell{ gap:8px; }
}
/* Juda kichik desktop ekranlar (1024px va undan kam) uchun qo'shimcha
   siqish - "Xodim" ustuni yanada torroq qilinadi */
@media (max-width: 1050px){
  tbody td.truncate, tbody td .truncate{ max-width:80px; }
  tbody td, thead th{ padding:9px 6px !important; }
  .badge{ padding:4px 8px; font-size:10.5px; }
}

/* ============ PAROL KO'RSATISH TUGMASI (users.php - Xodimlar tab) ============ */
.password-reveal-btn{
  display:inline-flex; align-items:center; gap:6px; background:var(--bg-sunken);
  border:1px solid var(--line); border-radius:9px; padding:4px 10px; cursor:pointer;
  font-family:var(--font-mono); font-size:11.5px; color:var(--ink-soft); transition:background .15s;
}
.password-reveal-btn:hover{ background:var(--bg-elevated); border-color:var(--season-3); }
.password-reveal-btn svg{ flex-shrink:0; opacity:.7; }

/* ============ DAVOMAT DINAMIKASI - chiziqli chart (line chart) ============ */
.trend-legend-row{ display:flex; gap:18px; margin-bottom:16px; font-size:12.5px; color:var(--ink-soft); }
.trend-legend-item{ display:flex; align-items:center; gap:6px; }
.trend-legend-dot{ width:11px; height:11px; border-radius:4px; display:inline-block; }
.daily-chart-tooltip{
  position:absolute; background:var(--bg-elevated); border:1px solid var(--line); border-radius:12px;
  padding:10px 14px; font-size:12px; box-shadow:var(--shadow-lg); pointer-events:none;
  z-index:20; display:none; white-space:nowrap;
}
/* FIXED pozitsiya - sichqoncha qaysi tomonga harakatlansa ham,
   tooltip joyidan QIMIRLAMAYDI, faqat ICHIDAGI ma'lumot almashadi
   (sizning aniq so'rovingiz bo'yicha). Grafik konteynerining yuqori
   o'ng burchagida turadi. */
.daily-chart-tooltip-fixed{
  top:8px; right:8px; left:auto !important; min-width:170px;
}
.daily-chart-tooltip .dctt-date{ font-weight:700; margin-bottom:6px; color:var(--ink); }
.daily-chart-tooltip .dctt-row{ display:flex; align-items:center; gap:6px; margin-top:3px; }
.daily-chart-tooltip .dctt-dot{ width:8px; height:8px; border-radius:3px; display:inline-block; }
