:root {
  --ink: #13252b;
  --ink-soft: #3a5058;
  --muted: #6b7f86;
  --line: #d5dde0;
  --paper: #f3f6f4;
  --panel: #ffffff;
  --side: #0f2a32;
  --side-2: #163943;
  --accent: #1f7a5c;
  --accent-2: #c46a2b;
  --danger: #b42318;
  --ok: #1b6b45;
  --shadow: 0 18px 50px rgba(15, 42, 50, 0.18);
  --radius: 12px;
  --font: "Figtree", "Segoe UI", sans-serif;
  --display: "Libre Baskerville", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(31, 122, 92, 0.12), transparent 60%),
    radial-gradient(900px 500px at 100% 0%, rgba(196, 106, 43, 0.10), transparent 55%),
    var(--paper);
}

.app-body { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--side) 0%, #0b1f25 100%);
  color: #e8f0f2;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand { display: flex; gap: 12px; align-items: center; padding: 6px 8px 18px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #2a9b74, #1f7a5c);
  font-weight: 700; letter-spacing: 0.02em;
}
.brand-name { font-family: var(--display); font-size: 1.05rem; line-height: 1.2; }
.brand-sub { font-size: 0.75rem; color: #9db4bb; margin-top: 2px; }

.side-nav { display: flex; flex-direction: column; gap: 4px; overflow: auto; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  color: #d5e4e8; text-decoration: none;
  padding: 10px 12px; border-radius: 8px;
  border: 0; background: transparent; width: 100%;
  font: inherit; cursor: pointer; text-align: left;
}
.nav-item:hover, .nav-item.is-active { background: rgba(255,255,255,0.08); color: #fff; }
.nav-section {
  margin: 14px 8px 6px;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8aa3aa;
}

.sidebar-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.08); }
.active-co { background: rgba(255,255,255,0.06); border-radius: 10px; padding: 10px 12px; margin-bottom: 10px; }
.active-co .label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.06em; color: #9db4bb; }
.active-co .name { font-weight: 600; margin-top: 4px; }
.active-co .reg { font-size: 0.8rem; color: #b7c9cf; }
.active-co.muted { color: #9db4bb; font-size: 0.85rem; }
.user-row { display: flex; justify-content: space-between; gap: 8px; font-size: 0.85rem; color: #b7c9cf; }
.user-row a { color: #8fd0b5; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 28px 8px; gap: 16px;
}
.topbar h1 { margin: 0; font-size: 1.55rem; font-weight: 700; letter-spacing: -0.02em; }
.content { padding: 12px 28px 36px; }
.flash { margin: 0 28px 12px; padding: 12px 14px; border-radius: 10px; }
.flash-ok { background: #e7f6ee; color: var(--ok); }
.flash-err { background: #fdecec; color: var(--danger); }

.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat, .panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 1px 0 rgba(255,255,255,0.7) inset;
}
.stat { padding: 18px 20px; }
.stat-label { color: var(--muted); font-size: 0.85rem; }
.stat-value { font-size: 2rem; font-weight: 700; margin-top: 6px; letter-spacing: -0.03em; }
.panel { padding: 20px 22px; }
.panel h2 { margin: 0 0 8px; font-size: 1.15rem; }
.panel-head-row { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 12px; }
.lede { color: var(--ink-soft); line-height: 1.5; }
.steps { margin: 0; padding-left: 1.2rem; color: var(--ink-soft); line-height: 1.7; }
.cert-current {
  background: #e7f3ee;
  border: 1px solid #c5ddd2;
  border-radius: 10px;
  padding: 12px 14px;
  margin-top: 8px;
}
.cert-current .tiny { margin-top: 4px; }
.tiny { font-size: 0.75rem; color: var(--muted); }

.btn {
  appearance: none; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 8px; padding: 9px 14px; font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { background: #f7faf8; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #19684e; }
.btn-danger { background: #fff5f4; border-color: #f0c2bd; color: var(--danger); }
.btn-sm { padding: 6px 10px; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn-stack-h { display: flex; gap: 8px; flex-wrap: wrap; }
.icon-btn {
  border: 0; background: transparent; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted);
}

.input, input[type="file"], select.input, textarea.input {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  font: inherit; background: #fff; color: var(--ink);
}
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field span { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-bottom: 14px; }
.check { display: flex; align-items: center; gap: 8px; grid-column: 1 / -1; }
.inline { display: inline; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.inline-form { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.inline-field { margin: 0; min-width: 140px; }

.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.data-table th, .data-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.data-table th { background: #f0f4f2; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.data-table tbody tr { cursor: pointer; }
.data-table tbody tr:hover { background: #f7faf8; }
.data-table tbody tr.is-selected { background: #e7f3ee; }

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10, 24, 28, 0.55);
  display: grid; place-items: center; padding: 20px; z-index: 50;
  backdrop-filter: blur(2px);
}
.modal-backdrop[hidden] { display: none !important; }
.modal {
  width: min(560px, 100%); background: var(--panel); border-radius: 14px;
  box-shadow: var(--shadow); overflow: hidden; animation: rise .18s ease-out;
}
.modal-lg { width: min(980px, 100%); }
@keyframes rise { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px 8px; }
.modal-head h2 { margin: 0; font-size: 1.25rem; }
.modal-sub { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.modal-toolbar { display: flex; justify-content: space-between; gap: 12px; padding: 8px 20px 12px; flex-wrap: wrap; }
.modal-toolbar .input { max-width: 320px; }
.modal-body-split { display: grid; grid-template-columns: 1fr 150px; gap: 14px; padding: 0 20px 16px; }
.modal-actions-col { display: flex; flex-direction: column; gap: 8px; }
.modal-foot { padding: 12px 20px; background: #f4f7f5; color: var(--ink-soft); font-size: 0.88rem; border-top: 1px solid var(--line); }
.modal-form { padding: 8px 20px 20px; }
.modal-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.hint { font-size: 0.85rem; color: var(--muted); margin: 0 0 12px; }
.import-result { background: #f4f7f5; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; white-space: pre-wrap; font-size: 0.9rem; }
.code-out {
  margin-top: 14px; background: #0f2a32; color: #d7ece4; border-radius: 10px;
  padding: 14px; overflow: auto; max-height: 420px; font-size: 0.82rem;
}

/* —— Corporate listing (RPN / dense data pages) —— */
body.is-listing-page .topbar {
  padding: 14px 22px 4px;
}
body.is-listing-page .topbar h1 {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
body.is-listing-page .content {
  padding: 8px 18px 18px;
}

.listing-shell {
  --listing-line: #e2e8ea;
  --listing-head: #f4f7f6;
  --listing-row: #ffffff;
  --listing-row-alt: #f8faf9;
  --listing-sticky: #fbfcfc;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 88px);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(255,255,255,0.98)),
    var(--panel);
  border: 1px solid var(--listing-line);
  border-radius: 16px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.8) inset,
    0 12px 40px rgba(15, 42, 50, 0.06);
  overflow: hidden;
}

.listing-bar {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px 20px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--listing-line);
  background:
    linear-gradient(110deg, rgba(31,122,92,0.06), transparent 42%),
    #fff;
  flex-shrink: 0;
}
.listing-kicker {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.listing-title {
  margin: 2px 0 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.listing-bar-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}
.listing-count {
  font-size: 0.82rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.listing-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: 1px solid var(--listing-line);
  background: #f3f6f4;
  color: var(--ink-soft);
}
.listing-pill::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.listing-pill[data-tone="busy"] { color: #9a6700; background: #fff7e6; border-color: #f0d9a0; }
.listing-pill[data-tone="ok"] { color: var(--ok); background: #e8f6ee; border-color: #b9deca; }
.listing-pill[data-tone="danger"] { color: var(--danger); background: #fdecec; border-color: #f0c2bd; }
.listing-bar-actions { display: flex; gap: 8px; }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink-soft);
}
.btn-ghost:hover { background: #f0f4f2; border-color: var(--listing-line); }

.listing-progress {
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-soft);
}
.listing-progress p { margin: 14px 0 0; font-weight: 600; }
.listing-progress-track {
  height: 3px;
  max-width: 280px;
  margin: 0 auto;
  border-radius: 999px;
  background: #e7eeeb;
  overflow: hidden;
}
.listing-progress-track span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #2a9b74);
  animation: listingSweep 1.05s ease-in-out infinite;
}
@keyframes listingSweep {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(280%); }
}

.listing-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.listing-facts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--listing-line);
  background: #fcfdfd;
  flex-shrink: 0;
}
.listing-fact {
  padding: 10px 14px;
  border-right: 1px solid var(--listing-line);
  min-width: 0;
}
.listing-fact:last-child { border-right: 0; }
.listing-fact span {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 3px;
}
.listing-fact strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 650;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.listing-fact .is-emphasis,
.listing-fact strong.is-emphasis { color: #9f2d1f; }

.listing-grid-wrap {
  flex: 1;
  min-height: 320px;
  height: calc(100vh - 250px);
  overflow: auto;
  background:
    linear-gradient(90deg, rgba(15,42,50,0.04), transparent 12px),
    #fff;
}

.listing-grid {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.78rem;
}
.listing-grid thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--listing-head);
  color: #5a7077;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--listing-line);
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(15,42,50,0.04);
}
.listing-grid tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--listing-line);
  white-space: nowrap;
  vertical-align: middle;
  background: var(--listing-row);
  color: var(--ink);
}
.listing-grid tbody tr:nth-child(even) td { background: var(--listing-row-alt); }
.listing-grid tbody tr:hover td { background: #eef6f2; }
.listing-grid .is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  font-family: "IBM Plex Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: -0.01em;
}
.listing-grid .is-mono {
  font-family: "IBM Plex Mono", "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
  font-size: 0.74rem;
  letter-spacing: -0.01em;
}
.listing-grid .is-credit { font-weight: 650; color: #145c45; }
.listing-grid .is-name { font-weight: 650; letter-spacing: -0.01em; }
.listing-grid .is-sticky,
.listing-grid thead th.is-sticky {
  position: sticky;
  left: 0;
  z-index: 2;
  box-shadow: 4px 0 10px rgba(15,42,50,0.04);
}
.listing-grid thead th.is-sticky { z-index: 4; background: #eef2f1; }
.listing-grid tbody td.is-sticky { background: var(--listing-sticky); }
.listing-grid tbody tr:nth-child(even) td.is-sticky { background: #f3f6f5; }
.listing-grid tbody tr:hover td.is-sticky { background: #e7f2ed; }
.listing-grid .is-sticky-2 { left: 118px; }
.listing-grid thead th.is-sticky-2,
.listing-grid tbody td.is-sticky-2 {
  left: 118px;
  min-width: 140px;
}
.listing-grid thead th.is-sticky,
.listing-grid tbody td.is-sticky {
  min-width: 118px;
}

.listing-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.listing-chip[data-tone="neutral"] { background: #eef2f1; color: #4d636a; }
.listing-chip[data-tone="ok"] { background: #e5f5ec; color: #176844; }
.listing-chip[data-tone="warn"] { background: #fff4df; color: #8a5a00; }
.listing-chip[data-tone="info"] { background: #e8f1f7; color: #1f5678; }

.listing-toast {
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid var(--listing-line);
  font-size: 0.88rem;
  flex-shrink: 0;
}
.listing-toast.is-ok { background: #e8f6ee; color: var(--ok); }
.listing-toast.is-err { background: #fdecec; color: var(--danger); }

.confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(800px 400px at 50% 20%, rgba(31,122,92,0.18), transparent 55%),
    rgba(10, 24, 28, 0.58);
  backdrop-filter: blur(8px);
  animation: confirmFade .18s ease-out;
}
.confirm-overlay[hidden] { display: none !important; }
@keyframes confirmFade {
  from { opacity: 0; }
  to { opacity: 1; }
}
.confirm-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 20px;
  padding: 28px 26px 22px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.85) inset,
    0 28px 80px rgba(8, 24, 28, 0.35);
  text-align: center;
  animation: confirmRise .22s cubic-bezier(.2,.8,.2,1);
}
@keyframes confirmRise {
  from { transform: translateY(14px) scale(.98); opacity: 0; }
  to { transform: none; opacity: 1; }
}
.confirm-mark {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  font-weight: 700;
}
.confirm-mark.is-ok {
  background: linear-gradient(145deg, #1f7a5c, #2a9b74);
  color: #fff;
  box-shadow: 0 10px 24px rgba(31,122,92,0.35);
}
.confirm-mark.is-busy {
  background: linear-gradient(145deg, #163943, #1f7a5c);
  position: relative;
  overflow: hidden;
}
.confirm-mark.is-busy::after {
  content: "";
  width: 22px;
  height: 22px;
  border: 2.5px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: confirmSpin .7s linear infinite;
}
@keyframes confirmSpin { to { transform: rotate(360deg); } }
.confirm-card h3 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  letter-spacing: -0.02em;
}
.confirm-card > p {
  margin: 0;
  color: var(--ink-soft);
  line-height: 1.45;
}
.confirm-sub {
  margin-top: 12px !important;
  font-size: 0.85rem;
  color: var(--muted) !important;
}
.confirm-progress {
  margin-top: 18px;
  height: 6px;
  border-radius: 999px;
  background: #e7eeeb;
  overflow: hidden;
}
.confirm-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f7a5c, #2a9b74, #3cb88a);
  transition: width .45s ease;
}
.confirm-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 18px 0 8px;
  text-align: left;
}
.confirm-stats > div {
  background: #f4f8f6;
  border: 1px solid #e2ebe7;
  border-radius: 12px;
  padding: 10px 12px;
}
.confirm-stats span {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 4px;
}
.confirm-stats strong {
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.confirm-actions {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}
.btn-lg {
  min-width: 132px;
  padding: 11px 22px;
  border-radius: 10px;
}

.emp-grid-wrap {
  height: calc(100vh - 230px);
  min-height: 280px;
}
.emp-grid {
  width: 100%;
  min-width: 0;
}
.emp-grid th.is-actions,
.emp-grid td.is-actions {
  text-align: right;
  white-space: nowrap;
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--listing-head);
  box-shadow: -4px 0 10px rgba(15,42,50,0.04);
}
.emp-grid tbody td.is-actions {
  background: var(--listing-row);
}
.emp-grid tbody tr:nth-child(even) td.is-actions { background: var(--listing-row-alt); }
.emp-grid tbody tr:hover td.is-actions { background: #eef6f2; }
.emp-actions {
  justify-content: flex-end;
  flex-wrap: nowrap;
}
.emp-actions .btn-sm {
  padding: 5px 10px;
  font-size: 0.78rem;
}

/* Employee Saurus-style tabbed form */
.emp-form-shell {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(15,42,50,0.06);
}
.emp-form-bar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(110deg, rgba(31,122,92,0.06), transparent 45%), #fff;
}
.emp-form-bar-actions { display: flex; gap: 8px; }
.emp-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: #f4f7f6;
  padding: 0 8px;
}
.emp-tab {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 12px 14px;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.emp-tab:hover { color: var(--ink); }
.emp-tab.is-active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: #fff;
}
.emp-form-layout {
  display: grid;
  grid-template-columns: 1fr 160px;
  min-height: calc(100vh - 220px);
}
.emp-form-main { padding: 16px 18px 24px; overflow: auto; }
.emp-pane { display: none; }
.emp-pane.is-active { display: block; animation: confirmFade .15s ease; }
.emp-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.emp-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: #fcfdfd;
}
.emp-box h3 { margin: 0 0 10px; font-size: 0.98rem; }
.emp-subhead { margin: 12px 0 8px; font-size: 0.85rem; color: var(--ink-soft); }
.inline-pair { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.radio-row { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.check.tight { margin: 0; }
.pair-row {
  display: grid;
  grid-template-columns: 1fr 110px;
  gap: 8px;
  margin-bottom: 8px;
}
.usc-cop-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.emp-side-actions {
  border-left: 1px solid var(--line);
  background: #f7faf8;
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.emp-side-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.emp-side-foot span {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  font-weight: 600;
}
.emp-side-foot strong { font-size: 1.35rem; }
.emp-form.is-readonly input[readonly],
.emp-form.is-readonly textarea[readonly] {
  background: #f3f6f4;
  color: var(--ink);
}
.field em.tiny { font-style: normal; font-weight: 500; }

/* Large employee form popup */
.emp-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: grid;
  place-items: center;
  padding: 18px;
  background:
    radial-gradient(900px 420px at 50% 0%, rgba(31,122,92,0.16), transparent 55%),
    rgba(8, 20, 24, 0.62);
  backdrop-filter: blur(8px);
  animation: confirmFade .16s ease-out;
}
.emp-modal-overlay[hidden] { display: none !important; }
.emp-modal-dialog {
  width: min(1280px, 100%);
  height: min(920px, calc(100vh - 36px));
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 30px 90px rgba(8, 24, 28, 0.4);
  animation: confirmRise .2s cubic-bezier(.2,.8,.2,1);
  display: flex;
  flex-direction: column;
}
.emp-modal-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: #fff;
}
.emp-modal-loading {
  padding: 48px 24px;
  text-align: center;
  color: var(--ink-soft);
  font-weight: 600;
}
body.emp-modal-open { overflow: hidden; }
.emp-form-in-modal {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: 100%;
  display: flex;
  flex-direction: column;
}
.emp-form-in-modal .emp-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.emp-form-in-modal .emp-form-layout {
  flex: 1;
  min-height: 0;
  height: auto;
}
.emp-form-in-modal .emp-form-main {
  overflow: auto;
  max-height: calc(100vh - 220px);
}

@media (max-width: 980px) {
  .emp-form-layout, .emp-grid-2, .usc-cop-grid { grid-template-columns: 1fr; }
  .emp-side-actions { border-left: 0; border-top: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; }
  .emp-side-foot { width: 100%; margin-top: 0; }
  .emp-modal-dialog { height: calc(100vh - 24px); border-radius: 14px; }
}

@media (max-width: 1100px) {
  .listing-bar { grid-template-columns: 1fr; }
  .listing-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .listing-fact:nth-child(3n) { border-right: 0; }
}
@media (max-width: 720px) {
  .listing-facts { grid-template-columns: 1fr 1fr; }
  .listing-fact { border-right: 0; border-bottom: 1px solid var(--listing-line); }
  .confirm-stats { grid-template-columns: 1fr; }
}

@media print {
  .sidebar, .topbar, .listing-bar-actions, .flash, .confirm-overlay, .emp-actions, .emp-side-actions, .emp-tabs { display: none !important; }
  .listing-grid-wrap { height: auto; overflow: visible; }
  .listing-shell, .emp-form-shell { border: 0; box-shadow: none; }
  .emp-pane { display: block !important; page-break-inside: avoid; }
}

/* legacy rpn class hooks kept empty intentionally */

/* Auth */
.auth-body {
  min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background:
    linear-gradient(135deg, rgba(15,42,50,0.92), rgba(31,122,92,0.75)),
    radial-gradient(circle at 20% 20%, #2a9b74, transparent 40%),
    #0f2a32;
}
.auth-shell {
  width: min(920px, 100%); display: grid; grid-template-columns: 1.1fr 0.9fr;
  background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 18px; overflow: hidden; box-shadow: var(--shadow);
}
.auth-visual { padding: 42px; color: #eef6f3; }
.auth-brand { font-family: var(--display); font-size: 2rem; margin-bottom: 14px; }
.auth-visual p { max-width: 28ch; line-height: 1.55; color: #cfe0db; }
.auth-card { background: #fff; padding: 36px 32px; }
.auth-card h1 { margin: 0 0 18px; font-size: 1.6rem; }
.auth-form .btn { margin-top: 8px; }

@media (max-width: 900px) {
  .app-body { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .nav-item { width: auto; }
  .dash-grid, .form-grid, .auth-shell, .modal-body-split { grid-template-columns: 1fr; }
  .content, .topbar, .flash { padding-left: 16px; padding-right: 16px; margin-left: 0; margin-right: 0; }
}
