:root {
  --bg: #eef5f7;
  --panel: rgba(255, 255, 255, .92);
  --text: #102033;
  --muted: #627089;
  --line: rgba(100, 116, 139, .2);
  --primary: #2563eb;
  --accent: #06b6d4;
  --accent-2: #10b981;
  --danger: #dc2626;
  --shadow: 0 18px 44px rgba(24, 45, 70, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  background:
    radial-gradient(circle at 12% 10%, rgba(37, 99, 235, .16), transparent 30%),
    radial-gradient(circle at 88% 18%, rgba(6, 182, 212, .16), transparent 28%),
    linear-gradient(135deg, #f7fbfd, var(--bg));
}

body.client-aniu {
  --primary: #0ea5e9;
  --accent: #7dd3fc;
}

button, input, select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

button {
  cursor: pointer;
  font-weight: 800;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

button:hover { transform: translateY(-1px); }

input, select {
  width: 100%;
  padding: 0 12px;
  color: var(--text);
  background: #fff;
}

.hidden { display: none !important; }
.shell {
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}
.eyebrow { margin: 0; color: var(--primary); font-size: 12px; font-weight: 900; }
.muted { color: var(--muted); font-weight: 700; }

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(360px, 500px);
  gap: 40px;
  align-items: center;
  padding: 44px 7vw;
}

.login-visual {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  display: grid;
  align-content: center;
  padding: 54px;
  border-radius: 18px;
  color: #fff;
  background:
    linear-gradient(112deg, rgba(5, 18, 38, .94), rgba(14, 116, 144, .58)),
    url("./assets/login-bg.png");
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
}

.motion-grid {
  position: absolute;
  inset: 0;
  opacity: .3;
  background-image:
    linear-gradient(rgba(255,255,255,.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.16) 1px, transparent 1px);
  background-size: 46px 46px;
  animation: drift 18s linear infinite;
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(46px); }
}

.login-visual > *:not(.motion-grid) { position: relative; z-index: 1; }
.login-visual h1 { max-width: 680px; margin: 12px 0; font-size: 58px; line-height: 1.04; }
.login-visual p { max-width: 600px; line-height: 1.8; }
.login-visual .eyebrow { color: #ffd15c; }

.client-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  max-width: 620px;
  margin-top: 30px;
}

.client-picker button {
  display: grid;
  gap: 6px;
  min-height: 96px;
  padding: 16px;
  color: rgba(255,255,255,.84);
  text-align: left;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.25);
  backdrop-filter: blur(8px);
}

.client-picker button.active {
  color: #08211f;
  background: #c9fff5;
}

.client-picker strong { font-size: 20px; }
.client-picker span { font-size: 13px; }

.login-card {
  display: grid;
  gap: 16px;
  padding: 38px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.login-card h2 { margin: 0; font-size: 32px; }
.login-card label { display: grid; gap: 8px; font-weight: 800; }
.form-row, .check-line { display: flex; align-items: center; gap: 8px; }
.check-line input { width: auto; min-height: auto; }
.link-button { border: 0; color: var(--primary); background: transparent; }
.error-text { min-height: 20px; margin: 0; color: var(--danger); font-weight: 800; }
.primary-button {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 12px 24px rgba(37, 99, 235, .22);
}
.ghost-button { color: var(--text); background: rgba(255,255,255,.78); }
.quick-logins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-logins button { background: #fff; }
.quick-logins small { display: block; color: var(--muted); }

.module-home {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 42px 6vw;
}

.module-home-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, rgba(7, 20, 38, .94), rgba(14, 116, 144, .56)),
    url("./assets/login-bg.png");
  background-size: cover;
  background-position: center;
}

.module-home::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.1) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: .2;
  animation: drift 18s linear infinite;
}

.module-home-top,
.module-grid {
  position: relative;
  z-index: 1;
}

.module-home-top {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  align-items: flex-start;
  margin-bottom: 34px;
  color: #fff;
}

.module-home-top h1 {
  margin: 10px 0 12px;
  font-size: 46px;
}

.module-home-top p:not(.eyebrow) {
  max-width: 640px;
  margin: 0;
  color: rgba(255,255,255,.78);
  line-height: 1.8;
}

.module-account {
  min-width: 230px;
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  color: #fff;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(14px);
}

.module-account span {
  color: rgba(255,255,255,.72);
  font-size: 12px;
  font-weight: 800;
}

.module-account strong {
  font-size: 20px;
}

.module-account em {
  width: fit-content;
  padding: 5px 10px;
  border-radius: 999px;
  color: #08211f;
  background: #c9fff5;
  font-style: normal;
  font-weight: 900;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 18px;
}

.module-card {
  min-height: 210px;
  display: grid;
  place-content: center;
  gap: 14px;
  padding: 28px;
  text-align: center;
  color: rgba(255,255,255,.86);
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 16px;
  background: rgba(255,255,255,.12);
  box-shadow: 0 18px 42px rgba(0,0,0,.18);
  backdrop-filter: blur(12px);
}

.module-card.active {
  color: #08211f;
  background: linear-gradient(135deg, #c9fff5, #dff8ff);
}

.module-card span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
}

.module-card strong {
  font-size: 32px;
  line-height: 1.25;
}

.module-card em {
  color: inherit;
  opacity: .75;
  font-style: normal;
  font-size: 16px;
  line-height: 1.7;
}

.module-placeholder {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 42px;
}

.placeholder-shell {
  width: min(780px, 100%);
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow);
}

.placeholder-shell h1 {
  margin: 10px 0;
  font-size: 40px;
}

.placeholder-shell p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.8;
}

.back-home-link {
  margin-bottom: 24px;
  padding: 0;
}

.workspace {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 250px 1fr;
  max-width: 100vw;
  overflow-x: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto auto;
  gap: 20px;
  padding: 28px 18px;
  color: #fff;
  background: linear-gradient(180deg, #071426, #123a69);
}

body.client-aniu .sidebar {
  background: linear-gradient(180deg, #062c44, #0b77a8);
}

.brand-block h2 {
  margin: 8px 0 0;
  font-size: 28px;
  line-height: 1.18;
}

.back-home-button {
  min-height: 34px;
  margin-bottom: 18px;
  padding: 0 10px;
  color: #d9fff7;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 10px;
}

.side-nav-label {
  margin: 10px 2px 0;
  color: rgba(255,255,255,.58);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.side-nav-button {
  min-height: 50px;
  padding: 0 14px;
  color: rgba(255,255,255,.82);
  text-align: left;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.16);
}

.side-nav-button.active {
  color: #08211f;
  background: #c9fff5;
}

.settings-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.utility-nav {
  align-content: end;
}

.settings-nav svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.account-panel {
  align-self: end;
  display: grid;
  gap: 7px;
  padding: 15px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  background: rgba(255,255,255,.1);
}

.account-panel span { color: rgba(255,255,255,.72); font-size: 12px; font-weight: 800; }
.account-panel strong { font-size: 18px; }
.account-panel em {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  color: #d9fff7;
  background: rgba(255,255,255,.12);
  font-style: normal;
  font-weight: 900;
}

.main-panel {
  min-width: 0;
  max-width: calc(100vw - 250px);
  padding: 20px 22px;
  overflow-x: hidden;
}

.client-title-line {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow);
}

.title-copy {
  min-width: 140px;
}

.title-copy span,
.client-title-line > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.title-copy strong,
.client-title-line > strong {
  display: block;
  margin-top: 5px;
  color: #0f172a;
  font-size: 24px;
}

.top-filter-panel {
  min-width: 0;
  flex: 1;
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px;
  border: 1px solid rgba(148, 163, 184, .26);
  border-radius: 10px;
  background: rgba(248, 250, 252, .78);
}

.filter-group-title {
  padding: 0 4px;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.filter-group em {
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.filter-group input,
.filter-group select {
  min-width: 142px;
  min-height: 34px;
  height: 34px;
  border-radius: 7px;
  background: #fff;
  font-size: 13px;
}

.filter-control {
  display: flex;
  align-items: center;
  gap: 7px;
}

.filter-control span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.compact-select select {
  min-width: 150px;
}

.filter-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.filter-clear,
.filter-apply {
  min-height: 48px;
  padding: 0 16px;
  border-radius: 10px;
}

.filter-clear {
  color: #334155;
  background: #fff;
}

.filter-apply {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 10px 24px rgba(37, 99, 235, .18);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 16px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.topbar h1 { margin: 5px 0 0; font-size: 32px; }
.realtime-state {
  display: grid;
  justify-items: end;
  gap: 5px;
  color: var(--muted);
  font-weight: 800;
}
.realtime-state span {
  padding: 6px 10px;
  border-radius: 999px;
  color: #065f46;
  background: #d1fae5;
}
.realtime-state strong { color: var(--text); }

.view-panel {
  animation: viewIn .22s ease both;
}

@keyframes viewIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.source-status {
  margin-bottom: 14px;
  padding: 13px 15px;
  border-radius: 10px;
  font-weight: 800;
}
.source-status.loading { color: #1d4ed8; background: #eff6ff; }
.source-status.warning { color: #92400e; background: #fffbeb; }
.source-status.error { color: #991b1b; background: #fff1f2; }
.source-status.success { color: #08766c; background: #ecfdf5; }

.official-layout {
  min-height: calc(100vh - 98px);
  display: grid;
  grid-template-columns: 190px 1fr;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow);
}

.loading-board {
  min-height: calc(100vh - 98px);
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--primary);
  background: rgba(255,255,255,.8);
  box-shadow: var(--shadow);
  font-size: 18px;
  font-weight: 900;
  animation: pulseText 1.4s ease-in-out infinite;
}

@keyframes pulseText {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

.partner-menu {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px 10px;
  border-right: 1px solid var(--line);
  background: #fbfdff;
}

.menu-title {
  padding: 8px 10px;
  color: #0f172a;
  font-weight: 900;
}

.partner-menu button {
  min-height: 42px;
  border: 0;
  color: #334155;
  background: transparent;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.partner-menu button.active {
  color: #fff;
  background: #ff4d1f;
}

.official-report {
  padding: 14px 16px 20px;
}

.unified-report {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  min-height: calc(100vh - 150px);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}

.report-title-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
  padding: 10px 0 14px;
  border-bottom: 1px solid var(--line);
}

.report-title-row h2 { margin: 5px 0 0; font-size: 18px; }
.live-badge {
  padding: 7px 12px;
  border-radius: 999px;
  color: #065f46;
  background: #d1fae5;
  font-weight: 900;
}

.filter-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #475569;
  font-size: 13px;
}

.filter-strip strong {
  min-width: 90px;
  padding: 8px 10px;
  border-radius: 6px;
  background: #f8fafc;
  color: #0f172a;
}

.filter-strip button,
.filter-strip input {
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: #334155;
  font-weight: 800;
}

.filter-strip button {
  padding: 0 12px;
  cursor: pointer;
}

.filter-strip button.active,
.filter-strip .mini-primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.filter-strip input {
  min-width: 140px;
  padding: 0 10px;
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  height: calc(100vh - 245px);
  min-height: 280px;
  max-height: calc(100vh - 245px);
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}

.source-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-size: 13px;
  line-height: 1.45;
}

.source-table thead {
  position: sticky;
  top: 0;
  z-index: 30;
}

.source-table th,
.source-table td {
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid #edf2f7;
  border-right: 1px solid #edf2f7;
  width: calc(100% / var(--table-columns, 1));
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.source-table th:first-child,
.source-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  width: calc(100% / var(--table-columns, 1));
  text-align: center;
  background: inherit;
  box-shadow: 1px 0 0 #edf2f7;
}

.source-table th:nth-child(2),
.source-table td:nth-child(2) {
  width: calc(100% / var(--table-columns, 1));
  max-width: none;
}

.source-table th {
  position: sticky;
  top: 0;
  z-index: 31;
  height: 38px;
  background: #f6f8fb;
  color: #0f172a;
  font-weight: 900;
  font-size: 12px;
  background-clip: padding-box;
  box-shadow: 0 1px 0 #dbe3ef, 0 6px 12px rgba(15, 23, 42, .04);
}

.source-table th:first-child {
  z-index: 32;
  background: #f6f8fb;
}

.source-table tbody tr {
  background: #fff;
}

.source-table tbody tr:nth-child(even) {
  background: #fbfdff;
}

.source-table tbody tr:hover {
  background: #eef8ff;
}

.source-table tbody tr td:first-child {
  color: #334155;
  font-weight: 700;
}

.source-table tbody td {
  font-variant-numeric: tabular-nums;
}

.source-table tbody td:first-child {
  font-variant-numeric: normal;
}

.source-table tbody td:not(:first-child) {
  color: #0f172a;
  font-weight: 700;
}

.source-table tbody tr.total-row td,
.source-table tfoot tr.total-row td {
  border-top: 1px solid #dbeafe;
  border-bottom-color: #dbeafe;
  background: #eff6ff;
  color: #0b2f5f;
  font-weight: 900;
}

.source-table tbody tr.total-row td:first-child,
.source-table tfoot tr.total-row td:first-child {
  background: #eff6ff;
}

.source-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 28;
  height: 44px;
  padding: 0 14px;
  border-top: 1px solid #bfdbfe;
  border-right: 1px solid #dbeafe;
  text-align: center;
  white-space: nowrap;
}

.source-table tfoot td:first-child {
  left: 0;
  z-index: 5;
  text-align: center;
}

.aniu-board {
  position: relative;
  min-height: calc(100vh - 98px);
  padding: 14px 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.aniu-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
  color: #0f172a;
}

.aniu-head h2 { margin: 8px 0 0; font-size: 20px; }

.aniu-board .filter-strip {
  margin: 12px 0;
}

.traffic-table-wrap {
  width: 100%;
  max-width: 100%;
  height: calc(100vh - 250px);
  min-height: 280px;
  max-height: calc(100vh - 250px);
  overflow-x: auto;
  overflow-y: auto;
}

.traffic-table {
  table-layout: fixed;
  font-size: 12px;
}

.traffic-table th,
.traffic-table td {
  min-width: 0;
  max-width: none;
  padding: 0 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}

.traffic-table th {
  height: 42px;
  white-space: nowrap;
}

.traffic-table td {
  white-space: nowrap;
}

.traffic-table th:first-child,
.traffic-table td:first-child {
  width: calc(100% / var(--table-columns, 1));
  min-width: 0;
  max-width: none;
}

.traffic-table th:nth-child(2),
.traffic-table td:nth-child(2) {
  position: static;
  left: auto;
  z-index: auto;
  width: calc(100% / var(--table-columns, 1));
  min-width: 0;
  max-width: none;
  text-align: center;
  background: inherit;
  box-shadow: none;
}

.traffic-table th:nth-child(2) {
  z-index: 31;
  background: #f6f8fb;
}

.traffic-table th:nth-child(3),
.traffic-table td:nth-child(3) {
  min-width: 0;
  text-align: center;
}

.traffic-table tfoot td:nth-child(2) {
  position: sticky;
  bottom: 0;
  left: auto;
  z-index: 34;
  background: #eff6ff;
}

.traffic-table tfoot td {
  position: sticky;
  bottom: 0;
  z-index: 34;
  background: #eff6ff;
}

.traffic-table tfoot td:first-child {
  left: 0;
  z-index: 36;
  background: #eff6ff;
}

.settings-panel {
  min-height: calc(100vh - 150px);
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow);
}

.settings-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 220px auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 12px;
  background: #fff;
}

.settings-row strong {
  display: block;
  margin-bottom: 5px;
  font-size: 18px;
}

.settings-row p {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.settings-row input {
  min-height: 48px;
  font-weight: 900;
}

.section-heading {
  margin-bottom: 14px;
}
.section-heading h3 { margin: 0 0 5px; font-size: 24px; }
.section-heading p { margin: 0; color: var(--muted); font-weight: 700; }

.register-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.user-list {
  display: grid;
  gap: 10px;
}

.user-item {
  display: grid;
  grid-template-columns: 240px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.user-main {
  display: grid;
  gap: 5px;
}
.user-main strong { font-size: 18px; }
.user-main span { color: var(--muted); font-weight: 700; }

.binding-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.binding-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px 7px 12px;
  border-radius: 999px;
  background: #eef6ff;
  color: #1d4ed8;
  font-weight: 800;
}

.binding-chip button,
.danger-button {
  min-height: 32px;
  border: 0;
  color: #fff;
  background: #dc2626;
}

.binding-chip button {
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
}

.danger-button {
  padding: 0 14px;
}

.self-user {
  justify-self: end;
  padding: 8px 12px;
  border-radius: 999px;
  color: #065f46;
  background: #d1fae5;
  font-weight: 900;
}

.admin-page {
  display: grid;
  gap: 16px;
}

.admin-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--soft-shadow);
}

.admin-register-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  align-items: center;
}

.admin-register-form .admin-department-input,
.admin-register-form .permission-grid,
.admin-register-form .admin-feature-permissions {
  grid-column: span 2;
}

.admin-feature-permissions {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, .72);
}

.admin-feature-permissions > strong {
  color: var(--text);
}

.admin-feature-permissions > em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}

.admin-register-form select,
.admin-register-form input {
  min-height: 44px;
}

.permission-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.permission-grid.compact-note {
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(14, 165, 233, .08);
  color: var(--muted);
  font-weight: 900;
}

.permission-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf8;
  color: var(--text);
  font-weight: 900;
}

.permission-check input {
  width: 16px;
  height: 16px;
}

.permission-check.sensitive {
  border-color: rgba(220, 38, 38, .35);
  background: rgba(254, 226, 226, .55);
  color: #991b1b;
}

.admin-user-list {
  display: grid;
  gap: 12px;
}

.admin-user-item {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(220px, .8fr) minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: stretch;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.admin-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.admin-readonly-line {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf8;
  color: var(--muted);
  font-weight: 900;
}

.admin-scope-field {
  display: grid;
  gap: 8px;
  min-width: 240px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.admin-scope-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-scope-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-scope-head small {
  color: #0e6f63;
  font-size: 12px;
  font-weight: 900;
}

.admin-scope-actions {
  display: flex;
  gap: 8px;
}

.admin-scope-actions button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8faf8;
  color: var(--text);
  font-weight: 800;
  cursor: pointer;
}

.admin-scope-actions button:hover {
  border-color: rgba(20, 184, 166, .5);
  color: #0e8f7e;
}

.admin-scope-add {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto;
  gap: 8px;
}

.admin-scope-add input {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 800;
}

.admin-scope-add button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(20, 184, 166, .38);
  border-radius: 8px;
  background: rgba(20, 184, 166, .1);
  color: #0e6f63;
  font-weight: 900;
  cursor: pointer;
}

.admin-scope-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(138px, 1fr));
  gap: 8px;
  max-height: 158px;
  overflow: auto;
  padding: 2px;
}

.admin-scope-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 32px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfbf8;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.admin-scope-check label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.admin-scope-check span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-scope-check input {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  accent-color: #0ea5a0;
}

.admin-scope-check button {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #b42318;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.admin-scope-empty {
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.admin-scope-field em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.admin-user-item .user-main em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.admin-department-input {
  min-height: 44px;
  font-weight: 800;
}

.empty-card {
  padding: 24px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: rgba(255,255,255,.7);
  font-weight: 800;
}

.empty-line {
  padding: 10px;
  color: var(--muted);
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff;
  background: #0f172a;
  box-shadow: var(--shadow);
}

/* Premium visual layer */
:root {
  --bg: #e8f0f6;
  --panel: rgba(255, 255, 255, .9);
  --text: #0b1728;
  --muted: #637186;
  --line: rgba(42, 61, 86, .14);
  --primary: #155eef;
  --accent: #0ea5a4;
  --accent-2: #d6a843;
  --shadow: 0 18px 50px rgba(15, 30, 50, .13);
  --soft-shadow: 0 10px 28px rgba(15, 30, 50, .08);
  --radius: 8px;
}

body {
  background:
    linear-gradient(180deg, rgba(7, 18, 35, .06), rgba(255,255,255,0) 280px),
    linear-gradient(135deg, #edf4fb 0%, #f8fbfd 46%, #e7f3f0 100%);
}

button, input, select {
  border-radius: var(--radius);
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(21, 94, 239, .32);
  outline-offset: 2px;
}

.eyebrow {
  color: var(--primary);
  letter-spacing: .02em;
  text-transform: uppercase;
}

.login-screen {
  position: relative;
  gap: 34px;
  padding: 48px 6.5vw;
  background:
    linear-gradient(90deg, rgba(7, 18, 35, .03) 1px, transparent 1px),
    linear-gradient(rgba(7, 18, 35, .03) 1px, transparent 1px);
  background-size: 44px 44px;
}

.login-visual {
  min-height: 650px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.18);
  background:
    linear-gradient(105deg, rgba(2, 12, 27, .96), rgba(9, 53, 78, .75) 52%, rgba(12, 97, 103, .42)),
    url("./assets/login-bg.png");
  background-size: cover;
  background-position: center;
  box-shadow: 0 28px 80px rgba(6, 20, 38, .24);
}

.login-visual::before,
.module-home-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(90deg, #000, transparent 82%);
}

.login-visual::after {
  content: "";
  position: absolute;
  left: 52px;
  right: 52px;
  bottom: 42px;
  height: 1px;
  background: linear-gradient(90deg, rgba(214,168,67,.82), rgba(14,165,164,.62), transparent);
}

.motion-grid {
  opacity: .18;
  background-size: 52px 52px;
}

.login-visual h1 {
  font-size: clamp(44px, 4.6vw, 68px);
  letter-spacing: 0;
}

.login-visual p:not(.eyebrow) {
  color: rgba(255,255,255,.82);
  font-size: 16px;
}

.login-visual .eyebrow {
  color: #f4c65a;
}

.login-card {
  position: relative;
  gap: 18px;
  padding: 42px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.72);
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(247, 251, 253, .88));
  box-shadow: 0 22px 70px rgba(22, 42, 65, .15);
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  border-radius: 10px 10px 0 0;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--accent-2));
}

.login-card h2 {
  font-size: 34px;
  letter-spacing: 0;
}

.login-card label span {
  color: #1c2b3f;
}

input, select {
  border-color: rgba(42, 61, 86, .16);
  background: rgba(255,255,255,.94);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

input:hover, select:hover {
  border-color: rgba(21, 94, 239, .28);
}

.primary-button,
.filter-apply {
  background: linear-gradient(135deg, #155eef, #0ea5a4);
  box-shadow: 0 14px 30px rgba(21, 94, 239, .24);
}

.ghost-button,
.filter-clear,
.back-home-button {
  border-color: rgba(42, 61, 86, .14);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.55);
}

.module-home {
  padding: 52px 6vw;
}

.module-home-bg {
  background:
    linear-gradient(112deg, rgba(2, 12, 27, .97), rgba(8, 43, 66, .82) 52%, rgba(11, 94, 96, .55)),
    url("./assets/login-bg.png");
  background-size: cover;
  background-position: center;
}

.module-home-top {
  align-items: center;
  padding: 22px 0 6px;
}

.module-home-top h1 {
  font-size: clamp(44px, 5vw, 72px);
  letter-spacing: 0;
}

.module-account {
  border-radius: 8px;
  border-color: rgba(255,255,255,.2);
  background: rgba(7, 18, 35, .42);
  box-shadow: 0 18px 48px rgba(0,0,0,.22);
}

.module-grid {
  grid-template-columns: repeat(2, minmax(280px, 420px));
  gap: 18px;
}

.module-card {
  position: relative;
  min-height: 190px;
  place-content: end start;
  padding: 28px;
  text-align: left;
  border-radius: 8px;
  border-color: rgba(255,255,255,.18);
  background: rgba(7, 18, 35, .5);
  box-shadow: 0 22px 60px rgba(0,0,0,.23);
  overflow: hidden;
}

.module-card::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 26px;
  width: 44px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

.module-card:hover {
  border-color: rgba(255,255,255,.35);
  box-shadow: 0 28px 76px rgba(0,0,0,.28);
}

.module-card.active {
  color: #071426;
  background: linear-gradient(135deg, #e8fff9, #c8f6ee);
}

.module-card strong {
  font-size: 30px;
}

.workspace {
  grid-template-columns: 260px 1fr;
  background:
    linear-gradient(90deg, rgba(15, 30, 50, .06) 1px, transparent 1px),
    linear-gradient(rgba(15, 30, 50, .045) 1px, transparent 1px),
    linear-gradient(135deg, #edf4fb, #f9fcfd 45%, #eaf5f1);
  background-size: 48px 48px, 48px 48px, auto;
}

.sidebar {
  padding: 24px 18px;
  background:
    linear-gradient(180deg, rgba(3, 11, 24, .98), rgba(9, 42, 72, .96) 56%, rgba(10, 72, 89, .98));
  box-shadow: 12px 0 34px rgba(7, 18, 35, .16);
}

body.client-aniu .sidebar {
  background:
    linear-gradient(180deg, rgba(3, 20, 36, .98), rgba(8, 72, 102, .96) 56%, rgba(8, 112, 140, .98));
}

.brand-block {
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255,255,255,.12);
}

.brand-block h2 {
  font-size: 30px;
}

.back-home-button {
  min-height: 38px;
  color: rgba(255,255,255,.84);
  background: rgba(255,255,255,.08);
}

.side-nav {
  gap: 8px;
}

.side-nav-label {
  margin: 14px 4px 2px;
  color: rgba(255,255,255,.48);
}

.side-nav-button {
  min-height: 48px;
  border-radius: 8px;
  color: rgba(255,255,255,.78);
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.1);
}

.side-nav-button:hover {
  color: #fff;
  background: rgba(255,255,255,.12);
}

.side-nav-button.active {
  color: #06172b;
  background: linear-gradient(135deg, #d9fff7, #b9efe5);
  box-shadow: 0 14px 28px rgba(0,0,0,.16);
}

.account-panel {
  border-radius: 8px;
  border-color: rgba(255,255,255,.16);
  background: linear-gradient(180deg, rgba(255,255,255,.13), rgba(255,255,255,.07));
}

.main-panel {
  max-width: calc(100vw - 260px);
  padding: 22px 24px;
}

.client-title-line {
  margin-bottom: 16px;
  padding: 18px 20px;
  border-radius: 8px;
  border-color: rgba(255,255,255,.75);
  background: linear-gradient(180deg, rgba(255,255,255,.94), rgba(247,251,253,.88));
  box-shadow: var(--soft-shadow);
}

.title-copy strong,
.client-title-line > strong {
  font-size: 26px;
}

.top-filter-panel {
  gap: 12px;
}

.filter-group {
  border-radius: 8px;
  border-color: rgba(42, 61, 86, .12);
  background: rgba(255,255,255,.82);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.filter-group input,
.filter-group select {
  min-height: 36px;
  height: 36px;
  border-radius: 6px;
}

.filter-clear,
.filter-apply {
  border-radius: 8px;
}

.source-status {
  border: 1px solid rgba(255,255,255,.62);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.unified-report,
.aniu-board,
.loading-board,
.placeholder-shell {
  border-radius: 8px;
  border-color: rgba(255,255,255,.72);
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(250,252,254,.92));
  box-shadow: var(--soft-shadow);
}

.official-report {
  padding: 16px 18px 20px;
}

.report-title-row,
.aniu-head {
  border-bottom-color: rgba(42, 61, 86, .12);
}

.report-title-row h2,
.aniu-head h2 {
  font-size: 22px;
}

.live-badge {
  color: #075e54;
  background: linear-gradient(135deg, #d8fff6, #c8f6e4);
  border: 1px solid rgba(14,165,164,.18);
}

.table-wrap,
.traffic-table-wrap {
  border-radius: 8px;
  border-color: rgba(42, 61, 86, .12);
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 10px 24px rgba(15, 30, 50, .05);
}

.source-table {
  font-size: 13px;
}

.source-table th {
  height: 42px;
  background: linear-gradient(180deg, #f6f9fc, #edf3f8);
  color: #102033;
  border-bottom-color: #d9e3ee;
  box-shadow: 0 1px 0 #d9e3ee, 0 10px 16px rgba(15, 30, 50, .04);
}

.source-table th:first-child {
  background: linear-gradient(180deg, #f6f9fc, #edf3f8);
}

.source-table th,
.source-table td {
  border-right-color: #eef3f8;
  border-bottom-color: #eef3f8;
}

.source-table tbody tr:nth-child(even) {
  background: #f8fbfe;
}

.source-table tbody tr:hover {
  background: #edf8fb;
}

.source-table tbody td:not(:first-child) {
  color: #0b1728;
}

.source-table tbody tr.total-row td,
.source-table tfoot tr.total-row td,
.traffic-table tfoot td {
  background: linear-gradient(180deg, #eef7ff, #e5f0fb);
  color: #0b376d;
  border-top-color: #c9ddf2;
}

.source-table tbody tr.total-row td:first-child,
.source-table tfoot tr.total-row td:first-child,
.traffic-table tfoot td:first-child,
.traffic-table tfoot td:nth-child(2) {
  background: linear-gradient(180deg, #eef7ff, #e5f0fb);
}

.empty-card {
  border-radius: 8px;
  border-color: rgba(42, 61, 86, .18);
  background: rgba(255,255,255,.76);
}

.toast {
  border-radius: 8px;
  background: rgba(7, 18, 35, .94);
  box-shadow: 0 18px 48px rgba(7, 18, 35, .22);
}

.finance-toolbar {
  justify-content: flex-end;
  align-items: center;
}

.finance-date-filter {
  flex-wrap: wrap;
}

.finance-date-filter input {
  width: 142px;
  min-width: 142px;
}

.finance-date-filter .filter-clear {
  min-height: 34px;
  height: 34px;
  padding: 0 14px;
}

.finance-name-filter input {
  width: min(280px, 32vw);
}

.finance-name-filter .filter-clear {
  min-height: 34px;
  height: 34px;
  padding: 0 14px;
}

.finance-page {
  min-height: calc(100vh - 145px);
}

.salary-distribution-panel {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid rgba(15, 118, 110, .2);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(240, 253, 250, .96), rgba(248, 250, 252, .98));
  box-shadow: 0 12px 32px rgba(15, 23, 42, .06);
}

.salary-distribution-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.salary-distribution-heading h3 {
  margin: 2px 0 4px;
  font-size: 22px;
}

.salary-distribution-heading span:not(.live-badge) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.salary-rate-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.salary-rate-field {
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .24);
  border-radius: 10px;
  background: rgba(255, 255, 255, .9);
}

.salary-rate-field > span,
.salary-preview-base > span,
.salary-preview-card > span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.salary-rate-input-wrap,
.salary-preview-base > div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.salary-rate-input-wrap input,
.salary-preview-base input {
  width: 100%;
  min-width: 0;
  height: 36px;
  border: 1px solid #d7e1eb;
  border-radius: 7px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-weight: 900;
  text-align: right;
  outline: none;
}

.salary-rate-input-wrap input:focus,
.salary-preview-base input:focus {
  border-color: rgba(15, 118, 110, .58);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .1);
}

.salary-rate-input-wrap input[readonly] {
  background: #f6f8fa;
  color: #475569;
}

.salary-rate-input-wrap em,
.salary-preview-base b {
  color: #0f766e;
  font-style: normal;
  font-weight: 900;
}

.salary-rule-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.salary-rate-status {
  color: #0f766e;
  font-size: 12px;
  font-weight: 800;
}

.salary-rate-status.invalid {
  color: #b42318;
}

.salary-preview-row {
  display: grid;
  grid-template-columns: 1.25fr repeat(4, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.salary-preview-base,
.salary-preview-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, .22);
  border-radius: 10px;
  background: rgba(255, 255, 255, .82);
}

.salary-preview-card strong {
  color: #0f172a;
  font-size: 18px;
}

.salary-preview-card strong em {
  font-style: normal;
}

.salary-preview-card.company {
  border-color: rgba(15, 118, 110, .22);
  background: rgba(204, 251, 241, .4);
}

.salary-distribution-panel ~ .finance-table-wrap {
  height: calc(100vh - 570px);
  min-height: 300px;
}

.salary-details-pending {
  min-height: 280px;
  padding: 48px 24px;
  border: 1px dashed rgba(100, 116, 139, .34);
  border-radius: 12px;
  background: rgba(248, 250, 252, .84);
  text-align: center;
}

.salary-details-pending h2 {
  margin: 6px 0 10px;
  font-size: 24px;
}

.salary-details-pending span {
  color: var(--muted);
  font-weight: 700;
}

.finance-table-wrap {
  height: calc(100vh - 250px);
  min-height: 420px;
}

.finance-table th,
.finance-table td {
  height: 48px;
  padding: 0 10px;
}

.finance-table th:last-child,
.finance-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  background: inherit;
  box-shadow: -1px 0 0 #edf2f7;
}

.finance-table th:last-child {
  z-index: 31;
  background: linear-gradient(180deg, #f6f9fc, #edf3f8);
}

.finance-input {
  width: 100%;
  height: 34px;
  border: 1px solid #dfe6ee;
  border-radius: 7px;
  background: rgba(255,255,255,.92);
  color: #111827;
  font: inherit;
  font-weight: 800;
  text-align: center;
  outline: none;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.finance-input:focus {
  border-color: rgba(15, 118, 110, .56);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
  background: #fff;
}

.finance-input.saving {
  border-color: rgba(182, 139, 45, .7);
}

@media (max-width: 1100px) {
  .salary-rate-grid,
  .salary-preview-row {
    grid-template-columns: repeat(2, minmax(150px, 1fr));
  }
}

@media (max-width: 680px) {
  .salary-distribution-heading,
  .salary-rule-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .salary-rate-grid,
  .salary-preview-row {
    grid-template-columns: 1fr;
  }
}

.finance-input.saved {
  border-color: rgba(15, 118, 110, .72);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .12);
}

.finance-input.save-error {
  border-color: rgba(185, 28, 28, .8);
  box-shadow: 0 0 0 3px rgba(185, 28, 28, .1);
}

.finance-readonly {
  background: #f7fbff;
  color: #0b376d;
  font-weight: 900;
}

.finance-actions-cell {
  min-width: 92px;
}

.finance-delete-button {
  width: 72px;
  height: 32px;
  border: 0;
  border-radius: 7px;
  background: #dc2626;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(220, 38, 38, .18);
}

.finance-delete-button:hover {
  background: #b91c1c;
}

@media (max-width: 1100px) {
  .workspace, .login-screen, .official-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .register-form, .user-item { grid-template-columns: 1fr; }
  .client-title-line { align-items: stretch; flex-direction: column; }
  .top-filter-panel { justify-content: flex-start; }
  .settings-row { grid-template-columns: 1fr; }
}

/* Refined executive minimal theme */
:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #101418;
  --muted: #6b7280;
  --line: #e3e7ec;
  --primary: #111827;
  --accent: #0f766e;
  --accent-2: #b68b2d;
  --danger: #b91c1c;
  --shadow: 0 16px 40px rgba(16, 20, 24, .07);
  --soft-shadow: 0 8px 24px rgba(16, 20, 24, .045);
  --radius: 6px;
}

body {
  color: var(--text);
  background: #f4f6f8;
}

button {
  letter-spacing: 0;
}

button:hover {
  transform: translateY(-1px);
}

input,
select {
  height: 40px;
  border-color: #d9dee6;
  background: #fff;
  box-shadow: none;
}

input:hover,
select:hover,
input:focus,
select:focus {
  border-color: #9aa5b1;
}

.eyebrow {
  color: #4b5563;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-screen {
  grid-template-columns: minmax(560px, 1.15fr) minmax(360px, 440px);
  gap: 48px;
  padding: 56px 7vw;
  background: #f4f6f8;
}

.login-visual {
  min-height: 620px;
  padding: 64px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(8, 14, 24, .9), rgba(8, 14, 24, .46)),
    url("./assets/login-bg.png");
  background-size: cover;
  background-position: center;
  box-shadow: 0 20px 60px rgba(16, 20, 24, .16);
}

.login-visual::before,
.module-home-bg::before,
.motion-grid {
  display: none;
}

.login-visual::after {
  left: 64px;
  right: auto;
  bottom: 74px;
  width: 120px;
  height: 2px;
  background: #b68b2d;
}

.login-visual h1 {
  max-width: 720px;
  margin: 16px 0 18px;
  font-size: clamp(48px, 5vw, 72px);
  line-height: 1.04;
  font-weight: 900;
}

.login-visual p:not(.eyebrow) {
  max-width: 620px;
  color: rgba(255,255,255,.76);
  font-size: 16px;
  line-height: 1.9;
}

.login-visual .eyebrow {
  color: #d6b15a;
}

.login-card {
  gap: 18px;
  padding: 42px;
  border: 1px solid #e3e7ec;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 46px rgba(16, 20, 24, .08);
  backdrop-filter: none;
}

.login-card::before {
  height: 2px;
  background: #111827;
}

.login-card h2 {
  color: #111827;
  font-size: 34px;
  font-weight: 900;
}

.login-card label {
  gap: 9px;
  color: #1f2937;
}

.login-card input {
  height: 46px;
  border-radius: 6px;
}

.primary-button {
  min-height: 48px;
  border-radius: 6px;
  background: #111827;
  box-shadow: 0 12px 24px rgba(17, 24, 39, .16);
}

.primary-button:hover {
  background: #0b1220;
}

.link-button {
  color: #0f766e;
}

.module-home {
  padding: 64px 7vw;
  background: #0b111b;
}

.module-home-bg {
  background:
    linear-gradient(90deg, rgba(8, 14, 24, .94), rgba(8, 14, 24, .54)),
    url("./assets/login-bg.png");
  background-size: cover;
  background-position: center;
}

.module-home::after {
  display: none;
}

.module-home-top {
  align-items: flex-start;
  padding: 0;
  margin-bottom: 78px;
}

.module-home-top h1 {
  margin-top: 16px;
  font-size: clamp(54px, 6vw, 86px);
  line-height: 1;
  font-weight: 900;
}

.module-home-top .eyebrow {
  color: #d6b15a;
}

.module-account {
  min-width: 248px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  background: rgba(11, 17, 27, .78);
  box-shadow: none;
}

.module-account em,
.account-panel em {
  color: #0b111b;
  background: #e5f4ef;
}

.module-grid {
  grid-template-columns: repeat(2, minmax(280px, 460px));
  gap: 20px;
}

.module-card {
  min-height: 188px;
  padding: 32px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 8px;
  color: rgba(255,255,255,.86);
  background: rgba(255,255,255,.06);
  box-shadow: none;
  backdrop-filter: blur(10px);
}

.module-card::before {
  left: 32px;
  top: 30px;
  width: 34px;
  height: 2px;
  background: #d6b15a;
}

.module-card.active {
  color: #111827;
  background: #f8fafc;
}

.module-card:hover {
  border-color: rgba(255,255,255,.34);
  box-shadow: none;
}

.module-card strong {
  font-size: 32px;
}

.module-card em {
  opacity: .72;
  font-size: 15px;
}

.workspace {
  grid-template-columns: 248px 1fr;
  background: #f4f6f8;
}

.sidebar,
body.client-aniu .sidebar {
  padding: 26px 18px;
  background: #0b111b;
  box-shadow: none;
}

.brand-block {
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.brand-block h2 {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 900;
}

.back-home-button {
  min-height: 36px;
  padding: 0 12px;
  color: rgba(255,255,255,.78);
  border-color: rgba(255,255,255,.14);
  background: transparent;
  box-shadow: none;
}

.back-home-button:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}

.side-nav {
  gap: 7px;
}

.side-nav-label {
  margin: 16px 4px 4px;
  color: rgba(255,255,255,.4);
  font-size: 11px;
}

.side-nav-button {
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: rgba(255,255,255,.72);
  background: transparent;
}

.side-nav-button:hover {
  color: #fff;
  background: rgba(255,255,255,.06);
}

.side-nav-button.active {
  color: #111827;
  background: #f8fafc;
  box-shadow: none;
}

.account-panel {
  padding: 16px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
}

.account-panel strong {
  color: #fff;
}

.sidebar > .ghost-button {
  min-height: 44px;
  color: #111827;
  border: 0;
  border-radius: 6px;
  background: #f8fafc;
}

.main-panel {
  max-width: calc(100vw - 248px);
  padding: 24px;
}

.client-title-line {
  align-items: flex-start;
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid #e3e7ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.title-copy,
.client-title-line > span,
.client-title-line > strong {
  min-width: 170px;
}

.title-copy strong,
.client-title-line > strong {
  color: #111827;
  font-size: 26px;
  font-weight: 900;
}

.top-filter-panel {
  gap: 10px;
}

.filter-group {
  min-height: 48px;
  padding: 7px;
  border: 1px solid #e3e7ec;
  border-radius: 7px;
  background: #f9fafb;
  box-shadow: none;
}

.filter-group-title,
.filter-control span {
  color: #4b5563;
  font-size: 12px;
}

.filter-group input,
.filter-group select {
  min-height: 34px;
  height: 34px;
  border-radius: 5px;
  font-weight: 700;
}

.filter-clear,
.filter-apply {
  min-height: 48px;
  border-radius: 7px;
}

.filter-clear {
  border-color: #d9dee6;
  background: #fff;
  box-shadow: none;
}

.filter-apply {
  border-color: #111827;
  background: #111827;
  box-shadow: none;
}

.source-status {
  border-radius: 7px;
  box-shadow: none;
}

.unified-report,
.aniu-board,
.loading-board,
.placeholder-shell {
  border: 1px solid #e3e7ec;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
}

.official-report {
  padding: 18px;
}

.report-title-row,
.aniu-head {
  padding-bottom: 16px;
  border-bottom: 1px solid #e8ecf1;
}

.report-title-row h2,
.aniu-head h2 {
  color: #111827;
  font-size: 24px;
  font-weight: 900;
}

.live-badge {
  color: #065f46;
  border: 1px solid #d7eee7;
  background: #effaf6;
}

.table-wrap,
.traffic-table-wrap {
  border: 1px solid #e3e7ec;
  border-radius: 7px;
  background: #fff;
  box-shadow: none;
}

.source-table {
  color: #111827;
  font-size: 13px;
}

.source-table th {
  height: 42px;
  color: #374151;
  background: #f7f8fa;
  border-bottom-color: #e3e7ec;
  box-shadow: none;
}

.source-table th:first-child {
  background: #f7f8fa;
}

.source-table th,
.source-table td {
  border-right-color: #edf0f3;
  border-bottom-color: #edf0f3;
}

.source-table tbody tr {
  background: #fff;
}

.source-table tbody tr:nth-child(even) {
  background: #fbfcfd;
}

.source-table tbody tr:hover {
  background: #f2f7f6;
}

.source-table tbody td {
  color: #111827;
}

.source-table tbody td:not(:first-child) {
  color: #111827;
  font-weight: 800;
}

.source-table tbody tr.total-row td,
.source-table tfoot tr.total-row td,
.traffic-table tfoot td {
  color: #111827;
  border-top-color: #d6dde6;
  background: #f3f6f8;
}

.source-table tbody tr.total-row td:first-child,
.source-table tfoot tr.total-row td:first-child,
.traffic-table tfoot td:first-child,
.traffic-table tfoot td:nth-child(2) {
  background: #f3f6f8;
}

.empty-card {
  border: 1px dashed #d9dee6;
  border-radius: 7px;
  background: #fbfcfd;
}

.toast {
  border-radius: 7px;
  background: #111827;
  box-shadow: 0 16px 34px rgba(17, 24, 39, .18);
}

/* Executive calm theme: restrained, premium, data-first */
:root {
  --bg: #f2f3f1;
  --panel: #ffffff;
  --panel-soft: #f8f8f5;
  --ink: #111111;
  --ink-2: #252525;
  --muted: #6d706a;
  --line: #deded8;
  --line-soft: #ecece7;
  --accent: #9b7a33;
  --accent-dark: #151515;
  --success: #2f7d5a;
  --shadow: 0 20px 60px rgba(17, 17, 17, .08);
  --soft-shadow: 0 10px 30px rgba(17, 17, 17, .05);
  --radius: 10px;
}

html {
  background: #f2f3f1;
}

body {
  color: var(--ink);
  background:
    linear-gradient(180deg, #f8f8f5 0%, #f2f3f1 46%, #ecefeb 100%);
  font-family: "Inter", "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

button:hover {
  transform: translateY(-1px);
}

input,
select {
  color: var(--ink);
  border: 1px solid #d8d8d2;
  border-radius: 8px;
  background: #fff;
}

input:focus,
select:focus {
  border-color: #aaa18a;
  box-shadow: 0 0 0 3px rgba(155, 122, 51, .12);
}

.eyebrow {
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.login-screen {
  min-height: 100vh;
  grid-template-columns: minmax(560px, 1.2fr) minmax(380px, 430px);
  gap: 44px;
  align-items: center;
  padding: 54px 7vw;
  background:
    linear-gradient(135deg, rgba(255,255,255,.88), rgba(241,242,238,.84)),
    #f2f3f1;
}

.login-visual {
  overflow: hidden;
  min-height: 620px;
  padding: 70px 68px;
  border: 1px solid rgba(255,255,255,.36);
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(10, 10, 10, .88) 0%, rgba(10, 10, 10, .58) 46%, rgba(10, 10, 10, .14) 100%),
    url("./assets/login-bg.png");
  background-size: cover;
  background-position: center;
  box-shadow: 0 30px 90px rgba(17, 17, 17, .16);
}

.login-visual::before,
.login-visual .motion-grid,
.module-home-bg::before,
.motion-grid {
  display: none;
}

.login-visual::after {
  left: 68px;
  bottom: 76px;
  width: 96px;
  height: 2px;
  border-radius: 0;
  background: var(--accent);
  opacity: 1;
}

.login-visual h1 {
  max-width: 720px;
  margin: 16px 0 20px;
  color: #fff;
  font-size: clamp(50px, 5.4vw, 78px);
  line-height: 1.02;
  font-weight: 900;
}

.login-visual p:not(.eyebrow) {
  max-width: 610px;
  color: rgba(255,255,255,.75);
  font-size: 16px;
  line-height: 1.9;
}

.login-card {
  gap: 18px;
  padding: 44px;
  border: 1px solid rgba(17, 17, 17, .08);
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.login-card::before {
  left: 44px;
  top: 34px;
  width: 54px;
  height: 2px;
  border-radius: 0;
  background: var(--accent);
}

.login-card h2 {
  color: var(--ink);
  font-size: 36px;
  line-height: 1.08;
  font-weight: 900;
}

.login-card label span {
  color: var(--ink-2);
  font-size: 13px;
}

.login-card input {
  height: 48px;
  border-radius: 8px;
  background: #fbfbf8;
}

.primary-button,
.filter-apply {
  color: #fff;
  border: 1px solid var(--accent-dark);
  background: var(--accent-dark);
  box-shadow: 0 14px 28px rgba(17, 17, 17, .14);
}

.primary-button:hover,
.filter-apply:hover {
  color: #fff;
  background: #000;
}

.link-button {
  color: var(--accent);
  font-weight: 800;
}

.module-home {
  min-height: 100vh;
  padding: 62px 7vw;
  background: #111;
}

.module-home-bg {
  background:
    linear-gradient(90deg, rgba(10,10,10,.9), rgba(10,10,10,.62), rgba(10,10,10,.28)),
    url("./assets/login-bg.png");
  background-size: cover;
  background-position: center;
}

.module-home::after {
  display: none;
}

.module-home-top {
  align-items: flex-start;
  margin: 0 0 76px;
  padding: 0;
}

.module-home-top h1 {
  margin: 14px 0 0;
  color: #fff;
  font-size: clamp(58px, 6.4vw, 92px);
  line-height: .98;
  font-weight: 900;
}

.module-account {
  min-width: 250px;
  padding: 20px;
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  background: rgba(255,255,255,.08);
  box-shadow: none;
  backdrop-filter: blur(16px);
}

.module-account span,
.account-panel span {
  color: rgba(255,255,255,.58);
}

.module-account strong,
.account-panel strong {
  color: #fff;
}

.module-account em,
.account-panel em {
  color: #111;
  background: #f2ead7;
}

.module-grid {
  grid-template-columns: repeat(2, minmax(300px, 520px));
  gap: 18px;
  align-items: stretch;
}

.module-card {
  justify-content: center;
  min-height: 190px;
  padding: 34px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 14px;
  color: rgba(255,255,255,.88);
  background: rgba(255,255,255,.08);
  box-shadow: none;
  backdrop-filter: blur(18px);
}

.module-card::before {
  left: 34px;
  top: 30px;
  width: 36px;
  height: 2px;
  background: var(--accent);
}

.module-card:hover {
  border-color: rgba(255,255,255,.38);
  background: rgba(255,255,255,.12);
}

.module-card.active {
  color: #111;
  border-color: rgba(255,255,255,.82);
  background: #f6f1e4;
}

.module-card strong {
  color: inherit;
  font-size: 34px;
  line-height: 1.14;
  font-weight: 900;
}

.module-card em {
  color: currentColor;
  opacity: .68;
  font-size: 15px;
}

.module-placeholder,
.workspace {
  background: #f2f3f1;
}

.workspace {
  grid-template-columns: 254px minmax(0, 1fr);
}

.sidebar,
body.client-aniu .sidebar {
  padding: 26px 18px;
  background: #111;
  box-shadow: 10px 0 36px rgba(17, 17, 17, .08);
}

.brand-block {
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.brand-block h2 {
  margin-top: 10px;
  color: #fff;
  font-size: 30px;
  line-height: 1.1;
}

.back-home-button {
  min-height: 36px;
  padding: 0 12px;
  color: rgba(255,255,255,.72);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 8px;
  background: transparent;
}

.back-home-button:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}

.side-nav {
  gap: 8px;
}

.side-nav-button {
  min-height: 48px;
  justify-content: flex-start;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: rgba(255,255,255,.7);
  background: transparent;
  font-weight: 800;
}

.side-nav-button:hover {
  color: #fff;
  background: rgba(255,255,255,.07);
}

.side-nav-button.active {
  color: #111;
  border-color: #f6f1e4;
  background: #f6f1e4;
  box-shadow: none;
}

.account-panel {
  padding: 17px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px;
  background: rgba(255,255,255,.08);
}

.sidebar > .ghost-button {
  min-height: 44px;
  color: #111;
  border: 0;
  border-radius: 10px;
  background: #f2f3f1;
  box-shadow: none;
}

.main-panel {
  max-width: calc(100vw - 254px);
  padding: 22px;
}

.client-title-line {
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.92);
  box-shadow: var(--soft-shadow);
}

.title-copy,
.client-title-line > span,
.client-title-line > strong {
  min-width: 166px;
}

.client-title-line > span,
.title-copy .eyebrow {
  color: var(--accent);
}

.client-title-line > strong,
.title-copy strong {
  color: var(--ink);
  font-size: 28px;
  line-height: 1.12;
  font-weight: 900;
}

.top-filter-panel {
  gap: 10px;
  justify-content: flex-end;
}

.filter-group {
  min-height: 48px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfbf8;
  box-shadow: none;
}

.filter-group-title,
.filter-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filter-group input,
.filter-group select {
  height: 34px;
  min-height: 34px;
  border-radius: 8px;
  background: #fff;
  font-weight: 800;
}

.filter-clear,
.filter-apply {
  min-height: 48px;
  border-radius: 10px;
  font-weight: 900;
}

.filter-clear {
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: none;
}

.source-status {
  border: 1px solid #efe3bd;
  border-radius: 12px;
  color: #6e541c;
  background: #fff8e6;
  box-shadow: none;
}

.unified-report,
.aniu-board,
.loading-board,
.placeholder-shell {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--soft-shadow);
}

.official-report,
.aniu-board {
  padding: 18px;
}

.report-title-row,
.aniu-head {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line-soft);
}

.report-title-row h2,
.aniu-head h2 {
  color: var(--ink);
  font-size: 26px;
  line-height: 1.12;
  font-weight: 900;
}

.live-badge {
  color: #17583d;
  border: 1px solid #d9eadf;
  border-radius: 999px;
  background: #edf8f1;
  font-weight: 900;
}

.table-wrap,
.traffic-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: none;
}

.source-table,
.traffic-table {
  color: var(--ink);
  font-size: 13px;
  border-collapse: separate;
  border-spacing: 0;
}

.source-table th,
.traffic-table th {
  height: 44px;
  color: #333;
  border-bottom: 1px solid var(--line);
  background: #f4f4f0;
  box-shadow: none;
  font-weight: 900;
}

.source-table th:first-child,
.traffic-table th:first-child {
  background: #f4f4f0;
}

.source-table th,
.source-table td,
.traffic-table th,
.traffic-table td {
  border-right: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  text-align: center;
  vertical-align: middle;
}

.source-table tbody tr,
.traffic-table tbody tr {
  background: #fff;
}

.source-table tbody tr:nth-child(even),
.traffic-table tbody tr:nth-child(even) {
  background: #fbfbf8;
}

.source-table tbody tr:hover,
.traffic-table tbody tr:hover {
  background: #f6f1e4;
}

.source-table tbody td,
.traffic-table tbody td {
  color: var(--ink);
}

.source-table tbody td:not(:first-child),
.traffic-table tbody td:not(:first-child) {
  color: var(--ink);
  font-weight: 800;
}

.source-table tbody tr.total-row td,
.source-table tfoot tr.total-row td,
.traffic-table tfoot td {
  color: var(--ink);
  border-top: 1px solid #cfc9bb;
  background: #f3eee1;
  font-weight: 900;
}

.source-table tbody tr.total-row td:first-child,
.source-table tfoot tr.total-row td:first-child,
.traffic-table tfoot td:first-child,
.traffic-table tfoot td:nth-child(2) {
  background: #f3eee1;
}

.empty-card {
  border: 1px dashed #cfc9bb;
  border-radius: 12px;
  color: var(--muted);
  background: #fbfbf8;
}

.toast {
  border-radius: 12px;
  background: #111;
  box-shadow: 0 20px 50px rgba(17, 17, 17, .16);
}

@media (max-width: 1100px) {
  .login-screen {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .login-visual {
    min-height: 380px;
    padding: 42px;
  }

  .module-home {
    padding: 32px 24px;
  }

  .module-home-top {
    gap: 24px;
    flex-direction: column;
  }

  .module-grid {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .main-panel {
    max-width: 100vw;
    padding: 16px;
  }

  .client-title-line {
    align-items: stretch;
    flex-direction: column;
  }

  .top-filter-panel {
    justify-content: flex-start;
  }
}

/* Premium interaction layer: not only colors, but real page atmosphere */
.login-screen,
.module-home,
.workspace {
  isolation: isolate;
}

.login-screen::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(17,17,17,.04) 1px, transparent 1px),
    linear-gradient(rgba(17,17,17,.03) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, transparent, #000 18%, #000 72%, transparent);
}

.hero-scan {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0%, rgba(255,255,255,.12) 48%, transparent 58%);
  transform: translateX(-100%);
  animation: heroScan 7s ease-in-out infinite;
}

@keyframes heroScan {
  0%, 16% { transform: translateX(-100%); opacity: 0; }
  24%, 62% { opacity: .78; }
  78%, 100% { transform: translateX(100%); opacity: 0; }
}

.hero-data-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(150px, 190px);
  gap: 14px;
  max-width: 650px;
  margin-top: 54px;
}

.stage-panel {
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 16px;
  background: rgba(12, 13, 15, .46);
  box-shadow: 0 24px 60px rgba(0,0,0,.22);
  backdrop-filter: blur(14px);
}

.stage-main {
  min-height: 204px;
  padding: 18px;
  animation: panelFloat 6s ease-in-out infinite;
}

.stage-side {
  align-self: end;
  display: grid;
  gap: 10px;
  min-height: 136px;
  padding: 18px;
  animation: panelFloat 6s ease-in-out infinite .8s;
}

@keyframes panelFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.stage-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: rgba(255,255,255,.66);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}

.stage-head em {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #d8b35b;
  box-shadow: 0 0 0 6px rgba(216,179,91,.12);
  animation: statusPulse 1.9s ease-in-out infinite;
}

@keyframes statusPulse {
  0%, 100% { transform: scale(.86); opacity: .7; }
  50% { transform: scale(1); opacity: 1; }
}

.stage-chart {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  align-items: end;
  gap: 9px;
  height: 92px;
  margin: 26px 0 18px;
  padding: 0 4px;
}

.stage-chart span {
  height: var(--h);
  min-height: 16px;
  border-radius: 999px 999px 2px 2px;
  background: linear-gradient(180deg, #f6d477, rgba(246,212,119,.18));
  transform-origin: bottom;
  animation: chartBreath 2.8s ease-in-out infinite;
}

.stage-chart span:nth-child(2n) {
  animation-delay: .35s;
}

.stage-chart span:nth-child(3n) {
  animation-delay: .7s;
}

@keyframes chartBreath {
  0%, 100% { transform: scaleY(.72); opacity: .66; }
  50% { transform: scaleY(1); opacity: 1; }
}

.stage-table {
  display: grid;
  grid-template-columns: 1.1fr .7fr .9fr;
  gap: 7px;
}

.stage-table i {
  height: 9px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  overflow: hidden;
}

.stage-table i::after {
  content: "";
  display: block;
  width: 58%;
  height: 100%;
  border-radius: inherit;
  background: rgba(255,255,255,.42);
  transform: translateX(-100%);
  animation: rowStream 3.2s ease-in-out infinite;
}

.stage-table i:nth-child(3n)::after {
  width: 76%;
  animation-delay: .45s;
}

.stage-table i:nth-child(4n)::after {
  width: 42%;
  animation-delay: .9s;
}

@keyframes rowStream {
  0%, 10% { transform: translateX(-100%); }
  56%, 100% { transform: translateX(180%); }
}

.stage-side span {
  color: rgba(255,255,255,.58);
  font-size: 12px;
  font-weight: 900;
}

.stage-side strong {
  color: #fff;
  font-size: 28px;
  letter-spacing: .04em;
}

.stage-line {
  height: 2px;
  overflow: hidden;
  background: rgba(255,255,255,.16);
}

.stage-line::after {
  content: "";
  display: block;
  width: 46%;
  height: 100%;
  background: #d8b35b;
  animation: lineRun 2.4s ease-in-out infinite;
}

@keyframes lineRun {
  from { transform: translateX(-100%); }
  to { transform: translateX(240%); }
}

.stage-ribbon {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  overflow: hidden;
  padding: 0 2px;
}

.stage-ribbon span {
  flex: 0 0 auto;
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: rgba(255,255,255,.72);
  background: rgba(255,255,255,.08);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  animation: ribbonDrift 9s linear infinite;
}

@keyframes ribbonDrift {
  from { transform: translateX(0); }
  to { transform: translateX(-92px); }
}

.login-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.login-meta span {
  min-height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid #ebe4d5;
  border-radius: 999px;
  color: #7b612c;
  background: #fbf6e8;
  font-size: 12px;
  font-weight: 900;
}

.check-line {
  align-items: center;
}

.check-line input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-height: 16px;
  padding: 0;
  border-radius: 4px;
  accent-color: #151515;
}

.login-card label {
  animation: fadeUp .36s ease both;
}

.login-card label:nth-of-type(2) {
  animation-delay: .08s;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.home-command {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(260px, 360px) 1fr minmax(280px, 380px);
  gap: 18px;
  align-items: stretch;
  margin: -28px 0 28px;
}

.command-copy,
.command-track,
.command-stats {
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 18px;
  background: rgba(255,255,255,.08);
  box-shadow: 0 20px 60px rgba(0,0,0,.16);
  backdrop-filter: blur(16px);
}

.command-copy {
  display: grid;
  gap: 7px;
  padding: 22px;
  color: #fff;
}

.command-copy span {
  color: #d8b35b;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}

.command-copy strong {
  font-size: 26px;
  line-height: 1.12;
}

.command-copy em {
  color: rgba(255,255,255,.58);
  font-style: normal;
  line-height: 1.6;
}

.command-track {
  position: relative;
  overflow: hidden;
  min-height: 126px;
  padding: 22px;
}

.command-track::before {
  content: "";
  position: absolute;
  left: 22px;
  right: 22px;
  top: 50%;
  height: 1px;
  background: rgba(255,255,255,.2);
}

.command-track i {
  position: absolute;
  top: calc(50% - 5px);
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #d8b35b;
  box-shadow: 0 0 0 8px rgba(216,179,91,.09);
  animation: nodeMove 7s linear infinite;
}

.command-track i:nth-child(1) { animation-delay: 0s; }
.command-track i:nth-child(2) { animation-delay: -1s; }
.command-track i:nth-child(3) { animation-delay: -2s; }
.command-track i:nth-child(4) { animation-delay: -3s; }
.command-track i:nth-child(5) { animation-delay: -4s; }
.command-track i:nth-child(6) { animation-delay: -5s; }
.command-track i:nth-child(7) { animation-delay: -6s; }

@keyframes nodeMove {
  from { left: 20px; opacity: 0; }
  10%, 82% { opacity: 1; }
  to { left: calc(100% - 30px); opacity: 0; }
}

.command-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  overflow: hidden;
}

.command-stats span {
  display: grid;
  place-content: center;
  gap: 6px;
  min-height: 126px;
  padding: 16px;
  color: rgba(255,255,255,.58);
  text-align: center;
  font-size: 12px;
  font-weight: 900;
}

.command-stats span + span {
  border-left: 1px solid rgba(255,255,255,.12);
}

.command-stats b {
  color: #fff;
  font-size: 28px;
}

.module-card {
  position: relative;
  overflow: hidden;
  place-content: initial;
  text-align: left;
}

.module-card::after {
  content: "";
  position: absolute;
  inset: auto -28% -48% 18%;
  height: 140px;
  border: 1px solid rgba(255,255,255,.12);
  transform: rotate(-8deg);
  transition: transform .28s ease, border-color .28s ease;
}

.module-card:hover::after {
  border-color: rgba(216,179,91,.42);
  transform: rotate(-4deg) translateY(-10px);
}

.module-index {
  width: fit-content;
  color: #d8b35b !important;
  font-size: 13px !important;
  font-weight: 900;
  letter-spacing: .12em;
}

.module-arrow {
  position: absolute;
  right: 28px;
  bottom: 24px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 999px;
  color: inherit !important;
  opacity: .54;
  transition: opacity .2s ease, transform .2s ease;
}

.module-card:hover .module-arrow {
  opacity: 1;
  transform: translateX(4px);
}

.desk-ribbon {
  display: none !important;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.desk-ribbon div {
  position: relative;
  overflow: hidden;
  min-height: 74px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.82);
  box-shadow: var(--soft-shadow);
}

.desk-ribbon div::after {
  content: "";
  position: absolute;
  left: -40%;
  top: 0;
  width: 36%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(155,122,51,.12), transparent);
  animation: cardSweep 7s ease-in-out infinite;
}

.desk-ribbon div:nth-child(2)::after {
  animation-delay: 1.2s;
}

.desk-ribbon div:nth-child(3)::after {
  animation-delay: 2.4s;
}

@keyframes cardSweep {
  0%, 18% { transform: translateX(0); opacity: 0; }
  28%, 62% { opacity: 1; }
  84%, 100% { transform: translateX(420%); opacity: 0; }
}

.desk-ribbon span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.desk-ribbon strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.14;
}

.client-title-line {
  position: relative;
  overflow: hidden;
}

.client-title-line::before {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, #9b7a33, transparent);
}

.unified-report,
.loading-board,
.placeholder-shell {
  animation: none;
}

@keyframes reportEnter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.report-title-row,
.aniu-head {
  position: relative;
  padding-left: 18px;
}

.report-title-row::before,
.aniu-head::before {
  content: "";
  position: absolute;
  left: 0;
  top: 2px;
  bottom: 18px;
  width: 3px;
  border-radius: 999px;
  background: #9b7a33;
}

.live-badge {
  position: relative;
  overflow: hidden;
}

.live-badge::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 7px;
  border-radius: 999px;
  background: currentColor;
  animation: statusPulse 1.8s ease-in-out infinite;
}

.table-wrap {
  position: relative;
}

.table-wrap::before {
  content: "";
  position: sticky;
  left: 0;
  top: 0;
  z-index: 4;
  display: block;
  height: 0;
  box-shadow: 0 14px 30px rgba(17,17,17,.08);
}

.source-table tbody tr {
  animation: none;
}

.source-table tbody tr:nth-child(2n),
.source-table tbody tr:nth-child(3n),
.source-table tbody tr:nth-child(4n) { animation-delay: 0s; }

@keyframes rowAppear {
  from { opacity: .68; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1180px) {
  .hero-data-stage,
  .home-command,
  .desk-ribbon {
    grid-template-columns: 1fr;
  }

  .stage-ribbon {
    grid-column: auto;
  }

  .command-stats {
    grid-template-columns: 1fr;
  }

  .command-stats span + span {
    border-top: 1px solid rgba(255,255,255,.12);
    border-left: 0;
  }
}

@media (max-width: 720px) {
  .hero-data-stage,
  .home-command,
  .desk-ribbon {
    display: none;
  }

  .login-meta {
    grid-template-columns: 1fr;
  }
}

/* Login refinement after visual review: fuller layout, calmer hero widget */
.login-screen {
  min-height: 100vh;
  grid-template-columns: minmax(720px, 1fr) minmax(390px, 430px);
  gap: clamp(28px, 3vw, 48px);
  align-items: stretch;
  padding: 28px clamp(34px, 6vw, 96px);
}

.login-visual {
  min-height: calc(100vh - 56px);
  padding: clamp(48px, 5vw, 76px);
  align-content: start;
}

.login-visual h1 {
  max-width: 660px;
  margin-top: 18px;
}

.login-visual p:not(.eyebrow) {
  max-width: 560px;
}

.hero-scan {
  display: none;
}

.hero-data-stage {
  grid-template-columns: minmax(360px, 500px) minmax(170px, 220px);
  gap: 18px;
  margin-top: auto;
  padding-top: 36px;
}

.stage-ribbon {
  display: none !important;
}

.stage-main,
.stage-side,
.stage-chart span,
.stage-table i::after,
.stage-line::after,
.stage-head em {
  animation: none !important;
}

.stage-panel {
  border-color: rgba(255,255,255,.22);
  background: rgba(9, 11, 14, .58);
  box-shadow: none;
}

.stage-main {
  min-height: 188px;
  padding: 20px;
}

.stage-side {
  min-height: 132px;
  align-self: end;
  padding: 20px;
}

.stage-head span {
  color: rgba(255,255,255,.78);
  letter-spacing: .04em;
}

.stage-head em {
  width: 8px;
  height: 8px;
  background: #d8b35b;
  box-shadow: 0 0 0 5px rgba(216,179,91,.12);
}

.stage-chart {
  height: 76px;
  margin: 22px 0 18px;
}

.stage-chart span {
  opacity: .86;
  transform: none !important;
}

.stage-table i::after {
  transform: none;
  width: 62%;
}

.stage-side strong {
  font-size: 24px;
  letter-spacing: 0;
}

.stage-line::after {
  width: 56%;
  transform: none;
}

.login-card {
  align-self: center;
  min-height: 548px;
  padding: 46px;
}

.login-card h2 {
  margin-bottom: 4px;
}

.login-meta {
  margin-bottom: 4px;
}

@media (min-width: 1600px) {
  .login-screen {
    grid-template-columns: minmax(980px, 1fr) 430px;
    gap: 36px;
  }

  .login-visual {
    min-height: calc(100vh - 56px);
  }
}

@media (max-width: 1180px) {
  .login-screen {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .login-visual {
    min-height: 620px;
  }

  .login-card {
    width: min(100%, 520px);
    justify-self: center;
  }
}

/* HR module */
.module-grid {
  grid-template-columns: repeat(3, minmax(240px, 1fr));
}

.hr-title-note {
  display: grid;
  gap: 4px;
  justify-items: end;
  min-width: min(520px, 100%);
  color: var(--muted);
  text-align: right;
}

.hr-title-note span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.hr-title-note strong {
  color: var(--ink);
  font-size: 18px;
}

.hr-title-note em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.5;
}

.hr-page {
  min-height: calc(100vh - 248px);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--soft-shadow);
  animation: none;
}

.hr-stats-page {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.hr-hero-card {
  display: grid;
  align-items: center;
  min-height: 150px;
  padding: 26px;
  overflow: hidden;
  border: 1px solid #e8e2d2;
  border-radius: 14px;
  background:
    linear-gradient(100deg, rgba(246,241,228,.96), rgba(255,255,255,.82)),
    radial-gradient(circle at 86% 38%, rgba(155,122,51,.14), transparent 34%);
}

.hr-hero-card h2 {
  margin: 8px 0 10px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.12;
}

.hr-hero-card p:not(.eyebrow) {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  font-weight: 700;
}

.hr-kpi-grid,
.hr-education-row {
  display: grid;
  gap: 12px;
}

.hr-kpi-grid {
  grid-template-columns: repeat(3, 1fr);
}

.hr-education-row {
  grid-template-columns: repeat(5, 1fr);
}

.hr-kpi {
  min-height: 108px;
  display: grid;
  align-content: center;
  gap: 10px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbf8;
}

.hr-kpi span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.hr-kpi strong {
  color: var(--ink);
  font-size: 34px;
  line-height: 1;
}

.hr-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.hr-chart-card {
  min-height: 260px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.hr-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 18px;
}

.hr-card-head strong {
  color: var(--ink);
  font-size: 20px;
}

.hr-card-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hr-empty-visual {
  min-height: 176px;
  display: grid;
  place-items: center;
  border: 1px dashed #d8d0be;
  border-radius: 12px;
  color: var(--muted);
  background:
    linear-gradient(90deg, rgba(17,17,17,.03) 1px, transparent 1px),
    linear-gradient(rgba(17,17,17,.03) 1px, transparent 1px),
    #fbfbf8;
  background-size: 32px 32px;
  font-weight: 900;
}

.hr-bars {
  display: grid;
  gap: 12px;
}

.hr-bar-row {
  display: grid;
  grid-template-columns: 96px 1fr 42px;
  gap: 10px;
  align-items: center;
}

.hr-bar-row span,
.hr-bar-row em {
  color: var(--muted);
  font-style: normal;
  font-weight: 900;
}

.hr-bar-row i {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #f1eee5;
}

.hr-bar-row i::after {
  content: "";
  display: block;
  width: var(--bar);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #151515, #9b7a33);
}

.hr-query-page {
  padding: 18px;
}

.hr-query-panel {
  min-height: calc(100vh - 286px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
}

.hr-query-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.hr-query-input-label {
  flex: 1;
  min-width: 260px;
}

.hr-query-results {
  min-height: 420px;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.hr-query-empty {
  min-height: 260px;
  display: grid;
  place-items: center;
  border: 1px dashed #d8d0be;
  border-radius: 12px;
  color: var(--muted);
  background:
    linear-gradient(90deg, rgba(17,17,17,.03) 1px, transparent 1px),
    linear-gradient(rgba(17,17,17,.03) 1px, transparent 1px),
    #fbfbf8;
  background-size: 32px 32px;
  font-weight: 900;
}

.hr-query-result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 900;
}

.hr-query-result-head strong {
  color: var(--ink);
  font-size: 20px;
}

.hr-query-detail {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.hr-query-detail-item {
  min-height: 84px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fbfbf8;
}

.hr-query-detail-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.hr-query-detail-item strong {
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
}

.hr-query-table-wrap {
  max-height: 360px;
}

.hr-query-table th,
.hr-query-table td {
  text-align: center;
  white-space: nowrap;
}

.hr-query-photo-cell img {
  width: 44px;
  height: 56px;
  object-fit: cover;
  border-radius: 8px;
  vertical-align: middle;
}

.hr-roster-page {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
}

.hr-roster-filter {
  justify-content: flex-start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.hr-roster-name-search input {
  min-width: 190px;
}

.hr-roster-actions {
  justify-content: flex-end;
  gap: 10px;
}

.hr-roster-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.hr-roster-count strong {
  color: var(--ink);
}

.hr-quality-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.hr-quality-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.hr-quality-item {
  min-width: 0;
  min-height: 112px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border: 1px solid #dfe7df;
  border-radius: 12px;
  background: #f4fbf6;
}

.hr-quality-item.has-issue {
  border-color: #f2c3bd;
  background: #fff3f1;
}

.hr-quality-item div {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.hr-quality-item strong {
  color: var(--ink);
  font-size: 14px;
}

.hr-quality-item span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  text-overflow: ellipsis;
}

.hr-quality-item em {
  flex: 0 0 auto;
  color: #16794b;
  font-size: 24px;
  font-style: normal;
  font-weight: 950;
}

.hr-quality-item.has-issue em {
  color: #c53326;
}

.hr-table-wrap {
  height: calc(100vh - 300px);
  min-height: 420px;
}

.hr-table th,
.hr-table td {
  min-width: 172px;
  white-space: nowrap;
}

.hr-table th:nth-child(1),
.hr-table td:nth-child(1) {
  left: 0;
  width: 84px;
  min-width: 84px;
  max-width: 84px;
}

.hr-table th:nth-child(2),
.hr-table td:nth-child(2) {
  position: sticky;
  left: 84px;
  z-index: 5;
  width: 130px;
  min-width: 130px;
  max-width: 130px;
  background: inherit;
}

.hr-table th:nth-child(3),
.hr-table td:nth-child(3) {
  position: sticky;
  left: 214px;
  z-index: 6;
  width: 150px;
  min-width: 150px;
  max-width: 150px;
  background: inherit;
  box-shadow: 1px 0 0 #d8e0e8, 8px 0 14px rgba(15, 23, 42, .05);
}

.hr-table th:nth-child(1),
.hr-table th:nth-child(2),
.hr-table th:nth-child(3) {
  z-index: 34;
  background: #f6f8fb;
}

.hr-table th.hr-action-column,
.hr-table td.hr-action-column {
  position: sticky;
  right: 0;
  z-index: 3;
  min-width: 190px;
  width: 190px;
  padding: 6px 10px;
  background: #fff;
  text-align: center;
  box-shadow: -1px 0 0 #e7ebef;
}

.hr-table th.hr-action-column {
  z-index: 32;
  background: linear-gradient(180deg, #f6f9fc, #edf3f8);
}

.hr-row-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.hr-history-button,
.hr-delete-button,
.hr-restore-button {
  min-width: 78px;
  height: 34px;
  border: 0;
  border-radius: 7px;
  font-weight: 900;
  cursor: pointer;
}

.hr-history-button {
  background: #e8f1fb;
  color: #1d4e89;
}

.hr-history-button:hover,
.hr-history-button.active {
  background: #1d4e89;
  color: #fff;
}

.hr-delete-button {
  background: #dc2626;
  color: #fff;
}

.hr-delete-button:hover {
  background: #b91c1c;
}

.hr-restore-button {
  background: #16794b;
  color: #fff;
}

.hr-restore-button:hover {
  background: #0f603b;
}

.hr-table .hr-history-cell {
  padding: 0;
  white-space: normal;
  background: #f6f9fc;
}

.hr-history-panel {
  position: sticky;
  left: 0;
  width: min(1100px, calc(100vw - 330px));
  min-width: 720px;
  padding: 16px;
  border-right: 1px solid #d9e2ec;
  background: #f6f9fc;
}

.hr-history-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.hr-history-heading strong {
  color: #172033;
  font-size: 15px;
}

.hr-history-heading span {
  color: #6b7280;
  font-size: 12px;
}

.hr-history-table-wrap {
  max-height: 300px;
  overflow: auto;
  border: 1px solid #dce4ec;
  border-radius: 10px;
  background: #fff;
}

.hr-history-table {
  width: 100%;
  min-width: 870px;
  border-collapse: collapse;
  table-layout: fixed;
}

.hr-table .hr-history-table th,
.hr-table .hr-history-table td {
  position: static;
  left: auto;
  width: auto;
  min-width: 0;
  max-width: none;
  padding: 9px 12px;
  border-right: 1px solid #edf0f3;
  border-bottom: 1px solid #edf0f3;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  vertical-align: top;
  box-shadow: none;
}

.hr-table .hr-history-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #eef3f8;
  color: #374151;
  font-size: 12px;
}

.hr-history-table th:nth-child(1),
.hr-history-table td:nth-child(1) {
  width: 165px;
}

.hr-history-table th:nth-child(2),
.hr-history-table td:nth-child(2) {
  width: 105px;
}

.hr-history-table th:nth-child(3),
.hr-history-table td:nth-child(3) {
  width: 100px;
}

.hr-history-table th:nth-child(4),
.hr-history-table td:nth-child(4),
.hr-history-table th:nth-child(5),
.hr-history-table td:nth-child(5) {
  width: 205px;
}

.hr-history-table th:nth-child(6),
.hr-history-table td:nth-child(6) {
  width: 90px;
  text-align: center;
}

.hr-history-delete-button {
  min-width: 76px;
  height: 30px;
  border: 1px solid #fecaca;
  border-radius: 7px;
  background: #fff1f2;
  color: #b91c1c;
  font-weight: 800;
  cursor: pointer;
}

.hr-history-delete-button:hover {
  border-color: #ef4444;
  background: #dc2626;
  color: #fff;
}

.hr-history-empty,
.hr-history-state {
  color: #8a94a3;
}

.hr-history-state {
  padding: 18px;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  background: #fff;
  text-align: center;
}

.hr-edit-cell {
  padding: 4px 10px;
}

.hr-edit-cell:focus-within {
  position: relative;
  z-index: 30;
  overflow: visible;
}

.hr-edit-input {
  min-height: 32px;
  line-height: 32px;
  display: block;
  width: 100%;
  cursor: text;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 6px;
  transition: background-color .16s ease, box-shadow .16s ease;
}

.hr-edit-select {
  width: 100%;
  min-height: 36px;
  border: 1px solid #d9dee7;
  border-radius: 6px;
  background: #fff;
  color: #172033;
  font: inherit;
  padding: 0 8px;
}

.hr-edit-select:focus {
  outline: 2px solid rgba(155, 122, 51, .45);
  border-color: rgba(155, 122, 51, .55);
}

.hr-edit-select.saving { background: #fff7df; }
.hr-edit-select.saved { background: #eefaf3; }
.hr-edit-select.save-error { background: #fff1f1; color: #991b1b; }

.hr-edit-input:empty::before {
  content: "\00a0";
}

.hr-edit-input:focus {
  position: relative;
  z-index: 31;
  width: max-content;
  min-width: 100%;
  max-width: min(620px, calc(100vw - 390px));
  min-height: 36px;
  height: auto;
  padding: 4px 10px;
  line-height: 1.6;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: left;
  overflow: visible;
  outline: 2px solid rgba(155, 122, 51, .45);
  outline-offset: -2px;
  background: #fffdf5;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .16), inset 0 0 0 1px rgba(155, 122, 51, .3);
}

.hr-edit-input.saving {
  background: #fff7df;
}

.hr-edit-input.saved {
  background: #eefaf3;
}

.hr-edit-input.save-error {
  background: #fff1f1;
  color: #991b1b;
}

.hr-table .hr-auto-cell {
  padding: 4px 10px;
  background: #f4f7fa !important;
  color: #475569 !important;
  cursor: default;
}

.hr-table .hr-photo-cell {
  padding: 4px 8px;
  background: #fff !important;
}

.hr-photo-box {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.hr-photo-preview,
.hr-photo-placeholder {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 8px;
}

.hr-photo-preview {
  display: block;
  border: 1px solid #d8e1ea;
  background: #f4f7fa;
  object-fit: cover;
}

.hr-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
}

.hr-photo-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.hr-photo-upload-button,
.hr-photo-delete-button {
  min-width: 48px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.hr-photo-upload-button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.hr-photo-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.hr-photo-upload-button.loading {
  min-width: 68px;
  opacity: .7;
  pointer-events: none;
}

.hr-photo-error {
  color: #b91c1c;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
}

.hr-photo-delete-button {
  border: 1px solid #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}

.hr-photo-upload-button:hover {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.hr-photo-delete-button:hover {
  border-color: #dc2626;
  background: #dc2626;
  color: #fff;
}

.hr-auto-value {
  display: flex;
  min-height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  font-weight: 800;
  white-space: nowrap;
}

.hr-readonly-cell {
  background: #f8fafc !important;
  color: #475569;
}

.hr-sensitive-cell {
  background: #fff8ed !important;
}

.hr-table .hr-contract-reminder.level-notice {
  background: #fef08a !important;
  color: #713f12 !important;
}

.hr-table .hr-contract-reminder.level-warning {
  background: #fbbf24 !important;
  color: #422006 !important;
}

.hr-table .hr-contract-reminder.level-urgent {
  background: #fb7185 !important;
  color: #500724 !important;
}

.hr-table .hr-contract-reminder.level-critical {
  background: #e11d48 !important;
  color: #fff !important;
}

.hr-table .hr-contract-reminder.level-overdue {
  background: #7f1d1d !important;
  color: #fff !important;
  box-shadow: inset 0 0 0 2px #fecaca;
}

.hr-table .hr-contract-reminder.departed {
  background: #fff !important;
  color: #475569 !important;
  box-shadow: none;
}

.hr-contract-reminder.level-critical .hr-auto-value,
.hr-contract-reminder.level-overdue .hr-auto-value {
  text-shadow: 0 1px 1px rgba(0, 0, 0, .25);
}

.hr-table .empty-row td {
  height: 170px;
  color: var(--muted);
  background: #fbfbf8;
  font-size: 15px;
  font-weight: 900;
}

@media (max-width: 1180px) {
  .module-grid,
  .hr-kpi-grid,
  .hr-education-row,
  .hr-chart-grid,
  .hr-quality-grid {
    grid-template-columns: 1fr;
  }

  .hr-roster-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .hr-query-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .hr-query-detail {
    grid-template-columns: 1fr;
  }

  .hr-title-note {
    justify-items: start;
    text-align: left;
  }
}
