:root {
  --navy: #10284f;
  --navy-2: #17386d;
  --navy-3: #0b1d3b;
  --blue: #1f4f99;
  --gold: #d4a63a;
  --gold-2: #f3e2b0;
  --bg: #e6edf6;
  --card: #ffffff;
  --ink: #16233a;
  --muted: #5d6d84;
  --line: #d7e1ee;
  --dsc: #8d6414;
  --phd: #1a5fa8;
  --prof: #7a2f45;
  --dot: #0d6b58;
  /* grafik ranglari (dataviz palitrasi, validatordan o'tgan) */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --grid: #e1e0d9;
  --shadow: 0 10px 30px rgba(16, 40, 79, 0.08);
  --radius: 14px;
  --side-w: 250px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", system-ui, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
button, input, select, textarea { font: inherit; }
a { color: inherit; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------------- karkas: yon panel + ish maydoni ---------------- */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr);
  /* yon panel ustuni sahifa qancha uzun bo'lsa ham to'q rangda qoladi */
  background: linear-gradient(90deg, var(--navy-3) var(--side-w), transparent var(--side-w));
}

.side {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-3) 100%);
  color: #fff;
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 6px 6px; text-decoration: none; color: #fff; }
.brand-text { display: flex; flex-direction: column; }
.brand-text strong { font-size: 1.02rem; }
.brand-text small { color: #c9d6ea; font-size: 0.74rem; margin-top: 2px; }
.seal {
  width: 46px;
  height: 46px;
  border: 2px solid var(--gold);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--gold-2);
  background: rgba(255, 255, 255, 0.04);
  flex: 0 0 auto;
}
.seal.seal-lg { width: 62px; height: 62px; font-size: 1rem; }
/* Universitet logotipi (qalqon) */
.logo { width: 46px; height: 46px; object-fit: contain; flex: 0 0 auto; filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.35)); }
.logo.logo-login { width: 110px; height: 110px; margin: 0 auto; filter: drop-shadow(0 4px 10px rgba(16, 40, 79, 0.25)); }
.seal.dark { margin: 0 auto; background: var(--navy); }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: #d7e3f5;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 0.9rem;
  line-height: 1.15;
}
.nav a span { display: flex; flex-direction: column; }
.nav a small { color: #93a8c9; font-size: 0.68rem; margin-top: 2px; }
.nav a i { width: 22px; height: 22px; flex: 0 0 22px; color: var(--gold); display: grid; place-items: center; }
.nav a i svg { width: 22px; height: 22px; }
.nav a.active, .nav a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; }
.nav a.active { box-shadow: inset 3px 0 0 var(--gold); }
.nav-group { margin: 12px 10px 4px; color: #8ea3c4; font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.08em; }

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

/* ---------------- banner va asboblar qatori ---------------- */
.banner {
  display: grid;
  align-items: center;
  min-height: 98px;
  padding: 14px 26px;
  background: linear-gradient(90deg, var(--navy) 0%, var(--navy-2) 55%, var(--navy) 100%);
  border-bottom: 4px solid var(--gold);
  color: #fff;
}
.banner h1 {
  margin: 0;
  text-align: center;
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold-2);
}
.banner h1 span { color: #fff; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  padding: 12px 26px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.year-pick, .search { display: flex; flex-direction: column; gap: 4px; font-size: 0.74rem; color: var(--muted); }
.search { flex: 1 1 260px; }
.year-pick select, .search input, .filters select, .filters input {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--ink);
  min-width: 140px;
}
.search input { width: 100%; }
.net { border-radius: 999px; padding: 8px 12px; font-size: 0.76rem; font-weight: 700; background: #e7f6ef; color: #0d6b58; }
.net.off { background: #f8efe3; color: #8d6414; }
.net.busy { background: #e5f0fb; color: #1d4f8f; }
.net.err { background: #fde8e8; color: #a12828; }
.net.clickable { cursor: pointer; text-decoration: underline dotted; }
.off-ribbon { position: sticky; top: 0; z-index: 71; padding: 8px 16px; text-align: center; font-size: 0.85rem; font-weight: 700; color: #6b4a00; background: #fff1c7; border-bottom: 1px solid #e8c766; }
.off-queue { position: fixed; right: 16px; bottom: 16px; z-index: 90; width: min(460px, calc(100vw - 32px)); max-height: 70vh; overflow: auto; }
.off-queue ol { margin: 10px 0; padding-left: 20px; display: grid; gap: 8px; font-size: 0.88rem; }
.off-queue li.dead b { color: #a12828; }
.off-queue .row-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
@media print { .off-ribbon, .off-queue { display: none; } }
.user-box { display: flex; gap: 8px; align-items: center; margin-left: auto; }
.user-box .who { font-size: 0.82rem; }
.user-box .who em { font-style: normal; color: var(--gold); font-weight: 800; margin-left: 4px; }
.menu-btn { display: none; }
body.locked .side .nav, body.locked .data-tool { visibility: hidden; }

main { padding: 20px 26px 40px; }

/* ---------------- umumiy bloklar ---------------- */
.kpi, .card, .panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel { padding: 16px 18px; min-width: 0; }
.panel h2, .section-head h2 { margin: 0; font-size: 1rem; color: var(--navy); }
.ptitle {
  margin: 0 0 12px;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--navy);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.ptitle a { font-size: 0.74rem; letter-spacing: 0; text-transform: none; color: var(--blue); text-decoration: none; font-weight: 700; white-space: nowrap; }
.section-head { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.mini-stats { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: -6px 0 12px; color: var(--muted, #5d6d84); font-size: 0.9rem; }
.mini-stats b { color: var(--navy); }
.year-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 14px; padding: 10px 14px; border: 1px solid #f0d58c; border-radius: 12px; background: #fff8e5; color: #6b5310; }
.muted { color: var(--muted); font-size: 0.86rem; }
.small { font-size: 0.78rem; }
.big { font-size: 1.8rem; color: var(--navy); }
.lead { margin: 16px 0 0; }
.empty { padding: 26px; text-align: center; color: var(--muted); }
.empty-mini { padding: 14px; text-align: center; color: var(--muted); font-size: 0.84rem; background: #f6f9fd; border-radius: 10px; }

.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.kpis.three { grid-template-columns: repeat(3, 1fr); margin-bottom: 16px; }
.kpis.four { grid-template-columns: repeat(4, 1fr); margin-bottom: 16px; }
.kpi { padding: 13px 15px; }
.kpi span { display: block; color: var(--muted); font-size: 0.76rem; }
.kpi strong { display: block; margin-top: 6px; font-size: 1.5rem; color: var(--navy); }

.grid-2 { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 16px; margin-top: 16px; }
.grid-2.even { grid-template-columns: 1fr 1fr; }

/* ---------------- bosh panel (maket bo'yicha to'r) ---------------- */
.dash {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-template-areas:
    "prof prof kpi"
    "prof prof pubs"
    "grant map hist";
  gap: 16px;
}
.dash .a-prof { grid-area: prof; }
.dash .a-kpi { grid-area: kpi; }
.dash .a-pubs { grid-area: pubs; }
.dash .a-grant { grid-area: grant; }
.dash .a-map { grid-area: map; }
.dash .a-hist { grid-area: hist; }
.dash .cards { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.dash .person-body { padding: 8px 8px 10px; }
.dash .person-body h3 { font-size: 0.8rem; }
.dash .person-body p { font-size: 0.72rem; min-height: auto; }
.dash .photo { aspect-ratio: 3 / 3.3; }

/* ---------------- olim kartalari ---------------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.person { display: flex; flex-direction: column; text-decoration: none; overflow: hidden; transition: transform 0.15s ease; }
.person:hover { transform: translateY(-2px); }
.photo {
  aspect-ratio: 3 / 3.4;
  background: linear-gradient(160deg, #d9e4f2, #c3d3ea);
  display: grid;
  place-items: center;
  color: var(--navy);
  font-weight: 800;
  font-size: 1.5rem;
  overflow: hidden;
}
.photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.person-body { padding: 11px 11px 13px; }
.person-body h3 { margin: 0 0 4px; font-size: 0.92rem; line-height: 1.3; }
.person-body p { margin: 0; color: var(--muted); font-size: 0.78rem; min-height: 2.4em; }
.unit-line { min-height: auto !important; margin-top: 5px !important; color: var(--blue) !important; }
.badges { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 7px; }
.badge { font-size: 0.68rem; font-weight: 800; border-radius: 999px; padding: 2px 8px; background: #eef3f9; color: var(--navy); }
.badge.dsc { background: #f8efd8; color: var(--dsc); }
.badge.phd { background: #e5f0fb; color: var(--phd); }
.badge.prof { background: #f8e8ee; color: var(--prof); }
.badge.dot { background: #e5f6f2; color: var(--dot); }
.badge.pts { background: var(--navy); color: var(--gold-2); }

/* ---------------- grafiklar ---------------- */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: minmax(110px, 1fr) 1.4fr auto; gap: 8px; align-items: center; font-size: 0.82rem; }
.track { height: 10px; background: #e6eef8; border-radius: 99px; overflow: hidden; }
.track span { display: block; height: 100%; background: var(--series-1); border-radius: 99px; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis { stroke: #c3c2b7; stroke-width: 1; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart text { fill: var(--muted); font-size: 11px; }
.chart .val { fill: var(--ink); font-weight: 700; }
.chart .bar { fill: var(--series-1); }
.chart .bar:hover, .chart .seg:hover { opacity: 0.8; }
.kpi-mini { display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; align-items: center; }
.legend { display: flex; flex-direction: column; gap: 6px; font-size: 0.8rem; }
.legend span { display: flex; align-items: center; gap: 7px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; flex: 0 0 auto; }
.legend b { margin-left: auto; padding-left: 8px; }
.subtitle { margin: 14px 0 8px; font-size: 0.8rem; font-weight: 800; color: var(--navy); text-transform: uppercase; letter-spacing: 0.04em; }
.tip {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: var(--navy);
  color: #fff;
  font-size: 0.78rem;
  padding: 7px 10px;
  border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  max-width: 280px;
  white-space: pre-line;
}

/* ---------------- nashrlar, grantlar ---------------- */
.type-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.type-tile { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #f8fbfe; text-decoration: none; }
.type-tile span { display: block; font-size: 0.74rem; color: var(--muted); }
.type-tile strong { font-size: 1.35rem; color: var(--navy); }
.type-tile.on { border-color: var(--blue); background: #e5f0fb; }
.ptitle-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ptitle-row .ptitle { margin-bottom: 0; flex: 1 1 320px; }
.ptitle-row .btn { margin-left: auto; }
.type-tile strong { white-space: nowrap; }
.type-tile .manual-mark { display: inline; font-size: 0.85rem; color: var(--muted); font-weight: 400; }
.panel > .manual-note { margin: 10px 0 0; font-size: 0.78rem; }
.ptitle-row + .type-tiles, .pub-stats-form { margin-top: 12px; }
.type-tile.edit { display: grid; gap: 4px; }
.type-tile.edit input { width: 100%; padding: 4px 6px; font-size: 1.1rem; font-weight: 700; color: var(--navy); }
.type-tile.edit small { color: var(--muted); font-size: 0.7rem; }
.pub-stats-form .row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.shelf { display: flex; gap: 3px; align-items: flex-end; height: 54px; margin-bottom: 8px; }
.shelf i { width: 13px; border-radius: 3px 3px 1px 1px; background: var(--navy-2); }
.shelf i:nth-child(3n) { background: var(--gold); }
.shelf i:nth-child(4n) { background: var(--series-1); }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.status { font-size: 0.72rem; font-weight: 800; border-radius: 999px; padding: 2px 8px; white-space: nowrap; }
.status.current { background: #e5f6f2; color: var(--dot); }
.status.completed { background: #eef3f9; color: var(--muted); }

/* ---------------- xarita ---------------- */
.map { position: relative; background: #dce8f6; border-radius: 12px; overflow: hidden; }
.map svg { display: block; width: 100%; height: auto; }
.map .land { fill: #f4f7fb; stroke: #c8d5e6; stroke-width: 0.5; }
.map .land.partner { fill: #9ec5f4; }
.map .land.home { fill: var(--gold); }
.map .arc { fill: none; stroke: var(--series-2); stroke-width: 1.6; stroke-dasharray: 4 3; opacity: 0.85; }
.map .dot { fill: var(--series-2); stroke: #fff; stroke-width: 2; }
.map .dot.home { fill: var(--navy); }
.map-note { position: absolute; left: 10px; bottom: 8px; font-size: 0.72rem; color: var(--navy); background: rgba(255, 255, 255, 0.85); padding: 3px 8px; border-radius: 6px; }

/* ---------------- xalqaro hamkorlik ---------------- */
.country-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ccard { padding: 14px 16px; border-top: 4px solid var(--blue); }
.ccard h3 { margin: 0 0 8px; font-size: 1rem; color: var(--navy); display: flex; justify-content: space-between; align-items: center; }
.ccard h3 span { background: var(--navy); color: var(--gold-2); font-size: 0.74rem; border-radius: 999px; padding: 2px 9px; }
.ccard ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 0.86rem; }
.ccard li b { font-weight: 700; }
.info-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.info-cards.wide3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.icard { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #f8fbfe; font-size: 0.84rem; }
.icard b { display: block; color: var(--navy); font-size: 0.95rem; margin-bottom: 4px; }
.icard p { margin: 0 0 6px; color: var(--ink); }
.info-cards.round .icard { border-radius: 50%; aspect-ratio: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center;
  background: radial-gradient(circle at 35% 30%, #ffffff, #dbe8f7); padding: 18px; }

/* ---------------- tarix ---------------- */
.timeline-h { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.tl-item { flex: 0 0 150px; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #f8fbfe; color: var(--ink); }
.tl-photo { position: relative; overflow: hidden; }
.tl-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tl-item .tl-photo { height: 86px; flex: 0 0 86px; background: linear-gradient(160deg, #c8d4e4, #9fb2cc); display: grid; place-items: center; color: var(--navy); font-weight: 800; }
.tl-item .tl-photo img { filter: grayscale(0.5); }
.tl-item div.tl-body { padding: 8px 10px; font-size: 0.78rem; }
.tl-item b { color: var(--navy); display: block; }
.years-list { display: flex; flex-direction: column; gap: 10px; }
.year-row { display: grid; grid-template-columns: 70px 1fr; gap: 12px; border-left: 3px solid var(--gold); padding: 4px 0 4px 12px; }
.year-row strong { color: var(--navy); font-size: 1.1rem; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.chip { font-size: 0.74rem; background: #eef3f9; border-radius: 999px; padding: 2px 9px; text-decoration: none; color: var(--navy); }
.history-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.hcard { overflow: hidden; display: flex; flex-direction: column; }
.hcard .tl-photo { height: 150px; flex: 0 0 150px; background: linear-gradient(160deg, #c8d4e4, #9fb2cc); display: grid; place-items: center; color: var(--navy); font-weight: 800; font-size: 1.6rem; }
.hcard .hbody { padding: 12px 14px; }
.hcard h3 { margin: 4px 0 6px; font-size: 0.95rem; color: var(--navy); }
.hcard p { margin: 0; font-size: 0.84rem; color: var(--ink); white-space: pre-line; }

/* ---------------- jadval, filtr, tugmalar ---------------- */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; align-items: center; }
.filters select { min-width: 160px; }
.filters.compact select { min-width: 0; flex: 1 1 120px; padding: 7px 10px; font-size: 0.82rem; }
.btn {
  border: 0;
  background: var(--navy);
  color: #fff;
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn.light { background: #fff; color: var(--navy); border: 1px solid var(--line); }
.btn.danger { background: #a3263b; }
.btn.small { padding: 6px 10px; font-size: 0.8rem; }
.btn.wide { width: 100%; padding: 11px 14px; }
.btn:disabled { opacity: 0.6; cursor: wait; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }

.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 0.74rem; font-weight: 700; }
tr.total td { font-weight: 800; background: #f6f9fd; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-act { white-space: nowrap; text-align: right; }
.row-act a { color: var(--blue); font-weight: 600; text-decoration: none; }
.row-act .link-danger { margin-left: 12px; padding: 0; border: 0; background: none; color: #c0392b; font: inherit; font-weight: 600; cursor: pointer; }
.row-act .link-danger:hover, .row-act a:hover { text-decoration: underline; }
.rank { width: 34px; font-weight: 800; color: var(--navy); }
.mini-photo { width: 34px; height: 40px; border-radius: 6px; object-fit: cover; background: #d9e4f2; display: inline-grid; place-items: center; font-size: 0.7rem; font-weight: 800; color: var(--navy); vertical-align: middle; }
.warn { color: #8d6414; font-size: 0.78rem; font-weight: 700; cursor: help; }
.flash { background: #e7f6ef; color: #0d6b58; border: 1px solid #bfe5d5; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-weight: 600; }

/* ---------------- profil ---------------- */
.profile { display: grid; grid-template-columns: 280px 1fr; gap: 18px; }
.profile-photo { border-radius: var(--radius); overflow: hidden; align-self: start; position: sticky; top: 16px; }
.profile-photo .photo { width: 100%; aspect-ratio: 3 / 4; }
.facts { display: grid; grid-template-columns: 180px 1fr; gap: 8px 12px; margin-top: 8px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.timeline { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.timeline > a { display: block; text-decoration: none; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; background: #f8fbfe; }
.nav-back-row { margin-bottom: 12px; }
.nav-back { flex: 0 0 auto; font-weight: 700; }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.compare .year-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.compare .year-head h2 { margin: 0; }
.compare .year-edit { padding: 4px 10px; font-size: 0.78rem; }
.compare .manual-note { margin: 8px 0 0; font-size: 0.75rem; }
.compare .manual-mark { font-size: 0.9rem; color: var(--muted); }
.year-stats-form { margin-top: 12px; display: grid; gap: 8px; }
.year-stats-form label { display: grid; grid-template-columns: 82px 1fr; align-items: center; gap: 2px 8px; font-size: 0.88rem; }
.year-stats-form input { width: 100%; padding: 6px 8px; }
.year-stats-form small { grid-column: 2; color: var(--muted); font-size: 0.72rem; }
.year-stats-form .row-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.compare-potential { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.compare-potential h3 { margin: 0 0 8px; font-size: 0.95rem; color: var(--navy); }
.compare-potential .muted { margin: 0; font-size: 0.85rem; }
.compare-potential .small-note { margin-top: 8px; font-size: 0.75rem; line-height: 1.35; }
.compare-potential .est { font-size: 0.72rem; font-weight: 600; color: #8a6d1d; background: #fbf3dc; border-radius: 999px; padding: 2px 8px; margin-left: 4px; }
.delta { margin-top: 16px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.callout {
  margin-top: 16px;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius);
  padding: 18px 20px;
  display: grid;
  grid-template-columns: 1.2fr repeat(4, 1fr);
  gap: 12px;
}
.callout strong { display: block; font-size: 1.35rem; color: var(--gold-2); }
.callout span { display: block; color: #c5d4ea; font-size: 0.78rem; margin-bottom: 4px; }

/* ---------------- formalar ---------------- */
.login-wrap { min-height: 60vh; display: grid; place-items: center; }
.login { width: min(380px, 100%); display: flex; flex-direction: column; gap: 12px; text-align: center; }
.login h2 { margin: 6px 0 0; }
.login label { text-align: left; }
.form h2 { margin-bottom: 14px; }
.form h3 { margin: 22px 0 10px; font-size: 0.98rem; color: var(--navy); }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 16px; }
.form-grid.one { grid-template-columns: 1fr; }
.form-grid.four { grid-template-columns: repeat(4, 1fr); }
.form-grid .wide { grid-column: 1 / -1; }
.form label, .login label { display: flex; flex-direction: column; gap: 5px; font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.form input, .form select, .form textarea, .login input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fff;
  font-weight: 400;
}
.form textarea { min-height: 90px; resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus, .login input:focus { outline: 2px solid #9cbcf0; border-color: var(--blue); }
.form label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--ink); }
.form-error { color: #a3263b; background: #fbecef; border-radius: 10px; padding: 9px 12px; margin: 12px 0 0; font-size: 0.86rem; }
.photo-edit { display: flex; gap: 16px; align-items: flex-start; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.photo-edit img, .photo-ph { width: 120px; height: 150px; object-fit: cover; border-radius: 12px; background: #d9e4f2; flex: 0 0 auto; }
.photo-ph { display: grid; place-items: center; font-size: 1.6rem; font-weight: 800; color: var(--navy); }
code { background: #eef3f9; padding: 2px 6px; border-radius: 6px; font-size: 0.8rem; }

/* ---------------- moslashuvchan ---------------- */
@media (max-width: 1280px) {
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "prof prof" "kpi pubs" "grant map" "hist hist"; }
  .dash .cards { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .kpis, .callout { grid-template-columns: repeat(3, 1fr); }
  .grid-2, .grid-2.even, .profile, .compare, .delta { grid-template-columns: 1fr; }
  .banner h1 { font-size: 1.25rem; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: minmax(0, 1fr); background: none; }
  .side { position: fixed; z-index: 20; left: 0; transform: translateX(-105%); width: min(280px, 86vw); transition: transform 0.2s ease; }
  .side.open { transform: none; }
  .menu-btn { display: inline-block; border: 1px solid var(--line); background: #fff; border-radius: 10px; padding: 9px 12px; }
  .banner { min-height: 0; padding: 12px 16px; }
  .banner h1 { font-size: 1rem; text-align: left; }
  .toolbar, main { padding-left: 16px; padding-right: 16px; }
  .year-pick, .search { flex: 1 1 140px; }
  .year-pick select { min-width: 0; width: 100%; }
  .kpis, .callout, .kpis.four { grid-template-columns: repeat(2, 1fr); }
  .kpis.three, .form-grid, .form-grid.four { grid-template-columns: 1fr; }
  .dash { grid-template-columns: minmax(0, 1fr); grid-template-areas: "prof" "kpi" "pubs" "grant" "map" "hist"; }
  .dash .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi-mini { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .photo-edit { flex-direction: column; }
}
/* ---------------- bo'lim paneli: yuklab olish / chop etish (admin) ---------------- */
.page-tools { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.page-tools .page-title { margin: 0; font-size: 1.15rem; color: var(--navy); }
.page-actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.page-actions .export-sep { width: 1px; align-self: stretch; background: var(--line, #d6deea); margin: 0 4px; }
.print-only { display: none; }

@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; }
  .side, .banner, .toolbar, .nav-back-row, .menu-btn, .actions, .flash, .page-actions, .filters, .row-act, .btn, .tip { display: none !important; }
  .print-only { display: block; }
  img.print-only { display: inline-block; width: 44px; height: 44px; }
  .app { display: block; background: none; }
  main { padding: 0; }
  .page-tools { border-bottom: 3px solid var(--gold); padding-bottom: 8px; }
  .panel, .card, .kpi { box-shadow: none; break-inside: avoid; }
  .table-wrap { overflow: visible; }
  table { font-size: 9.5pt; }
  tr { break-inside: avoid; }
  .person:hover { transform: none; }
  a { text-decoration: none; color: inherit; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------------- kirish oynasi (to'liq ekran) ---------------- */
body.auth .side, body.auth .banner, body.auth .toolbar { display: none; }
body.auth .app { display: block; background: none; }
body.auth main { padding: 0; }
body.auth { background: #0b3a8c; }

/* Fon rasmi: chapda logotip, sarlavha va imkoniyatlar (rasmning o'zida), o'ngdagi och to'lqinlar ustida forma */
.auth-screen {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(380px, 31vw);
  background: #0b3a8c url("../assets/login-bg.jpg") left center / cover no-repeat;
}
.auth-hero { min-height: 100vh; }

.auth-side { display: grid; place-items: center; padding: 40px clamp(20px, 3.5vw, 64px) 40px 0; }
.auth-card {
  width: min(400px, 100%); display: flex; flex-direction: column; gap: 16px;
  padding: 34px 32px 28px; border-radius: 24px;
  background: rgba(255, 255, 255, 0.82); border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 30px 70px -20px rgba(8, 36, 96, 0.45), 0 0 0 1px rgba(16, 40, 79, 0.05);
  backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2);
  animation: rise 0.6s cubic-bezier(.2, .7, .2, 1) both;
}
.auth-kicker {
  align-self: flex-start; margin: 0; padding: 5px 12px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  color: #8a6510; background: #fdf2d3; border: 1px solid #f2d98f;
}
.auth-card h2 { margin: 0; font-size: 1.8rem; color: var(--navy); letter-spacing: -0.01em; }
.auth-sub { margin: -6px 0 6px; color: var(--muted); font-size: 0.92rem; line-height: 1.45; }

.auth-field { position: relative; display: flex; flex-direction: column; gap: 6px; font-size: 0.8rem; font-weight: 700; color: var(--navy); }
.auth-field > i { position: absolute; left: 14px; bottom: 13px; width: 20px; height: 20px; color: #8a9bb3; pointer-events: none; transition: color 0.2s; }
.auth-field > i svg, .auth-eye svg { width: 20px; height: 20px; }
.auth-field input {
  width: 100%; padding: 13px 46px 13px 44px; border-radius: 14px;
  border: 1.5px solid var(--line); background: #f8fafd; color: var(--ink); font-size: 0.98rem; font-weight: 500;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
.auth-field input::placeholder { color: #a6b3c6; }
.auth-field input:focus { outline: none; border-color: var(--blue); background: #fff; box-shadow: 0 0 0 4px rgba(31, 79, 153, 0.12); }
.auth-field:focus-within > i { color: var(--blue); }
.auth-eye {
  position: absolute; right: 8px; bottom: 7px; width: 34px; height: 34px; border: 0; border-radius: 10px;
  background: transparent; color: #8a9bb3; cursor: pointer; display: grid; place-items: center;
}
.auth-eye:hover, .auth-eye.on { color: var(--blue); background: #eaf1fb; }

.auth-submit {
  margin-top: 4px; display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 18px; border: 0; border-radius: 14px; cursor: pointer;
  color: #fff; font-weight: 700; font-size: 1rem; letter-spacing: 0.02em;
  background: linear-gradient(135deg, #0d3a8f 0%, #1f6fe0 100%);
  box-shadow: 0 12px 24px -8px rgba(13, 58, 143, 0.6), inset 0 -2px 0 rgba(242, 196, 48, 0.9);
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}
.auth-submit svg { width: 20px; height: 20px; transition: transform 0.2s; }
.auth-submit:hover { filter: brightness(1.08); box-shadow: 0 16px 28px -8px rgba(13, 58, 143, 0.65), inset 0 -2px 0 #f2c430; }
.auth-submit:hover svg { transform: translateX(4px); }
.auth-submit:active { transform: translateY(1px); }
.auth-submit:disabled { opacity: 0.7; cursor: wait; }
.auth-submit:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.auth-card .form-error { margin: 0; }
.auth-note { margin: 4px 0 0; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.76rem; color: #7d8ea8; text-align: center; }
.auth-note svg { width: 14px; height: 14px; flex: 0 0 auto; }

@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .auth-card { animation: none; } }

/* Tor ekran: rasm tepada to'liq (kesilmasdan) banner, forma uning ostida */
@media (max-width: 980px) {
  body.auth { background: #eef3fb; }
  .auth-screen { grid-template-columns: minmax(0, 1fr); background: #eef3fb; }
  .auth-hero { min-height: 0; aspect-ratio: 1727 / 911; background: #0b3a8c url("../assets/login-bg-sm.jpg") center / cover no-repeat; }
  .auth-side { padding: 0 16px 32px; place-items: start center; }
  .auth-card { margin-top: -28px; padding: 28px 22px 24px; background: #fff; }
}

/* ---------------- boshqa kompyuterlardan kelgan o'zgarish haqida eslatma ---------------- */
.sync-note {
  position: fixed; right: 18px; bottom: 18px; z-index: 60; max-width: min(420px, calc(100vw - 32px));
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 16px; border-radius: 12px; font-size: 0.88rem; font-weight: 600;
  color: #0d5a43; background: #e6f6ef; border: 1px solid #b9e4d1; box-shadow: var(--shadow);
  animation: rise 0.3s ease both;
}
.sync-note.pending { color: #6b4d0f; background: #fdf4dc; border-color: #f0dca4; }
.sync-note button { border: 0; border-radius: 8px; padding: 5px 10px; font-weight: 700; cursor: pointer; color: #fff; background: var(--navy); }
.sync-note[hidden] { display: none; }
@media print { .sync-note { display: none; } }

/* ---------------- lokal (XAMPP) nusxa ogohlantirishi ---------------- */
.local-ribbon { position: sticky; top: 0; z-index: 70; padding: 8px 16px; text-align: center; font-size: 0.85rem; font-weight: 700; color: #5c3b00; background: #ffd666; border-bottom: 1px solid #e0b43a; }
.local-ribbon a { color: #10284f; }
.net.local { color: #5c3b00; background: #ffe9a8; }
@media print { .local-ribbon { display: none; } }

/* ---------------- hamkorlik memorandumi ---------------- */
.memo-edit { margin: 16px 0 6px; padding: 14px; border: 1px dashed var(--line); border-radius: 12px; background: #f8fbfe; }
.memo-edit h3 { margin: 0 0 10px; font-size: 0.92rem; color: var(--navy); }
.memo-edit label { display: block; margin-top: 10px; font-size: 0.8rem; color: var(--muted); }
.memo-edit input[type="file"] { display: block; margin-top: 6px; max-width: 100%; }
.memo-cur { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.memo-cur > div { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; }
.memo-ico { flex: none; display: grid; place-items: center; width: 42px; height: 50px; border-radius: 6px; background: #c62828; color: #fff; font-size: 0.7rem; font-weight: 800; }
.memo-link { display: inline-block; margin-top: 4px; font-size: 0.78rem; font-weight: 700; white-space: nowrap; }
@media print { .memo-link { display: none; } }

/* ---------------- qurilmalar (super admin) ---------------- */
.dev-table td { vertical-align: top; }
.dev-table tr.dev-blocked td { background: #fff5f5; }
.dev-name { display: flex; gap: 8px; align-items: flex-start; }
.dev-ico { font-size: 1.4rem; line-height: 1; }
.dev-code { font-size: 0.72rem; background: #eef3f9; padding: 1px 5px; border-radius: 4px; }
.dev-badge { display: inline-block; font-size: 0.7rem; font-weight: 800; border-radius: 999px; padding: 2px 8px; background: #eef3f9; color: var(--navy); white-space: nowrap; }
.dev-badge.red { background: #fde8e8; color: #a12828; }
.dev-badge.green { background: #e7f6ef; color: #0d6b58; }
.dev-badge.blue { background: #e5f0fb; color: #1d4f8f; }
.dev-acts { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; min-width: 150px; }
.dev-ips summary { cursor: pointer; color: var(--blue); }
.dev-ips > div { margin-top: 6px; }
.flash.warn { background: #fff1c7; color: #6b4a00; border-color: #e8c766; }
.blocked-screen { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: rgba(10, 25, 50, 0.92); }
.blocked-card { max-width: 460px; background: #fff; border-radius: 16px; padding: 28px 24px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.blocked-card h2 { margin: 6px 0 10px; color: #a12828; }
.blocked-ico { font-size: 2.6rem; }
.dev-acts .link-danger { padding: 0; border: 0; background: none; color: #c0392b; font: inherit; font-size: 0.8rem; font-weight: 600; cursor: pointer; }
.text-red { color: #a12828; }
#devDay { padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font: inherit; }
.dev-title { font-weight: 800; color: var(--navy); margin-bottom: 2px; }
.dev-rename { padding: 0; border: 0; background: none; color: var(--blue); font: inherit; font-size: 0.74rem; font-weight: 600; cursor: pointer; }
.dev-rename:hover { text-decoration: underline; }
.dev-chk { width: 28px; text-align: center; }
.dev-chk input { width: 16px; height: 16px; cursor: pointer; }
.dev-bulk { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 10px; }
