:root {
  --bg: #eef3f7;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #667085;
  --line: #d0d7de;
  --brand: #008556;
  --brand-dark: #006b45;
  --brand-soft: #e7f4ee;
  --blue-soft: #e8f1fb;
  --nav-ink: #243447;
  --danger: #b42318;
  --focus: #2563eb;
  --excel-line: #7f8a95;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(238, 243, 247, 0.94)),
    var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

body.auth-body {
  background:
    linear-gradient(90deg, rgba(246, 251, 249, 0.92) 0%, rgba(246, 251, 249, 0.68) 43%, rgba(246, 251, 249, 0.2) 100%),
    url("/static/images/login-report-workspace.png") center / cover no-repeat fixed;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 64px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(184, 192, 204, 0.74);
  box-shadow: 0 8px 24px rgba(25, 42, 62, 0.06);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--brand-dark);
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #008556, #2f75a8);
  border-radius: 8px;
  font-weight: 800;
  box-shadow: 0 10px 20px rgba(0, 107, 69, 0.18);
}

.topbar-main {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  background: #eef3f7;
  border: 1px solid #d8e0e8;
  border-radius: 8px;
}

.nav a {
  min-width: 72px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 6px;
  color: var(--nav-ink);
  text-align: center;
  border: 1px solid transparent;
  font-weight: 700;
}

.nav a:hover {
  background: #ffffff;
  color: var(--brand-dark);
}

.nav a.active {
  background: #ffffff;
  color: var(--brand-dark);
  border-color: #bcd4c9;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.09);
  font-weight: 700;
}

.topbar-clock {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #2d4054;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.topbar-clock span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d8e0e8;
  border-radius: 6px;
  background: rgba(248, 250, 252, 0.92);
}

.topbar-clock .clock-time {
  color: #055f46;
  background: var(--brand-soft);
  border-color: #b8ddcc;
  font-weight: 800;
}

.topbar-clock .clock-lunar {
  color: #1f4e79;
  background: var(--blue-soft);
  border-color: #c7d9eb;
}

.page.page-loading {
  opacity: 0.62;
  transition: opacity 120ms ease;
}

.logout-form {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-name {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  color: #24415f;
  background: #f8fafc;
  border: 1px solid #d8e0e8;
  border-radius: 6px;
  font-weight: 700;
}

.page {
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  padding: 20px 24px 48px;
}

.flash-stack {
  display: none;
  gap: 8px;
  margin-bottom: 14px;
}

.flash {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.flash-error {
  border-color: #fecdca;
  color: #912018;
  background: #fff6f5;
}

.flash-success {
  border-color: #abefc6;
  color: #067647;
  background: #f6fef9;
}

.toast-stack {
  position: fixed;
  top: 78px;
  right: 24px;
  z-index: 80;
  display: grid;
  gap: 10px;
  width: min(420px, calc(100vw - 32px));
  pointer-events: none;
}

.toast-item {
  padding: 12px 14px;
  color: #1f2933;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: auto;
}

.toast-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast-item.is-leaving {
  opacity: 0;
  transform: translateY(-8px);
}

.toast-success {
  color: #05603a;
  border-left-color: #079455;
  background: rgba(246, 254, 249, 0.98);
}

.toast-error {
  color: #912018;
  border-left-color: #d92d20;
  background: rgba(255, 246, 245, 0.98);
}

.auth-wrap {
  min-height: calc(100vh - 104px);
  display: grid;
  align-items: center;
}

.auth-stage {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  align-items: center;
  margin: 0 auto;
}

.auth-panel,
.toolbar-panel,
.side-panel,
.editor-panel,
.table-panel,
.user-list-panel,
.user-editor-panel,
.user-form,
.permission-panel,
.log-panel,
.error-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(25, 42, 62, 0.06);
}

.auth-panel {
  width: min(430px, 100%);
  padding: 30px;
  display: grid;
  gap: 18px;
  border-color: rgba(255, 255, 255, 0.78);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 24px 70px rgba(24, 43, 62, 0.18);
  backdrop-filter: blur(14px);
}

.auth-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 6px;
}

h1,
h2 {
  margin: 0;
  font-weight: 700;
}

h1 {
  font-size: 22px;
}

h2 {
  font-size: 16px;
}

label {
  display: grid;
  gap: 6px;
  color: #344054;
}

label > span {
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #b7c4d1;
  border-radius: 6px;
  padding: 10px 11px;
  background: #ffffff;
  color: var(--ink);
}

input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

textarea {
  min-height: 540px;
  resize: vertical;
  font-family: Consolas, "Microsoft YaHei", monospace;
  line-height: 1.5;
}

.primary-button,
.secondary-button,
.danger-button,
.text-button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0 14px;
  cursor: pointer;
  white-space: nowrap;
}

.primary-button {
  background: var(--brand);
  color: #ffffff;
}

.primary-button:hover {
  background: var(--brand-dark);
}

button:disabled,
button:disabled:hover {
  cursor: not-allowed;
  opacity: 0.55;
  background: #f3f6f8;
  color: #98a2b3;
  border-color: #d0d7de;
}

a.disabled-link,
a.disabled-link:hover {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.55;
  background: #f3f6f8;
  color: #98a2b3;
  border-color: #d0d7de;
}

.secondary-button,
.link-button {
  background: #ffffff;
  color: #344054;
  border-color: #b8c0cc;
}

.secondary-button:hover,
.link-button:hover {
  background: #f3f6f8;
}

.danger-button {
  background: #fff1f0;
  color: var(--danger);
  border-color: #fecdca;
}

.danger-button:hover {
  background: #fee4e2;
}

.text-button {
  background: transparent;
  color: #344054;
  border-color: transparent;
}

.text-button:hover {
  background: #f3f6f8;
}

.date-picker {
  position: relative;
  width: 100%;
}

.date-display {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 10px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid #b8c0cc;
  border-radius: 6px;
}

.date-display:hover {
  background: #f8fafc;
}

.date-display-icon {
  color: #667085;
  font-size: 14px;
}

.date-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 35;
  width: 336px;
  padding: 12px;
  color: #213244;
  background: #ffffff;
  border: 1px solid #cbd5e0;
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.28);
}

.date-popover[hidden] {
  display: none;
}

.calendar-head {
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.calendar-nav,
.calendar-month-label {
  min-height: 30px;
  color: #ffffff;
  background: #5b6f84;
  border: 1px solid #5b6f84;
  border-radius: 5px;
  cursor: pointer;
}

.calendar-month-label {
  font-weight: 700;
}

.calendar-nav:hover,
.calendar-month-label:hover {
  background: #4c6074;
}

.calendar-weekdays,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar-grid-with-week {
  grid-template-columns: 34px repeat(7, 1fr);
}

.calendar-weekday {
  text-align: center;
  color: #4c6074;
  background: #e9eff5;
  border-radius: 5px;
  padding: 4px 0;
  font-size: 12px;
}

.calendar-week-header {
  cursor: help;
  font-weight: 700;
}

.calendar-weekday:nth-child(6),
.calendar-weekday:nth-child(7) {
  color: #4c6074;
}

.calendar-grid-with-week .calendar-weekday:nth-child(7),
.calendar-grid-with-week .calendar-weekday:nth-child(8) {
  color: #35546e;
}

.calendar-grid {
  margin-top: 8px;
}

.calendar-day {
  min-width: 0;
  aspect-ratio: 1 / 1;
  padding: 0;
  color: #213244;
  background: #ffffff;
  border: 1px solid #e3e8ef;
  border-radius: 5px;
  cursor: pointer;
  font-size: 12px;
}

.calendar-day:hover {
  background: #eef4f1;
  border-color: #9bb8aa;
}

.calendar-day.day-rest {
  color: #2f6b47;
  background: #e8f4ec;
}

.calendar-day.day-holiday {
  color: #9e3030;
  background: #fde8e4;
  border-color: #f3b5ad;
}

.calendar-day.day-makeup {
  color: #8d6712;
  background: #fff4d6;
  border-color: #8d6712;
}

.calendar-day.other-month {
  opacity: 0.42;
}

.calendar-day.is-today {
  box-shadow: inset 0 0 0 1px #4c6074;
}

.calendar-day.is-selected {
  color: #ffffff;
  background: #4e8dbf;
  border-color: #4e8dbf;
  font-weight: 700;
}

.calendar-day.is-disabled,
.calendar-day.is-disabled:hover {
  cursor: not-allowed;
  opacity: 0.28;
  color: #c7cbd1;
  background: transparent;
  border-color: transparent;
  text-decoration: line-through;
}

.calendar-week-number {
  min-width: 0;
  aspect-ratio: 1 / 1;
  padding: 0;
  color: #4c6074;
  background: #f5f7fa;
  border: 1px solid #e3e8ef;
  border-radius: 5px;
  cursor: help;
  font-size: 12px;
}

.toolbar-panel {
  padding: 16px;
  margin-bottom: 16px;
}

.query-form {
  display: grid;
  grid-template-columns: minmax(300px, 1.5fr) 180px minmax(210px, 0.8fr) 210px 126px auto;
  gap: 14px;
  align-items: end;
}

.query-check-line {
  min-height: 43px;
  justify-content: center;
  align-self: end;
  padding: 0 10px;
  min-width: 126px;
  white-space: nowrap;
  color: #344054;
  background: #f8fafc;
  border: 1px solid #d8e0e8;
  border-radius: 6px;
}

.query-check-line span {
  white-space: nowrap;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.summary-band {
  margin-bottom: 14px;
  padding: 12px 14px;
  background: #ffffff;
  border: 1px solid #abefc6;
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  color: #164b35;
  font-weight: 600;
}

.preview-section {
  display: grid;
  gap: 10px;
}

.copy-status {
  min-height: 0;
  color: #175cd3;
  font-weight: 600;
}

.copy-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.copy-toolbar > span {
  font-weight: 700;
  color: #344054;
}

.copy-toolbar .copy-status {
  margin-left: auto;
  color: #175cd3;
  white-space: nowrap;
}

.copy-mini-action {
  min-height: 30px;
  padding: 0 10px;
}

.excel-shell {
  max-height: calc(100vh - 260px);
  overflow: auto;
  background: #ffffff;
  border: 1px solid var(--excel-line);
  border-radius: 8px;
}

.excel-table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  min-width: 2338px;
  width: 2338px;
}

.excel-table col:nth-child(1) { width: 58px; }
.excel-table col:nth-child(2) { width: 111px; }
.excel-table col:nth-child(3) { width: 88px; }
.excel-table col:nth-child(4) { width: 136px; }
.excel-table col:nth-child(5) { width: 153px; }
.excel-table col:nth-child(6) { width: 88px; }
.excel-table col:nth-child(7) { width: 88px; }
.excel-table col:nth-child(8) { width: 170px; }
.excel-table col:nth-child(9) { width: 153px; }
.excel-table col:nth-child(10) { width: 187px; }
.excel-table col:nth-child(11) { width: 204px; }
.excel-table col:nth-child(12) { width: 238px; }
.excel-table col:nth-child(13) { width: 136px; }
.excel-table col:nth-child(14) { width: 153px; }
.excel-table col:nth-child(15) { width: 88px; }
.excel-table col:nth-child(16) { width: 170px; }
.excel-table col:nth-child(17) { width: 170px; }

@media (min-width: 1600px) {
  .excel-table {
    min-width: 2965px;
    width: 2965px;
  }

  .excel-table col:nth-child(1) { width: 68px; }
  .excel-table col:nth-child(2) { width: 130px; }
  .excel-table col:nth-child(3) { width: 100px; }
  .excel-table col:nth-child(4) { width: 160px; }
  .excel-table col:nth-child(5) { width: 180px; }
  .excel-table col:nth-child(6) { width: 96px; }
  .excel-table col:nth-child(7) { width: 96px; }
  .excel-table col:nth-child(8) { width: 220px; }
  .excel-table col:nth-child(9) { width: 190px; }
  .excel-table col:nth-child(10) { width: 230px; }
  .excel-table col:nth-child(11) { width: 260px; }
  .excel-table col:nth-child(12) { width: 320px; }
  .excel-table col:nth-child(13) { width: 180px; }
  .excel-table col:nth-child(14) { width: 220px; }
  .excel-table col:nth-child(15) { width: 105px; }
  .excel-table col:nth-child(16) { width: 230px; }
  .excel-table col:nth-child(17) { width: 230px; }
}

.excel-table th,
.excel-table td {
  border-right: 1px solid var(--excel-line);
  border-bottom: 1px solid var(--excel-line);
  padding: 7px 8px;
  height: 34px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  background: #ffffff;
}

.excel-table th {
  font-weight: 700;
  text-align: center;
}

.excel-table thead {
  position: sticky;
  top: 0;
  z-index: 12;
}

.copy-row th {
  height: 38px;
  white-space: pre-line;
}

.header-row th {
  height: 56px;
  color: #ffffff;
  background: #008556;
  white-space: normal;
  line-height: 1.25;
}

.copy-sec-0 { color: #344054 !important; background: #e7ecf2 !important; }
.copy-sec-1 { color: #7a4a00 !important; background: #ffe599 !important; }
.copy-sec-2 { color: #1f4e79 !important; background: #cfe2f3 !important; }
.copy-sec-3 { color: #27633a !important; background: #d9ead3 !important; }
.copy-sec-4 { color: #8a2e2e !important; background: #f4cccc !important; }

.copyable {
  cursor: copy;
}

.copyable:hover {
  filter: brightness(0.97);
}

.freeze-col {
  position: sticky;
  left: 0;
  z-index: 6;
  box-shadow: 1px 0 0 var(--excel-line);
}

.freeze-col-0 {
  left: 0;
}

.freeze-col-1 {
  left: 58px;
}

@media (min-width: 1600px) {
  .freeze-col-1 {
    left: 68px;
  }
}

.header-row .freeze-col {
  z-index: 15;
  background: #008556;
}

.row-odd td {
  background: #ffffff;
}

.row-even td {
  background: #f3f8f6;
}

.row-latest td {
  background: #fff2cc;
  font-weight: 700;
}

.data-row {
  cursor: pointer;
}

.data-row.copy-selected.row-odd td,
.data-row.copy-selected.row-even td {
  background: #eef6ff;
}

.data-row.copy-selected.row-latest td {
  background: #fff2cc;
}

.data-row.copy-selected td {
  box-shadow: inset 0 1px 0 rgba(23, 92, 211, 0.45), inset 0 -1px 0 rgba(23, 92, 211, 0.22);
}

.data-row.copy-selected td:first-child {
  box-shadow: inset 4px 0 0 #175cd3, inset 0 1px 0 rgba(23, 92, 211, 0.45), inset 0 -1px 0 rgba(23, 92, 211, 0.22);
}

.summary-row td {
  background: #d9ead3;
  font-weight: 700;
}

.summary-row .cell-summary-average {
  background: #cfe2f3;
}

.cell-date,
.cell-integer:first-child,
.cell-text,
.cell-summary-text {
  text-align: center;
}

.cell-money,
.cell-integer,
.cell-summary-money,
.cell-summary-integer,
.cell-summary-average {
  text-align: right;
}

.detail-cell {
  cursor: pointer;
  color: #175cd3;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.modal-backdrop[hidden] {
  display: none;
}

.detail-modal {
  width: min(1480px, calc(100vw - 48px));
  max-height: 86vh;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.24);
}

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

.detail-summary {
  color: #164b35;
  font-weight: 700;
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
}

.detail-table-wrap {
  overflow: auto;
  border: 1px solid var(--excel-line);
  border-radius: 6px;
  background: #ffffff;
}

.detail-table {
  margin-top: 0;
  min-width: 1360px;
  table-layout: fixed;
}

.note-list {
  color: #666666;
  font-style: italic;
  display: grid;
  gap: 4px;
}

.note-list p {
  margin: 0;
}

.log-panel {
  margin-top: 16px;
  padding: 14px;
}

.log-panel pre {
  margin: 10px 0 0;
  max-height: 260px;
  overflow: auto;
  color: #344054;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  white-space: pre-wrap;
}

.split-layout,
.users-layout {
  display: grid;
  grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  gap: 16px;
}

.side-panel,
.editor-panel,
.table-panel,
.user-list-panel,
.user-editor-panel,
.user-form,
.permission-panel,
.wide-panel,
.error-panel {
  padding: 18px;
}

.config-list {
  display: grid;
  gap: 6px;
  margin: 14px 0 18px;
}

.config-list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 6px;
  border-radius: 6px;
  border: 1px solid transparent;
}

.config-list-row a,
.empty-text {
  display: block;
  padding: 9px 10px;
  border-radius: 6px;
  color: #344054;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.config-list-row:hover,
.config-list-row.active {
  background: #eef4f1;
  border-color: #cfe5da;
  color: var(--brand-dark);
}

.config-list-row form {
  margin: 0;
}

.icon-danger-button {
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  color: #b42318;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.icon-danger-button:hover {
  background: #fee4e2;
  border-color: #fecdca;
}

.upload-form {
  display: grid;
  gap: 10px;
}

.editor-panel form,
.user-form,
.profile-form {
  display: grid;
  gap: 14px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #e4eaf0;
}

.user-list-panel,
.user-editor-panel {
  margin-bottom: 16px;
}

.user-table th,
.user-table td {
  white-space: nowrap;
}

.user-table td:nth-child(5) {
  white-space: normal;
  min-width: 260px;
}

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

.strong-cell {
  font-weight: 700;
}

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

.inline-form {
  display: inline;
}

.compact-button {
  min-height: 30px;
  padding: 0 10px;
}

form.ajax-submitting button[disabled] {
  cursor: wait;
  opacity: 0.78;
}

.user-form-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(220px, 1fr) minmax(360px, 1.4fr);
  gap: 14px;
  align-items: end;
}

.user-form-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.readonly-input {
  background: #f3f6f8;
  color: #475467;
}

.password-field {
  min-width: 0;
}

.user-option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.full-button {
  width: 100%;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 860px);
  gap: 18px;
  align-items: start;
}

.profile-summary-panel,
.profile-form-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(25, 42, 62, 0.06);
}

.profile-summary-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.profile-avatar {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #008556, #2f75a8);
  border-radius: 8px;
  font-size: 24px;
  font-weight: 800;
}

.profile-facts {
  display: grid;
  gap: 10px;
  margin: 0;
}

.profile-facts div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid #e4eaf0;
}

.profile-facts dt {
  color: var(--muted);
}

.profile-facts dd {
  margin: 0;
  color: #1d344c;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.profile-form-card {
  padding: 22px;
}

.form-section-title {
  padding-bottom: 8px;
  border-bottom: 1px solid #e4eaf0;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
}

.profile-single-grid {
  grid-template-columns: minmax(0, 1fr);
}

.form-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding-top: 4px;
}

.form-actions .primary-button,
.form-actions .secondary-button {
  min-width: 160px;
  min-height: 38px;
  font-weight: 700;
}

.profile-form-card .generate-password {
  color: #006b45;
  background: #e7f4ee;
  border-color: #9ed8bd;
}

.profile-form-card .generate-password:hover {
  background: #d9efe5;
  border-color: #6fc69d;
}

.wide-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.user-list-panel,
.permission-panel,
.table-panel {
  overflow-x: auto;
}

.password-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px auto;
  gap: 8px;
  align-items: center;
}

.password-tools input {
  min-width: 0;
}

.password-tools .icon-button {
  width: 40px;
  min-height: 38px;
  font-size: 15px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  border: 1px solid #b8c0cc;
  border-radius: 6px;
  background: #ffffff;
  color: #344054;
  cursor: pointer;
}

.icon-button:hover {
  background: #f3f6f8;
}

.eye-icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  background-repeat: no-repeat;
  background-position: center;
  background-size: 20px 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23344054' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49'/%3E%3Cpath d='M14.084 14.158a3 3 0 0 1-4.242-4.242'/%3E%3Cpath d='M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143'/%3E%3Cpath d='m2 2 20 20'/%3E%3C/svg%3E");
}

.toggle-password.is-visible .eye-icon {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23344054' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
}

.audit-table code {
  white-space: pre-wrap;
  word-break: break-word;
}

.audit-filter-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(180px, 1.2fr) minmax(140px, 1fr) minmax(220px, 2fr) auto auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}

.audit-page {
  padding-bottom: 86px;
}

.audit-pager {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 30;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 14px;
  color: #344054;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
}

.audit-pager label {
  display: flex;
  align-items: center;
  grid-gap: 6px;
  gap: 6px;
}

.audit-pager select {
  width: auto;
  min-width: 96px;
  padding: 6px 28px 6px 8px;
}

.audit-table details {
  max-width: 620px;
}

.audit-table summary {
  cursor: pointer;
  color: #344054;
}

.plain-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  background: #ffffff;
}

.plain-table th,
.plain-table td {
  border-bottom: 1px solid var(--line);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

.plain-table th {
  color: #475467;
  background: #f8fafc;
}

.plain-table.detail-table {
  border-collapse: separate;
  border-spacing: 0;
  margin-top: 0;
  font-variant-numeric: tabular-nums;
}

.plain-table.detail-table th,
.plain-table.detail-table td {
  border-right: 1px solid var(--excel-line);
  border-bottom: 1px solid var(--excel-line);
  padding: 8px 10px;
  height: 40px;
  vertical-align: middle;
}

.plain-table.detail-table th {
  color: #ffffff;
  background: #008556;
  text-align: center;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 1;
}

.plain-table.detail-table tbody tr:nth-child(odd) td {
  background: #ffffff;
}

.plain-table.detail-table tbody tr:nth-child(even) td {
  background: #f3f8f6;
}

.plain-table.detail-table .detail-date,
.plain-table.detail-table .detail-code,
.plain-table.detail-table .detail-index,
.plain-table.detail-table .detail-source {
  text-align: center;
}

.plain-table.detail-table .detail-number,
.plain-table.detail-table .detail-money {
  text-align: right;
}

.plain-table.detail-table .detail-empty {
  text-align: center;
  color: #667085;
  background: #f8fafc;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.check-line input {
  width: auto;
}

.config-checks {
  display: grid;
  gap: 8px;
  max-height: 160px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
}

.config-permission-panel {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfe;
}

.config-permission-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.field-title {
  font-weight: 700;
  color: #344054;
}

.config-check-item {
  padding: 6px 8px;
  border-radius: 6px;
}

.config-check-item:hover {
  background: #eef4f1;
}

.config-permission-panel.is-disabled {
  opacity: 0.62;
}

.config-permission-panel.is-disabled .config-checks {
  background: #f3f6f8;
}

.refresh-button {
  min-height: 32px;
  padding: 0 12px;
}

.permission-panel {
  margin-top: 16px;
}

.permission-chip {
  display: inline-flex;
  margin: 0 6px 6px 0;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef4f1;
  color: #176647;
  font-size: 12px;
}

.error-panel {
  display: grid;
  gap: 14px;
  max-width: 560px;
}

@media (max-width: 900px) {
  .topbar {
    padding: 10px 14px;
    gap: 10px;
    flex-wrap: wrap;
    min-height: 72px;
  }

  .topbar-main,
  .topbar-clock {
    width: 100%;
    flex-wrap: wrap;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
  }

  .nav a {
    min-width: 70px;
  }

  .topbar-clock span {
    min-height: 28px;
    padding: 0 8px;
  }

  .auth-stage {
    grid-template-columns: 1fr;
  }

  .auth-panel {
    width: min(430px, 100%);
  }

  body.auth-body {
    background:
      linear-gradient(180deg, rgba(246, 251, 249, 0.92), rgba(246, 251, 249, 0.72)),
      url("/static/images/login-report-workspace.png") center / cover no-repeat fixed;
  }

  .page {
    padding: 14px;
  }

  .query-form,
  .split-layout,
  .users-layout,
  .user-form-grid,
  .audit-filter-form,
  .profile-layout,
  .profile-form-grid {
    grid-template-columns: 1fr;
  }

  .logout-form {
    margin-left: 0;
  }

  .excel-shell {
    max-height: 62vh;
  }

  .audit-pager {
    width: calc(100vw - 28px);
    flex-wrap: wrap;
    bottom: 8px;
  }
}
