/*
 * Hujjatlar bazasi — fayl menejeri uslubidagi interfeys (Windows Explorer / macOS Finder).
 * Ish stoli ichida (iframe) ochilganda <html class="is-embedded">: sarlavha paneli yashiriladi.
 */
:root {
  --background: #eef3f8;
  --surface: #fcfdfe;
  --surface-secondary: #f8fafc;
  --surface-sunken: #e9eff6;
  --text-primary: #1b2430;
  --text-secondary: #556270;
  --text-tertiary: #8a97a6;
  --text-on-accent: #ffffff;
  --border: rgba(120, 140, 165, .24);
  --border-strong: rgba(120, 140, 165, .42);
  --accent: #3f5f92;
  --accent-hover: #35527f;
  --accent-subtle: rgba(63, 95, 146, .12);
  --accent-subtle-hover: rgba(63, 95, 146, .19);
  --accent-border: rgba(63, 95, 146, .34);
  --select-bg: #dbe6f6;
  --select-border: #8eaad6;
  --success: #2f8f5b;
  --success-subtle: rgba(60, 160, 105, .13);
  --success-border: rgba(60, 160, 105, .3);
  --warning: #b07d1e;
  --warning-subtle: rgba(190, 145, 50, .14);
  --warning-border: rgba(190, 145, 50, .32);
  --danger: #c03a44;
  --danger-hover: #a63039;
  --danger-subtle: rgba(192, 58, 68, .1);
  --danger-border: rgba(192, 58, 68, .26);
  --star: #e2a10f;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, sans-serif;
  --text-xs: .75rem;
  --text-sm: .8125rem;
  --text-base: .875rem;
  --text-md: 1rem;
  --text-lg: 1.25rem;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --shadow-xs: 0 1px 1.5px rgba(30, 50, 80, .05);
  --shadow-sm: 0 1px 2px rgba(30, 50, 80, .05), 0 2px 8px rgba(30, 50, 80, .07);
  --shadow-md: 0 2px 6px rgba(30, 50, 80, .06), 0 12px 30px rgba(30, 50, 80, .12);
  --shadow-lg: 0 10px 20px rgba(30, 50, 80, .1), 0 30px 60px rgba(30, 50, 80, .18);
  --ring: 0 0 0 3px rgba(63, 95, 146, .25);
  --hairline: rgba(120, 140, 165, .18);
  --hover: rgba(88, 120, 173, .08);
  --nav-bg: #f4f7fb;
  --chrome-bg: #f9fbfd;
  --navpane-width: 250px;
  --details-width: 300px;
  --dur: .15s;
  --ease: cubic-bezier(.4, 0, .2, 1);
  --folder: #f2b84b;
  --folder-dark: #d99a26;
  --c-pdf: #d93a3a;
  --c-word: #2b67c9;
  --c-sheet: #1d8a50;
  --c-slide: #d0602a;
  --c-image: #8a4fd1;
  --c-other: #6b7a8c;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; font-family: var(--font-sans); font-size: var(--text-base); line-height: 1.45;
  color: var(--text-primary); background: var(--background); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
h1, h2, h3 { letter-spacing: -.011em; line-height: 1.25; margin: 0; }
h1 { font-size: var(--text-lg); font-weight: 600; }
h2 { font-size: var(--text-md); font-weight: 600; margin-bottom: 12px; }
.muted { color: var(--text-secondary); }
.faint { color: var(--text-tertiary); }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
kbd { font: inherit; font-size: var(--text-xs); padding: 0 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 4px; background: var(--surface); color: var(--text-secondary); }

.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i--sm { width: 15px; height: 15px; }
.i--lg { width: 22px; height: 22px; }

/* ================= Oyna ================= */
.win { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.titlebar {
  display: flex; align-items: center; gap: 12px; height: 50px; padding: 0 12px 0 14px; flex: none;
  background: #1f3352; color: #fff;
}
.titlebar__brand { display: flex; align-items: center; gap: 10px; color: #fff; min-width: 0; }
.titlebar__brand:hover { color: #fff; text-decoration: none; }
.titlebar__brand img { width: 28px; height: 28px; border-radius: 6px; }
.titlebar__name { font-weight: 600; white-space: nowrap; }
.titlebar__sub { color: #a9bad3; font-size: var(--text-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.titlebar__right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.titlebar .icon-btn { color: #d5e0f0; }
.titlebar .icon-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.user-chip { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border-radius: 999px; background: rgba(255,255,255,.1); }
.user-chip__name { font-size: var(--text-sm); white-space: nowrap; }
.user-chip__role { font-size: var(--text-xs); color: #a9bad3; }
.avatar {
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(120deg, #7fb0dd 0%, #5878ad 55%, #45608f 100%); color: #fff; font-size: var(--text-xs); font-weight: 700;
}
.nav-toggle { display: none; }

.win__body { display: flex; flex: 1; min-height: 0; }
.win__main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--surface); }

/* ================= Navigatsiya paneli ================= */
.navpane {
  width: var(--navpane-width); flex: none; display: flex; flex-direction: column;
  background: var(--nav-bg); border-right: 1px solid var(--hairline); overflow: hidden;
}
.navpane__scroll { flex: 1; overflow-y: auto; padding: 8px 6px 12px; }
.navpane__group { margin-bottom: 6px; }
.navpane__label { display: block; padding: 10px 10px 4px; font-size: var(--text-xs); font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .04em; }
.nav-link, .tree-row {
  display: flex; align-items: center; gap: 8px; height: 30px; padding: 0 8px; border-radius: var(--radius-md);
  color: var(--text-primary); white-space: nowrap; cursor: pointer; user-select: none; font-size: var(--text-base);
}
.nav-link:hover, .tree-row:hover { background: var(--hover); color: var(--text-primary); text-decoration: none; }
.nav-link.is-active, .tree-row.is-active { background: var(--select-bg); }
.nav-link .i { color: var(--text-secondary); }
.nav-link .i.star { color: var(--star); fill: var(--star); }
.tree-row { padding-left: calc(4px + var(--depth, 0) * 16px); }
.tree-row__name { overflow: hidden; text-overflow: ellipsis; }
.tree-toggle { display: grid; place-items: center; width: 18px; height: 18px; border: 0; padding: 0; background: none; color: var(--text-tertiary); cursor: pointer; border-radius: 4px; flex: none; }
.tree-toggle:hover { background: var(--hover); color: var(--text-primary); }
.tree-toggle .i { width: 14px; height: 14px; transition: transform var(--dur) var(--ease); }
.tree-toggle.is-open .i { transform: rotate(90deg); }
.tree-toggle.is-empty { visibility: hidden; }
.tree-row.is-drop, .nav-link.is-drop { background: var(--accent-subtle); box-shadow: inset 0 0 0 1px var(--accent); }
.navpane__storage { padding: 10px 14px 12px; border-top: 1px solid var(--hairline); font-size: var(--text-xs); color: var(--text-secondary); }
.navpane__storage strong { color: var(--text-primary); font-size: var(--text-sm); }
.meter { height: 5px; border-radius: 5px; background: var(--surface-sunken); margin-top: 6px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); }

/* ================= Explorer: asboblar ================= */
.xp { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.xp-toolbar { display: flex; align-items: center; gap: 6px; height: 50px; padding: 0 10px; border-bottom: 1px solid var(--hairline); background: var(--chrome-bg); flex: none; }
.xp-nav { display: flex; gap: 2px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--radius-md); border: 0;
  background: transparent; color: var(--text-secondary); cursor: pointer; flex: none;
}
.icon-btn:hover:not(:disabled) { background: var(--hover); color: var(--text-primary); }
.icon-btn:disabled { opacity: .35; cursor: default; }
.icon-btn.is-on { background: var(--select-bg); color: var(--accent); }
.icon-btn:focus-visible, .btn:focus-visible, .cmd:focus-visible { outline: none; box-shadow: var(--ring); }

.address {
  flex: 1; min-width: 0; display: flex; align-items: center; height: 34px; padding: 0 4px; gap: 0;
  border: 1px solid var(--border-strong); border-radius: var(--radius-md); background: var(--surface); overflow: hidden;
}
.address__icon { margin: 0 6px 0 6px; color: var(--folder-dark); }
.address__seg { display: flex; align-items: center; min-width: 0; }
.address__btn {
  border: 0; background: none; font: inherit; color: var(--text-primary); padding: 4px 6px; border-radius: 4px;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px;
}
.address__btn:hover { background: var(--hover); }
.address__btn.is-drop { background: var(--accent-subtle); box-shadow: inset 0 0 0 1px var(--accent); }
.address__sep { color: var(--text-tertiary); width: 14px; height: 14px; }
.address input { flex: 1; border: 0; outline: none; font: inherit; height: 100%; padding: 0 6px; background: transparent; min-width: 0; }

.xp-search { position: relative; width: clamp(180px, 24vw, 320px); flex: none; }
.xp-search input[type="search"] {
  width: 100%; height: 34px; padding: 0 30px 0 32px; border: 1px solid var(--border-strong); border-radius: var(--radius-md);
  background: var(--surface); font: inherit; color: var(--text-primary);
}
.xp-search input[type="search"]:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.xp-search > .i { position: absolute; left: 9px; top: 8px; color: var(--text-tertiary); pointer-events: none; }
.xp-search .icon-btn { position: absolute; right: 2px; top: 2px; width: 30px; height: 30px; }

.xp-cmdbar {
  display: flex; align-items: center; gap: 2px; height: 46px; padding: 0 8px; border-bottom: 1px solid var(--hairline);
  background: var(--chrome-bg); flex: none; overflow-x: auto; scrollbar-width: none;
}
.xp-cmdbar::-webkit-scrollbar { display: none; }
.cmd {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 10px; border: 0; border-radius: var(--radius-md);
  background: transparent; font: inherit; color: var(--text-primary); cursor: pointer; white-space: nowrap; flex: none;
}
.cmd:hover:not(:disabled) { background: var(--hover); }
.cmd:disabled { color: var(--text-tertiary); cursor: default; }
.cmd:disabled .i { opacity: .5; }
.cmd .i { color: var(--text-secondary); }
.cmd--primary { background: var(--accent); color: #fff; padding: 0 12px; }
.cmd--primary .i { color: #fff; }
.cmd--primary:hover:not(:disabled) { background: var(--accent-hover); }
.cmd.is-on { background: var(--select-bg); }
.cmd__caret { width: 12px; height: 12px; margin-left: -2px; }
.cmd-sep { width: 1px; height: 24px; background: var(--hairline); margin: 0 6px; flex: none; }
.cmd-spacer { flex: 1; }

.xp-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--hairline); background: var(--surface-secondary); font-size: var(--text-sm); }
.xp-filters select, .xp-filters input { height: 30px; min-height: 30px; padding: 0 8px; width: auto; font-size: var(--text-sm); }
.xp-filters label { display: flex; align-items: center; gap: 6px; color: var(--text-secondary); }

/* ================= Explorer: tana ================= */
.xp-body { flex: 1; display: flex; min-height: 0; }
.xp-area { flex: 1; overflow: auto; position: relative; outline: none; padding: 6px 6px 40px; user-select: none; }
.xp-area.is-dragover { background: var(--accent-subtle); box-shadow: inset 0 0 0 2px var(--accent); }
.xp-group-title { font-size: var(--text-xs); font-weight: 600; color: var(--text-tertiary); text-transform: uppercase; letter-spacing: .04em; padding: 10px 8px 6px; }
.lasso { position: absolute; border: 1px solid var(--select-border); background: rgba(142, 170, 214, .18); pointer-events: none; z-index: 5; }

.it { position: relative; border: 1px solid transparent; border-radius: var(--radius-md); cursor: default; color: var(--text-primary); }
.it:hover { background: var(--hover); }
.it.is-selected { background: var(--select-bg); border-color: var(--select-border); }
.it.is-focused { outline: 1px dotted var(--accent); outline-offset: -2px; }
.it.is-cut { opacity: .5; }
.it.is-drop { background: var(--accent-subtle); border-color: var(--accent); }
.it__star { position: absolute; color: var(--star); fill: var(--star); width: 14px; height: 14px; }
.it__name { overflow-wrap: anywhere; }

/* Katta ikonalar */
.xp-items.icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 4px; align-content: start; }
.icons .it { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 8px; text-align: center; }
.icons .it__icon { width: 64px; height: 64px; display: grid; place-items: center; }
.icons .it__icon svg, .icons .it__icon img { width: 60px; height: 60px; }
.icons .it__icon img { object-fit: cover; border-radius: 4px; box-shadow: var(--shadow-sm); }
.icons .it__name { font-size: var(--text-sm); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.icons .it.is-selected .it__name { -webkit-line-clamp: unset; }
.icons .it__meta, .icons .it__cols { display: none; }
.icons .it__star { top: 8px; right: 12px; }

/* Plitkalar */
.xp-items.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 4px; align-content: start; }
.tiles .it { display: grid; grid-template-columns: 48px 1fr; gap: 2px 10px; align-items: center; padding: 8px 10px; min-height: 64px; }
.tiles .it__icon { grid-row: 1 / span 2; width: 48px; height: 48px; display: grid; place-items: center; }
.tiles .it__icon svg, .tiles .it__icon img { width: 44px; height: 44px; }
.tiles .it__icon img { object-fit: cover; border-radius: 4px; }
.tiles .it__name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: end; }
.tiles .it__meta { font-size: var(--text-xs); color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; align-self: start; }
.tiles .it__cols { display: none; }
.tiles .it__star { top: 6px; right: 8px; }

/* Jadval (tafsilotlar) */
.xp-items.details { display: block; min-width: 760px; }
.details-head, .details .it {
  display: grid; grid-template-columns: minmax(260px, 3fr) 140px 150px 100px 110px 80px; align-items: center; gap: 0;
}
.details-head {
  position: sticky; top: -6px; z-index: 2; height: 32px; margin: -6px -6px 2px; padding: 0 6px; background: var(--surface);
  border-bottom: 1px solid var(--hairline); font-size: var(--text-xs); color: var(--text-secondary);
}
.details-head button {
  display: flex; align-items: center; gap: 4px; height: 100%; padding: 0 10px; border: 0; background: none; font: inherit; color: inherit;
  cursor: pointer; text-align: left; border-right: 1px solid var(--hairline); white-space: nowrap;
}
.details-head button:hover { background: var(--hover); color: var(--text-primary); }
.details-head button.is-sorted { color: var(--text-primary); font-weight: 600; }
.details-head .i { width: 12px; height: 12px; }
.details .it { height: 34px; border-radius: var(--radius-sm); }
.details .it__icon { display: none; }
.details .it__meta { display: none; }
.details .it__cols { display: contents; }
.details .it__col { padding: 0 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: var(--text-sm); color: var(--text-secondary); }
.details .it__col--name { display: flex; align-items: center; gap: 8px; color: var(--text-primary); font-size: var(--text-base); }
.details .it__col--name svg, .details .it__col--name img { width: 20px; height: 20px; flex: none; }
.details .it__col--name img { object-fit: cover; border-radius: 2px; }
.details .it__col--num { text-align: right; }
.details .it__star { position: static; margin-left: 4px; }
.details .it .it__name { display: none; }

.xp-empty { display: grid; place-items: center; text-align: center; padding: 60px 20px; color: var(--text-secondary); }
.xp-empty .i { width: 54px; height: 54px; stroke-width: 1.2; color: var(--text-tertiary); margin-bottom: 8px; }
.xp-empty h3 { color: var(--text-primary); font-size: var(--text-md); margin-bottom: 6px; }
.xp-empty p { max-width: 420px; margin: 0 auto 14px; }
.xp-loading { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(252,253,254,.6); z-index: 4; }
.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--surface-sunken); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Ma’lumot paneli */
.xp-details { width: var(--details-width); flex: none; border-left: 1px solid var(--hairline); background: var(--chrome-bg); overflow-y: auto; padding: 18px 16px; }
.xp-details__preview { display: grid; place-items: center; height: 150px; margin-bottom: 14px; border-radius: var(--radius-lg); background: var(--surface-sunken); overflow: hidden; }
.xp-details__preview svg { width: 84px; height: 84px; }
.xp-details__preview img { max-width: 100%; max-height: 100%; object-fit: contain; }
.xp-details__name { font-weight: 600; font-size: var(--text-md); overflow-wrap: anywhere; margin-bottom: 4px; }
.xp-details__kind { color: var(--text-secondary); font-size: var(--text-sm); margin-bottom: 14px; }
.xp-details__actions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.props { display: grid; grid-template-columns: 112px 1fr; gap: 8px 10px; margin: 0; font-size: var(--text-sm); }
.props dt { color: var(--text-tertiary); }
.props dd { margin: 0; overflow-wrap: anywhere; }
.xp-details__hint { color: var(--text-tertiary); font-size: var(--text-sm); text-align: center; padding-top: 30px; }
.shortcuts { margin-top: 18px; font-size: var(--text-xs); color: var(--text-secondary); display: grid; gap: 6px; }
.shortcuts div { display: flex; justify-content: space-between; gap: 8px; }

/* Holat qatori */
.xp-status {
  display: flex; align-items: center; gap: 14px; height: 30px; padding: 0 12px; flex: none; border-top: 1px solid var(--hairline);
  background: var(--chrome-bg); font-size: var(--text-xs); color: var(--text-secondary);
}
.xp-status__views { margin-left: auto; display: flex; gap: 2px; }
.xp-status__views .icon-btn { width: 26px; height: 24px; }
.xp-status__views .i { width: 15px; height: 15px; }

/* ================= Fayl belgilari ================= */
.ficon { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 4px; color: #fff; font-size: 8px; font-weight: 700; flex: none; }
.ficon--pdf { background: var(--c-pdf); } .ficon--word { background: var(--c-word); } .ficon--sheet { background: var(--c-sheet); }
.ficon--slide { background: var(--c-slide); } .ficon--image { background: var(--c-image); } .ficon--other { background: var(--c-other); }

/* ================= Umumiy komponentlar ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 14px; font: inherit; font-weight: 500;
  color: var(--text-primary); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-md); cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface-secondary); color: var(--text-primary); text-decoration: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); color: #fff; }
.btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn--danger:hover { background: var(--danger-hover); color: #fff; }
.btn--ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.btn--ghost:hover { background: var(--hover); }
.btn--sm { height: 28px; padding: 0 10px; font-size: var(--text-sm); }
.btn--block { width: 100%; height: 40px; }
.btn:disabled { opacity: .55; cursor: default; }

input[type="text"], input[type="search"], input[type="date"], input[type="number"], input[type="password"], select, textarea {
  width: 100%; min-height: 34px; padding: 5px 10px; font: inherit; color: var(--text-primary); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-md);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
textarea { min-height: 80px; resize: vertical; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; min-width: 0; }
.field label, .field legend { font-weight: 500; font-size: var(--text-sm); color: var(--text-secondary); }
fieldset.field { border: 0; padding: 0; margin: 0 0 14px; }
.req { color: var(--danger); }
.help { color: var(--text-tertiary); font-size: var(--text-xs); }
.error { color: var(--danger); font-size: var(--text-sm); font-weight: 500; }
.field--error input, .field--error select, .field--error textarea { border-color: var(--danger); }
.checkbox { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.checklist ul, .checklist div { list-style: none; padding: 0; margin: 0; }
.checklist label { display: flex; gap: 8px; align-items: center; font-weight: 400; padding: 3px 0; color: var(--text-primary); }
.grid-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.grid-form .field--wide { grid-column: 1 / -1; }
.grid-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0 12px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.page { flex: 1; overflow-y: auto; padding: 20px clamp(14px, 2.4vw, 32px) 48px; background: var(--background); }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head p { margin: 4px 0 0; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); margin-bottom: 12px; font-weight: 500; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow-xs); }
.card--flush { padding: 0; overflow: hidden; }
.card--danger { border-color: var(--danger-border); }
.form-card { max-width: 780px; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.table th { font-size: var(--text-xs); color: var(--text-tertiary); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; background: var(--surface-secondary); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--hover); }
.details-list { list-style: none; margin: 0; padding: 0; font-size: var(--text-sm); }
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 8px; height: 22px; font-size: var(--text-xs); font-weight: 500; white-space: nowrap;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-secondary); color: var(--text-secondary);
}
.badge--ok, .badge--upload, .badge--restore, .badge--folder_restore { background: var(--success-subtle); border-color: var(--success-border); color: var(--success); }
.badge--accent, .badge--new_version, .badge--edit, .badge--move, .badge--folder_create, .badge--folder_rename { background: var(--accent-subtle); border-color: var(--accent-border); color: var(--accent); }
.badge--archive, .badge--folder_archive { background: var(--danger-subtle); border-color: var(--danger-border); color: var(--danger); }
.badge--access_change, .badge--dictionary_change, .badge--warn { background: var(--warning-subtle); border-color: var(--warning-border); color: var(--warning); }
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius-md); margin-bottom: 14px; border: 1px solid var(--accent-border); background: var(--accent-subtle); }
.alert--error { background: var(--danger-subtle); border-color: var(--danger-border); color: #8d2730; }
.alert--warning { background: var(--warning-subtle); border-color: var(--warning-border); color: #6f4f12; }
.state { text-align: center; padding: 56px 20px; }
.state__art { display: inline-grid; place-items: center; width: 80px; height: 80px; border-radius: 50%; background: var(--accent-subtle); color: var(--accent); margin-bottom: 14px; }
.state__art .i { width: 36px; height: 36px; stroke-width: 1.4; }
.state p { color: var(--text-secondary); max-width: 460px; margin: 6px auto 16px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs__item { padding: 5px 14px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-secondary); background: var(--surface); font-weight: 500; }
.tabs__item--active { background: var(--accent-subtle); border-color: var(--accent-border); color: var(--accent); }
.pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 20px 0; }
.pagination__info { color: var(--text-secondary); font-size: var(--text-sm); }
.versions { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.versions__item { border: 1px solid var(--border); border-radius: var(--radius-md); padding: 10px 12px; font-size: var(--text-sm); overflow-wrap: anywhere; }
.versions__item--current { border-color: var(--success-border); background: var(--success-subtle); }
.versions__head { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 2px; }

/* Menyu */
.menu {
  position: fixed; z-index: 70; min-width: 240px; padding: 5px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); font-size: var(--text-base);
}
.menu__item {
  display: flex; align-items: center; gap: 10px; width: 100%; height: 32px; padding: 0 10px; border: 0; background: transparent;
  border-radius: var(--radius-md); font: inherit; color: var(--text-primary); cursor: pointer; text-align: left; white-space: nowrap;
}
.menu__item:hover:not(:disabled), .menu__item:focus-visible { background: var(--hover); outline: none; color: var(--text-primary); text-decoration: none; }
.menu__item:disabled { color: var(--text-tertiary); cursor: default; }
.menu__item .i { color: var(--text-secondary); }
.menu__item.is-checked .i:first-child { color: var(--accent); }
.menu__item--danger, .menu__item--danger .i { color: var(--danger); }
.menu__key { margin-left: auto; padding-left: 18px; color: var(--text-tertiary); font-size: var(--text-xs); }
.menu__sep { height: 1px; background: var(--hairline); margin: 5px 4px; }

/* Dialoglar */
dialog.modal { width: min(94vw, 520px); padding: 0; border: 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); background: var(--surface); color: var(--text-primary); }
dialog.modal--wide { width: min(96vw, 780px); }
dialog.modal::backdrop { background: rgba(20, 30, 45, .4); }
.modal__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 6px; }
.modal__body { padding: 8px 20px; max-height: 64vh; overflow-y: auto; }
.modal__foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px 18px; flex-wrap: wrap; }
.upload-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 8px; }
.upload-row { display: grid; grid-template-columns: 26px 1fr 150px 30px; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.upload-row input { min-height: 30px; padding: 3px 8px; }
.upload-row__meta { grid-column: 2 / -1; font-size: var(--text-xs); color: var(--text-secondary); display: flex; justify-content: space-between; gap: 8px; }
.upload-row__bar { grid-column: 1 / -1; height: 4px; border-radius: 4px; background: var(--surface-sunken); overflow: hidden; }
.upload-row__bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.upload-row.is-done { opacity: .7; }
.upload-row.is-done .upload-row__bar span { background: var(--success); }
.upload-row.is-error { border-color: var(--danger-border); background: var(--danger-subtle); }
.upload-row__err { grid-column: 1 / -1; color: var(--danger); font-size: var(--text-sm); }
.tree-pick { list-style: none; margin: 0; padding: 0; }
.tree-pick .tree-pick { padding-left: 20px; }
.tree-pick button { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px; border: 0; background: transparent; border-radius: var(--radius-md); font: inherit; color: var(--text-primary); cursor: pointer; text-align: left; }
.tree-pick button:hover { background: var(--hover); }
.tree-pick button.is-on { background: var(--select-bg); font-weight: 600; }
.tree-pick button:disabled { color: var(--text-tertiary); cursor: not-allowed; }

/* Bildirishnomalar */
.toasts { position: fixed; left: 50%; bottom: 44px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 100; width: min(92vw, 460px); pointer-events: none; }
.toast { padding: 11px 16px; border-radius: var(--radius-md); background: #1f2a3a; color: #fff; box-shadow: var(--shadow-lg); font-weight: 500; animation: toast-in .18s var(--ease); }
.toast--error { background: var(--danger); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ================= Ko‘ruvchilar ================= */
.viewer { display: flex; flex-direction: column; height: 100vh; background: #e6ebf2; }
.viewer__bar { display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 10px; background: #1f3352; color: #fff; flex: none; }
.viewer__bar .icon-btn { color: #d5e0f0; }
.viewer__bar .icon-btn:hover { background: rgba(255,255,255,.12); color: #fff; }
.viewer__title { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.viewer__title strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer__title small { color: #a9bad3; white-space: nowrap; }
.viewer__bar .btn { background: rgba(255,255,255,.1); border-color: rgba(255,255,255,.2); color: #fff; height: 32px; }
.viewer__bar .btn:hover { background: rgba(255,255,255,.18); color: #fff; }
.viewer__bar .btn--primary { background: #fff; color: #1f3352; border-color: #fff; }
.viewer__bar .btn--primary:hover { background: #e8eef7; color: #1f3352; }
.viewer__frame { flex: 1; border: 0; width: 100%; display: block; background: #fff; }
.viewer__editor { flex: 1; min-height: 0; }
.viewer__image { flex: 1; overflow: auto; display: grid; place-items: center; padding: 20px; }
.viewer__image img { max-width: 100%; box-shadow: var(--shadow-md); background: #fff; }
.viewer__notice { flex: 1; display: grid; place-items: center; padding: 20px; }
.viewer__notice .card { max-width: 560px; text-align: center; }
.mode-pill { font-size: var(--text-xs); padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.14); color: #dbe6f6; white-space: nowrap; }
.mode-pill--edit { background: #2f8f5b; color: #fff; }

/* ================= Kirish ================= */
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(1100px 640px at 12% -10%, rgba(160,195,230,.35), transparent 55%), linear-gradient(160deg, #f6f9fc, #eaf0f6); }
.auth { width: min(100%, 400px); }
.auth__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.auth__brand img { width: 44px; height: 44px; border-radius: 8px; box-shadow: 0 1px 3px #1018283d; }
.auth__brand strong { font-size: var(--text-lg); display: block; line-height: 1.1; }
.auth .card { padding: 28px; box-shadow: var(--shadow-md); }
.demo-hint { margin-top: 14px; font-size: var(--text-sm); color: var(--text-secondary); }
.demo-hint code { background: var(--surface-sunken); padding: 1px 6px; border-radius: 4px; }

/* ================= Moslashuvchanlik ================= */
@media (max-width: 1180px) {
  .xp-details { display: none; }
  .xp.has-details .xp-details { display: block; position: absolute; right: 0; top: 0; bottom: 0; z-index: 20; box-shadow: var(--shadow-lg); }
  .xp-body { position: relative; }
}
@media (max-width: 860px) {
  .nav-toggle { display: inline-grid; }
  .navpane { position: fixed; top: 50px; bottom: 0; left: 0; z-index: 40; transform: translateX(-100%); transition: transform .2s var(--ease); box-shadow: var(--shadow-lg); width: min(84vw, 300px); }
  .win.is-nav-open .navpane { transform: none; }
  .win.is-nav-open .navpane-backdrop { display: block; position: fixed; inset: 50px 0 0 0; background: rgba(20, 30, 45, .35); z-index: 35; }
  .titlebar__sub, .user-chip__name, .user-chip__role { display: none; }
  .user-chip { padding: 0; background: none; }
  .xp-search { width: 44px; }
  .xp-search input[type="search"] { padding-right: 6px; }
  .xp-search input[type="search"]:not(:focus):placeholder-shown { padding-left: 30px; color: transparent; }
  .xp-search input[type="search"]:focus { position: absolute; right: 0; width: calc(100vw - 100px); z-index: 10; }
  .xp-nav [data-cmd="forward"], .xp-nav [data-cmd="refresh"] { display: none; }
  .cmd__label { display: none; }
  .cmd--primary .cmd__label { display: inline; }
  .xp-items.details { min-width: 0; }
  .details-head { display: none; }
  .details .it { grid-template-columns: 1fr auto; height: auto; min-height: 44px; padding: 4px 0; }
  .details .it__col { display: none; }
  .details .it__col--name, .details .it__col--size { display: flex; }
  .xp-items.icons { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
  .grid-form { grid-template-columns: 1fr; }
  .table thead { display: none; }
  .table tr { display: block; border-bottom: 1px solid var(--hairline); padding: 6px 0; }
  .table td { display: grid; grid-template-columns: 120px 1fr; gap: 8px; border: 0; padding: 4px 14px; }
  .table td::before { content: attr(data-label); color: var(--text-tertiary); font-size: var(--text-xs); }
  .table td:not([data-label])::before { content: ""; }
  .props { grid-template-columns: 1fr; gap: 2px; }
  .props dd { margin-bottom: 8px; }
  .viewer__title small, .viewer__bar .btn__label { display: none; }
  .upload-row { grid-template-columns: 26px 1fr 30px; }
  .upload-row input[data-field="number"] { grid-column: 2; }
}
/* Ish stoli oynasi ichida: sarlavhani ish stoli oynasi beradi */
.is-embedded .titlebar { display: none; }
@media (max-width: 860px) {
  .is-embedded .titlebar { display: flex; height: 40px; background: var(--chrome-bg); border-bottom: 1px solid var(--hairline); }
  .is-embedded .titlebar .icon-btn { color: var(--text-secondary); }
  .is-embedded .titlebar__brand, .is-embedded .titlebar__right { display: none; }
  .is-embedded .navpane { top: 40px; }
  .is-embedded .win.is-nav-open .navpane-backdrop { inset: 40px 0 0 0; }
}
@media (pointer: coarse) {
  .details .it { min-height: 46px; }
  .nav-link, .tree-row { height: 38px; }
}
@media print {
  .titlebar, .navpane, .xp-toolbar, .xp-cmdbar, .xp-status, .xp-details { display: none !important; }
}
