:root {
  --bg: #eef2f7;
  --bg-soft: #f7f9fc;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --surface-strong: #111827;
  --sidebar: #151922;
  --sidebar-soft: #202632;
  --text: #182033;
  --text-strong: #0f172a;
  --muted: #64748b;
  --muted-strong: #475569;
  --line: #d9e0ea;
  --line-soft: #e8edf4;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #eaf1ff;
  --green: #15803d;
  --green-soft: #e8f7ee;
  --yellow: #b7791f;
  --yellow-soft: #fff7df;
  --red: #dc2626;
  --red-soft: #fff0f0;
  --blue: #1d4ed8;
  --blue-soft: #e8f0ff;
  --shadow: 0 16px 36px rgba(15, 23, 42, .08);
  --shadow-soft: 0 8px 22px rgba(15, 23, 42, .06);
  --radius: 8px;
  --radius-sm: 6px;
  --focus: 0 0 0 3px rgba(37, 99, 235, .18);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .82), rgba(247, 249, 252, .92) 34rem),
    linear-gradient(135deg, rgba(37, 99, 235, .08), rgba(20, 184, 166, .05) 42%, rgba(245, 158, 11, .05)),
    var(--bg);
  letter-spacing: 0;
}

body {
  min-width: 320px;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: .6;
}

h1,
h2,
h3,
h4,
p {
  overflow-wrap: anywhere;
}

h1,
h2,
h3,
h4 {
  color: var(--text-strong);
}

h1 {
  margin: .08rem 0 .22rem;
  font-size: clamp(1.75rem, 2.9vw, 3.05rem);
  line-height: 1.02;
}

h2 {
  margin: .1rem 0 .35rem;
  font-size: clamp(1.45rem, 2.15vw, 2.15rem);
  line-height: 1.08;
}

h3 {
  margin: .05rem 0 .35rem;
  font-size: 1.04rem;
  line-height: 1.22;
}

h4 {
  margin: 0;
  font-size: .92rem;
}

p {
  margin: .35rem 0;
}

form {
  display: grid;
  gap: .8rem;
}

summary {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
  line-height: 1.5;
}

.eyebrow {
  display: block;
  margin: 0 0 .32rem;
  color: var(--accent-strong);
  text-transform: uppercase;
  letter-spacing: .11em;
  font-size: .68rem;
  font-weight: 850;
}

.help {
  margin-top: .15rem;
  color: var(--muted);
  font-size: .86rem;
  line-height: 1.45;
}

.danger-text {
  color: var(--red);
}

.app-shell {
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: .85rem;
  padding: .9rem;
  color: #eef2f7;
  background: var(--sidebar);
  border-right: 1px solid rgba(255, 255, 255, .08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: .72rem;
  padding: .82rem;
  border: 1px solid rgba(255, 255, 255, .08);
  border-radius: var(--radius);
  background: var(--sidebar-soft);
}

.brand-seal,
.login-logo {
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), #14b8a6);
  box-shadow: 0 12px 24px rgba(37, 99, 235, .22);
}

.brand-seal {
  width: 46px;
  height: 46px;
  border-radius: var(--radius);
  font-size: .78rem;
  font-weight: 950;
}

.sidebar-brand strong {
  display: block;
  color: #ffffff;
  font-size: 1.02rem;
}

.sidebar-brand small,
.sidebar-meta-card small {
  display: block;
  color: #a7b6ca;
  text-transform: uppercase;
  letter-spacing: .09em;
  font-size: .64rem;
  font-weight: 850;
}

.sidebar-nav {
  display: grid;
  gap: .25rem;
  overflow: auto;
  padding-right: .12rem;
}

.sidebar-nav span {
  margin: .65rem 0 .16rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .64rem;
  font-weight: 850;
}

.sidebar-nav a {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: .62rem;
  padding: .68rem .72rem;
  color: #dbe4ef;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: .92rem;
  font-weight: 780;
}

.sidebar-nav a i {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  color: #b9c7d8;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .08);
  font-style: normal;
  font-size: .78rem;
  font-weight: 900;
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: #ffffff;
  background: rgba(37, 99, 235, .18);
  border-color: rgba(147, 197, 253, .24);
}

.sidebar-nav a.active i {
  color: #ffffff;
  background: var(--accent);
  border-color: transparent;
}

.sidebar-meta-card,
.sidebar-user {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .78rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .055);
}

.sidebar-meta-card {
  margin-top: auto;
}

.sidebar-meta-card p {
  margin: .12rem 0 .28rem;
  color: #b5c2d3;
  font-size: .84rem;
}

.meta-badge {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  color: #ffffff;
  background: rgba(255, 255, 255, .1);
}

.avatar,
.officer-avatar,
.profile-avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent), #14b8a6);
  font-weight: 900;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
}

.avatar.mini,
.user-pill .avatar.mini {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  font-size: .82rem;
}

.sidebar-user {
  align-items: center;
  margin-top: 0;
}

.sidebar-user strong {
  color: #ffffff;
}

.sidebar-user small {
  display: block;
  color: #aebbd0;
  margin-top: .08rem;
  line-height: 1.35;
}

.logout {
  display: block;
  padding: .72rem .8rem;
  color: #fecaca;
  text-align: center;
  text-decoration: none;
  border: 1px solid rgba(248, 113, 113, .25);
  border-radius: var(--radius);
  background: rgba(220, 38, 38, .13);
  font-weight: 850;
}

.main {
  min-width: 0;
  padding: 1rem 1.15rem 1.4rem;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .95rem;
}

.topbar-compact {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: -.2rem -.2rem .95rem;
  padding: .9rem .2rem .75rem;
  background: linear-gradient(180deg, rgba(238, 242, 247, .94), rgba(238, 242, 247, .78), rgba(238, 242, 247, 0));
  backdrop-filter: blur(12px);
}

.top-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .55rem;
  flex-wrap: wrap;
}

.status-chip,
.user-pill,
.system-pill {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: .48rem;
  padding: .58rem .72rem;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .84);
  box-shadow: var(--shadow-soft);
  font-size: .86rem;
  font-weight: 800;
  white-space: nowrap;
}

.status-chip.status-ok span,
.system-pill span {
  width: .58rem;
  height: .58rem;
  display: block;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(21, 128, 61, .13);
}

.user-pill {
  max-width: 280px;
  white-space: normal;
}

.user-pill strong {
  display: block;
  line-height: 1.15;
}

.user-pill small {
  display: block;
  color: var(--muted);
  margin-top: .08rem;
  line-height: 1.25;
}

.page-content {
  display: grid;
  gap: .95rem;
}

.panel,
.card,
.page-toolbar,
.hero-card,
.employee-hero,
.profile-hero,
.login-card,
.login-brand,
.stats article,
.profile-stats article,
.wizard-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .92);
  box-shadow: var(--shadow-soft);
}

.panel,
.card {
  padding: 1rem;
}

.hero-card,
.employee-hero,
.profile-hero,
.page-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
}

.hero-card,
.employee-hero,
.profile-hero {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, .96), rgba(248, 250, 252, .9)),
    var(--surface);
}

.hero-card h2,
.employee-hero h2,
.profile-hero h2 {
  margin: .08rem 0 .25rem;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: .78rem;
}

.panel-head h3,
.page-toolbar h2 {
  margin-top: 0;
}

.actions,
.auth-links,
.wizard-action-right,
.promotion-decision-actions {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
}

.stats,
.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .75rem;
}

.stats article,
.profile-stats article {
  min-height: 104px;
  display: grid;
  align-content: space-between;
  gap: .35rem;
  padding: .92rem;
  overflow: hidden;
}

.stats span,
.profile-stats span {
  color: var(--muted);
  font-size: .8rem;
  font-weight: 850;
}

.stats strong,
.profile-stats strong {
  color: var(--text-strong);
  font-size: clamp(1.8rem, 3.4vw, 2.35rem);
  line-height: 1;
}

.stats small,
.profile-stats small {
  color: var(--muted);
  font-size: .82rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .95rem;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .95rem;
}

.form-grid,
.helper-grid,
.personnel-note-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}

.form-grid-spacious {
  gap: .85rem;
}

.form-grid.compact {
  grid-template-columns: .7fr 1fr;
  gap: .65rem;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(160px, .35fr) minmax(160px, .35fr) auto;
  gap: .65rem;
  align-items: end;
}

.employee-filter {
  grid-template-columns: minmax(260px, 1fr) minmax(160px, .28fr) minmax(150px, .25fr) auto;
}

label {
  display: grid;
  gap: .34rem;
  color: var(--muted-strong);
  font-size: .86rem;
  font-weight: 760;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: .62rem .72rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background-color .16s ease;
}

textarea {
  min-height: 118px;
  resize: vertical;
}

input[type="checkbox"] {
  width: auto;
  min-height: 0;
  accent-color: var(--accent);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: var(--focus);
}

input::placeholder,
textarea::placeholder {
  color: #94a3b8;
}

.table-wrap {
  min-height: 160px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  min-width: 900px;
  border-collapse: collapse;
}

th,
td {
  padding: .72rem .78rem;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted-strong);
  background: var(--surface-alt);
  text-transform: uppercase;
  letter-spacing: .06em;
  font-size: .7rem;
  font-weight: 850;
}

tbody tr:hover td {
  background: #f8fbff;
}

td small {
  line-height: 1.45;
}

.btn,
.link-btn,
.delete-btn,
.warning-btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .38rem;
  padding: .56rem .78rem;
  color: var(--text-strong);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(15, 23, 42, .03);
  font-size: .88rem;
  font-weight: 850;
  line-height: 1.15;
}

.btn:hover,
.link-btn:hover,
.delete-btn:hover,
.warning-btn:hover {
  border-color: #b8c3d4;
  background: var(--surface-alt);
}

.btn.primary {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.btn.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}

.btn.ghost,
.btn.secondary {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: #c9d8ff;
}

.delete-btn,
.btn.danger {
  color: var(--red);
  background: var(--red-soft);
  border-color: #fecaca;
}

.warning-btn {
  color: #8a5a08;
  background: var(--yellow-soft);
  border-color: #fde68a;
}

.full {
  width: 100%;
}

.inline-form {
  display: inline;
}

.mt-sm {
  margin-top: .75rem;
}

.my-sm {
  margin: .7rem 0;
}

.login-card-narrow {
  width: min(760px, 100%);
}

.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  padding: .28rem .55rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 850;
  line-height: 1.15;
  white-space: nowrap;
}

.badge.green {
  color: var(--green);
  background: var(--green-soft);
  border-color: #bbebcc;
}

.badge.yellow {
  color: var(--yellow);
  background: var(--yellow-soft);
  border-color: #f7dda1;
}

.badge.red {
  color: var(--red);
  background: var(--red-soft);
  border-color: #fecaca;
}

.badge.blue {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #c7d7fe;
}

.list {
  display: grid;
  gap: .62rem;
}

.item,
.mini-card,
.role-card,
.request-card,
.backup-row,
.helper-tile,
.subpanel,
.create-role-card,
.create-role-card-clean,
.permission-group-card-clean,
.role-panel-header,
.role-rename-row-clean {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.item,
.mini-card,
.role-card,
.request-card,
.backup-row,
.helper-tile,
.subpanel {
  padding: .82rem;
}

.item p,
.mini-card p,
.role-card p,
.request-card p,
.backup-row p,
.helper-tile p {
  color: var(--muted);
  margin: .22rem 0 0;
}

.card-grid,
.module-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: .75rem;
}

.progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #14b8a6);
}

.split,
.role-layout,
.role-layout-noreload,
.role-layout-clean {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: .95rem;
  align-items: start;
}

.side-list,
.role-switch-list,
.role-clean-list {
  display: grid;
  gap: .55rem;
}

.side-list a,
.side-list button,
.role-switch,
.role-clean-button {
  width: 100%;
  min-height: 54px;
  display: grid;
  gap: .18rem;
  padding: .72rem .78rem;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  font-weight: 850;
}

.side-list small,
.role-switch small,
.role-clean-button small {
  display: block;
  color: var(--muted);
  margin-top: .1rem;
  font-size: .78rem;
  font-weight: 700;
}

.side-list .active,
.role-switch:hover,
.role-switch.active,
.role-clean-button:hover,
.role-clean-button.active {
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-color: #c6d6ff;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: .58rem;
}

.permission-tile {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: .55rem;
  align-items: start;
  padding: .72rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.permission-tile small {
  display: block;
  color: var(--muted);
  margin-top: .12rem;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.15rem;
}

.login-grid {
  width: min(1060px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: .95rem;
  align-items: stretch;
}

.login-brand,
.login-card {
  padding: 1.1rem;
}

.login-brand {
  display: grid;
  align-content: center;
  min-height: 440px;
  color: #e5edf8;
  background:
    linear-gradient(135deg, rgba(21, 25, 34, .96), rgba(31, 41, 55, .94)),
    var(--surface-strong);
  border-color: rgba(255, 255, 255, .08);
}

.login-brand h1 {
  color: #ffffff;
  font-size: clamp(2.25rem, 5vw, 4.2rem);
}

.login-brand .muted {
  color: #b8c5d8;
}

.login-logo {
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  border-radius: var(--radius);
  font-size: .9rem;
  font-weight: 950;
}

.login-card h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.45rem);
}

.message {
  padding: .72rem .78rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  line-height: 1.45;
}

.message.ok {
  color: var(--green);
  background: var(--green-soft);
  border-color: #bce8cb;
}

.message.error {
  color: var(--red);
  background: var(--red-soft);
  border-color: #fecaca;
}

.accordion-panel {
  margin: .75rem 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.accordion-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .8rem;
  padding: .82rem;
  list-style: none;
}

.accordion-summary::-webkit-details-marker {
  display: none;
}

.summary-meta {
  display: flex;
  align-items: center;
  gap: .55rem;
  flex-shrink: 0;
}

.accordion-chevron {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-strong);
  transition: transform .16s ease;
}

.accordion-panel[open] .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-body {
  padding: 0 .82rem .82rem;
}

.toggle-row {
  display: block;
  padding: .72rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.toggle-row > span {
  display: grid;
  gap: .24rem;
}

.toggle-row input[type="checkbox"] {
  margin-right: .38rem;
  vertical-align: middle;
}

.toast {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 40;
  max-width: min(420px, calc(100vw - 2rem));
  padding: .78rem .9rem;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--shadow);
}

.toast.ok {
  color: var(--green);
}

.toast.error {
  color: var(--red);
}

.wizard-shell {
  padding: 1rem;
}

.wizard-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: .9rem;
}

.wizard-progress {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
  padding: .4rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.wizard-indicator {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .58rem .7rem;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-weight: 850;
}

.wizard-indicator.active {
  color: var(--accent-strong);
  border-color: #c8d7ff;
  background: var(--accent-soft);
}

.wizard-index {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e2e8f0;
  color: var(--muted-strong);
  font-weight: 900;
}

.wizard-indicator.active .wizard-index {
  color: #ffffff;
  background: var(--accent);
}

.step-card,
.accordion-preview {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.step-card {
  padding: .9rem;
}

.accordion-preview {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: .78rem;
  margin-top: .75rem;
  padding: .78rem;
  cursor: pointer;
}

.accordion-preview:hover {
  border-color: #b8c3d4;
  background: var(--surface-alt);
}

.accordion-preview-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.accordion-preview-meta {
  display: grid;
  justify-items: end;
  gap: .3rem;
  color: var(--muted);
  font-size: .82rem;
  font-weight: 760;
}

.wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-top: .85rem;
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: .42rem;
  padding: 2.2rem 1rem;
  color: var(--muted);
  text-align: center;
  border: 1px dashed #c7d0dd;
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.empty-icon {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent-soft);
}

dialog,
.modal-dialog,
.employee-dialog,
.promotion-dialog {
  width: min(780px, calc(100vw - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  box-shadow: 0 28px 80px rgba(15, 23, 42, .32);
}

dialog::backdrop,
.employee-dialog::backdrop,
.promotion-dialog::backdrop {
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(8px);
}

.modal-shell {
  position: relative;
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border-radius: var(--radius);
  background: var(--surface);
}

.modal-topline {
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #14b8a6, #f59e0b);
}

.modal-header {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: .95rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
}

.modal-header h2 {
  margin: .08rem 0 .18rem;
}

.modal-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: var(--muted-strong);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 1.22rem;
  font-weight: 850;
}

.modal-close:hover {
  color: var(--red);
  background: var(--red-soft);
  border-color: #fecaca;
}

.wizard-form,
.promotion-reject-form,
.module-form {
  padding: 1rem;
}

body:has(dialog[open]) {
  overflow: hidden;
}

.employee-dialog {
  width: min(760px, calc(100vw - 2rem));
  max-height: 82vh;
}

.employee-dialog .modal-shell {
  max-height: 82vh;
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.employee-dialog .wizard-form {
  min-height: 0;
  overflow: auto;
  gap: .7rem;
  padding: .85rem 1rem 1rem;
}

.employee-dialog .wizard-progress {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(248, 250, 252, .94);
  backdrop-filter: blur(10px);
}

.employee-dialog .step-card {
  padding: .78rem;
}

.employee-dialog input,
.employee-dialog select,
.employee-dialog textarea {
  min-height: 38px;
  padding: .52rem .62rem;
  font-size: .84rem;
}

.employee-dialog textarea {
  min-height: 76px;
}

.employee-dialog label {
  font-size: .78rem;
}

.employee-dialog .wizard-actions {
  position: sticky;
  bottom: -1rem;
  z-index: 3;
  margin: .75rem -1rem -1rem;
  padding: .75rem 1rem;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(10px);
}

.promotion-dialog {
  width: min(680px, calc(100vw - 2rem));
}

.promotion-modal-shell {
  max-height: calc(100vh - 2rem);
}

.history-tools,
.promotion-item,
.lock-box {
  background: var(--surface);
}

.promotion-item.locked {
  border-color: #fecaca;
  background: #fffafa;
}

.lock-box {
  margin-top: .65rem;
  padding: .72rem;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  background: var(--red-soft);
}

.lock-box p {
  margin: .2rem 0 0;
}

.decision-box,
.mini-details {
  padding: .72rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.personnel-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: .95rem;
  align-items: start;
}

.personnel-sidebar {
  position: sticky;
  top: 98px;
  max-height: calc(100vh - 120px);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto 1fr;
}

.personnel-search {
  margin-bottom: .68rem;
}

.officer-list {
  display: grid;
  gap: .55rem;
  min-height: 0;
  overflow: auto;
  padding-right: .15rem;
}

.officer-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .62rem;
  align-items: center;
  padding: .65rem;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.officer-card:hover,
.officer-card.active {
  border-color: #c6d6ff;
  background: var(--accent-soft);
}

.officer-card strong,
.officer-card small,
.officer-card span {
  display: block;
}

.officer-card small,
.officer-card span {
  color: var(--muted);
  margin-top: .08rem;
  font-size: .78rem;
  line-height: 1.3;
}

.officer-card .status-dot {
  width: .62rem;
  height: .62rem;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(21, 128, 61, .12);
}

.officer-card .status-dot.green {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .13), 0 0 16px rgba(34, 197, 94, .35);
}

.officer-card .status-dot.yellow {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .13), 0 0 16px rgba(245, 158, 11, .32);
}

.officer-card .status-dot.red {
  background: #f43f5e;
  box-shadow: 0 0 0 4px rgba(244, 63, 94, .13), 0 0 16px rgba(244, 63, 94, .32);
}

.officer-avatar {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
}

.personnel-main {
  min-width: 0;
  display: grid;
  gap: .95rem;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: .85rem;
}

.profile-avatar {
  width: 70px;
  height: 70px;
  border-radius: var(--radius);
  font-size: 1.45rem;
}

.profile-badges {
  display: flex;
  justify-content: flex-end;
  gap: .45rem;
  flex-wrap: wrap;
}

.personnel-section {
  display: grid;
  gap: .8rem;
}

.module-card {
  display: grid;
  gap: .72rem;
  padding: .82rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.module-card.green {
  border-color: #bbebcc;
  background: var(--green-soft);
}

.module-card.yellow {
  border-color: #f7dda1;
  background: var(--yellow-soft);
}

.module-card.red {
  border-color: #fecaca;
  background: var(--red-soft);
}

.module-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .65rem;
}

.module-card-head small {
  display: block;
  color: var(--muted);
  margin-top: .08rem;
}

.access-role-panel {
  overflow: visible;
}

.role-clean-sidebar,
.role-sidebar {
  position: sticky;
  top: 100px;
  display: grid;
  gap: .75rem;
}

.role-clean-list,
.role-switch-list {
  max-height: calc(100vh - 275px);
  overflow: auto;
  padding-right: .15rem;
}

.role-clean-button,
.role-switch {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.role-clean-button span,
.role-switch span,
.role-clean-button small,
.role-switch small {
  grid-column: 1;
}

.role-clean-button::after,
.role-switch::after {
  content: ">";
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.create-role-card-clean,
.create-role-card {
  display: grid;
  gap: .65rem;
  padding: .75rem;
}

.role-clean-content,
.role-panel-area {
  min-width: 0;
}

.role-clean-panel,
.role-panel {
  display: none;
}

.role-clean-panel.is-visible,
.role-panel:not(.hidden) {
  display: grid;
  gap: .95rem;
}

.role-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: .9rem;
}

.role-rename-row-clean,
.role-rename-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: .7rem;
  align-items: end;
  padding: .82rem;
}

.permission-group-card-clean,
.permission-group-card {
  padding: .85rem;
}

.permission-group-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-bottom: .58rem;
}

.sticky-save-bar-clean,
.sticky-save-bar {
  position: sticky;
  bottom: .75rem;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .75rem;
  margin-top: .8rem;
  padding: .72rem .82rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
  }

  .sidebar-meta-card,
  .sidebar-user {
    margin-top: 0;
  }

  .sidebar-nav {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  }

  .topbar {
    flex-direction: column;
  }

  .top-actions {
    justify-content: flex-start;
  }

  .grid-2,
  .grid-3,
  .split,
  .role-layout,
  .role-layout-noreload,
  .role-layout-clean,
  .login-grid,
  .personnel-layout {
    grid-template-columns: 1fr;
  }

  .personnel-sidebar,
  .role-clean-sidebar,
  .role-sidebar {
    position: relative;
    top: auto;
    max-height: none;
  }

  .role-clean-list,
  .role-switch-list {
    max-height: none;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }
}

@media (max-width: 840px) {
  .main {
    padding: .8rem;
  }

  .topbar-compact {
    margin: -.15rem -.1rem .8rem;
    padding: .72rem .1rem .6rem;
  }

  .hero-card,
  .employee-hero,
  .profile-hero,
  .panel-head,
  .wizard-header,
  .modal-header,
  .role-panel-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats,
  .profile-stats,
  .filter-bar,
  .employee-filter,
  .form-grid,
  .form-grid.compact,
  .helper-grid,
  .personnel-note-grid,
  .wizard-progress,
  .accordion-preview,
  .role-rename-row-clean,
  .role-rename-row,
  .sticky-save-bar-clean,
  .sticky-save-bar {
    grid-template-columns: 1fr;
  }

  .wizard-actions,
  .sticky-save-bar-clean,
  .sticky-save-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .wizard-action-right,
  .wizard-action-right .btn,
  .wizard-actions .btn,
  .wizard-actions .link-btn,
  .wizard-actions .delete-btn {
    width: 100%;
  }

  .top-actions,
  .status-chip,
  .user-pill {
    width: 100%;
  }

  .login-brand {
    min-height: 280px;
  }
}

@media (max-width: 560px) {
  .sidebar,
  .main,
  .login-page {
    padding: .65rem;
  }

  .sidebar-nav {
    grid-template-columns: 1fr;
  }

  .panel,
  .card,
  .hero-card,
  .employee-hero,
  .profile-hero,
  .login-card,
  .login-brand {
    padding: .82rem;
  }

  .actions,
  .auth-links,
  .promotion-decision-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .actions > *,
  .auth-links > *,
  .promotion-decision-actions > *,
  .actions form,
  .actions button,
  .actions a {
    width: 100%;
  }

  dialog,
  .modal-dialog,
  .employee-dialog,
  .promotion-dialog {
    width: calc(100vw - .8rem);
    max-height: calc(100vh - .8rem);
  }

  .modal-shell,
  .employee-dialog .modal-shell {
    max-height: calc(100vh - .8rem);
  }

  .employee-dialog {
    max-height: calc(100vh - .8rem);
  }
}

/* Compact density pass */
html {
  font-size: 14px;
}

h1 {
  font-size: clamp(1.55rem, 2.1vw, 2.35rem);
}

h2 {
  font-size: clamp(1.22rem, 1.65vw, 1.7rem);
}

h3 {
  font-size: .98rem;
}

p {
  margin: .22rem 0;
}

form {
  gap: .58rem;
}

.app-shell {
  grid-template-columns: 236px minmax(0, 1fr);
}

.sidebar {
  gap: .55rem;
  padding: .58rem;
}

.sidebar-brand,
.sidebar-meta-card,
.sidebar-user {
  gap: .52rem;
  padding: .56rem;
}

.brand-seal {
  width: 38px;
  height: 38px;
  font-size: .68rem;
}

.sidebar-brand strong {
  font-size: .9rem;
}

.sidebar-brand small,
.sidebar-meta-card small,
.sidebar-nav span {
  font-size: .58rem;
}

.sidebar-nav {
  gap: .18rem;
}

.sidebar-nav span {
  margin: .45rem 0 .08rem;
}

.sidebar-nav a {
  min-height: 34px;
  gap: .45rem;
  padding: .46rem .5rem;
  font-size: .82rem;
}

.sidebar-nav a i {
  width: 22px;
  height: 22px;
  font-size: .66rem;
}

.meta-badge,
.avatar {
  width: 32px;
  height: 32px;
}

.avatar.mini,
.user-pill .avatar.mini {
  width: 28px;
  height: 28px;
}

.sidebar-meta-card p,
.sidebar-user small,
.user-pill small {
  font-size: .76rem;
}

.logout {
  padding: .54rem .6rem;
}

.main {
  padding: .62rem .78rem 1rem;
}

.topbar {
  gap: .65rem;
  margin-bottom: .62rem;
}

.topbar-compact {
  margin: -.15rem -.1rem .62rem;
  padding: .58rem .1rem .48rem;
}

.top-actions {
  gap: .38rem;
}

.status-chip,
.user-pill,
.system-pill {
  min-height: 34px;
  gap: .34rem;
  padding: .42rem .55rem;
  font-size: .78rem;
}

.page-content {
  gap: .62rem;
}

.panel,
.card,
.hero-card,
.employee-hero,
.profile-hero,
.page-toolbar,
.login-card,
.login-brand {
  padding: .68rem;
}

.panel-head {
  gap: .65rem;
  margin-bottom: .52rem;
}

.grid-2,
.grid-3,
.stats,
.profile-stats,
.card-grid,
.module-card-grid,
.personnel-layout,
.role-layout-clean,
.role-layout,
.split {
  gap: .55rem;
}

.stats article,
.profile-stats article {
  min-height: 76px;
  gap: .18rem;
  padding: .6rem;
}

.stats span,
.profile-stats span {
  font-size: .72rem;
}

.stats strong,
.profile-stats strong {
  font-size: clamp(1.35rem, 2.4vw, 1.8rem);
}

.stats small,
.profile-stats small {
  font-size: .72rem;
}

.form-grid,
.helper-grid,
.personnel-note-grid,
.filter-bar,
.employee-filter {
  gap: .5rem;
}

label {
  gap: .22rem;
  font-size: .78rem;
}

input,
select,
textarea {
  min-height: 34px;
  padding: .45rem .55rem;
  font-size: .82rem;
}

textarea {
  min-height: 86px;
}

.btn,
.link-btn,
.delete-btn,
.warning-btn {
  min-height: 32px;
  padding: .42rem .58rem;
  font-size: .8rem;
}

.badge {
  padding: .22rem .45rem;
  font-size: .68rem;
}

.list {
  gap: .42rem;
}

.item,
.mini-card,
.role-card,
.request-card,
.backup-row,
.helper-tile,
.subpanel,
.permission-group-card-clean,
.role-panel-header,
.role-rename-row-clean,
.module-card {
  padding: .58rem;
}

th,
td {
  padding: .5rem .55rem;
}

th {
  font-size: .64rem;
}

.permission-grid {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: .42rem;
}

.permission-tile {
  gap: .42rem;
  padding: .5rem;
}

.personnel-layout {
  grid-template-columns: 280px minmax(0, 1fr);
}

.personnel-sidebar {
  top: 72px;
  max-height: calc(100vh - 86px);
}

.officer-list {
  gap: .38rem;
}

.officer-card {
  gap: .46rem;
  padding: .48rem;
}

.officer-avatar {
  width: 32px;
  height: 32px;
}

.profile-avatar {
  width: 52px;
  height: 52px;
  font-size: 1.15rem;
}

.profile-identity {
  gap: .6rem;
}

.employee-dialog {
  width: min(640px, calc(100vw - 1.2rem));
  max-height: 74vh;
}

.employee-dialog .modal-shell {
  max-height: 74vh;
}

.modal-header {
  padding: .62rem .75rem;
}

.modal-close {
  width: 30px;
  height: 30px;
  font-size: 1rem;
}

.wizard-form,
.promotion-reject-form,
.employee-dialog .wizard-form {
  gap: .5rem;
  padding: .6rem .75rem .75rem;
}

.wizard-progress {
  gap: .35rem;
  padding: .3rem;
}

.wizard-indicator {
  min-height: 36px;
  gap: .38rem;
  padding: .4rem .5rem;
  font-size: .78rem;
}

.wizard-index {
  width: 22px;
  height: 22px;
}

.step-card {
  padding: .6rem;
}

.accordion-preview {
  gap: .52rem;
  margin-top: .5rem;
  padding: .55rem;
}

.accordion-preview-icon {
  width: 32px;
  height: 32px;
}

.wizard-actions,
.employee-dialog .wizard-actions {
  gap: .5rem;
  margin-top: .55rem;
  padding: .55rem .75rem;
}

.role-clean-sidebar,
.role-sidebar {
  top: 72px;
  gap: .5rem;
}

.role-clean-button,
.role-switch {
  min-height: 44px;
  padding: .5rem .56rem;
}

.role-clean-button::after,
.role-switch::after {
  width: 24px;
  height: 24px;
}

.login-grid {
  width: min(900px, 100%);
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
}

.login-brand {
  min-height: 340px;
}

.login-logo {
  width: 50px;
  height: 50px;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar-nav {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }
}

@media (max-width: 840px) {
  html {
    font-size: 13.5px;
  }

  .main {
    padding: .55rem;
  }

  .employee-dialog {
    width: calc(100vw - .7rem);
    max-height: 88vh;
  }

  .employee-dialog .modal-shell {
    max-height: 88vh;
  }
}

/* Modern dark command theme */
:root {
  --bg: #020713;
  --bg-soft: #07111f;
  --surface: rgba(9, 24, 43, .86);
  --surface-alt: rgba(13, 35, 62, .72);
  --surface-strong: #08111f;
  --sidebar: #030a13;
  --sidebar-soft: rgba(13, 31, 55, .82);
  --text: #d8e7ff;
  --text-strong: #ffffff;
  --muted: #97afd0;
  --muted-strong: #c4d7f3;
  --line: rgba(99, 164, 255, .22);
  --line-soft: rgba(99, 164, 255, .12);
  --accent: #3b82f6;
  --accent-strong: #60a5fa;
  --accent-soft: rgba(59, 130, 246, .18);
  --green: #22c55e;
  --green-soft: rgba(34, 197, 94, .14);
  --yellow: #f59e0b;
  --yellow-soft: rgba(245, 158, 11, .14);
  --red: #f43f5e;
  --red-soft: rgba(244, 63, 94, .14);
  --blue: #60a5fa;
  --blue-soft: rgba(96, 165, 250, .16);
  --shadow: 0 24px 70px rgba(0, 0, 0, .42);
  --shadow-soft: 0 14px 36px rgba(0, 0, 0, .22);
  --radius: 12px;
  --radius-sm: 9px;
  --focus: 0 0 0 3px rgba(59, 130, 246, .28);
}

body {
  color: var(--text);
  background:
    linear-gradient(rgba(96, 165, 250, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 165, 250, .035) 1px, transparent 1px),
    radial-gradient(circle at 72% 0%, rgba(37, 99, 235, .24), transparent 34rem),
    radial-gradient(circle at 18% 18%, rgba(14, 165, 233, .12), transparent 28rem),
    linear-gradient(135deg, #020713, #061426 48%, #020713);
  background-size: 72px 72px, 72px 72px, auto, auto, auto;
}

h1,
h2,
h3,
h4 {
  color: var(--text-strong);
}

.muted {
  color: var(--muted);
}

.eyebrow {
  color: #7dd3fc;
}

.app-shell {
  grid-template-columns: 244px minmax(0, 1fr);
}

.sidebar {
  background:
    linear-gradient(180deg, rgba(3, 10, 19, .98), rgba(4, 13, 25, .96)),
    var(--sidebar);
  box-shadow: inset -1px 0 0 rgba(96, 165, 250, .12);
}

.sidebar-brand {
  background:
    linear-gradient(135deg, rgba(59, 130, 246, .22), rgba(14, 165, 233, .08)),
    rgba(13, 31, 55, .7);
  border-color: rgba(125, 211, 252, .22);
}

.brand-seal,
.login-logo,
.avatar,
.officer-avatar,
.profile-avatar {
  background: linear-gradient(135deg, #3b82f6, #2563eb 58%, #8b5cf6);
  box-shadow: 0 12px 34px rgba(59, 130, 246, .32);
}

.sidebar-nav a {
  color: #dbeafe;
  background: rgba(12, 26, 45, .68);
  border-color: rgba(96, 165, 250, .08);
}

.sidebar-nav a i {
  color: #93c5fd;
  background: rgba(59, 130, 246, .14);
  border-color: rgba(147, 197, 253, .18);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(59, 130, 246, .28), rgba(14, 165, 233, .10)),
    rgba(15, 43, 76, .86);
  border-color: rgba(96, 165, 250, .45);
  box-shadow: inset 3px 0 0 var(--accent), 0 10px 28px rgba(37, 99, 235, .16);
}

.sidebar-meta-card,
.sidebar-user {
  background: rgba(13, 31, 55, .72);
  border-color: rgba(96, 165, 250, .18);
}

.logout {
  background: rgba(244, 63, 94, .11);
  border-color: rgba(244, 63, 94, .32);
}

.topbar-compact {
  background: linear-gradient(180deg, rgba(2, 7, 19, .96), rgba(2, 7, 19, .78), rgba(2, 7, 19, 0));
}

.status-chip,
.user-pill,
.system-pill {
  color: #f8fbff;
  background: rgba(9, 24, 43, .82);
  border-color: rgba(96, 165, 250, .24);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.panel,
.card,
.page-toolbar,
.hero-card,
.employee-hero,
.profile-hero,
.login-card,
.login-brand,
.stats article,
.profile-stats article,
.wizard-shell {
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(13, 35, 62, .88), rgba(7, 18, 34, .88)),
    var(--surface);
  border-color: rgba(96, 165, 250, .24);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.hero-card,
.employee-hero,
.profile-hero {
  background:
    linear-gradient(135deg, rgba(12, 34, 64, .92), rgba(10, 24, 43, .9)),
    radial-gradient(circle at 90% 0%, rgba(59, 130, 246, .2), transparent 20rem);
}

.hero-card::after,
.employee-hero::after,
.profile-hero::after {
  content: "";
  width: 92px;
  height: 92px;
  align-self: stretch;
  opacity: .12;
  background:
    linear-gradient(135deg, transparent 42%, #60a5fa 43% 48%, transparent 49%),
    linear-gradient(45deg, transparent 42%, #60a5fa 43% 48%, transparent 49%);
  background-size: 26px 26px;
  pointer-events: none;
}

.stats article,
.profile-stats article {
  position: relative;
  overflow: hidden;
}

.stats article::after,
.profile-stats article::after {
  content: "";
  position: absolute;
  right: .75rem;
  bottom: .55rem;
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  opacity: .85;
}

.stats span,
.profile-stats span,
label,
th {
  color: #bcd4f5;
}

.stats strong,
.profile-stats strong {
  color: #ffffff;
  text-shadow: 0 8px 24px rgba(59, 130, 246, .18);
}

.table-wrap,
table,
.item,
.mini-card,
.role-card,
.request-card,
.backup-row,
.helper-tile,
.subpanel,
.create-role-card,
.create-role-card-clean,
.permission-group-card-clean,
.role-panel-header,
.role-rename-row-clean,
.step-card,
.accordion-preview,
.module-card {
  color: var(--text);
  background: rgba(5, 15, 29, .74);
  border-color: rgba(96, 165, 250, .2);
}

th {
  background: rgba(14, 39, 70, .94);
}

td {
  border-color: var(--line-soft);
}

tbody tr:hover td {
  background: rgba(59, 130, 246, .08);
}

input,
select,
textarea {
  color: #ffffff;
  background: rgba(2, 10, 20, .86);
  border-color: rgba(96, 165, 250, .28);
}

input::placeholder,
textarea::placeholder {
  color: #7f98bb;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #60a5fa;
  background: rgba(3, 12, 24, .95);
}

.btn,
.link-btn,
.delete-btn,
.warning-btn {
  color: #f8fbff;
  background: rgba(13, 35, 62, .88);
  border-color: rgba(96, 165, 250, .28);
}

.btn:hover,
.link-btn:hover,
.delete-btn:hover,
.warning-btn:hover {
  background: rgba(19, 50, 88, .94);
  border-color: rgba(125, 211, 252, .42);
}

.btn.primary {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  border-color: rgba(147, 197, 253, .35);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .26);
}

.btn.ghost,
.btn.secondary,
.link-btn {
  color: #dbeafe;
  background: rgba(59, 130, 246, .14);
  border-color: rgba(96, 165, 250, .32);
}

.delete-btn,
.btn.danger {
  color: #fecdd3;
  background: rgba(244, 63, 94, .14);
  border-color: rgba(244, 63, 94, .34);
}

.warning-btn {
  color: #fde68a;
  background: rgba(245, 158, 11, .14);
  border-color: rgba(245, 158, 11, .32);
}

.badge.green {
  color: #bbf7d0;
  background: rgba(34, 197, 94, .16);
  border-color: rgba(34, 197, 94, .34);
}

.badge.yellow {
  color: #fde68a;
  background: rgba(245, 158, 11, .16);
  border-color: rgba(245, 158, 11, .34);
}

.badge.red {
  color: #fecdd3;
  background: rgba(244, 63, 94, .16);
  border-color: rgba(244, 63, 94, .34);
}

.badge.blue {
  color: #bfdbfe;
  background: rgba(59, 130, 246, .16);
  border-color: rgba(96, 165, 250, .34);
}

.employee-dialog,
.promotion-dialog,
.module-dialog,
.modal-dialog,
dialog {
  border-color: rgba(96, 165, 250, .28);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .58);
}

dialog::backdrop,
.employee-dialog::backdrop,
.promotion-dialog::backdrop {
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(12px);
}

.modal-shell {
  background:
    linear-gradient(135deg, rgba(10, 27, 50, .98), rgba(3, 12, 24, .98)),
    var(--surface-strong);
}

.modal-header {
  background: rgba(7, 18, 34, .94);
  border-color: rgba(96, 165, 250, .18);
}

.modal-topline {
  background: linear-gradient(90deg, #3b82f6, #22d3ee, #8b5cf6, #f59e0b);
}

.modal-close {
  color: #dbeafe;
  background: rgba(59, 130, 246, .12);
  border-color: rgba(96, 165, 250, .28);
}

.wizard-progress {
  background: rgba(3, 12, 24, .68);
  border-color: rgba(96, 165, 250, .18);
}

.wizard-indicator {
  color: #a8bfdd;
}

.wizard-indicator.active {
  color: #ffffff;
  background: linear-gradient(135deg, rgba(59, 130, 246, .34), rgba(37, 99, 235, .18));
  border-color: rgba(96, 165, 250, .42);
}

.wizard-index {
  color: #dbeafe;
  background: rgba(96, 165, 250, .18);
}

.wizard-indicator.active .wizard-index {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.accordion-preview:hover,
.officer-card:hover,
.officer-card.active,
.role-clean-button:hover,
.role-clean-button.active,
.role-switch:hover,
.role-switch.active {
  background: rgba(59, 130, 246, .14);
  border-color: rgba(96, 165, 250, .45);
}

.officer-card {
  background: rgba(5, 15, 29, .62);
  border-color: rgba(96, 165, 250, .16);
}

.sticky-save-bar-clean,
.sticky-save-bar,
.employee-dialog .wizard-actions {
  background: rgba(7, 18, 34, .94);
  border-color: rgba(96, 165, 250, .2);
}

.login-brand {
  background:
    radial-gradient(circle at 80% 15%, rgba(59, 130, 246, .24), transparent 20rem),
    linear-gradient(135deg, rgba(4, 13, 25, .98), rgba(12, 34, 64, .96));
}

/* Modern modal polish */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(96, 165, 250, .42) rgba(3, 12, 24, .72);
}

*::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

*::-webkit-scrollbar-track {
  background: rgba(3, 12, 24, .72);
  border-radius: 999px;
}

*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(96, 165, 250, .62), rgba(37, 99, 235, .36));
  border: 2px solid rgba(3, 12, 24, .72);
  border-radius: 999px;
}

.employee-dialog {
  width: min(660px, calc(100vw - 1.4rem));
  border-color: rgba(125, 211, 252, .34);
}

.employee-dialog .modal-shell,
.module-dialog .modal-shell {
  background:
    radial-gradient(circle at 100% 0%, rgba(59, 130, 246, .18), transparent 24rem),
    linear-gradient(180deg, rgba(8, 24, 45, .99), rgba(3, 11, 22, .99));
}

.employee-dialog .modal-header {
  padding: .7rem .85rem .62rem;
  background:
    linear-gradient(135deg, rgba(11, 31, 57, .98), rgba(5, 15, 29, .96));
}

.employee-dialog .modal-header h2 {
  font-size: clamp(1.25rem, 1.7vw, 1.65rem);
}

.employee-dialog .modal-header .muted {
  font-size: .8rem;
}

.employee-dialog .wizard-form,
.module-dialog .module-form {
  padding: .65rem .78rem .78rem;
}

.employee-dialog .wizard-progress {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: .28rem;
  gap: .32rem;
  background:
    linear-gradient(135deg, rgba(5, 15, 29, .96), rgba(10, 31, 56, .9));
  border: 1px solid rgba(96, 165, 250, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}

.employee-dialog .wizard-indicator {
  min-height: 34px;
  color: #9cb4d4;
  background: transparent;
  border-color: transparent;
}

.employee-dialog .wizard-indicator.active {
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(59, 130, 246, .38), rgba(37, 99, 235, .20));
  border-color: rgba(125, 211, 252, .42);
  box-shadow: 0 10px 24px rgba(37, 99, 235, .18);
}

.employee-dialog .wizard-index {
  width: 21px;
  height: 21px;
  color: #dbeafe;
  background: rgba(96, 165, 250, .16);
}

.employee-dialog .wizard-indicator.active .wizard-index {
  background: linear-gradient(135deg, #60a5fa, #2563eb);
}

.employee-dialog .step-card,
.module-dialog .step-card,
.employee-dialog .accordion-preview,
.employee-dialog .subpanel,
.employee-dialog .helper-tile {
  background:
    linear-gradient(135deg, rgba(7, 20, 38, .92), rgba(3, 12, 24, .9));
  border-color: rgba(96, 165, 250, .22);
}

.employee-dialog .step-card h3,
.employee-dialog .accordion-preview strong {
  color: #ffffff;
}

.employee-dialog input,
.module-dialog input,
.employee-dialog select,
.module-dialog select,
.employee-dialog textarea,
.module-dialog textarea {
  background: rgba(1, 8, 16, .86);
  border-color: rgba(96, 165, 250, .28);
}

.employee-dialog .accordion-preview {
  grid-template-columns: 38px minmax(0, 1fr) auto;
}

.employee-dialog .accordion-preview-icon {
  width: 34px;
  height: 34px;
  color: #7dd3fc;
  background: rgba(59, 130, 246, .18);
}

.employee-dialog .accordion-preview-meta {
  font-size: .72rem;
}

.employee-dialog .wizard-actions {
  bottom: -.78rem;
  margin: .58rem -.78rem -.78rem;
  padding: .58rem .78rem;
  background:
    linear-gradient(180deg, rgba(4, 13, 25, .72), rgba(4, 13, 25, .98));
}

.employee-dialog .btn,
.module-dialog .btn,
.employee-dialog .link-btn,
.module-dialog .link-btn,
.employee-dialog .delete-btn,
.module-dialog .delete-btn,
.employee-dialog .warning-btn {
  min-height: 31px;
  padding: .4rem .58rem;
}

.module-dialog {
  width: min(620px, calc(100vw - 1.4rem));
}

.module-dialog textarea {
  min-height: 96px;
}

.module-dialog .step-card {
  display: grid;
  gap: .65rem;
}

/* Modern personnel dossier */
.dossier-form {
  display: grid;
  gap: .72rem;
}

.dossier-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: .72rem;
  align-items: stretch;
}

.dossier-menu {
  display: grid;
  gap: .45rem;
  align-content: start;
  padding: .55rem;
  border: 1px solid rgba(96, 165, 250, .2);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(5, 15, 29, .78), rgba(3, 12, 24, .76));
}

.dossier-tab {
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: .12rem .55rem;
  align-items: center;
  padding: .55rem;
  color: var(--text);
  text-align: left;
  border: 1px solid rgba(96, 165, 250, .14);
  border-radius: var(--radius-sm);
  background: rgba(8, 24, 45, .58);
}

.dossier-tab span {
  grid-row: 1 / span 2;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: #bfdbfe;
  background: rgba(59, 130, 246, .16);
  font-size: .66rem;
  font-weight: 950;
}

.dossier-tab strong {
  color: #f8fbff;
  line-height: 1.15;
}

.dossier-tab small {
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.25;
}

.dossier-tab:hover,
.dossier-tab.active {
  background:
    linear-gradient(135deg, rgba(59, 130, 246, .24), rgba(14, 165, 233, .09));
  border-color: rgba(125, 211, 252, .42);
}

.dossier-tab.active {
  box-shadow: inset 3px 0 0 #60a5fa, 0 12px 28px rgba(37, 99, 235, .18);
}

.dossier-tab.active span {
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.dossier-editor {
  min-width: 0;
  display: grid;
}

.dossier-panel {
  display: none;
  min-height: 276px;
  padding: .72rem;
  border: 1px solid rgba(96, 165, 250, .22);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 100% 0%, rgba(59, 130, 246, .16), transparent 18rem),
    linear-gradient(135deg, rgba(7, 20, 38, .94), rgba(3, 12, 24, .92));
}

.dossier-panel.is-active {
  display: grid;
  gap: .65rem;
}

.dossier-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .75rem;
}

.dossier-panel-head > div {
  display: flex;
  align-items: flex-start;
  gap: .62rem;
}

.dossier-panel-head h4 {
  margin: .05rem 0 .2rem;
  color: #ffffff;
}

.dossier-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius-sm);
  color: #ffffff;
  background: linear-gradient(135deg, rgba(59, 130, 246, .95), rgba(139, 92, 246, .85));
  box-shadow: 0 12px 26px rgba(37, 99, 235, .22);
  font-size: .72rem;
  font-weight: 950;
}

.dossier-panel textarea {
  min-height: 188px;
  resize: vertical;
  background:
    linear-gradient(180deg, rgba(1, 8, 16, .92), rgba(2, 10, 20, .88));
  border-color: rgba(96, 165, 250, .28);
}

.promotion-timeline {
  position: relative;
  display: grid;
  gap: .55rem;
  padding-left: .4rem;
}

.promotion-timeline::before {
  content: "";
  position: absolute;
  top: .45rem;
  bottom: .45rem;
  left: .85rem;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(96, 165, 250, .65), rgba(139, 92, 246, .18));
}

.timeline-entry {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: .55rem;
  padding: .58rem .65rem .58rem 0;
}

.timeline-dot {
  position: relative;
  z-index: 1;
  width: 17px;
  height: 17px;
  margin: .18rem auto 0;
  border: 3px solid rgba(5, 15, 29, .98);
  border-radius: 999px;
  background: #60a5fa;
  box-shadow: 0 0 0 4px rgba(96, 165, 250, .14), 0 0 20px rgba(96, 165, 250, .38);
}

.timeline-entry.green .timeline-dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .13), 0 0 20px rgba(34, 197, 94, .34);
}

.timeline-entry.yellow .timeline-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, .13), 0 0 20px rgba(245, 158, 11, .34);
}

.timeline-entry.red .timeline-dot {
  background: #f43f5e;
  box-shadow: 0 0 0 4px rgba(244, 63, 94, .13), 0 0 20px rgba(244, 63, 94, .34);
}

.timeline-entry > div:last-child,
.timeline-empty {
  padding: .58rem .65rem;
  border: 1px solid rgba(96, 165, 250, .18);
  border-radius: var(--radius-sm);
  background: rgba(5, 15, 29, .62);
}

.timeline-entry-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .6rem;
}

.timeline-entry p {
  color: var(--muted);
  margin: .25rem 0;
}

.timeline-entry small {
  color: #9fb7d7;
}

.timeline-empty {
  margin-left: 2rem;
}

.entry-compose {
  display: grid;
  gap: .58rem;
  padding: .72rem;
  margin-bottom: .78rem;
  border: 1px solid rgba(96, 165, 250, .18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(15, 23, 42, .84), rgba(5, 15, 29, .72));
}

.entry-compose.green {
  border-color: rgba(34, 197, 94, .2);
}

.entry-compose.red {
  border-color: rgba(244, 63, 94, .22);
}

.entry-compose-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: .75rem;
}

.entry-compose-head > div {
  display: grid;
  gap: .15rem;
}

.entry-compose-head strong {
  font-size: .96rem;
}

.entry-compose-head label {
  min-width: 170px;
}

.entry-compose textarea {
  min-height: 78px;
  max-height: 160px;
  resize: vertical;
}

.entry-compose span,
.entry-compose-head span {
  color: #9fb7d7;
  font-size: .84rem;
}

.dossier-entry-list {
  position: relative;
  display: grid;
  gap: .55rem;
}

.dossier-entry-list::before {
  content: "";
  position: absolute;
  top: .45rem;
  bottom: .45rem;
  left: .85rem;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(96, 165, 250, .55), rgba(139, 92, 246, .14));
}

.dossier-entry {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: .55rem;
  padding: .28rem .2rem .28rem 0;
}

.dossier-entry-card {
  padding: .68rem .72rem;
  border: 1px solid rgba(96, 165, 250, .18);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, rgba(10, 28, 52, .72), rgba(4, 13, 25, .78));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.dossier-entry.green .dossier-entry-card {
  border-color: rgba(34, 197, 94, .2);
}

.dossier-entry.red .dossier-entry-card {
  border-color: rgba(244, 63, 94, .22);
}

.dossier-entry.green .timeline-dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, .13), 0 0 20px rgba(34, 197, 94, .34);
}

.dossier-entry.red .timeline-dot {
  background: #f43f5e;
  box-shadow: 0 0 0 4px rgba(244, 63, 94, .13), 0 0 20px rgba(244, 63, 94, .34);
}

.dossier-entry.legacy .dossier-entry-card {
  border-style: dashed;
}

.dossier-entry .timeline-entry-head {
  align-items: flex-start;
}

.dossier-entry p {
  color: var(--muted);
  margin: .25rem 0;
  line-height: 1.45;
}

.dossier-entry small {
  color: #9fb7d7;
}

.entry-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem;
  flex-shrink: 0;
}

.delete-btn.compact {
  min-height: 26px;
  padding: .26rem .48rem;
  border-radius: 7px;
  font-size: .78rem;
}

.confirm-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 50% 45%, rgba(59, 130, 246, .16), transparent 28rem),
    rgba(1, 8, 16, .72);
  opacity: 0;
  backdrop-filter: blur(10px);
  transition: opacity .16s ease;
}

.confirm-modal-backdrop.is-visible {
  opacity: 1;
}

.confirm-modal {
  width: min(430px, 100%);
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: .85rem;
  padding: .95rem;
  border: 1px solid rgba(244, 63, 94, .28);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(10, 28, 52, .98), rgba(4, 13, 25, .98));
  box-shadow: 0 24px 80px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .04);
  transform: translateY(8px) scale(.98);
  transition: transform .16s ease;
}

.confirm-modal-backdrop.is-visible .confirm-modal {
  transform: translateY(0) scale(1);
}

.confirm-modal-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #fecdd3;
  border: 1px solid rgba(244, 63, 94, .35);
  border-radius: 12px;
  background: rgba(244, 63, 94, .13);
  font-weight: 950;
  box-shadow: 0 0 24px rgba(244, 63, 94, .16);
}

.confirm-modal-body {
  display: grid;
  gap: .42rem;
}

.confirm-modal-body .eyebrow {
  color: #fda4af;
  margin: 0;
}

.confirm-modal-body h3 {
  margin: 0;
  font-size: 1.12rem;
}

.confirm-modal-body .muted {
  margin: 0;
  line-height: 1.45;
}

.confirm-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: .45rem;
}

/* Access account workspace */
.access-command-panel {
  display: grid;
  gap: .72rem;
}

.access-command-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.access-command-bar h3 {
  margin: .1rem 0;
  font-size: 1.22rem;
}

.access-command-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .58rem;
  min-width: min(560px, 48vw);
}

.access-command-actions input {
  min-width: 240px;
}

.request-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .85rem;
  padding: .62rem .72rem;
  border: 1px solid rgba(96, 165, 250, .18);
  border-radius: var(--radius);
  background: rgba(5, 15, 29, .54);
}

.request-strip > div {
  display: flex;
  align-items: baseline;
  gap: .45rem;
  flex-wrap: wrap;
}

.request-compact-list {
  display: grid;
  gap: .52rem;
}

.request-compact-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .9fr);
  gap: .7rem;
  align-items: center;
  padding: .7rem;
  border: 1px solid rgba(245, 158, 11, .22);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(245, 158, 11, .08), rgba(5, 15, 29, .68));
}

.request-compact-card strong,
.request-compact-card small {
  display: block;
}

.request-compact-card small,
.request-compact-card p {
  color: var(--muted);
}

.request-compact-card p {
  margin: .22rem 0 0;
}

.request-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: .45rem;
  align-items: center;
}

.account-list-modern {
  display: grid;
  gap: .45rem;
}

.account-row-modern {
  border: 1px solid rgba(96, 165, 250, .16);
  border-radius: var(--radius);
  background: rgba(5, 15, 29, .58);
  overflow: hidden;
}

.account-row-modern[open] {
  border-color: rgba(96, 165, 250, .34);
  background:
    linear-gradient(135deg, rgba(10, 28, 52, .72), rgba(5, 15, 29, .78));
}

.account-summary-modern {
  display: grid;
  grid-template-columns: 20px 38px minmax(150px, 1.2fr) 88px minmax(130px, .8fr) minmax(180px, 1fr);
  gap: .62rem;
  align-items: center;
  padding: .62rem .72rem;
  cursor: pointer;
  list-style: none;
}

.account-summary-modern::-webkit-details-marker {
  display: none;
}

.account-caret {
  color: #93c5fd;
  font-size: 1.15rem;
  transform: rotate(0deg);
  transition: transform .16s ease;
}

.account-row-modern[open] .account-caret {
  transform: rotate(90deg);
}

.account-avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 10px;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  font-weight: 950;
}

.account-main {
  min-width: 0;
}

.account-main strong,
.account-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-main small,
.account-meta {
  font-size: .83rem;
}

.account-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-edit-panel {
  display: grid;
  gap: .66rem;
  padding: .72rem;
  border-top: 1px solid rgba(96, 165, 250, .15);
  background: rgba(1, 8, 16, .26);
}

.account-edit-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  margin-top: .62rem;
}

.account-delete-form {
  display: flex;
  justify-content: flex-end;
}

.access-user-dialog {
  width: min(720px, calc(100vw - 1.2rem));
}

.access-create-form {
  display: grid;
  gap: .72rem;
}

.access-create-form .wizard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .72rem;
  padding-top: .72rem;
  border-top: 1px solid rgba(96, 165, 250, .16);
}

.dossier-save-bar {
  position: sticky;
  bottom: .6rem;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .58rem .72rem;
  border: 1px solid rgba(96, 165, 250, .24);
  border-radius: var(--radius);
  background: rgba(4, 13, 25, .94);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

@media (max-width: 980px) {
  .access-command-bar,
  .request-compact-card {
    grid-template-columns: 1fr;
  }

  .access-command-bar {
    display: grid;
  }

  .access-command-actions {
    justify-content: stretch;
    min-width: 0;
  }

  .access-command-actions input {
    min-width: 0;
    width: 100%;
  }

  .request-actions {
    grid-template-columns: 1fr;
  }

  .account-summary-modern {
    grid-template-columns: 20px 36px minmax(0, 1fr) auto;
  }

  .account-role,
  .account-officer {
    display: none;
  }

  .dossier-layout {
    grid-template-columns: 1fr;
  }

  .dossier-menu {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (max-width: 620px) {
  .entry-compose-head,
  .timeline-entry-head,
  .entry-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .confirm-modal {
    grid-template-columns: 1fr;
  }

  .confirm-modal-actions {
    flex-direction: column-reverse;
  }

  .access-command-actions,
  .request-strip,
  .access-create-form .wizard-actions,
  .account-edit-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .request-strip {
    display: grid;
  }

  .dossier-save-bar,
  .dossier-panel-head {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Promotion request picker */
.promotion-create-form {
  display: grid;
  gap: .72rem;
}

.promotion-create-layout {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(0, 1.1fr);
  gap: .72rem;
  align-items: start;
}

.promotion-officer-picker,
.promotion-request-fields {
  display: grid;
  gap: .58rem;
  padding: .68rem;
  border: 1px solid rgba(96, 165, 250, .22);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(7, 20, 38, .92), rgba(3, 12, 24, .88));
}

.promotion-field-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .72rem;
}

.promotion-field-head h4 {
  margin: .05rem 0 .18rem;
  color: #ffffff;
}

.promotion-officer-list {
  display: grid;
  gap: .42rem;
  max-height: 300px;
  overflow: auto;
  padding-right: .12rem;
}

.promotion-officer-option {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: .58rem;
  padding: .52rem;
  color: var(--text);
  text-align: left;
  border: 1px solid rgba(96, 165, 250, .16);
  border-radius: var(--radius-sm);
  background: rgba(5, 15, 29, .64);
}

.promotion-officer-option:hover,
.promotion-officer-option.active {
  background:
    linear-gradient(135deg, rgba(59, 130, 246, .24), rgba(14, 165, 233, .08));
  border-color: rgba(125, 211, 252, .45);
}

.promotion-officer-option.active {
  box-shadow: inset 3px 0 0 #60a5fa, 0 12px 28px rgba(37, 99, 235, .18);
}

.promotion-officer-option.is-locked {
  opacity: .58;
}

.promotion-officer-badge {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  font-weight: 950;
}

.promotion-officer-option strong,
.promotion-officer-option small {
  display: block;
}

.promotion-officer-option small {
  color: var(--muted);
  margin-top: .08rem;
}

.promotion-request-fields textarea {
  min-height: 126px;
}

@media (max-width: 980px) {
  .promotion-create-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .promotion-field-head,
  .promotion-officer-option {
    grid-template-columns: 1fr;
  }

  .promotion-field-head {
    display: grid;
  }
}

/* Ticket desk */
.ticket-stats {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.ticket-filter-bar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(170px, .28fr) minmax(170px, .28fr) auto;
  gap: .65rem;
  align-items: end;
}

.ticket-admin-layout {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: .95rem;
  align-items: start;
}

.ticket-list-panel,
.ticket-detail-panel {
  min-width: 0;
}

.ticket-admin-list {
  display: grid;
  gap: .48rem;
  max-height: calc(100vh - 280px);
  overflow: auto;
  padding-right: .12rem;
}

.ticket-admin-item {
  display: grid;
  gap: .26rem;
  padding: .72rem;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.ticket-admin-item:hover,
.ticket-admin-item.active {
  color: var(--accent-strong);
  border-color: #c7d7fe;
  background: var(--accent-soft);
}

.ticket-admin-item-top,
.ticket-detail-head,
.ticket-detail-badges,
.ticket-reply-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .62rem;
}

.ticket-admin-item span:not(.badge),
.ticket-admin-item small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ticket-admin-item small {
  color: var(--muted);
}

.empty-ticket-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
}

.ticket-detail-head {
  margin-bottom: .75rem;
}

.ticket-detail-badges {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.ticket-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .62rem;
  margin-bottom: .75rem;
}

.ticket-meta-grid div {
  padding: .72rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.ticket-meta-grid span,
.ticket-meta-grid strong {
  display: block;
}

.ticket-meta-grid span {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 850;
}

.ticket-meta-grid strong {
  margin-top: .16rem;
  color: var(--text-strong);
  font-size: .9rem;
}

.ticket-action-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: .65rem;
  align-items: end;
  margin-bottom: .85rem;
  padding: .72rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.ticket-status-form {
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  align-items: end;
}

.ticket-chat-admin {
  display: grid;
  gap: .62rem;
  max-height: 560px;
  overflow: auto;
  padding: .25rem .2rem .25rem 0;
}

.ticket-message-admin {
  width: min(820px, 92%);
  padding: .72rem .78rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.ticket-message-admin.staff {
  justify-self: end;
  border-color: #bce8cb;
  background: var(--green-soft);
}

.ticket-message-admin.public {
  justify-self: start;
}

.ticket-message-meta {
  display: flex;
  justify-content: space-between;
  gap: .72rem;
  color: var(--muted);
  font-size: .82rem;
}

.ticket-message-admin p {
  margin: .35rem 0 0;
  line-height: 1.5;
}

.ticket-reply-admin {
  margin-top: .85rem;
  padding-top: .85rem;
  border-top: 1px solid var(--line);
}

.ticket-reply-actions {
  align-items: end;
}

.ticket-reply-actions label {
  min-width: 220px;
}

@media (max-width: 980px) {
  .ticket-filter-bar,
  .ticket-admin-layout,
  .ticket-action-grid,
  .ticket-status-form,
  .ticket-meta-grid {
    grid-template-columns: 1fr;
  }

  .ticket-admin-list {
    max-height: none;
  }
}

@media (max-width: 620px) {
  .ticket-detail-head,
  .ticket-detail-badges,
  .ticket-reply-actions,
  .ticket-message-meta {
    display: grid;
    justify-content: stretch;
  }

  .ticket-message-admin {
    width: 100%;
  }
}
