/* ICHTB hisobotlari — O'zbekiston milliy elektr tarmoqlari AJ */
:root {
  --navy-900: #0f1d5c;
  --navy-800: #15267a;
  --navy-700: #1b3196;
  --navy-600: #2340b3;
  --navy-100: #e6ebfa;
  --navy-50: #f2f5fd;
  --green: #4fae2e;
  --yellow: #f1c21b;
  --red: #e0312b;
  --ink: #111a33;
  --ink-2: #3a4560;
  --muted: #6b7690;
  --line: #e3e7f0;
  --line-2: #d3d9e6;
  --bg: #f3f5fa;
  --card: #ffffff;
  --danger: #c62828;
  --danger-bg: #fdecec;
  --ok: #1d7a3a;
  --ok-bg: #e8f6ec;
  --warn-bg: #fff6dc;
  --pdf: #d33a2c;
  --word: #2b5bb5;
  --excel: #1e7b45;
  --r: 10px;
  --r-sm: 7px;
  --shadow: 0 1px 2px rgba(17, 26, 51, .05), 0 4px 16px rgba(17, 26, 51, .05);
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Noto Sans", Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); }
a { color: var(--navy-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; line-height: 1.25; }
hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.sprite { display: none; }
.ic { width: 18px; height: 18px; flex: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
:focus-visible { outline: 3px solid rgba(35, 64, 179, .35); outline-offset: 2px; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--r-sm); border: 1px solid transparent;
  font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap; text-decoration: none !important;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn.sm { height: 34px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 46px; font-size: 15px; }
.btn.block { width: 100%; }
.btn.primary { background: var(--navy-700); color: #fff; }
.btn.primary:hover { background: var(--navy-800); }
.btn.ghost { background: #fff; color: var(--ink-2); border-color: var(--line-2); }
.btn.ghost:hover { background: var(--navy-50); border-color: var(--navy-100); color: var(--navy-700); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #a61f1f; }
.btn.danger-ghost { background: #fff; color: var(--danger); border-color: #f2c4c4; }
.btn.danger-ghost:hover { background: var(--danger-bg); }
.btn[disabled] { opacity: .6; cursor: progress; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--navy-50); color: var(--navy-700); border-color: var(--navy-100); text-decoration: none; }
.icon-btn.danger:hover { background: var(--danger-bg); color: var(--danger); border-color: #f2c4c4; }

input, select, textarea {
  width: 100%; font: 14px/1.4 var(--font); color: var(--ink); background: #fff;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); padding: 9px 11px; min-height: 40px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(35, 64, 179, .15); }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--navy-700); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field em { color: var(--danger); font-style: normal; }
.check { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; font-size: 14px; }
.input-icon { position: relative; }
.input-icon > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-icon input { padding-left: 40px; height: 46px; }
.input-icon .peek { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); cursor: pointer; padding: 8px; }
.input-icon .peek .ic { position: static; transform: none; }

/* ---------- alerts ---------- */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); margin-bottom: 16px; font-size: 14px; }
.alert .ic { margin-top: 1px; }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.err { background: var(--danger-bg); color: var(--danger); }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); margin-bottom: 16px; background: var(--navy-50); color: var(--ink-2); font-size: 14px; border: 1px solid var(--navy-100); }
.note .ic { color: var(--navy-700); margin-top: 1px; }
.note.warn { background: var(--warn-bg); border-color: #f4e2a6; }
.note.warn .ic { color: #9a6b00; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--navy-50); color: var(--navy-700); }
.badge.muted { background: #eef0f4; color: var(--muted); }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.off { background: var(--danger-bg); color: var(--danger); }

/* ---------- app shell ---------- */
body.app { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; width: 268px; flex: none; display: flex; flex-direction: column;
  background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%); color: #dfe5fb;
}
.stripe { display: flex; height: 4px; }
.stripe i { flex: 1; }
.stripe i:nth-child(1) { background: var(--red); }
.stripe i:nth-child(2) { background: var(--green); }
.stripe i:nth-child(3) { background: var(--yellow); }
.brand { display: flex; gap: 12px; align-items: center; padding: 20px 18px 18px; color: #fff; text-decoration: none !important; }
.brand img { background: #fff; border-radius: 50%; padding: 2px; flex: none; }
.brand strong { display: block; font-size: 16px; letter-spacing: .2px; }
.brand small { display: block; font-size: 11.5px; line-height: 1.3; color: #aebbe9; margin-top: 2px; }
.nav { flex: 1; padding: 6px 12px; overflow-y: auto; }
.nav a {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 2px; border-radius: 8px;
  color: #cfd8f7; font-weight: 500; text-decoration: none; position: relative;
}
.nav a:hover { background: rgba(255, 255, 255, .07); color: #fff; }
.nav a.on { background: rgba(255, 255, 255, .13); color: #fff; }
.nav a.on::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--green); }
.nav-label { margin: 18px 12px 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: #8696d4; font-weight: 600; }
.side-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .09); }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 8px; color: #fff; text-decoration: none !important; }
.me:hover, .me.on { background: rgba(255, 255, 255, .08); }
.me-text { min-width: 0; }
.me-text strong { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { display: block; font-size: 12px; color: #aebbe9; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; background: var(--green); color: #fff; font-weight: 700; font-size: 14px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; background: var(--navy-100); color: var(--navy-700); }
.avatar.lg { width: 56px; height: 56px; font-size: 20px; }
.logout { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 4px; padding: 10px 12px; border: 0; border-radius: 8px; background: none; color: #cfd8f7; font: 500 14px var(--font); cursor: pointer; }
.logout:hover { background: rgba(224, 49, 43, .18); color: #fff; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; height: 64px; padding: 0 28px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar h1 { flex: 1; font-size: 20px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-btn { display: none; }
.content { flex: 1; padding: 24px 28px 32px; width: 100%; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px; padding: 16px 28px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); }
.scrim { display: none; }

.lang-switch { display: inline-flex; padding: 3px; background: #eef1f7; border-radius: 99px; }
.lang-switch a { padding: 5px 12px; border-radius: 99px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.lang-switch a.on { background: #fff; color: var(--navy-700); box-shadow: 0 1px 3px rgba(17, 26, 51, .12); }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 16px; margin-bottom: 14px; }
.card-title .ic { color: var(--navy-700); }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.two-col > .card { margin-bottom: 0; }
.two-col + .card, .two-col + section { margin-top: 20px; }
.page-actions { display: flex; justify-content: flex-end; margin-bottom: 16px; }
.back-link { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 14px; font-weight: 600; font-size: 14px; }

.dept-banner { display: flex; align-items: center; gap: 14px; padding: 16px 20px; margin-bottom: 20px; border-radius: var(--r); background: linear-gradient(110deg, var(--navy-700), var(--navy-600)); color: #fff; box-shadow: var(--shadow); }
.dept-banner small { display: block; color: #c4cff5; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.dept-banner strong { font-size: 18px; }
.dept-banner > div:nth-child(2) { flex: 1; }
.dept-banner-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: rgba(255, 255, 255, .15); }
.dept-banner .btn.primary { background: #fff; color: var(--navy-700); }
.dept-banner .btn.primary:hover { background: var(--navy-50); }

/* ---------- filters ---------- */
.filters { padding: 16px; }
.search { position: relative; margin-bottom: 12px; }
.search > .ic { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 40px; height: 44px; font-size: 15px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; }
.filter-grid label { display: flex; flex-direction: column; gap: 4px; }
.filter-grid label > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.filter-grid select, .filter-grid input { min-height: 38px; padding: 7px 10px; }
.filter-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.filters.compact { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters.compact .search { flex: 2 1 260px; margin: 0; }
.filters.compact .filter-grid { flex: 1 1 220px; }
.filters.compact .filter-actions { margin: 0; }

/* ---------- tables ---------- */
.list-card { padding: 0; overflow: hidden; }
.list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.list-head h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.list-head h2 b { color: var(--ink); }
.list-foot { display: flex; justify-content: flex-end; padding: 10px 20px; }
.list-foot:empty { display: none; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfd; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbff; }
.table .num { text-align: right; }
.actions-col { width: 1%; }
.actions { display: flex; gap: 2px; justify-content: flex-end; align-items: center; white-space: nowrap; }
.actions form { display: inline-flex; margin: 0; }
.title-cell { display: flex; gap: 12px; align-items: flex-start; min-width: 260px; }
.title-cell > div { min-width: 0; }
.title-cell strong, .title-cell .file-link { display: block; font-weight: 600; word-break: break-word; }
.file-link { color: var(--ink); }
.file-link:hover { color: var(--navy-700); text-decoration: underline; }
.title-cell .fname { display: block; font-size: 12.5px; word-break: break-all; }
.title-cell .comment { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 3px; white-space: pre-line; }
.ftype { display: inline-grid; place-items: center; flex: none; width: 44px; height: 30px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; color: #fff; margin-top: 2px; }
.ftype.pdf { background: var(--pdf); }
.ftype.word { background: var(--word); }
.ftype.excel { background: var(--excel); }
.ftype.other { background: var(--muted); }
.pager { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 20px; color: var(--muted); text-align: center; }
.empty > .ic { width: 42px; height: 42px; color: var(--line-2); }
.empty p { margin: 0 0 6px; font-size: 15px; }
.empty.small { padding: 28px 20px; }

/* ---------- upload ---------- */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 34px 20px; margin-bottom: 20px;
  border: 2px dashed var(--line-2); border-radius: var(--r); background: var(--navy-50); text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--navy-600); background: var(--navy-100); }
.dropzone.has-file { border-style: solid; border-color: var(--green); background: #f1f9ec; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.dz-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #fff; color: var(--navy-700); box-shadow: var(--shadow); margin-bottom: 4px; }
.dz-icon .ic { width: 24px; height: 24px; }
.dropzone strong { font-size: 15px; word-break: break-all; }
.upload-list { margin: -6px 0 20px; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.upload-list-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 10px 14px; background: #fafbfd; border-bottom: 1px solid var(--line); }
.upload-list ul { list-style: none; margin: 0; padding: 0; max-height: 420px; overflow-y: auto; }
.up-item { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.up-item:last-child { border-bottom: 0; }
.up-item .ftype { margin-top: 0; }
.up-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.up-main input { min-height: 34px; padding: 6px 10px; font-weight: 600; }
.up-main small { word-break: break-all; }
.up-bar { height: 4px; border-radius: 4px; background: var(--navy-50); overflow: hidden; }
.up-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--navy-600), var(--green)); transition: width .2s; }
.up-status { flex: 0 1 260px; font-size: 13px; text-align: right; }
.up-item.invalid, .up-item.error { background: #fff7f7; }
.up-item.invalid .up-status, .up-item.error .up-status { color: var(--danger); }
.up-item.done { background: #f3faf0; }
.up-item.done .up-status { color: var(--ok); font-weight: 600; }
.up-item.uploading .up-status::after { content: "…"; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-grid.four { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.span-2 { grid-column: span 2; }
.static-value { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 9px 11px; border-radius: var(--r-sm); background: #f6f7fa; border: 1px solid var(--line); font-weight: 600; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 6px; }
.progress { position: relative; height: 28px; border-radius: 99px; background: var(--navy-50); overflow: hidden; margin: 6px 0 16px; border: 1px solid var(--navy-100); }
.progress .bar { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, var(--navy-600), var(--green)); transition: width .2s; }
.progress span { position: relative; display: block; text-align: center; font: 600 13px/26px var(--font); color: var(--ink); }

/* ---------- departments ---------- */
.inline-create { display: flex; align-items: flex-end; gap: 14px; }
.inline-create .field { margin: 0; flex: 1; }
.inline-create .ic-wrap { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--navy-50); color: var(--navy-700); flex: none; }
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; padding: 18px 20px 20px; }
.dept-card { display: flex; align-items: center; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r); color: var(--ink); text-decoration: none !important; transition: border-color .15s, box-shadow .15s, transform .15s; background: #fff; }
.dept-card:hover { border-color: var(--navy-100); box-shadow: 0 6px 18px rgba(27, 49, 150, .1); transform: translateY(-1px); }
.dept-card-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; background: var(--navy-50); color: var(--navy-700); flex: none; }
.dept-card.archived .dept-card-icon { background: #f0f1f4; color: var(--muted); }
.dept-card-body { flex: 1; min-width: 0; }
.dept-card-body strong { display: block; font-size: 15px; margin-bottom: 4px; word-break: break-word; }
.dept-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--muted); }
.dept-stats span { display: inline-flex; align-items: center; gap: 5px; }
.dept-stats .ic { width: 14px; height: 14px; }
.chev { color: var(--line-2); }
.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; box-shadow: var(--shadow); }
.stat small { display: block; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat b { font-size: 20px; }
.stat.link { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; color: var(--navy-700); text-decoration: none !important; }
.stat.link:hover { background: var(--navy-50); }
.row-form { display: flex; gap: 10px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }
.user-list { padding: 8px 12px; }
.user-item { border-bottom: 1px solid var(--line); }
.user-item:last-child { border-bottom: 0; }
.user-item summary { display: flex; align-items: center; gap: 12px; padding: 12px 8px; cursor: pointer; list-style: none; border-radius: 8px; }
.user-item summary::-webkit-details-marker { display: none; }
.user-item summary:hover { background: #fafbff; }
.user-main { flex: 1; min-width: 0; }
.user-main strong, .user-main small { display: block; }
.last-login { white-space: nowrap; }
.user-edit { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px 24px; padding: 8px 8px 18px 52px; }
.user-edit h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin-bottom: 10px; }
.user-delete { grid-column: 1 / -1; }
.card-sub { padding: 18px 20px; border-top: 1px solid var(--line); background: #fbfcfe; }
.card-sub h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin-bottom: 14px; }
.card-sub h3 .ic { color: var(--navy-700); }
.account-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.account-head strong { display: block; font-size: 16px; }
.account-head small { display: block; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 18px; margin: 0; font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; }

.user-cell { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; }
.user-cell strong, .user-cell small { display: block; }
.user-cell:hover strong { color: var(--navy-700); }
.table .badge { margin: 1px 0; }
.check-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.check-pill { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border: 1px solid var(--line-2); border-radius: 99px; background: #fff; cursor: pointer; font-size: 14px; user-select: none; transition: background .15s, border-color .15s; }
.check-pill:hover { border-color: var(--navy-600); }
.check-pill:has(input:checked) { background: var(--navy-50); border-color: var(--navy-600); color: var(--navy-700); font-weight: 600; }
.check-pill.archived { color: var(--muted); }
.check-pill input { width: 16px; height: 16px; }
.add-member { display: flex; align-items: flex-end; gap: 12px; border-top: 0; border-bottom: 1px solid var(--line); }
.add-member .field { margin: 0; flex: 1; }
.add-member p { margin: 0; }
.mini-search { position: relative; width: min(320px, 100%); }
.mini-search > .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.mini-search input { min-height: 36px; padding: 6px 10px 6px 34px; }
.section-title { display: flex; align-items: center; gap: 8px; font-size: 16px; margin: 28px 0 14px; color: var(--ink-2); }
.section-title .ic { color: var(--navy-700); }
.danger-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; border-color: #f2d0d0; }
.danger-zone .card-title { margin-bottom: 4px; }
.danger-zone .card-title .ic { color: var(--danger); }
.danger-zone p { margin: 0; }
.card .form-grid > form { min-width: 0; }

/* ---------- modal ---------- */
.modal { border: 0; border-radius: 14px; padding: 0; width: min(440px, calc(100vw - 32px)); box-shadow: 0 24px 60px rgba(15, 29, 92, .3); }
.modal::backdrop { background: rgba(15, 29, 92, .45); }
.modal form { padding: 24px; text-align: center; }
.modal-icon { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--danger-bg); color: var(--danger); }
.modal-icon .ic { width: 26px; height: 26px; }
.modal-text { margin: 14px 0 18px; font-size: 15px; color: var(--ink); word-break: break-word; }
.modal-input { display: block; text-align: left; margin-bottom: 18px; }
.modal-input span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-actions .btn { min-width: 130px; }

/* ---------- login ---------- */
body.auth { min-height: 100vh; background: #fff; }
.login { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; }
.login-hero {
  position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 48px; text-align: center; color: #fff;
  background: radial-gradient(circle at 30% 20%, var(--navy-600) 0%, var(--navy-800) 45%, var(--navy-900) 100%);
}
.hero-logo { position: relative; width: 220px; height: 220px; border-radius: 50%; background: #fff; padding: 6px; box-shadow: 0 18px 50px rgba(0, 0, 0, .35); }
.login-hero h2 { position: relative; max-width: 460px; font-size: 26px; font-weight: 700; }
.login-hero p { position: relative; margin: 0; color: #b9c5f0; font-size: 15px; }
.hero-arcs i { position: absolute; left: -30%; width: 160%; height: 70%; border-radius: 50%; border-top: 6px solid; opacity: .5; }
.hero-arcs i:nth-child(1) { bottom: -38%; border-color: var(--red); transform: rotate(-6deg); }
.hero-arcs i:nth-child(2) { bottom: -42%; border-color: var(--green); transform: rotate(-6deg); }
.hero-arcs i:nth-child(3) { bottom: -46%; border-color: var(--yellow); transform: rotate(-6deg); }
.login-panel { display: flex; flex-direction: column; padding: 24px 40px; }
.login-top { display: flex; justify-content: flex-end; }
.login-form { width: 100%; max-width: 380px; margin: auto; padding: 24px 0; }
.login-form h1 { font-size: 28px; margin-bottom: 6px; }
.login-form > p { margin: 0 0 24px; }
.login-mini-logo { display: none; }
.login-form .btn { margin-top: 8px; }
.login-foot { text-align: center; font-size: 12px; color: var(--muted); margin: 0; }
.error-solo { max-width: 440px; margin: 15vh auto; }
.error-box { display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; padding: 40px 24px; }
.error-box > .ic { width: 44px; height: 44px; color: var(--danger); }
.error-box p { margin: 0; font-size: 16px; }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 30; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 20; background: rgba(15, 29, 92, .4); }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 0 14px; }
  .topbar h1 { font-size: 17px; }
  .content { padding: 16px 14px 24px; }
  .foot { padding: 14px; }
  .login { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .login-panel { padding: 16px 20px; min-height: 100vh; }
  .login-mini-logo { display: block; margin: 0 auto 14px; }
  .login-form { text-align: left; }
  .login-form h1 { text-align: center; }
  .login-form > p { text-align: center; }
}
@media (max-width: 760px) {
  .files-table thead { display: none; }
  .files-table, .files-table tbody, .files-table tr, .files-table td { display: block; width: 100%; }
  .files-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line); }
  .files-table td { border: 0; padding: 3px 0; }
  .files-table td[data-label] { display: flex; gap: 8px; font-size: 13px; }
  .files-table td[data-label]::before { content: attr(data-label) ":"; color: var(--muted); min-width: 92px; }
  .files-table td.num { text-align: left; }
  .files-table .title-cell { min-width: 0; margin-bottom: 4px; }
  .files-table .actions { justify-content: flex-start; margin-top: 6px; }
  .files-table .nowrap { white-space: normal; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .inline-create, .add-member, .danger-zone { flex-direction: column; align-items: stretch; }
  .inline-create .ic-wrap { display: none; }
  .dept-banner { flex-wrap: wrap; }
  .user-edit { padding-left: 8px; }
  .up-item { flex-wrap: wrap; }
  .up-status { flex-basis: 100%; text-align: left; }
  .last-login { display: none; }
  .list-head { flex-wrap: wrap; }
}
