/* ADAU THİK — Tələbə Bazası · Apple-style UI */
:root {
  --brand: #143663;
  --brand-2: #1f4f8f;
  --accent: #143663;
  --accent-text: #fff;
  --link: #0a5bc4;
  --bg: #f5f5f7;
  --bg-2: #ebebf0;
  --surface: #ffffff;
  --surface-2: #f9f9fb;
  --elevated: #ffffff;
  --glass: rgba(246, 246, 248, .72);
  --text: #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #a1a1a6;
  --sep: rgba(0, 0, 0, .08);
  --sep-strong: rgba(0, 0, 0, .14);
  --fill: rgba(120, 120, 128, .12);
  --fill-2: rgba(120, 120, 128, .08);
  --hover: rgba(0, 0, 0, .04);
  --green: #248a3d;
  --green-bg: rgba(52, 199, 89, .14);
  --orange: #c93400;
  --orange-bg: rgba(255, 149, 0, .16);
  --red: #d70015;
  --red-bg: rgba(255, 59, 48, .12);
  --blue-bg: rgba(20, 54, 99, .09);
  --purple: #8944ab;
  --pink: #d30f45;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .04), 0 1px 1px rgba(0, 0, 0, .03);
  --shadow: 0 2px 8px rgba(0, 0, 0, .04), 0 8px 24px rgba(0, 0, 0, .06);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, .18), 0 2px 8px rgba(0, 0, 0, .08);
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --r-xl: 22px;
  --sidebar: 268px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter Variable", "Inter", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.25, .1, .25, 1);
  --spring: cubic-bezier(.34, 1.36, .64, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --accent: #2a6fd1;
  --accent-text: #ffffff;
  --link: #6aa3f0;
  --bg: #000000;
  --bg-2: #0d0d0f;
  --surface: #1c1c1e;
  --surface-2: #232325;
  --elevated: #2c2c2e;
  --glass: rgba(28, 28, 30, .72);
  --text: #f5f5f7;
  --text-2: #98989d;
  --text-3: #636366;
  --sep: rgba(255, 255, 255, .09);
  --sep-strong: rgba(255, 255, 255, .16);
  --fill: rgba(118, 118, 128, .24);
  --fill-2: rgba(118, 118, 128, .16);
  --hover: rgba(255, 255, 255, .05);
  --green: #30d158;
  --green-bg: rgba(48, 209, 88, .16);
  --orange: #ff9f0a;
  --orange-bg: rgba(255, 159, 10, .16);
  --red: #ff453a;
  --red-bg: rgba(255, 69, 58, .16);
  --blue-bg: rgba(106, 163, 240, .14);
  --purple: #bf5af2;
  --pink: #ff375f;
  --shadow-sm: 0 0 0 1px rgba(255, 255, 255, .04);
  --shadow: 0 0 0 1px rgba(255, 255, 255, .05), 0 8px 24px rgba(0, 0, 0, .4);
  --shadow-lg: 0 0 0 1px rgba(255, 255, 255, .08), 0 24px 64px rgba(0, 0, 0, .6);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.47 var(--font); letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  transition: background-color .3s var(--ease), color .3s var(--ease);
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: none; opacity: .85; }
img { max-width: 100%; display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -.022em; font-weight: 700; }
kbd { font: 500 11px var(--font); padding: 2px 6px; border-radius: 6px; background: var(--fill); color: var(--text-2); }
::selection { background: rgba(42, 111, 209, .28); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

.logo-dark { display: none !important; }
[data-theme="dark"] .logo-light { display: none !important; }
[data-theme="dark"] .logo-dark { display: block !important; }

/* ---------- App shell ---------- */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
  display: flex; flex-direction: column; gap: 14px; padding: 18px 14px 14px;
  background: var(--glass);
  backdrop-filter: saturate(180%) blur(24px); -webkit-backdrop-filter: saturate(180%) blur(24px);
  border-right: 1px solid var(--sep);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px; color: var(--text); }
.brand img { width: 40px; height: 40px; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-text strong { font-size: 15px; font-weight: 700; letter-spacing: -.02em; }
.brand-text small { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.search-pill {
  display: flex; align-items: center; gap: 8px; width: 100%; height: 34px; padding: 0 8px 0 10px;
  border: 0; border-radius: 10px; background: var(--fill); color: var(--text-2);
  font: inherit; font-size: 14px; cursor: pointer; transition: background .2s;
}
.search-pill:hover { background: var(--fill-2); box-shadow: inset 0 0 0 1px var(--sep); }
.search-pill span { flex: 1; text-align: left; }

.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; margin: 0 -4px; padding: 0 4px; }
.nav-label { font-size: 11.5px; font-weight: 600; color: var(--text-3); padding: 14px 10px 6px; text-transform: none; letter-spacing: 0; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 7px 10px; border-radius: 9px;
  color: var(--text); font-size: 14.5px; font-weight: 500; transition: background .15s;
}
.nav-item i { font-size: 17px; width: 20px; text-align: center; color: var(--link); }
.nav-item:hover { background: var(--hover); opacity: 1; }
.nav-item.active { background: var(--accent); color: var(--accent-text); }
.nav-item.active i { color: var(--accent-text); }

.sidebar-foot { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 1px solid var(--sep); }
.me { display: flex; align-items: center; gap: 10px; }
.me-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.me-text strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { font-size: 11.5px; color: var(--text-2); }

.main { flex: 1; margin-left: var(--sidebar); min-width: 0; }
.topbar { display: none; }
.page { max-width: 1240px; margin: 0 auto; padding: 36px 40px 80px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -.028em; }
.page-head .sub { margin: 6px 0 0; color: var(--text-2); font-size: 15px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }

.scrim { display: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 36px; padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer;
  font: 500 14px var(--font); letter-spacing: -.01em; white-space: nowrap;
  background: var(--fill); color: var(--text); transition: transform .12s var(--ease), background .2s, opacity .2s, box-shadow .2s;
  text-decoration: none;
}
.btn:hover { opacity: 1; background: var(--fill-2); box-shadow: inset 0 0 0 1px var(--sep); }
.btn:active { transform: scale(.97); }
.btn i { font-size: 15px; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { background: var(--accent); filter: brightness(1.12); box-shadow: none; }
.btn-danger { background: var(--red-bg); color: var(--red); }
.btn-danger:hover { background: var(--red-bg); filter: brightness(1.05); }
.btn-plain { background: transparent; color: var(--link); padding: 0 8px; }
.btn-plain:hover { background: var(--hover); box-shadow: none; }
.btn-sm { height: 30px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 46px; padding: 0 24px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }

.icon-btn {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 0; background: transparent; color: var(--text-2); cursor: pointer; font-size: 16px; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--fill); color: var(--text); opacity: 1; }
.icon-btn.danger:hover { background: var(--red-bg); color: var(--red); }

/* ---------- Segmented ---------- */
.segmented {
  display: inline-flex; padding: 2px; border-radius: 9px; background: var(--fill); gap: 2px; position: relative;
}
.segmented button, .segmented label {
  flex: 1; min-width: 36px; height: 28px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 7px; background: transparent; color: var(--text); font: 500 13px var(--font);
  cursor: pointer; transition: background .2s var(--ease), box-shadow .2s;
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented button.on, .segmented input:checked + span,
.segmented label:has(input:checked) { background: var(--surface); box-shadow: 0 1px 3px rgba(0,0,0,.12), 0 0 0 .5px rgba(0,0,0,.04); }
[data-theme="dark"] .segmented button.on, [data-theme="dark"] .segmented label:has(input:checked) { background: #636366; }
.theme-switch { width: 100%; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); border: 1px solid var(--sep); }
.card-pad { padding: 22px 24px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px 0; }
.card-head h2, .card-title { font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.card-head .muted { font-size: 13px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--text-2); margin: 28px 4px 8px; text-transform: uppercase; letter-spacing: .02em; }
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-main { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
.muted { color: var(--text-2); }
.tiny { font-size: 12px; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

/* Stats */
.stat { padding: 20px 22px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; }
.stat-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; color: #fff; background: var(--brand); }
.stat-icon.green { background: linear-gradient(135deg, #34c759, #248a3d); }
.stat-icon.orange { background: linear-gradient(135deg, #ff9f0a, #ff6b00); }
.stat-icon.purple { background: linear-gradient(135deg, #bf5af2, #8944ab); }
.stat-icon.blue { background: linear-gradient(135deg, #2d6bc4, #143663); }
.stat-value { font-size: 32px; font-weight: 700; letter-spacing: -.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 13.5px; color: var(--text-2); }

/* Bars */
.bars { display: flex; flex-direction: column; gap: 14px; padding: 18px 22px 22px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 12px; align-items: center; }
.bar-row .bar-name { font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bar-num { font-size: 13.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.bar-track { grid-column: 1 / -1; height: 8px; border-radius: 99px; background: var(--fill-2); overflow: hidden; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand-2), var(--accent)); transform-origin: left; animation: grow .9s var(--ease) both; }
[data-theme="dark"] .bar-fill { background: linear-gradient(90deg, #3c78cf, var(--accent)); }
@keyframes grow { from { transform: scaleX(0); } }

.split-bar { display: flex; height: 12px; border-radius: 99px; overflow: hidden; background: var(--fill-2); gap: 2px; }
.split-bar span { display: block; height: 100%; }
.legend { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13px; color: var(--text-2); margin-top: 12px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.c-male { background: #2d6bc4; }
.c-female { background: #ff375f; }
.c-none { background: var(--text-3); }

/* ---------- Lists (inset grouped) ---------- */
.list { list-style: none; margin: 0; padding: 0; }
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 11px 22px; position: relative; color: var(--text);
  transition: background .15s;
}
.list-row + .list-row::before { content: ""; position: absolute; top: 0; left: 70px; right: 0; height: 1px; background: var(--sep); }
.list.plain .list-row + .list-row::before { left: 22px; }
a.list-row:hover { background: var(--hover); opacity: 1; }
.list-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.list-main strong { font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-main small { color: var(--text-2); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-aside { color: var(--text-2); font-size: 13px; text-align: right; white-space: nowrap; }
.chev { color: var(--text-3); font-size: 13px; }

/* ---------- Avatar ---------- */
.avatar {
  flex: none; width: 38px; height: 38px; border-radius: 50%; overflow: hidden; display: inline-grid; place-items: center;
  font-size: 14px; font-weight: 600; color: #fff; background: linear-gradient(160deg, #a1a1a6, #7c7c80); letter-spacing: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.av-m { background: linear-gradient(160deg, #5b8fd6, #143663); }
.avatar.av-f { background: linear-gradient(160deg, #ff7a9a, #d30f45); }
.avatar.sm { width: 32px; height: 32px; font-size: 13px; }
.avatar.lg { width: 96px; height: 96px; font-size: 34px; }
.avatar.xl { width: 132px; height: 132px; font-size: 44px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: var(--fill); color: var(--text-2); white-space: nowrap; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.orange { background: var(--orange-bg); color: var(--orange); }
.badge.red { background: var(--red-bg); color: var(--red); }
.badge.blue { background: var(--blue-bg); color: var(--link); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.show-sm { display: none; }
.code { white-space: nowrap; font: 600 12.5px ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 0; color: var(--text-2); }
.count { min-width: 24px; height: 20px; padding: 0 7px; border-radius: 99px; background: var(--fill); color: var(--text-2); font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-weight: 600; font-size: 12px; color: var(--text-2); padding: 12px 14px; border-bottom: 1px solid var(--sep); white-space: nowrap; }
.table th a { color: inherit; }
.table th.sorted { color: var(--text); }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--sep); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--hover); }
.table tbody tr[data-href] { cursor: pointer; }
.table th:first-child, .table td:first-child { padding-left: 22px; }
.table th:last-child, .table td:last-child { padding-right: 22px; }
.person { display: flex; align-items: center; gap: 12px; min-width: 220px; }
.person-name { display: flex; flex-direction: column; line-height: 1.3; }
.person-name strong { font-weight: 600; }
.person-name small { color: var(--text-2); font-size: 12.5px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.form-grid .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-size: 13px; font-weight: 600; color: var(--text-2); padding-left: 2px; }
.field .req { color: var(--red); margin-left: 2px; }
.field .hint { font-size: 12px; color: var(--text-3); padding-left: 2px; }
.input, select.input, textarea.input {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 11px; border: 1px solid var(--sep-strong);
  background: var(--surface); color: var(--text); font: 15px var(--font); letter-spacing: -.01em;
  transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
textarea.input { height: auto; min-height: 92px; padding: 11px 14px; resize: vertical; line-height: 1.45; }
select.input {
  padding-right: 34px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%238e8e93' d='M3.2 5.7a1 1 0 0 1 1.4 0L8 9.1l3.4-3.4a1 1 0 1 1 1.4 1.4l-4.1 4.1a1 1 0 0 1-1.4 0L3.2 7.1a1 1 0 0 1 0-1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 13px center;
}
.input::placeholder { color: var(--text-3); }
.input:focus { outline: 0; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 20%, transparent); }
.input.invalid { border-color: var(--red); box-shadow: 0 0 0 4px var(--red-bg); }
.input-sm { height: 34px; font-size: 14px; border-radius: 9px; padding: 0 12px; }
select.input-sm { padding-right: 30px; background-position: right 10px center; }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-icon .input { padding-left: 38px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 46px; height: 28px; border-radius: 99px; background: var(--fill); position: relative; transition: background .25s var(--ease); flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .3s var(--spring); }
.switch input:checked + .track { background: #34c759; }
.switch input:checked + .track::after { transform: translateX(18px); }

.form-actions { display: flex; gap: 10px; justify-content: flex-end; padding-top: 6px; flex-wrap: wrap; }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 13px; font-size: 14px; margin-bottom: 18px; }
.alert i { font-size: 17px; line-height: 1.3; }
.alert-error { background: var(--red-bg); color: var(--red); }
.alert-warning { background: var(--orange-bg); color: var(--orange); }
.alert-info { background: var(--blue-bg); color: var(--link); }
.alert-success { background: var(--green-bg); color: var(--green); }
.alert .alert-body { flex: 1; color: var(--text); }
.alert strong { color: inherit; }

/* Photo uploader */
.photo-up { display: flex; align-items: center; gap: 20px; }
.photo-up .preview { position: relative; width: 112px; height: 112px; border-radius: 50%; overflow: hidden; background: var(--fill); display: grid; place-items: center; color: var(--text-3); font-size: 40px; flex: none; }
.photo-up .preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-up .actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.photo-up input[type=file] { display: none; }

/* ---------- Filters ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 16px 22px; border-bottom: 1px solid var(--sep); }
.toolbar .grow { flex: 1 1 260px; }
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; padding: 14px 22px; border-bottom: 1px solid var(--sep); background: var(--surface-2); }
.filters[hidden] { display: none; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 22px 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 12px; border-radius: 99px; background: var(--blue-bg); color: var(--link); font-size: 13px; font-weight: 500; }
.chip a { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: inherit; background: color-mix(in srgb, currentColor 14%, transparent); font-size: 11px; }
.result-meta { display: flex; align-items: center; justify-content: space-between; padding: 12px 22px; font-size: 13px; color: var(--text-2); border-bottom: 1px solid var(--sep); gap: 10px; flex-wrap: wrap; }

.pagination { display: flex; justify-content: center; gap: 4px; padding: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 34px; height: 34px; padding: 0 10px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 14px; color: var(--text); font-variant-numeric: tabular-nums; }
.pagination a:hover { background: var(--fill); opacity: 1; }
.pagination .on { background: var(--accent); color: var(--accent-text); font-weight: 600; }
.pagination .gap { color: var(--text-3); }

.empty { text-align: center; padding: 64px 24px; color: var(--text-2); }
.empty i { font-size: 44px; color: var(--text-3); display: block; margin-bottom: 12px; }
.empty h3 { color: var(--text); font-size: 19px; margin-bottom: 6px; }
.empty p { margin: 0 0 18px; }

/* ---------- Column browser (Struktur) ---------- */
.browser { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: hidden; min-height: 560px; }
.col { display: flex; flex-direction: column; min-width: 0; border-right: 1px solid var(--sep); }
.col:last-child { border-right: 0; }
.col-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 14px 10px 20px; }
.col-head h3 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.col-head h3 .count { font-size: 11.5px; }
.col-body { flex: 1; overflow-y: auto; padding: 0 8px 12px; max-height: 70vh; }
.col-item { cursor: pointer;
  display: flex; align-items: center; gap: 10px; padding: 9px 10px 9px 12px; border-radius: 10px; color: var(--text); position: relative;
  transition: background .12s;
}
.col-item:hover { background: var(--hover); opacity: 1; }
.col-item.sel { background: var(--accent); color: var(--accent-text); }
.col-item.sel .count { background: rgba(255,255,255,.22); color: inherit; }
.col-item.sel .ci-main small, .col-item.sel .chev, .col-item.sel .icon-btn { color: inherit; }
.col-item.sel .ci-main small { opacity: .78; }
.col-item.sel .icon-btn:hover { background: rgba(255,255,255,.18); }
.col-item .ci-main { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.col-item .ci-main strong { font-weight: 600; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-item .ci-main small { font-size: 12px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-item .ci-tools { display: none; gap: 0; }
.col-item:hover .ci-tools, .col-item.sel .ci-tools { display: inline-flex; }
.col-item .icon-btn { width: 28px; height: 28px; font-size: 14px; }
.col-empty { padding: 30px 16px; text-align: center; color: var(--text-3); font-size: 13.5px; }
.col-empty i { font-size: 28px; display: block; margin-bottom: 8px; }

/* ---------- Dialog / sheet ---------- */
dialog.sheet {
  border: 0; padding: 0; width: min(520px, calc(100vw - 32px)); border-radius: var(--r-xl);
  background: var(--elevated); color: var(--text); box-shadow: var(--shadow-lg);
}
dialog.sheet::backdrop { background: rgba(0, 0, 0, .32); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
dialog.sheet[open] { animation: pop .32s var(--spring); }
dialog.sheet[open]::backdrop { animation: fade .25s var(--ease); }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(8px); } }
@keyframes fade { from { opacity: 0; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 22px 4px; }
.sheet-head h3 { font-size: 20px; }
.sheet-body { padding: 14px 22px 4px; display: flex; flex-direction: column; gap: 14px; }
.sheet-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 18px 22px 22px; }
.confirm-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; background: var(--red-bg); color: var(--red); margin: 6px auto 2px; }
.confirm-text { text-align: center; }
.confirm-text h3 { font-size: 18px; margin-bottom: 6px; }
.confirm-text p { margin: 0; color: var(--text-2); font-size: 14px; }

/* ---------- Spotlight ---------- */
.spotlight { position: fixed; inset: 0; z-index: 100; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.spotlight[hidden] { display: none; }
.spotlight-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.25); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .2s; }
.spotlight-panel {
  position: relative; width: min(680px, 100%); border-radius: 18px; overflow: hidden;
  background: var(--glass); backdrop-filter: saturate(180%) blur(40px); -webkit-backdrop-filter: saturate(180%) blur(40px);
  box-shadow: var(--shadow-lg); border: 1px solid var(--sep); animation: pop .28s var(--spring);
}
[data-theme="dark"] .spotlight-panel { background: rgba(40, 40, 42, .82); }
.spotlight-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 60px; }
.spotlight-input i { font-size: 20px; color: var(--text-2); }
.spotlight-input input { flex: 1; border: 0; background: transparent; outline: 0; font: 400 21px var(--font); color: var(--text); letter-spacing: -.015em; min-width: 0; }
.spotlight-results { border-top: 1px solid var(--sep); max-height: 56vh; overflow-y: auto; padding: 6px; }
.spotlight-results:empty { display: none; }
.spotlight-hint { padding: 18px 14px; color: var(--text-2); font-size: 14px; text-align: center; }
.sp-section { font-size: 11.5px; font-weight: 600; color: var(--text-2); padding: 10px 12px 4px; }
.sp-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; color: var(--text); cursor: pointer; }
.sp-item.on { background: var(--accent); color: var(--accent-text); }
.sp-item.on small, .sp-item.on .code { color: inherit; opacity: .85; }
.sp-item .list-main small { color: var(--text-2); }
.sp-item .sp-ico { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--fill); font-size: 15px; flex: none; }
.sp-item.on .sp-ico { background: rgba(255,255,255,.2); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 11px 18px; border-radius: 99px; font-size: 14px; font-weight: 500;
  background: var(--glass); backdrop-filter: saturate(180%) blur(30px); -webkit-backdrop-filter: saturate(180%) blur(30px);
  box-shadow: var(--shadow); border: 1px solid var(--sep); color: var(--text);
  animation: toastIn .45s var(--spring) both, toastOut .35s var(--ease) 4.2s forwards;
}
[data-theme="dark"] .toast { background: rgba(44,44,46,.9); }
.toast i { font-size: 17px; }
.toast-success i { color: var(--green); }
.toast-error i { color: var(--red); }
.toast-warning i { color: var(--orange); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-16px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-12px); } }

/* ---------- Profile ---------- */
.profile-hero { display: flex; gap: 26px; align-items: center; padding: 28px; flex-wrap: wrap; }
.profile-hero h2 { font-size: 28px; letter-spacing: -.025em; }
.profile-hero .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.kv { display: grid; grid-template-columns: 170px 1fr; }
.kv > div { padding: 13px 22px; border-bottom: 1px solid var(--sep); font-size: 14.5px; }
.kv > div:nth-child(odd) { color: var(--text-2); padding-right: 0; }
.kv > div:nth-last-child(-n+2) { border-bottom: 0; }

/* ---------- Login ---------- */
.auth-page { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, rgba(20,54,99,.10), transparent 60%), var(--bg); }
[data-theme="dark"] .auth-page { background: radial-gradient(1200px 600px at 50% -10%, rgba(106,163,240,.14), transparent 60%), var(--bg); }
.auth-card { width: min(420px, 100%); text-align: center; }
.auth-card .auth-logo { width: min(330px, 86%); margin: 0 auto 30px; }
.auth-card h1 { font-size: 28px; margin-bottom: 6px; }
.auth-card .sub { color: var(--text-2); margin: 0 0 26px; }
.auth-form { display: flex; flex-direction: column; gap: 12px; text-align: left; }
.auth-form .input { height: 48px; font-size: 16px; border-radius: 13px; }
.auth-foot { margin-top: 28px; font-size: 12.5px; color: var(--text-3); }
.theme-float { position: fixed; top: 16px; right: 16px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-102%); transition: transform .35s var(--ease); box-shadow: none; background: var(--surface); }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.3); }
  .main { margin-left: 0; }
  .topbar {
    display: flex; align-items: center; gap: 8px; position: sticky; top: 0; z-index: 20; height: 52px; padding: 0 10px;
    padding-top: env(safe-area-inset-top);
    background: var(--glass); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--sep);
  }
  .topbar-title { flex: 1; text-align: center; font-weight: 600; font-size: 16px; }
  .topbar .icon-btn { width: 38px; height: 38px; font-size: 20px; color: var(--accent); }
  .page { padding: 20px 16px 60px; }
  .page-head h1 { font-size: 28px; }
  .browser { grid-template-columns: 1fr; min-height: 0; }
  .col { border-right: 0; border-bottom: 1px solid var(--sep); }
  .col-body { max-height: 46vh; }
  .col-item .ci-tools { display: inline-flex; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat { padding: 16px; }
  .stat-value { font-size: 26px; }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv > div:nth-child(odd) { padding-bottom: 0; border-bottom: 0; font-size: 12.5px; }
  .table .hide-sm { display: none; }
  .show-sm { display: inline; }
  .person { min-width: 0; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .card-pad { padding: 18px; }
  .photo-up { flex-direction: column; align-items: flex-start; }
  .spotlight { padding-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media print {
  .sidebar, .topbar, .page-actions, .toasts, .no-print { display: none !important; }
  .main { margin: 0; }
  body { background: #fff; }
}

#bulkBar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
#bulkBar[hidden] { display: none; }
.sp-item.on .list-main small { color: inherit; opacity: .8; }
select.input.input-sm, .input.input-sm { height: 34px; font-size: 14px; border-radius: 9px; }
