:root {
  --bg: #08111d;
  --bg-2: #0e1727;
  --panel: rgba(14, 24, 39, 0.78);
  --panel-2: rgba(18, 31, 52, 0.72);
  --line: rgba(81, 143, 255, 0.15);
  --line-strong: rgba(94, 171, 255, 0.35);
  --text: #eaf3ff;
  --muted: #91a4c7;
  --blue: #2f7cff;
  --cyan: #61d4ff;
  --green: #89ff87;
  --yellow: #ffd24a;
  --red: #ff6d6d;
  --orange: #ffaf5f;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --radius: 28px;
  --radius-sm: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(70, 184, 255, 0.12), transparent 24%),
    radial-gradient(circle at 80% 10%, rgba(72, 104, 255, 0.12), transparent 18%),
    linear-gradient(180deg, #050a12 0%, #08111d 48%, #0b1320 100%);
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
input, select, textarea {
  width: 100%;
  background: rgba(8, 17, 29, 0.76);
  border: 1px solid rgba(112, 163, 255, 0.16);
  color: var(--text);
  padding: 14px 16px;
  border-radius: 16px;
  outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: rgba(97, 212, 255, 0.65);
  box-shadow: 0 0 0 4px rgba(97, 212, 255, 0.08);
}
textarea { min-height: 110px; resize: vertical; }
.hidden { display: none !important; }
.glass {
  background: linear-gradient(180deg, rgba(18, 31, 52, 0.78), rgba(8, 15, 25, 0.78));
  border: 1px solid rgba(100, 159, 255, 0.16);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.glass-soft {
  background: rgba(14, 24, 39, 0.65);
  border: 1px solid rgba(100, 159, 255, 0.16);
  backdrop-filter: blur(16px);
}
.bg-orb {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.3;
  pointer-events: none;
}
.orb-a { top: -180px; left: -80px; background: rgba(52, 125, 255, 0.45); }
.orb-b { right: -120px; bottom: -160px; background: rgba(97, 212, 255, 0.3); }
.bg-grid {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(80, 115, 180, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(80, 115, 180, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at center, black, transparent 80%);
  pointer-events: none;
}
.shell {
  width: min(1400px, calc(100vw - 48px));
  margin: 34px auto 60px;
  display: grid;
  gap: 22px;
}
.topbar {
  border-radius: 32px;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 22px;
  align-items: center;
}
.top-left, .top-right { display: flex; align-items: center; gap: 18px; }
.top-left { min-width: 0; }
.top-center { min-width: 0; }
.brand-block { min-width: 0; }
.brand-title { font-size: 26px; font-weight: 800; letter-spacing: -0.03em; }
.brand-subtitle { color: var(--muted); font-size: 13px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip-row { display: flex; gap: 12px; }
.top-chip, .view-btn, .login-btn, .primary-btn, .subtle-btn, .icon-btn, .pill-btn {
  border: 1px solid rgba(104, 157, 255, 0.18);
  color: var(--text);
  background: rgba(13, 26, 45, 0.88);
  transition: 0.2s ease;
}
.top-chip, .view-btn, .login-btn, .subtle-btn, .primary-btn, .pill-btn {
  padding: 14px 18px;
  border-radius: 18px;
  font-weight: 700;
}
.top-chip.active, .view-btn.active, .primary-btn, .department-btn.active {
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: white;
  border-color: transparent;
  box-shadow: 0 12px 40px rgba(47, 124, 255, 0.28);
}
.top-chip.ghost { opacity: 0.55; cursor: not-allowed; }
.search-wrap {
  height: 64px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 18px;
}
.search-wrap svg { width: 22px; height: 22px; fill: #85a6dc; flex: 0 0 auto; }
.search-wrap input {
  padding: 0;
  border: 0;
  background: transparent;
  height: 100%;
}
.view-switch { display: flex; gap: 10px; padding: 8px; border-radius: 22px; }
.login-btn { min-width: 132px; }
.filters { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.department-filters { display: flex; flex-wrap: wrap; gap: 14px; }
.department-btn {
  padding: 14px 20px;
  border-radius: 18px;
  background: rgba(15, 28, 47, 0.86);
  color: #9fb6de;
  border: 1px solid rgba(104, 157, 255, 0.12);
  font-weight: 700;
}
.table-card {
  border-radius: 32px;
  padding: 18px 18px 10px;
}
.table-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  padding: 12px 12px 16px;
}
.table-head h2, .modal-header h3, .drawer-header h3 { margin: 0; font-size: 30px; letter-spacing: -0.03em; }
.table-head p, .hint, .drawer-kicker, .section-title.small { color: var(--muted); }
.head-actions { display: flex; gap: 10px; }
.table-wrap {
  overflow: auto;
  border-radius: 24px;
  border: 1px solid rgba(104, 157, 255, 0.12);
}
table { width: 100%; border-collapse: collapse; min-width: 1120px; }
thead th {
  padding: 22px 18px;
  text-align: left;
  color: #cfe0ff;
  font-size: 15px;
  font-weight: 700;
  background: rgba(19, 35, 60, 0.8);
  position: sticky;
  top: 0;
  z-index: 1;
}
tbody tr {
  border-top: 1px dashed rgba(69, 129, 214, 0.25);
  cursor: pointer;
  transition: 0.18s ease;
}
tbody tr:hover { background: rgba(19, 35, 60, 0.56); transform: translateY(-1px); }
tbody td {
  padding: 18px 16px;
  color: #dce8fb;
  font-size: 15px;
}
.tag-department { font-weight: 700; }
.role-text.red { color: #ff7e7e; }
.role-text.cyan { color: #69f1ff; }
.role-text.yellow { color: #ffd879; }
.role-text.violet { color: #9c7dff; }
.role-text.soft { color: #dce8fb; }
.status-pill, .count-pill, .small-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}
.status-active { background: rgba(72, 211, 104, 0.12); color: #9cf89b; }
.status-vacation { background: rgba(255, 194, 69, 0.14); color: #ffe07f; }
.status-paused { background: rgba(255, 111, 111, 0.14); color: #ff9a9a; }
.status-other { background: rgba(97, 212, 255, 0.13); color: #94e7ff; }
.count-pill.warn { background: rgba(255, 109, 109, 0.14); color: #ff8f8f; }
.count-pill.pred { background: rgba(255, 184, 95, 0.14); color: #ffcf93; }
.activity, .stats { border-radius: 32px; padding: 20px; }
.activity-list { display: grid; gap: 12px; }
.activity-item {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border-radius: 20px;
  background: rgba(8, 16, 28, 0.52);
  border: 1px solid rgba(100, 159, 255, 0.09);
}
.activity-item strong { display: block; margin-bottom: 6px; }
.activity-item span, .activity-item time { color: var(--muted); font-size: 13px; }
.section-title { font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}
.stat-card, .department-card {
  border-radius: 26px;
  padding: 22px;
}
.stat-card span { color: var(--muted); }
.stat-card strong { display: block; margin-top: 14px; font-size: 46px; letter-spacing: -0.05em; }
.department-card { grid-column: 1 / -1; }
.bars { display: grid; gap: 12px; }
.bar-row {
  display: grid;
  grid-template-columns: 160px 1fr 48px;
  align-items: center;
  gap: 16px;
}
.bar-track {
  position: relative;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.bar-fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 9, 15, 0.72);
  backdrop-filter: blur(8px);
  z-index: 30;
}
.drawer {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: min(560px, calc(100vw - 32px));
  z-index: 40;
  border-radius: 32px;
  background: linear-gradient(180deg, rgba(17, 29, 49, 0.94), rgba(7, 13, 22, 0.96));
  border: 1px solid rgba(100, 159, 255, 0.18);
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto 1fr;
}
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  padding: 24px 24px 18px;
  border-bottom: 1px solid rgba(100, 159, 255, 0.12);
}
.drawer-body { overflow: auto; padding: 22px 24px 28px; display: grid; gap: 20px; }
.profile-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}
.avatar {
  width: 78px;
  height: 78px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(47, 124, 255, 0.8), rgba(97, 212, 255, 0.78));
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 800;
}
.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.meta-card, .action-card, .notes-card, .history-card {
  border-radius: 24px;
  padding: 18px;
  background: rgba(8, 16, 28, 0.46);
  border: 1px solid rgba(100, 159, 255, 0.1);
}
.meta-label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.meta-value { margin-top: 8px; font-weight: 700; }
.form-grid { display: grid; gap: 14px; }
.form-grid label, .account-form label { display: grid; gap: 8px; }
.form-grid span, .account-form span { color: #bdd4ff; font-size: 13px; }
.inline-actions, .stack-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pill-btn { font-size: 13px; padding: 11px 14px; }
.pill-btn.negative { border-color: rgba(255, 109, 109, 0.2); color: #ff9d9d; }
.pill-btn.positive { border-color: rgba(137, 255, 135, 0.2); color: #9ffba0; }
.icon-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 26px;
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(4, 9, 15, 0.72);
  backdrop-filter: blur(10px);
}
.modal-card {
  width: min(460px, 100%);
  border-radius: 28px;
  padding: 22px;
}
.modal-card.large {
  width: min(1160px, 100%);
  max-height: min(92vh, 940px);
  display: grid;
  grid-template-rows: auto auto 1fr;
  overflow: hidden;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 18px;
}
.full { width: 100%; }
.manager-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.manager-switch-btn {
  appearance: none;
  border: 1px solid rgba(100, 159, 255, 0.16);
  background: rgba(12, 23, 39, 0.72);
  color: #dce9fb;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.1;
  border-radius: 14px;
  padding: 10px 13px;
  cursor: pointer;
  transition: 0.18s ease;
}
.manager-switch-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(100, 159, 255, 0.28);
}
.manager-switch-btn.active {
  background: linear-gradient(135deg, rgba(48, 110, 255, 0.95), rgba(84, 214, 255, 0.85));
  color: #07111e;
  border-color: transparent;
  box-shadow: 0 14px 30px rgba(26, 81, 176, 0.35);
}
.accounts-layout {
  display: grid;
  grid-template-columns: minmax(390px, 540px) 1fr;
  gap: 16px;
  min-height: 0;
  overflow: hidden;
}
.management-column {
  display: grid;
  gap: 16px;
  min-height: 0;
}
.account-form, .account-list-wrap {
  border-radius: 24px;
  padding: 16px;
  background: rgba(8, 16, 28, 0.44);
  border: 1px solid rgba(100, 159, 255, 0.1);
  min-height: 0;
}
.account-list-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}
.compact-action {
  white-space: nowrap;
}

.account-list-wrap {
  overflow: hidden;
  display: grid;
  grid-template-rows: auto 1fr;
}
.compact-action {
  padding: 10px 14px;
  font-size: 13px;
}
.permission-grid {
  max-height: 340px;
}
.account-form {
  display: grid;
  gap: 12px;
  overflow: auto;
}
.employee-form {
  align-content: start;
}
.employee-form-head {
  display: grid;
  gap: 4px;
}
.compact-hint {
  margin: 0;
  font-size: 12px;
}
.employee-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.employee-grid .full-span {
  grid-column: 1 / -1;
}
.employee-form textarea { min-height: 72px; }
.account-actions { display: flex; gap: 10px; }
.sticky-actions {
  position: sticky;
  bottom: -16px;
  padding-top: 10px;
  padding-bottom: 2px;
  background: linear-gradient(180deg, rgba(8, 16, 28, 0), rgba(8, 16, 28, 0.92) 24%, rgba(8, 16, 28, 0.98));
}
.account-list { display: grid; gap: 12px; max-height: 100%; overflow: auto; }
.account-card {
  border-radius: 20px;
  padding: 18px;
  background: linear-gradient(180deg, rgba(16, 30, 50, 0.72), rgba(10, 21, 36, 0.72));
  border: 1px solid rgba(100, 159, 255, 0.12);
  display: grid;
  gap: 12px;
}
.account-permissions-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.account-card-top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}
.account-card small, .muted { color: var(--muted); }
.permission-block {
  display: grid;
  gap: 12px;
}
.permission-hint {
  margin: 0;
}
.permission-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.permission-summary {
  border-radius: 18px;
  padding: 14px;
  background: rgba(14, 25, 42, 0.82);
  border: 1px solid rgba(100, 159, 255, 0.14);
  display: grid;
  gap: 12px;
}
.permission-summary-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}
.permission-summary-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.permission-summary-value {
  font-weight: 800;
  color: #e7f1ff;
}
.permission-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.permission-badge {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(70, 184, 255, 0.14);
  border: 1px solid rgba(100, 159, 255, 0.16);
  color: #d9ebff;
  font-size: 12px;
  font-weight: 700;
}
.permission-badge.compact {
  padding: 7px 10px;
}
.permission-badge.muted-badge {
  background: rgba(255, 255, 255, 0.06);
  color: #b9c7de;
}
.permission-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-height: 420px;
  overflow: auto;
  padding-right: 4px;
}
.permission-grid.permission-grid-disabled {
  opacity: 0.58;
}
.permission-item {
  display: flex;
  gap: 12px;
  align-items: start;
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(13, 24, 40, 0.82), rgba(9, 18, 31, 0.82));
  border: 1px solid rgba(100, 159, 255, 0.12);
  min-height: 112px;
  transition: 0.18s ease;
}
.permission-item.selected {
  border-color: rgba(97, 212, 255, 0.46);
  box-shadow: 0 0 0 1px rgba(97, 212, 255, 0.18) inset, 0 12px 24px rgba(10, 23, 41, 0.28);
}
.permission-item:hover {
  transform: translateY(-1px);
}
.permission-item input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}
.permission-copy {
  display: grid;
  gap: 8px;
}
.permission-label-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}
.permission-key {
  color: #7ebcff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.permission-desc {
  color: #bfd0ea;
  font-size: 13px;
  line-height: 1.45;
}
.checkbox-row { display: flex !important; align-items: center; gap: 10px; }
.checkbox-row input { width: 18px; height: 18px; }
.note-list, .history-list { display: grid; gap: 10px; }
.note-item, .history-item {
  padding: 14px;
  border-radius: 18px;
  background: rgba(15, 28, 47, 0.54);
  border: 1px solid rgba(100, 159, 255, 0.08);
}
.history-item strong { display: block; margin-bottom: 6px; }
.toast-host {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 80;
  display: grid;
  gap: 10px;
}
.toast {
  min-width: 260px;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(9, 19, 31, 0.92);
  border: 1px solid rgba(100, 159, 255, 0.16);
  box-shadow: var(--shadow);
}
.toast.error { border-color: rgba(255, 109, 109, 0.2); }
@media (max-width: 1100px) {
  .topbar { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .accounts-layout { grid-template-columns: 1fr; }
  .permission-summary-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .permission-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .employee-grid { grid-template-columns: 1fr; }
  .account-list-head { flex-direction: column; align-items: stretch; }
  .shell { width: min(100vw - 20px, 1400px); margin-top: 18px; }
  .top-left, .top-right { flex-wrap: wrap; }
  .stats { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: 1fr; }
  .table-head { flex-direction: column; align-items: start; }
  .table-head h2, .modal-header h3, .drawer-header h3 { font-size: 24px; }
  .permission-summary-row { grid-template-columns: 1fr; }
}
