:root {
  --ink: #17211b;
  --muted: #66746d;
  --line: #dfe7e1;
  --paper: #fffdf7;
  --canvas: #f3efe5;
  --brand: #1c5c4f;
  --brand-2: #e6a93d;
  --danger: #ba3b2c;
  --success: #26764d;
  --shadow: 0 24px 70px rgba(32, 41, 35, 0.14);
  --font-sans: "Inter", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", "Source Han Sans SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(230, 169, 61, 0.25), transparent 26rem),
    radial-gradient(circle at 90% 12%, rgba(28, 92, 79, 0.16), transparent 28rem),
    linear-gradient(135deg, #f8f5ec 0%, #eef3ec 48%, #f8f5ec 100%);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  min-height: 100vh;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

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

table {
  font-size: 14px;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: stretch;
}

.login-hero {
  padding: 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.eyebrow {
  color: var(--brand);
  font-weight: 700;
  letter-spacing: 0.12em;
}

.login-hero h1 {
  font-size: clamp(36px, 5.6vw, 68px);
  line-height: 1.06;
  margin: 18px 0;
  max-width: 900px;
}

.login-hero p {
  color: var(--muted);
  font-size: 18px;
  max-width: 680px;
  line-height: 1.8;
}

.login-card {
  align-self: center;
  justify-self: center;
  width: min(430px, calc(100vw - 48px));
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid rgba(223, 231, 225, 0.9);
  border-radius: 30px;
  padding: 34px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.login-card h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.login-card p {
  margin: 0 0 24px;
  color: var(--muted);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.inline-field {
  margin-bottom: 0;
  min-width: 180px;
}

.field label {
  font-size: 14px;
  color: #435047;
}

.input,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffefb;
  min-height: 44px;
  padding: 10px 13px;
  outline: none;
}

.field textarea {
  min-height: 92px;
  resize: vertical;
}

.field.textarea-large textarea {
  min-height: 260px;
}

.field.policy-content-field textarea {
  min-height: 320px;
  line-height: 1.75;
}

.field.disabled-field input,
.field.disabled-field select {
  color: var(--muted);
  background: #f3f5f0;
  cursor: not-allowed;
}

.danger-text {
  color: #a84a3a;
  font-weight: 700;
}

.input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(28, 92, 79, 0.1);
}

.input-unit-wrap {
  position: relative;
  display: block;
}

.field-with-unit .input-unit-wrap input {
  padding-right: 54px;
}

.input-unit-suffix {
  position: absolute;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  pointer-events: none;
}

.btn {
  border: 0;
  border-radius: 14px;
  min-height: 42px;
  padding: 0 18px;
  background: #e7ebe6;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

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

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #23826b);
  box-shadow: 0 12px 26px rgba(28, 92, 79, 0.25);
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
}

.btn.danger {
  color: #fff;
  background: var(--danger);
}

.btn.small {
  min-height: 34px;
  border-radius: 11px;
  padding: 0 12px;
  font-size: 13px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
  transform: none;
  box-shadow: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background: rgba(23, 33, 27, 0.94);
  color: #eff5ef;
  overflow-y: auto;
}

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

.brand strong {
  display: block;
  font-size: clamp(20px, 1.6vw, 24px);
  line-height: 1.24;
  overflow-wrap: break-word;
}

.brand span {
  display: block;
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
}

.nav {
  display: grid;
  gap: 6px;
  margin-top: 18px;
}

.nav button {
  width: 100%;
  text-align: left;
  border: 0;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  padding: 12px;
  border-radius: 14px;
  cursor: pointer;
}

.nav button.active,
.nav button:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.subnav {
  display: flex;
  gap: 8px;
  align-items: center;
  align-content: flex-start;
  flex-wrap: wrap;
  max-height: min(30vh, 260px);
  overflow-y: auto;
  margin-bottom: 14px;
  padding-bottom: 2px;
  scrollbar-gutter: stable;
}

.subnav button {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 38px;
  padding: 0 14px;
  background: rgba(255, 253, 247, 0.78);
  color: var(--ink);
  cursor: pointer;
}

.subnav button.active,
.subnav button:hover {
  border-color: rgba(28, 92, 79, 0.38);
  background: var(--brand);
  color: #fff;
}

.project-brand-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.project-brand-header h2 {
  margin: 2px 0 0;
  font-size: 28px;
  color: var(--ink);
}

.project-brand-kicker {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.shining-lily-card {
  overflow: hidden;
}

.shining-lily-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 14px;
  border-bottom: 1px solid var(--line);
}

.shining-lily-head h2 {
  margin: 2px 0 0;
  font-size: 28px;
  color: var(--ink);
}

.shining-lily-head > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.shining-lily-note {
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.7;
}

.brand-subnav {
  margin-bottom: 18px;
}

.ai-accounting-panel {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.ledger-parameter-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 24px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
}

.ledger-parameter-note span {
  color: var(--muted);
  font-size: 13px;
}

.ai-accounting-panel > header,
.ai-accounting-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.ai-accounting-panel h3 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 20px;
}

.ai-accounting-panel header span,
.ai-accounting-empty span {
  color: var(--muted);
  font-size: 13px;
}

.ai-status {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

.ai-accounting-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.ai-accounting-cards div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.ai-accounting-cards span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.ai-accounting-cards strong {
  color: var(--ink);
  font-size: 18px;
}

.ai-warning-list {
  display: grid;
  gap: 6px;
  margin: 12px 0;
}

.ai-warning-list p,
.ai-review-text {
  border: 1px solid rgba(196, 128, 29, 0.24);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0;
  background: rgba(255, 246, 226, 0.78);
  color: var(--ink);
}

.ai-warning-list.quiet p {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.68);
}

.ai-review-text {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.72);
  margin-bottom: 12px;
}

.ai-review-text strong {
  display: block;
  margin-bottom: 6px;
}

.ai-review-text p {
  margin: 0;
  white-space: pre-wrap;
}

.ecommerce-analysis .education-report-title {
  margin-bottom: 16px;
}

.analysis-grid {
  display: grid;
  gap: 16px;
}

.store-accounting-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.store-accounting-metrics > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.66);
}

.store-accounting-metrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.store-accounting-metrics strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
}

.operating-calculation-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 18px;
  background: rgba(255, 255, 255, 0.68);
}

.operating-calculation-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.operating-calculation-panel h3,
.operating-calculation-panel p {
  margin: 0;
}

.operating-calculation-panel h3 {
  font-size: 18px;
  color: var(--ink);
}

.operating-calculation-panel header p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
}

.operating-calculation-panel header span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--green);
  background: rgba(255, 255, 255, 0.76);
  white-space: nowrap;
}

.operating-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.operating-source-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(249, 249, 245, 0.74);
}

.operating-source-grid span,
.operating-source-grid em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.operating-source-grid strong {
  display: block;
  color: var(--ink);
  font-size: 20px;
  margin: 5px 0 3px;
}

.operating-source-grid p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  margin-top: 8px;
}

.operating-formula-table {
  margin-bottom: 12px;
}

.operating-warning-list {
  display: grid;
  gap: 6px;
}

.operating-warning-list p {
  border: 1px solid rgba(196, 128, 29, 0.24);
  border-radius: 8px;
  padding: 9px 11px;
  margin: 0;
  color: var(--ink);
  background: rgba(255, 246, 226, 0.78);
}

.operating-warning-list.quiet p {
  border-color: var(--line);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.68);
}

.analysis-table-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
  overflow: hidden;
}

.analysis-table-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.analysis-table-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.analysis-table-card header span {
  color: var(--muted);
  font-size: 13px;
}

.analysis-table-card .mini-table-wrap {
  border-radius: 0;
  border: 0;
}

.ai-final-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.ai-final-action strong,
.ai-final-action span {
  display: block;
}

.ai-final-action span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
}

.ecommerce-import-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  padding: 18px 24px 24px;
}

.ecommerce-import-card {
  display: grid;
  gap: 14px;
  align-content: space-between;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.ecommerce-import-card h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 18px;
}

.ecommerce-import-card p {
  margin: 0;
  color: var(--muted);
}

.ecommerce-import-card span {
  display: block;
  margin-top: 10px;
  color: var(--ink);
  font-size: 13px;
}

.main {
  min-width: 0;
  padding: 26px;
}

.site-footer {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
  padding: 22px 10px 4px;
}

.site-footer a {
  color: var(--muted);
  text-decoration: none;
}

.site-footer a:hover {
  color: var(--brand);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
}

.user-pill {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 253, 247, 0.8);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 10px 12px;
}

.content-card {
  background: rgba(255, 253, 247, 0.86);
  border: 1px solid rgba(223, 231, 225, 0.86);
  border-radius: 26px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.content-card.filter-menu-open {
  overflow: visible;
}

.toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.employee-roster-card {
  overflow: hidden;
}

.employee-roster-toolbar {
  display: grid;
  gap: 14px;
  align-items: stretch;
  padding: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 253, 247, 0.88));
}

.employee-filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
  width: 100%;
}

.employee-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.1fr) minmax(180px, 0.82fr) minmax(300px, 1fr);
  gap: 12px;
  align-items: end;
  min-width: 0;
}

.employee-filter-field {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.employee-filter-field span {
  color: #506158;
  font-size: 12px;
  font-weight: 700;
}

.employee-filter-field .input,
.employee-date-inputs input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
}

.employee-date-inputs {
  display: grid;
  grid-template-columns: minmax(128px, 1fr) auto minmax(128px, 1fr);
  gap: 8px;
  align-items: center;
}

.employee-date-inputs i {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.employee-filter-actions,
.employee-roster-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.employee-filter-actions {
  align-items: end;
}

.employee-filter-actions .btn {
  min-width: 76px;
  height: 42px;
  justify-content: center;
}

.employee-roster-actions {
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px dashed rgba(170, 188, 178, 0.54);
}

.employee-roster-actions .btn {
  min-height: 40px;
}

@media (max-width: 1180px) {
  .employee-filter-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  .employee-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .employee-date-filter {
    grid-column: 1 / -1;
  }

  .employee-filter-actions,
  .employee-roster-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 720px) {
  .employee-roster-toolbar {
    padding: 14px;
  }

  .employee-filter-grid,
  .employee-date-inputs {
    grid-template-columns: minmax(0, 1fr);
  }

  .employee-date-inputs i {
    display: none;
  }

  .employee-filter-actions .btn,
  .employee-roster-actions .btn {
    flex: 1 1 140px;
  }
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.stat-card {
  background: rgba(255, 253, 247, 0.9);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 20px;
  box-shadow: 0 12px 35px rgba(32, 41, 35, 0.08);
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 26px;
}

.daily-block-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.daily-block-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.daily-block-modal {
  width: min(1180px, calc(100vw - 72px));
}

.daily-block-name-grid {
  grid-template-columns: minmax(260px, 1fr);
}

.daily-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 28px 12px;
}

.daily-detail-list {
  display: grid;
  gap: 12px;
  padding: 0 28px 24px;
}

.daily-detail-row {
  display: grid;
  grid-template-columns: 150px minmax(150px, 1fr) minmax(140px, 0.9fr) 130px minmax(220px, 1.4fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.95);
}

.daily-detail-row label,
.daily-detail-attachments {
  display: grid;
  gap: 6px;
}

.daily-detail-row span {
  color: var(--muted);
  font-size: 12px;
}

.daily-detail-row input {
  width: 100%;
}

.daily-detail-attachments .image-preview-grid {
  min-height: 38px;
}

@media (max-width: 1200px) {
  .daily-detail-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.dashboard-strip,
.ledger-month-strip {
  display: grid;
  grid-template-columns: minmax(190px, 0.8fr) minmax(360px, 2fr) auto;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(32, 41, 35, 0.08);
}

.ledger-month-strip {
  margin: 0 18px 18px;
}

.dashboard-strip span,
.ledger-month-strip span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.dashboard-strip strong,
.ledger-month-strip strong {
  display: block;
  margin-top: 6px;
  font-size: 26px;
}

.dashboard-strip dl,
.ledger-month-strip dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 12px;
  margin: 0;
}

.dashboard-strip dt,
.ledger-month-strip dt {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-strip dd,
.ledger-month-strip dd {
  margin: 4px 0 0;
  font-weight: 700;
  white-space: normal;
}

.dashboard-workbench {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.dashboard-task {
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.92);
  padding: 16px;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(32, 41, 35, 0.07);
}

.dashboard-task:hover {
  border-color: var(--brand);
}

.dashboard-task.warning {
  border-left: 5px solid var(--brand-2);
}

.dashboard-task.danger {
  border-left: 5px solid var(--danger);
}

.dashboard-task.info {
  border-left: 5px solid var(--brand);
}

.dashboard-task span,
.dashboard-task em {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.dashboard-task strong {
  display: block;
  margin: 8px 0;
  font-size: 24px;
}

.dashboard-note-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 14px;
  padding: 18px;
}

.dashboard-note-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.dashboard-note-grid p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.control-tower-hero {
  display: grid;
  grid-template-columns: minmax(320px, 1.5fr) minmax(360px, 1fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(32, 41, 35, 0.1);
  overflow: hidden;
}

.control-tower-title {
  padding: 24px;
}

.control-tower-title span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.control-tower-title h2 {
  margin: 10px 0 12px;
  font-size: 30px;
}

.control-tower-title p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.control-tower-kpis {
  display: grid;
  grid-template-columns: 1fr;
  border-left: 1px solid var(--line);
}

.control-tower-kpis > div {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.control-tower-kpis > div:last-child {
  border-bottom: 0;
}

.control-tower-kpis span,
.control-metric span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.control-tower-kpis strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.control-tower-kpis small,
.control-metric small {
  display: block;
  margin-top: 8px;
  color: #718078;
  font-size: 11px;
  line-height: 1.45;
}

.control-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.control-metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.92);
  padding: 16px;
  text-align: left;
  cursor: pointer;
}

.control-metric:hover {
  border-color: var(--brand);
  background: #fff;
}

.control-metric strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.control-metric em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.control-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.35fr) minmax(320px, 0.9fr);
  gap: 18px;
  margin-bottom: 18px;
}

.control-panel {
  border-radius: 8px;
}

.control-detail-panel,
.budget-control-card,
.settlement-control-card,
.risk-warning-card,
.profit-balance-card {
  margin-bottom: 18px;
  border-radius: 8px;
}

.profit-balance-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  padding: 16px;
}

.profit-balance-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.profit-balance-summary span,
.profit-balance-summary em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.profit-balance-summary strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 22px;
}

.profit-balance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(300px, 1fr));
  gap: 14px;
  padding: 0 16px 16px;
}

.profit-balance-row {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.profit-balance-row:hover {
  border-color: var(--brand);
}

.profit-balance-row.warning {
  border-left-color: var(--brand-2);
}

.profit-balance-row.danger {
  border-left-color: var(--danger);
}

.profit-balance-head {
  display: grid;
  grid-template-columns: 12px minmax(90px, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.profit-balance-head span {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--project-color, var(--brand));
}

.profit-balance-head em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.profit-scale {
  height: 10px;
  border-radius: 8px;
  background: #edf0eb;
  overflow: hidden;
}

.profit-scale i {
  display: block;
  height: 100%;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.profit-balance-row dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(90px, 1fr));
  gap: 10px;
  margin: 0;
}

.profit-balance-row dl > div {
  min-width: 0;
}

.profit-balance-row dt {
  color: var(--muted);
  font-size: 12px;
}

.profit-balance-row dd {
  margin: 3px 0 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.profit-balance-row p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.control-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
  padding: 16px;
}

.control-detail-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.control-detail-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 249, 244, 0.86);
}

.control-detail-card header div {
  display: grid;
  gap: 4px;
}

.control-detail-card header span {
  color: var(--muted);
  font-size: 12px;
}

.budget-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 12px;
  padding: 16px;
}

.settlement-summary {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.budget-summary > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.budget-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.budget-summary strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
}

.link-button {
  border: 0;
  background: none;
  color: var(--brand);
  font: inherit;
  font-weight: 800;
  padding: 0;
  cursor: pointer;
}

.risk-warning-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.risk-warning-row {
  display: grid;
  grid-template-columns: 130px 90px minmax(220px, 1fr) 120px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  background: #fff;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
}

.risk-warning-row.warning {
  border-left-color: #d68b19;
}

.risk-warning-row.danger {
  border-left-color: #b94545;
}

.risk-warning-row:hover {
  border-color: var(--brand);
}

.risk-warning-row span,
.risk-warning-row strong,
.risk-warning-row b {
  font-size: 13px;
}

.risk-warning-row em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.45;
}

.risk-warning-row b {
  text-align: right;
}

.ppt-workspace {
  display: grid;
  gap: 18px;
}

.integrated-payroll-shell {
  display: grid;
  gap: 18px;
}

.integrated-payroll-hero {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 22px;
  border-radius: 8px;
}

.integrated-payroll-hero span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
}

.integrated-payroll-hero h2 {
  margin: 8px 0;
  font-size: 30px;
}

.integrated-payroll-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.integrated-payroll-actions {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.integrated-payroll-note {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 14px;
  padding: 16px;
  border-radius: 8px;
}

.integrated-payroll-note > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.integrated-payroll-note strong,
.integrated-payroll-note span {
  display: block;
}

.integrated-payroll-note span {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.65;
}

.integrated-department-sheets {
  display: grid;
  gap: 18px;
}

.integrated-department-card {
  display: grid;
  gap: 14px;
}

.integrated-department-card > header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.integrated-department-card > header span {
  color: var(--muted);
  font-size: 13px;
}

.integrated-department-card h3 {
  margin: 4px 0 0;
  font-size: 22px;
}

.integrated-department-summary {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.integrated-department-summary span {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf6;
  color: #26352e;
}

.integrated-department-grid {
  display: grid;
  gap: 14px;
}

.ppt-control-card,
.ppt-ai-card,
.ppt-slide-card {
  border-radius: 8px;
}

.inline-month-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.inline-month-filter input {
  min-width: 150px;
}

.ppt-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  padding: 16px;
}

.ppt-summary-grid > div,
.ppt-metric-grid > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.ppt-summary-grid span,
.ppt-metric-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.ppt-summary-grid strong,
.ppt-metric-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  line-height: 1.15;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.ppt-ai-text {
  padding: 16px;
  line-height: 1.8;
  color: var(--text);
}

.ppt-slide-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.ppt-slide-card {
  min-width: 0;
  border: 1px solid var(--line);
  background: #fff;
  min-height: 280px;
  overflow: hidden;
}

.ppt-slide-card header {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(247, 249, 244, 0.86);
}

.ppt-slide-card header span,
.ppt-slide-card header em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.ppt-slide-card header strong {
  font-size: 18px;
}

.ppt-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  padding: 16px 16px 0;
}

.ppt-slide-card .mini-table-wrap {
  overflow-x: auto;
}

.ppt-slide-card .mini-table {
  min-width: 860px;
}

.ppt-trend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 14px;
  padding: 16px;
}

.ppt-trend-grid .line-chart-card {
  background: #fbfaf6;
}

.ppt-trend-grid .line-chart-svg {
  min-height: 190px;
}

.ppt-bullets {
  margin: 0;
  padding: 16px 28px;
  color: var(--text);
  line-height: 1.7;
}

.ppt-bullets li + li {
  margin-top: 8px;
}

.line-chart-section {
  margin-bottom: 18px;
  border-radius: 8px;
}

.annual-analysis-card {
  margin-bottom: 18px;
  border-radius: 8px;
}

.annual-analysis-toolbar {
  align-items: flex-start;
}

.annual-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  align-items: center;
}

.annual-metric-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.annual-metric-tabs button {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.annual-metric-tabs button.active {
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.annual-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 12px;
  padding: 16px 16px 0;
}

.annual-summary-grid > div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  min-width: 0;
}

.annual-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.annual-summary-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
  word-break: break-word;
}

.annual-project-grid {
  padding-top: 14px;
}

.line-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 14px;
  padding: 16px;
}

.line-chart-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.line-chart-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px 16px 10px;
}

.line-chart-card header strong {
  display: block;
  font-size: 16px;
}

.line-chart-card header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.line-chart-svg-wrap {
  padding: 4px 12px 0;
}

.line-chart-svg {
  display: block;
  width: 100%;
  min-height: 220px;
}

.line-chart-grid-line {
  stroke: #e5ece6;
  stroke-width: 1;
}

.line-chart-zero-line {
  stroke: #aebdb4;
  stroke-dasharray: 4 5;
  stroke-width: 1.2;
}

.line-chart-axis {
  fill: var(--muted);
  font-size: 11px;
}

.line-chart-line {
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-chart-point {
  fill: #fff;
  stroke-width: 2.5;
}

.line-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 0 16px 14px;
}

.line-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.line-chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.project-chart-card {
  margin-bottom: 18px;
  border-radius: 8px;
}

.project-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 14px;
  padding: 16px;
}

.project-chart-row {
  display: grid;
  grid-template-columns: 120px minmax(180px, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.project-chart-row:hover {
  border-color: var(--brand);
}

.project-chart-row strong,
.project-chart-row span {
  display: block;
}

.project-chart-row span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.project-chart-row dl {
  display: grid;
  grid-template-columns: 42px minmax(150px, 1fr);
  gap: 8px 10px;
  margin: 0;
  align-items: center;
}

.project-chart-row dt {
  color: var(--muted);
  font-size: 12px;
}

.project-chart-row dd {
  position: relative;
  min-height: 24px;
  margin: 0;
  border-radius: 8px;
  background: #eef3ef;
  overflow: hidden;
}

.project-chart-row dd i {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 8px;
  background: var(--brand);
}

.project-chart-row dd i.cost {
  background: #d69b35;
}

.project-chart-row dd i.loss {
  background: var(--danger);
}

.project-chart-row dd i.profit {
  background: var(--success);
}

.project-chart-row dd span {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 4px 8px;
  color: #17211b;
  font-size: 12px;
  font-weight: 700;
}

.payroll-filter-bar {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 0 16px 16px;
}

.payroll-search-field {
  min-width: min(360px, 100%);
}

.assistant-widget {
  position: fixed;
  right: 0;
  top: 50%;
  bottom: auto;
  z-index: 60;
  display: grid;
  justify-items: end;
  gap: 10px;
  transform: translateY(-50%);
}

.assistant-widget.open {
  right: 20px;
  top: auto;
  bottom: 20px;
  transform: none;
}

.assistant-fab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: #174f43;
  color: #fff;
  padding: 8px 8px 8px 10px;
  box-shadow: 0 14px 32px rgba(23, 33, 27, 0.2);
  cursor: pointer;
  font-weight: 800;
  writing-mode: vertical-rl;
}

.assistant-widget.open .assistant-fab {
  order: 2;
  writing-mode: horizontal-tb;
  border-right: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 8px;
  padding: 10px 12px 10px 10px;
}

.assistant-fab:hover {
  background: #216a59;
}

.assistant-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 8px;
  background: #fffdf7;
  color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(28, 92, 79, 0.18);
  writing-mode: horizontal-tb;
}

.assistant-widget.open .assistant-icon {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
}

.assistant-icon::before,
.assistant-icon::after {
  content: "";
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-2);
}

.assistant-icon::before {
  top: 7px;
  right: 8px;
}

.assistant-icon::after {
  left: 8px;
  bottom: 7px;
}

.assistant-icon span {
  position: relative;
  z-index: 1;
  font-size: 13px;
  font-weight: 900;
}

.assistant-fab-text {
  display: grid;
  gap: 2px;
  text-align: center;
  writing-mode: horizontal-tb;
}

.assistant-widget:not(.open) .assistant-fab-text {
  display: none;
}

.assistant-widget.open .assistant-fab-text {
  text-align: left;
}

.assistant-fab-text strong,
.assistant-fab-text em {
  display: block;
  line-height: 1.1;
}

.assistant-fab-text em {
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-style: normal;
  font-weight: 600;
}

.assistant-panel {
  width: min(520px, calc(100vw - 32px));
  max-height: min(620px, calc(100vh - 96px));
  display: grid;
  grid-template-rows: auto auto minmax(180px, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.98);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.assistant-panel header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  background: #f7faf4;
}

.assistant-panel header > div {
  flex: 1;
}

.assistant-panel .panel-icon {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
}

.assistant-panel header span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.assistant-quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.assistant-quick-actions button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbf7;
  color: var(--brand);
  padding: 7px 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.assistant-quick-actions button:hover {
  border-color: var(--brand);
  background: #eef6f1;
}

.assistant-messages {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 14px;
  overflow: auto;
}

.assistant-messages article {
  display: grid;
  gap: 8px;
}

.assistant-messages article p {
  margin: 0;
  border-radius: 8px;
  padding: 10px 12px;
  line-height: 1.55;
  white-space: pre-line;
}

.assistant-messages .assistant p {
  background: #eef4ef;
}

.assistant-messages .user p {
  justify-self: end;
  background: var(--brand);
  color: #fff;
}

.assistant-cards {
  display: grid;
  gap: 8px;
}

.assistant-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.assistant-card:hover {
  border-color: var(--brand);
}

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

.assistant-card span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.assistant-panel form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #fff;
}

.assistant-panel input {
  min-width: 0;
}

.log-standby-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.log-standby-status {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

.log-standby-status span {
  display: inline-flex;
  border-radius: 8px;
  background: rgba(214, 155, 53, 0.13);
  color: #956317;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
}

.log-standby-status strong {
  display: block;
  margin-top: 12px;
  font-size: 20px;
}

.log-standby-status p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
}

.log-standby-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}

.log-standby-steps article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.log-standby-steps strong,
.log-standby-steps span {
  display: block;
}

.log-standby-steps span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.system-log-table-wrap {
  margin: 0 16px 16px;
}

.log-time-cell {
  min-width: 190px;
  white-space: nowrap;
}

.permission-modules-cell {
  min-width: 180px;
  max-width: 320px;
  white-space: normal;
  line-height: 1.55;
}

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

.confirm-body {
  display: grid;
  gap: 12px;
  padding: 18px 24px;
  color: var(--text);
}

.confirm-body strong {
  font-size: 18px;
}

.confirm-body span {
  color: var(--muted);
  line-height: 1.55;
}

.account-permission-field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.account-permission-field > label {
  font-size: 14px;
  color: #435047;
}

.permission-picker {
  display: grid;
  gap: 12px;
  max-height: min(42vh, 420px);
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 253, 247, 0.78);
  scrollbar-gutter: stable;
}

.permission-picker.disabled {
  opacity: 0.62;
  background: #f3f5f0;
}

.permission-picker-bar,
.permission-option-group header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.permission-picker-bar span,
.permission-selected-count,
.permission-option small {
  color: var(--muted);
  font-size: 12px;
}

.permission-picker-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.permission-option-group {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(223, 231, 225, 0.82);
}

.permission-option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.permission-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: flex-start;
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffefb;
}

.permission-option input {
  margin-top: 3px;
}

.permission-option span,
.permission-option strong,
.permission-option small {
  display: block;
}

.permission-option strong {
  color: var(--ink);
  font-size: 13px;
}

.control-bars,
.cause-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.control-bar-row {
  display: grid;
  grid-template-columns: 90px minmax(150px, 1fr) 130px 190px;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
  text-align: left;
  cursor: pointer;
}

.control-bar-row:hover,
.cause-card:hover,
.erp-chain-node:hover {
  border-color: var(--brand);
}

.control-bar-row div {
  height: 10px;
  border-radius: 8px;
  background: #edf0eb;
  overflow: hidden;
}

.control-bar-row i {
  display: block;
  height: 100%;
  border-radius: 8px;
  background: var(--brand);
}

.control-bar-row span,
.control-bar-row em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.control-bar-row strong {
  color: #1f332b;
}

.cause-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.cause-card span {
  color: var(--muted);
  line-height: 1.55;
}

.erp-chain-card {
  margin-bottom: 18px;
  border-radius: 8px;
}

.erp-chain {
  display: grid;
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  gap: 12px;
  padding: 16px;
}

.erp-chain-node {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
  text-align: left;
  cursor: pointer;
}

.erp-chain-node span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.erp-chain-node strong {
  display: block;
  margin-top: 8px;
  font-size: 18px;
}

.erp-chain-node em {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.4;
}

.alert-panel {
  margin: 18px 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.74);
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(32, 41, 35, 0.08);
}

.alert-panel header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.alert-panel header strong {
  font-size: 18px;
}

.alert-panel header p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.alert-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.alert-item {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.alert-item.warning {
  border-left-color: var(--brand-2);
}

.alert-item.danger {
  border-left-color: var(--danger);
}

.alert-item.info {
  border-left-color: var(--brand);
}

.alert-item h2 {
  margin: 0;
  font-size: 16px;
}

.alert-item p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.alert-empty {
  padding: 18px;
  color: var(--muted);
}

.table-wrap {
  overflow: auto;
  max-height: min(64vh, 640px);
  scrollbar-gutter: stable;
}

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

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid #edf0eb;
  text-align: left;
  white-space: nowrap;
  vertical-align: top;
}

th {
  color: #425047;
  background: #f5f5ef;
  font-weight: 700;
  position: sticky;
  top: 0;
  z-index: 6;
  box-shadow: 0 2px 0 #dfe7df, 0 8px 16px rgba(32, 41, 35, 0.06);
}

td {
  color: #2d3831;
}

.row-select-cell {
  width: 44px;
  min-width: 44px;
  text-align: center;
}

.row-select-cell input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
  cursor: pointer;
}

td.expandable-table-cell {
  position: relative;
  overflow: visible;
  white-space: normal;
}

.table-cell-details {
  position: relative;
  display: block;
  min-width: 0;
}

.table-cell-details > summary {
  list-style: none;
}

.table-cell-details > summary::-webkit-details-marker {
  display: none;
}

.table-cell-preview {
  display: -webkit-box;
  width: 100%;
  max-height: 44px;
  color: inherit;
  line-height: 1.42;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.table-cell-preview-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  font: inherit;
}

.table-cell-preview:hover {
  color: var(--brand);
}

.table-cell-preview:focus-visible {
  outline: 2px solid rgba(28, 92, 79, 0.35);
  outline-offset: 3px;
  border-radius: 6px;
}

.table-cell-inline-note {
  position: absolute;
  display: none;
  top: calc(100% - 4px);
  left: 0;
  z-index: 90;
  width: min(420px, 82vw);
  max-height: 320px;
  overflow: auto;
  border: 1px solid rgba(210, 221, 214, 0.98);
  border-radius: 8px;
  background: #fffefb;
  box-shadow: 0 18px 50px rgba(32, 41, 35, 0.18);
}

.table-cell-details[open] .table-cell-preview {
  display: block;
  max-height: none;
  overflow: visible;
  white-space: normal;
  -webkit-line-clamp: unset;
}

.table-cell-details[open] .table-cell-inline-note {
  display: none;
}

.investment-popup-cell,
.investment-notes-cell {
  position: relative;
  overflow: visible;
  min-width: 180px;
  max-width: 280px;
}

.investment-popup-cell .table-cell-preview,
.investment-notes-cell .table-cell-preview {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
}

.investment-popup-cell.table-note-open .table-cell-inline-note,
.investment-notes-cell.table-note-open .table-cell-inline-note {
  display: block;
}

.table-cell-inline-note-title {
  position: sticky;
  top: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fffefb;
  color: var(--ink);
  font-weight: 800;
}

.table-cell-inline-note-body {
  padding: 12px;
  color: var(--ink);
  line-height: 1.75;
  white-space: normal;
  word-break: break-word;
}

.empty {
  padding: 56px;
  text-align: center;
  color: var(--muted);
}

.business-followups {
  display: grid;
  gap: 16px;
  padding: 0 18px 18px;
}

.business-followup-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.business-followup-summary > div,
.business-followup-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.business-followup-summary > div {
  padding: 15px;
}

.business-followup-summary span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.business-followup-summary strong {
  display: block;
  margin-top: 7px;
  font-size: 20px;
}

.business-followup-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.business-followup-card {
  overflow: hidden;
}

.business-followup-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.business-followup-card .mini-table {
  min-width: 1180px;
}

.business-followup-table-wrap {
  max-height: min(54vh, 520px);
  border-top: 0;
  scrollbar-gutter: stable;
}

.business-followup-card .business-followup-table {
  table-layout: fixed;
}

.business-followup-card .business-followup-table th,
.business-followup-card .business-followup-table td {
  width: 150px;
  max-width: 150px;
}

.business-followup-card .business-followup-table td {
  white-space: nowrap;
  word-break: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.45;
}

.business-followup-card .business-followup-table td.expandable-table-cell {
  overflow: visible;
  white-space: normal;
}

.business-followup-card .business-followup-table .table-cell-preview {
  display: block;
  max-height: 24px;
  white-space: nowrap;
  word-break: normal;
  -webkit-line-clamp: 1;
}

.business-followup-card .business-followup-table .table-cell-details[open] .table-cell-preview {
  max-height: none;
  white-space: normal;
  word-break: break-word;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.business-cell-preview {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.business-highlight {
  color: var(--brand);
  font-weight: 700;
}

.report-sections {
  display: grid;
  gap: 18px;
  padding: 18px;
}

.report-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.52);
  overflow: hidden;
}

.report-card header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.report-section-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.group-payroll-manual-card {
  padding-bottom: 18px;
}

.group-payroll-manual-form {
  padding: 18px;
}

.group-payroll-manual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.group-payroll-manual-field,
.group-payroll-manual-notes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

.group-payroll-manual-field input,
.group-payroll-manual-field select,
.group-payroll-manual-notes textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  font: inherit;
}

.group-payroll-manual-notes {
  margin-top: 14px;
}

.group-payroll-manual-notes textarea {
  min-height: 72px;
  resize: vertical;
}

.group-payroll-manual-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.report-card h2 {
  margin: 0;
  font-size: 20px;
}

.report-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.sticky-report-table-wrap {
  max-height: min(56vh, 620px);
  overflow: auto;
  scrollbar-gutter: stable;
}

.sticky-report-card th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: #f5f5ef;
  box-shadow: 0 2px 0 #dfe7df, 0 8px 16px rgba(32, 41, 35, 0.06);
}

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

.template-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 18px 0;
}

.template-section-heading strong {
  display: block;
  font-size: 18px;
}

.template-section-heading span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.contract-template-hub {
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
}

.contract-template-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 14px;
  padding: 16px 18px 20px;
}

.contract-template-card {
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fffdf7;
}

.contract-template-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
}

.contract-template-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.contract-template-count {
  width: fit-content;
  border-radius: 8px;
  background: rgba(28, 92, 79, 0.09);
  color: var(--brand);
  padding: 6px 10px;
  font-size: 13px;
}

.contract-template-files {
  display: grid;
  gap: 8px;
}

.contract-template-files a,
.contract-template-files span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
  font-size: 13px;
}

.contract-template-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.contract-template-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 18px 22px;
  border: 1px solid rgba(28, 92, 79, 0.22);
  border-radius: 8px;
  padding: 16px;
  background: rgba(28, 92, 79, 0.07);
}

.contract-template-summary strong {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
}

.contract-template-summary span {
  color: var(--muted);
  line-height: 1.6;
}

.contract-template-summary-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.contract-template-summary-actions span {
  border-radius: 8px;
  background: #fffdf7;
  color: var(--brand);
  padding: 7px 10px;
  font-size: 13px;
  white-space: nowrap;
}

.template-card {
  display: grid;
  gap: 16px;
  align-content: space-between;
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background:
    linear-gradient(140deg, rgba(255,255,255,0.72), rgba(255,253,247,0.52)),
    radial-gradient(circle at 90% 10%, rgba(230,169,61,0.18), transparent 45%);
}

.template-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.template-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.template-meta,
.template-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.template-meta span {
  border-radius: 999px;
  background: rgba(28, 92, 79, 0.09);
  color: var(--brand);
  padding: 6px 10px;
  font-size: 13px;
}

.inline-history-import {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(28, 92, 79, 0.06);
}

.inline-history-import strong {
  display: block;
  margin-bottom: 4px;
  font-size: 16px;
}

.inline-history-import p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.inline-history-import small {
  display: block;
  margin-top: 4px;
  color: var(--brand);
  font-weight: 700;
}

.inline-history-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(12, 18, 14, 0.45);
  z-index: 20;
  padding: 20px;
}

.modal {
  width: min(980px, 100%);
  max-height: 88vh;
  overflow: auto;
  background: var(--paper);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.modal.compact-modal {
  width: min(1280px, 100%);
}

.modal.investment-modal {
  width: min(1120px, 100%);
}

.modal.employee-modal {
  width: min(1120px, 100%);
}

.modal.purchase-cost-modal {
  width: min(1440px, 100%);
}

.modal.text-detail-modal {
  width: min(760px, 100%);
  border-radius: 18px;
}

.modal header {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal h2 {
  margin: 0;
}

.modal-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.text-detail-body {
  padding: 22px;
  color: #26352e;
  line-height: 1.75;
  white-space: normal;
  word-break: break-word;
}

.form-grid {
  padding: 22px;
  display: grid;
  grid-template-columns: repeat(2, minmax(240px, 1fr));
  gap: 14px 18px;
}

.compact-modal .form-grid {
  padding: 18px;
  grid-template-columns: repeat(3, minmax(220px, 1fr));
  gap: 10px 14px;
}

.purchase-cost-modal .form-grid {
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  align-items: end;
}

.purchase-cost-modal .field[data-field-name="category_name"] {
  grid-column: span 2;
}

.purchase-cost-modal .field[data-field-name="contract_files"],
.purchase-cost-modal .field[data-field-name="payment_files"],
.purchase-cost-modal .field[data-field-name="notes"] {
  grid-column: 1 / -1;
}

.form-grid .wide {
  grid-column: 1 / -1;
}

.education-pk-modal .field[data-field-name="pk_name"] {
  grid-column: 1 / -1;
}

.field-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.form-section {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.55);
}

.form-section-title {
  color: var(--ink);
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 10px;
}

.form-section-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(200px, 1fr));
  gap: 10px 14px;
}

.investment-modal .form-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

.employee-modal .form-grid {
  grid-template-columns: 1fr;
  gap: 12px;
}

.investment-form-section {
  min-width: 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.employee-form-section {
  min-width: 0;
  padding: 16px;
  background: rgba(255, 255, 255, 0.7);
}

.investment-section-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px 18px;
}

.investment-pair-section {
  display: grid;
  grid-template-columns: 140px 1fr;
  align-items: end;
  gap: 14px 18px;
}

.investment-pair-section .form-section-title {
  margin-bottom: 16px;
}

.investment-pair-section .investment-section-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.employee-section-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px 18px;
}

.investment-section-grid .field {
  min-width: 0;
}

.employee-section-grid .field {
  min-width: 0;
}

.investment-modal .field input,
.investment-modal .field select,
.investment-modal .field textarea {
  min-width: 0;
}

.employee-modal .field input,
.employee-modal .field select,
.employee-modal .field textarea {
  min-width: 0;
}

.investment-basic-section .investment-section-grid {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
}

.investment-basic-section [data-field-name="business_type"],
.investment-form-section [data-field-name="notes"],
.investment-form-section [data-field-name="attachment_files"] {
  grid-column: 1 / -1;
}

.employee-form-section [data-field-name="notes"] {
  grid-column: 1 / -1;
}

.form-section-grid .field {
  margin-bottom: 0;
}

.form-section-grid .wide {
  grid-column: 1 / -1;
}

.advanced-filter-panel {
  border-top: 1px solid var(--line);
  padding: 14px 24px 16px;
  background: rgba(250, 250, 246, 0.82);
}

.advanced-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.advanced-filter-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 0;
}

.advanced-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 16px;
}

.advanced-filter-counts {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.field.conditional-required label::after {
  content: " *";
  color: var(--danger);
}

.filter-field {
  display: grid;
  gap: 6px;
}

.filter-field label {
  color: var(--muted);
  font-size: 12px;
}

.filter-field input,
.filter-field select {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 9px;
  background: #fff;
  color: var(--ink);
}

.segmented-filter-field {
  grid-column: 1 / -1;
}

.segmented-filter-control {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.segmented-filter-option {
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  padding: 0 16px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.segmented-filter-option.active {
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #23826b);
  box-shadow: 0 10px 22px rgba(28, 92, 79, 0.18);
}

.multi-filter-field {
  position: relative;
}

.multi-filter-trigger {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 7px 10px;
  background: #fff;
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  cursor: pointer;
}

.multi-filter-trigger span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-filter-arrow {
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
}

.multi-filter-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: none;
  max-height: 220px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(20, 38, 28, 0.16);
}

.multi-filter-field.open .multi-filter-menu {
  display: grid;
  gap: 4px;
}

.multi-filter-select-all {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 32px;
  margin-bottom: 4px;
  padding: 6px 8px;
  border: 1px solid rgba(23, 83, 62, 0.2);
  border-radius: 8px;
  background: rgba(23, 83, 62, 0.08);
  color: #17533e;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.multi-filter-select-all:hover,
.multi-filter-select-all.selected {
  background: rgba(23, 83, 62, 0.14);
}

.multi-filter-select-all-icon {
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 999px;
  background: #17533e;
  color: #fff;
  font-size: 11px;
  line-height: 1;
}

.multi-filter-option {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 30px;
  padding: 5px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.multi-filter-option:hover {
  background: rgba(23, 83, 62, 0.08);
}

.multi-filter-option input {
  width: 14px;
  min-height: 14px;
  margin: 0;
  padding: 0;
}

.multi-filter-option span,
.multi-filter-empty {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.multi-filter-empty {
  padding: 8px 6px;
  color: var(--muted);
  font-size: 13px;
}

.form-multi-select-field {
  position: relative;
}

.form-multi-select-field .multi-filter-trigger {
  min-height: 44px;
  border-radius: 14px;
  padding: 10px 13px;
}

.form-multi-select-field .multi-filter-menu {
  z-index: 90;
}

.filter-field.range-field {
  grid-column: span 2;
}

.filter-range {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 10px;
}

.advanced-filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.stacked-panels {
  display: grid;
  gap: 18px;
}

.payroll-board {
  display: grid;
  gap: 16px;
}

.payroll-export-panel {
  display: flex;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.74);
  padding: 14px;
}

.payroll-export-panel .inline-field {
  min-width: 220px;
}

.payroll-monthly-panel {
  display: grid;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 16px;
}

.payroll-monthly-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.payroll-monthly-toolbar > div:first-child {
  min-width: 240px;
}

.payroll-monthly-actions {
  display: flex;
  align-items: end;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.payroll-monthly-actions .inline-field {
  min-width: 180px;
}

.payroll-calc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.payroll-calc-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(250, 250, 246, 0.84);
  padding: 14px;
}

.payroll-calc-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

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

.payroll-monthly-table {
  min-width: 1380px;
}

.table-number-input {
  width: 124px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 7px 10px;
}

.table-number-input:focus {
  outline: 2px solid rgba(28, 92, 79, 0.2);
  border-color: var(--brand);
}

.table-text-input {
  width: 180px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 7px 10px;
}

.table-text-input:focus {
  outline: 2px solid rgba(28, 92, 79, 0.2);
  border-color: var(--brand);
}

.payroll-note-input {
  width: 220px;
}

.payroll-performance-input {
  max-width: 132px;
}

.credit-line-card .table-wrap table {
  min-width: 2380px;
}

.credit-line-card .table-wrap th,
.credit-line-card .table-wrap td {
  white-space: nowrap;
}

.credit-line-card .table-wrap td:nth-child(1),
.credit-line-card .table-wrap td:nth-child(2),
.credit-line-card .table-wrap td:nth-child(3) {
  font-weight: 700;
}

.credit-line-card .table-wrap td:nth-child(14),
.credit-line-card .table-wrap td:nth-child(15),
.credit-line-card .table-wrap td:nth-child(17),
.credit-line-card .table-wrap td:nth-child(18),
.credit-line-card .table-wrap td:nth-child(19),
.credit-line-card .table-wrap td:nth-child(22),
.credit-line-card .table-wrap td:nth-child(23),
.credit-line-card .table-wrap td:nth-child(24),
.credit-line-card .table-wrap td:nth-child(25),
.credit-line-card .table-wrap td:nth-child(28) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.credit-line-card .table-wrap td:last-child {
  position: sticky;
  right: 0;
  background: #fff;
  text-align: left;
  box-shadow: -8px 0 14px rgba(20, 37, 31, 0.06);
}

.credit-line-card .table-wrap th:last-child {
  position: sticky;
  right: 0;
  background: #f3efe5;
  box-shadow: -8px 0 14px rgba(20, 37, 31, 0.06);
}

.credit-modal {
  width: min(1280px, calc(100vw - 36px));
}

.credit-modal .form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  max-height: min(68vh, 720px);
  overflow-y: auto;
  padding: 18px;
}

.credit-modal .form-grid .field {
  margin-bottom: 0;
}

.credit-form-section {
  padding: 14px;
  background: rgba(255, 255, 255, 0.66);
}

.credit-section-grid {
  grid-template-columns: repeat(3, minmax(220px, 1fr));
}

.credit-section-grid .credit-detail-field,
.credit-section-grid [data-field-name="notes"],
.credit-section-grid [data-field-name="attachment_files"] {
  grid-column: 1 / -1;
}

.credit-modal .field input,
.credit-modal .field select,
.credit-modal .field textarea {
  min-width: 0;
}

.credit-modal .field textarea {
  min-height: 86px;
}

.credit-detail-field {
  min-width: 0;
}

.credit-detail-head,
.credit-payment-row,
.credit-settlement-row {
  display: grid;
  gap: 8px;
  align-items: center;
}

.credit-payment-head,
.credit-payment-row {
  grid-template-columns: minmax(130px, 1fr) minmax(150px, 1fr) minmax(180px, 1.2fr) 72px;
}

.credit-settlement-head,
.credit-settlement-row {
  grid-template-columns: minmax(130px, 1fr) minmax(150px, 1.1fr) minmax(130px, 1fr) minmax(150px, 1fr) 72px;
}

.credit-settlement-field:not(.education-settlement-field) .credit-settlement-head,
.credit-settlement-field:not(.education-settlement-field) .credit-settlement-row {
  grid-template-columns: minmax(120px, 1fr) minmax(140px, 1fr) minmax(120px, 0.9fr) minmax(140px, 0.9fr) minmax(160px, 1fr) 72px;
}

.credit-detail-head {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.credit-detail-list {
  display: grid;
  gap: 8px;
}

.credit-payment-row .btn,
.credit-settlement-row .btn {
  width: 72px;
}

.credit-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.credit-detail-actions span {
  color: var(--brand);
  font-weight: 700;
  white-space: nowrap;
}

.credit-course-picker {
  width: min(720px, calc(100vw - 36px));
}

.credit-course-picker .form-grid {
  grid-template-columns: 1fr;
}

.credit-course-picker select option:disabled {
  color: var(--muted);
}

.payroll-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.payroll-folder,
.payroll-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(250, 250, 246, 0.72);
  overflow: hidden;
}

.payroll-folder header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.payroll-folder header strong {
  color: var(--ink);
}

.payroll-folder header span,
.payroll-note {
  color: var(--muted);
  font-size: 12px;
}

.payroll-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 12px 0;
}

.payroll-tags span {
  border-radius: 999px;
  background: rgba(28, 92, 79, 0.08);
  color: var(--brand);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.payroll-note {
  padding: 10px 12px 12px;
  line-height: 1.6;
}

.payroll-table {
  min-width: 1280px;
}

.education-report {
  display: grid;
  gap: 16px;
}

.education-report > .toolbar {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
}

.education-report-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 14px 34px rgba(20, 37, 31, 0.08);
}

.education-report-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(28, 92, 79, 0.08), rgba(255, 255, 255, 0.8));
}

.education-report-header span {
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.education-report-header h2 {
  margin: 6px 0;
  color: var(--ink);
  font-size: 28px;
}

.education-report-header p {
  margin: 0;
  color: var(--muted);
}

.education-report-seal {
  align-self: center;
  min-width: 112px;
  max-width: 230px;
  border: 1px solid rgba(28, 92, 79, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
}

.education-report-seal strong,
.education-report-seal span {
  display: block;
}

.education-report-seal strong {
  color: var(--ink);
}

.education-report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  border-bottom: 1px solid var(--line);
}

.education-report-metric {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  min-height: 86px;
}

.education-report-metric span {
  color: var(--muted);
  font-size: 12px;
}

.education-report-metric strong {
  color: var(--ink);
  font-size: 20px;
}

.education-report-metric em {
  margin-left: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.education-report-notes {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 250, 246, 0.72);
}

.education-report-notes strong {
  color: var(--ink);
}

.education-report-notes span {
  color: var(--muted);
  font-size: 13px;
}

.education-report-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #fbfcf7;
}

.education-report-filter > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 210px;
}

.education-report-filter strong {
  color: var(--ink);
}

.education-report-filter span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.education-report-filter .toolbar-left {
  flex-wrap: wrap;
}

.education-report-sections {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.education-report-block {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.education-report-block > header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(250, 250, 246, 0.9);
}

.education-report-block header div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.education-report-section-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.education-report-block header span {
  color: var(--brand);
  font-weight: 900;
}

.education-report-block h3 {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
}

.education-pk-archive-card {
  background: #fff;
}

.education-pk-archive-summary {
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(220px, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 20px 22px;
  cursor: pointer;
  list-style: none;
}

.education-pk-archive-summary::-webkit-details-marker {
  display: none;
}

.education-pk-archive-summary > div {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.education-pk-archive-summary > div span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.education-pk-archive-summary > div strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.education-pk-summary-actions {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.education-pk-detail-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 8px 18px rgba(21, 113, 91, 0.14);
}

.education-pk-delete-btn {
  min-height: 42px;
  border-radius: 8px;
}

.education-pk-toggle-open {
  display: none;
}

.education-pk-archive-card[open] .education-pk-toggle-closed {
  display: none;
}

.education-pk-archive-card[open] .education-pk-toggle-open {
  display: inline;
}

.education-pk-archive-body {
  display: grid;
  gap: 14px;
  padding: 0 20px 20px;
}

.education-pk-text-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.education-pk-text-item {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid rgba(216, 226, 219, 0.72);
}

.education-pk-text-item span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.education-pk-text-item p {
  margin: 0;
  color: var(--ink);
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.education-pk-attachment-item > div {
  min-width: 0;
}

.education-pk-edit-btn {
  justify-self: end;
}

@media (max-width: 900px) {
  .education-pk-archive-summary {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .education-pk-summary-actions,
  .education-pk-detail-toggle,
  .education-pk-delete-btn {
    justify-self: stretch;
    width: 100%;
  }

  .education-pk-summary-actions {
    display: grid;
  }

  .education-pk-text-item {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

.education-report-table {
  min-width: 1180px;
}

.financial-statement-block {
  background: #fff;
}

.financial-statement-table {
  min-width: 920px;
}

.enrollment-monthly-board {
  margin: 16px 0 18px;
  padding: 18px 24px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.enrollment-monthly-board .toolbar {
  padding: 0 0 14px;
}

.enrollment-monthly-table {
  min-width: 1720px;
}

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

.enrollment-monthly-table td:nth-child(n+4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.enrollment-monthly-table td:nth-child(1),
.enrollment-monthly-table td:nth-child(2) {
  font-weight: 700;
}

.financial-statement-table th,
.financial-statement-table td {
  border-right: 1px solid var(--line);
}

.financial-statement-table th:last-child,
.financial-statement-table td:last-child {
  border-right: 0;
}

.financial-statement-table td:nth-child(2) {
  text-align: center;
  color: var(--muted);
}

.financial-statement-table td:nth-child(3) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.financial-inline-input {
  width: 136px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
  padding: 8px 10px;
  text-align: right;
}

.financial-inline-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(28, 92, 79, 0.14);
  outline: none;
}

.statement-total-row td {
  background: rgba(28, 92, 79, 0.07);
  color: var(--ink);
  font-weight: 800;
}

.education-board {
  border-top: 1px solid var(--line);
  padding: 16px 24px;
  background: #fff;
}

.education-board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.education-board-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.education-board-title {
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
}

.education-board-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(132px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.education-board-kpi-grid .stat-card {
  min-height: 82px;
  padding: 14px;
}

.board-year-select {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.board-year-select select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  background: #fff;
  color: var(--ink);
}

.mini-table-wrap {
  overflow: auto;
  max-height: min(62vh, 560px);
  scrollbar-gutter: stable;
}

.module-table-wrap,
.education-board-table-wrap {
  max-height: min(64vh, 620px);
  overflow: auto;
  border-top: 1px solid var(--line);
  scrollbar-gutter: stable;
}

.module-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px 4px;
  color: var(--muted);
  font-size: 14px;
}

.module-pagination-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.module-pagination-info strong {
  color: var(--ink);
  font-size: 15px;
}

.module-pagination-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.education-board-table-wrap {
  max-height: min(66vh, 680px);
}

.table-wrap thead th,
.mini-table-wrap thead th,
.module-table-wrap thead th,
.education-board-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 7;
  background: #f5f5ef;
  box-shadow: 0 2px 0 #dfe7df, 0 8px 16px rgba(32, 41, 35, 0.06);
}

.ledger-detail-table {
  table-layout: fixed;
  min-width: 1320px;
}

.ledger-detail-table th,
.ledger-detail-table td {
  width: 118px;
  max-width: 118px;
}

.ledger-detail-table .ledger-entry-date-header,
.ledger-detail-table .ledger-entry-date-cell,
.ledger-detail-table .ledger-account-name-header,
.ledger-detail-table .ledger-account-name-cell,
.ledger-detail-table .ledger-secondary-subject-header,
.ledger-detail-table .ledger-secondary-subject-cell {
  width: 132px;
  max-width: 132px;
}

.ledger-detail-table .ledger-summary-header,
.ledger-detail-table .ledger-summary-cell {
  width: 320px;
  max-width: 320px;
}

.education-business-table.has-row-selection {
  min-width: 1960px;
}

.education-business-table.has-row-selection th:nth-child(1),
.education-business-table.has-row-selection td:nth-child(1),
.education-business-table.has-row-selection th:nth-child(2),
.education-business-table.has-row-selection td:nth-child(2) {
  position: sticky;
  background: #fffdf7;
  box-shadow: 1px 0 0 var(--line);
}

.education-business-table.has-row-selection th:nth-child(1),
.education-business-table.has-row-selection td:nth-child(1) {
  left: 0;
  width: 58px;
  min-width: 58px;
  max-width: 58px;
}

.education-business-table.has-row-selection th:nth-child(2),
.education-business-table.has-row-selection td:nth-child(2) {
  left: 58px;
  width: 132px;
  min-width: 132px;
  max-width: 132px;
}

.education-business-table.has-row-selection th:nth-child(-n+2) {
  z-index: 12;
  background: #f5f5ef;
}

.education-business-table.has-row-selection td:nth-child(-n+2) {
  z-index: 5;
}

.education-business-table.has-row-selection td:nth-child(2) {
  white-space: normal;
}

.ledger-detail-table .ledger-amount-header,
.ledger-detail-table .ledger-amount-cell {
  width: 110px;
  max-width: 110px;
}

.ledger-detail-table td {
  position: relative;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ledger-detail-table .ledger-summary-cell {
  height: 64px;
  overflow: visible;
  white-space: normal;
  vertical-align: middle;
}

.ecommerce-purchase-cost-table {
  min-width: 2140px;
}

.ecommerce-imported-cost-table {
  min-width: 1540px;
  table-layout: fixed;
}

.ecommerce-imported-cost-table th:first-child,
.ecommerce-imported-cost-table td:first-child {
  width: 300px;
  max-width: 300px;
}

.ecommerce-imported-cost-table th,
.ecommerce-imported-cost-table td,
.ecommerce-imported-cost-table td.expandable-table-cell,
.ecommerce-purchase-cost-table th,
.ecommerce-purchase-cost-table td,
.ecommerce-purchase-cost-table td.expandable-table-cell {
  white-space: nowrap;
}

.ecommerce-imported-cost-table .table-cell-preview,
.ecommerce-purchase-cost-table .table-cell-preview {
  display: block;
  max-height: 24px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
  -webkit-line-clamp: 1;
}

.purchase-ledger-note {
  margin-top: 18px;
}

.purchase-ledger-note strong {
  min-width: 210px;
}

.ledger-cell-preview {
  display: -webkit-box;
  width: 100%;
  max-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.42;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ledger-cell-preview:hover {
  color: var(--brand);
}

.ledger-cell-preview:focus-visible {
  outline: 2px solid rgba(28, 92, 79, 0.35);
  outline-offset: 3px;
  border-radius: 6px;
}

.ledger-cell-inline-note {
  position: absolute;
  display: none;
  top: calc(100% - 4px);
  left: 10px;
  z-index: 20;
  width: min(420px, 82vw);
  max-height: 320px;
  overflow: auto;
  border: 1px solid rgba(210, 221, 214, 0.98);
  border-radius: 8px;
  background: #fffefb;
  box-shadow: 0 18px 50px rgba(32, 41, 35, 0.18);
}

.ledger-detail-table td:focus-within .ledger-cell-inline-note {
  display: block;
}

.ledger-cell-inline-note-title {
  position: sticky;
  top: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fffefb;
  color: var(--ink);
  font-weight: 800;
}

.ledger-cell-inline-note-body {
  padding: 12px;
  color: var(--ink);
  line-height: 1.75;
  white-space: normal;
  word-break: break-word;
}

.mini-table {
  min-width: 1100px;
}

.board-template-table {
  table-layout: fixed;
}

.board-table .summary-row {
  background: rgba(28, 92, 79, 0.08);
  font-weight: 800;
}

.board-template-table th {
  width: 142px;
  white-space: nowrap;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.board-template-table td {
  position: relative;
  width: 142px;
  height: 64px;
  max-width: 320px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.42;
  vertical-align: middle;
}

.board-template-table td.education-expanded-cell {
  max-width: 320px;
  overflow: visible;
  line-height: 1.42;
  vertical-align: middle;
}

.board-template-table th.education-order-no-header,
.board-template-table td.education-order-no-cell {
  width: 174px;
  min-width: 174px;
  max-width: 174px;
}

.board-template-table th.education-student-name-header,
.board-template-table td.education-student-name-cell {
  width: 148px;
  min-width: 148px;
  max-width: 148px;
}

.board-template-table th.education-signup-date-header,
.board-template-table td.education-signup-date-cell {
  width: 136px;
  min-width: 136px;
  max-width: 136px;
}

.board-template-table th.education-student-name-header,
.board-template-table td.education-student-name-cell,
.board-template-table.has-board-selection th.row-select-cell,
.board-template-table.has-board-selection td.row-select-cell {
  position: sticky;
  background: #fffdf7;
  box-shadow: 1px 0 0 var(--line);
}

.board-template-table th.education-student-name-header,
.board-template-table.has-board-selection th.row-select-cell {
  z-index: 10;
  background: #f5f5ef;
}

.board-template-table td.education-student-name-cell,
.board-template-table.has-board-selection td.row-select-cell {
  z-index: 5;
}

.board-template-table.has-board-selection th.row-select-cell,
.board-template-table.has-board-selection td.row-select-cell {
  left: 0;
  width: 58px;
  min-width: 58px;
}

.board-template-table.has-board-selection th.education-student-name-header,
.board-template-table.has-board-selection td.education-student-name-cell {
  left: 58px;
}

.board-template-table:not(.has-board-selection) th.education-student-name-header,
.board-template-table:not(.has-board-selection) td.education-student-name-cell {
  left: 0;
}

.board-template-table td.education-order-no-cell .board-cell-preview {
  max-height: 24px;
  white-space: nowrap;
  word-break: normal;
  -webkit-line-clamp: 1;
}

.board-template-table th.education-paid-amount-header,
.board-template-table td.education-paid-amount-cell,
.board-template-table th.education-payment-date-header,
.board-template-table td.education-payment-date-cell {
  width: 190px;
  min-width: 190px;
  max-width: 190px;
}

.board-template-table th.education-other-personnel-cost-header,
.board-template-table td.education-other-personnel-cost-cell {
  width: 220px;
  min-width: 220px;
  max-width: 220px;
}

.board-template-table th.education-other-personnel-cost-header {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.35;
}

.board-cell-preview {
  display: -webkit-box;
  width: 100%;
  max-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: 1.42;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.board-cell-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.board-cell-toggle:checked ~ .board-cell-inline-note {
  display: block;
}

.board-cell-details {
  position: relative;
}

.board-cell-details > summary {
  list-style: none;
}

.board-cell-details > summary::-webkit-details-marker {
  display: none;
}

.board-cell-preview:hover {
  color: var(--brand);
}

.board-cell-preview:focus-visible {
  outline: 2px solid rgba(28, 92, 79, 0.35);
  outline-offset: 3px;
  border-radius: 6px;
}

.board-cell-inline-note {
  position: absolute;
  display: none;
  top: calc(100% - 4px);
  left: 10px;
  z-index: 80;
  width: min(420px, 82vw);
  max-height: 320px;
  overflow: auto;
  border: 1px solid rgba(210, 221, 214, 0.98);
  border-radius: 8px;
  background: #fffefb;
  box-shadow: 0 18px 50px rgba(32, 41, 35, 0.18);
}

.board-template-table td:focus-within .board-cell-inline-note,
.board-template-table td.board-note-open .board-cell-inline-note,
.board-cell-details[open] .board-cell-inline-note {
  display: block;
}

.board-cell-inline-note-title {
  position: sticky;
  top: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fffefb;
  color: var(--ink);
  font-weight: 800;
}

.board-cell-inline-note-body {
  padding: 12px;
  color: var(--ink);
  line-height: 1.75;
  word-break: break-word;
}

.board-template-table th:last-child,
.board-template-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 4;
  max-width: none;
  min-width: 170px;
  width: 170px;
  background: #fffdf7;
  box-shadow: -1px 0 0 var(--line);
}

.board-template-table td:last-child {
  pointer-events: none;
}

.board-template-table th:last-child {
  z-index: 6;
  background: #f5f5ef;
}

.board-actions-cell {
  display: flex;
  gap: 8px;
  align-items: center;
  pointer-events: auto;
}

.board-actions-cell .btn {
  pointer-events: auto;
}

.action-count-header {
  min-width: 170px;
  white-space: nowrap;
}

.action-count-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}

.action-count-header > span:first-child:not(.action-count-header-inner) {
  display: inline-block;
}

.table-count-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 12px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(28, 92, 79, 0.09);
  color: var(--brand);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.action-count-header-inner .table-count-badge {
  margin-left: 0;
}

.business-followup-card .mini-table td {
  max-width: 150px;
  white-space: nowrap;
  word-break: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.45;
}

.policy-board {
  border-top: 1px solid var(--line);
  padding: 16px 24px;
  background: #fff;
}

.policy-board-header {
  margin-bottom: 12px;
}

.policy-reminder {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid rgba(185, 91, 43, 0.28);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 14px;
  background: rgba(185, 91, 43, 0.08);
  color: #8c3d18;
  font-size: 14px;
}

.policy-reminder.quiet {
  border-color: var(--line);
  background: rgba(28, 92, 79, 0.06);
  color: var(--muted);
}

.policy-sections {
  display: grid;
  gap: 14px;
}

.policy-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.policy-folder-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.policy-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
  padding: 12px;
}

.policy-folder {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(250, 250, 246, 0.72);
  overflow: hidden;
}

.policy-folder-header {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.policy-folder-header strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
}

.policy-folder-header span,
.policy-folder-row span,
.policy-folder-more {
  color: var(--muted);
  font-size: 12px;
}

.policy-folder-stats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.policy-folder-stats span {
  border-radius: 999px;
  background: rgba(28, 92, 79, 0.08);
  color: var(--brand);
  padding: 4px 8px;
  font-weight: 700;
}

.policy-folder-list {
  display: grid;
}

.policy-folder-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(221, 231, 225, 0.72);
}

.policy-folder-row:last-child {
  border-bottom: 0;
}

.policy-folder-row strong {
  display: block;
  margin-bottom: 3px;
}

.policy-folder-more {
  padding: 10px 12px;
}

.policy-section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(250, 250, 246, 0.9);
  color: var(--ink);
  font-weight: 800;
}

.policy-section-title span {
  color: var(--muted);
  font-weight: 600;
}

.payroll-detail-title {
  align-items: center;
  flex-wrap: wrap;
}

.payroll-detail-title > span:first-child {
  color: var(--ink);
  font-weight: 800;
}

.payroll-detail-actions {
  margin-left: auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.education-board-kpi-grid .stat-card em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-style: normal;
  font-size: 14px;
  font-weight: 700;
}

.policy-section-title-danger {
  color: var(--danger);
}

.policy-section-title-danger span {
  color: var(--danger);
}

.policy-table {
  min-width: 980px;
}

.policy-status {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(28, 92, 79, 0.09);
  color: var(--brand);
}

.policy-folder-row .policy-status {
  color: var(--brand);
  flex: 0 0 auto;
}

.policy-status.expiring {
  background: rgba(185, 91, 43, 0.12);
  color: #8c3d18;
}

.policy-status.expired {
  background: rgba(143, 39, 39, 0.12);
  color: #8f2727;
}

.compact-modal .field {
  gap: 6px;
  margin-bottom: 0;
}

.compact-modal .field label {
  font-size: 13px;
}

.compact-modal .field input,
.compact-modal .field select,
.compact-modal .field textarea {
  min-height: 38px;
  border-radius: 10px;
  padding: 8px 11px;
}

.readonly-field input,
.readonly-field select,
.readonly-field textarea,
.readonly-modal input:not([type="hidden"]),
.readonly-modal select,
.readonly-modal textarea {
  background: #f1f3ef;
  color: #67736d;
  border-color: #d9e2dc;
  cursor: not-allowed;
}

.compact-modal .field textarea {
  min-height: 76px;
}

.compact-modal .field.policy-content-field textarea {
  min-height: 320px;
}

.modal footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 22px;
  border-top: 1px solid var(--line);
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  background: var(--ink);
  color: #fff;
  padding: 13px 16px;
  border-radius: 14px;
  z-index: 40;
  box-shadow: var(--shadow);
}

.error {
  color: var(--danger);
  margin-top: 12px;
}

.import-error {
  grid-column: 1 / -1;
  border: 1px solid rgba(176, 74, 58, 0.28);
  border-radius: 16px;
  background: rgba(176, 74, 58, 0.08);
  color: var(--danger);
  line-height: 1.7;
  padding: 12px 14px;
  white-space: pre-line;
}

.import-preview {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.68);
  overflow: hidden;
}

.import-preview-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.import-preview-summary span {
  border-radius: 8px;
  background: rgba(28, 92, 79, 0.09);
  color: var(--brand);
  padding: 7px 10px;
  font-size: 13px;
}

.import-map,
.import-preview-rows {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.import-warning-list {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(185, 91, 43, 0.08);
  color: #7c3a18;
}

.import-warning-list strong {
  color: #7c3a18;
}

.import-warning-list p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.import-preview-rows {
  border-bottom: 0;
}

.import-map > div,
.preview-row > div {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.import-map span,
.preview-row span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 6px 8px;
  font-size: 12px;
}

.import-map p,
.preview-row p {
  margin: 0;
  color: var(--danger);
  line-height: 1.6;
}

.preview-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.preview-row.has-error {
  border-color: rgba(176, 74, 58, 0.34);
  background: rgba(176, 74, 58, 0.06);
}

.preview-row header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.preview-row em {
  color: var(--brand);
  font-style: normal;
  font-weight: 700;
}

.preview-row.has-error em {
  color: var(--danger);
}

.empty.compact {
  padding: 18px;
}

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

.profit {
  color: var(--success);
  font-weight: 700;
}

.small-text {
  font-size: 13px;
}

.image-upload {
  gap: 10px;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(116px, 1fr));
  gap: 10px;
  min-height: 42px;
}

.image-empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 14px;
}

.image-thumb {
  position: relative;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.image-thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f5f5ef;
}

.image-thumb figcaption {
  padding: 7px 8px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.image-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  border: 0;
  border-radius: 8px;
  background: rgba(17, 26, 20, 0.78);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  padding: 6px 8px;
  cursor: pointer;
}

.image-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.image-picker input {
  display: none;
}

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

  .login-hero {
    padding: 36px 24px 12px;
  }

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

  .stats-grid,
  .dashboard-strip,
  .ledger-month-strip,
  .dashboard-workbench,
  .dashboard-note-grid,
  .control-tower-hero,
  .control-metric-grid,
  .control-grid,
  .control-detail-grid,
  .profit-balance-summary,
  .profit-balance-grid,
  .budget-summary,
  .settlement-summary,
  .annual-summary-grid,
  .ppt-summary-grid,
  .ppt-slide-grid,
  .ppt-metric-grid,
  .integrated-payroll-hero,
  .integrated-payroll-note,
  .line-chart-grid,
  .project-chart-grid,
  .log-standby-steps,
  .inline-history-import,
  .erp-chain,
  .business-followup-summary,
  .business-followup-grid,
  .education-board-kpi-grid,
  .form-grid,
  .purchase-cost-modal .form-grid,
  .form-section-grid,
  .investment-section-grid,
  .advanced-filter-grid,
  .template-grid {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .contract-template-summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .contract-template-summary-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .purchase-cost-modal .field[data-field-name="category_name"] {
    grid-column: 1 / -1;
  }

  .advanced-filter-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .advanced-filter-counts {
    margin-left: 0;
    white-space: normal;
  }

  .investment-pair-section {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .credit-section-grid,
  .credit-payment-head,
  .credit-payment-row,
  .credit-settlement-head,
  .credit-settlement-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .credit-detail-head {
    display: none;
  }

  .credit-payment-row .btn,
  .credit-settlement-row .btn {
    width: 100%;
  }

  .investment-pair-section .form-section-title {
    margin-bottom: 0;
  }

  .dashboard-strip dl,
  .ledger-month-strip dl {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .control-tower-kpis {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  .control-bar-row {
    grid-template-columns: 1fr;
  }

  .risk-warning-row {
    grid-template-columns: 1fr;
  }

  .profit-balance-head,
  .profit-balance-row dl {
    grid-template-columns: 1fr;
  }

  .project-chart-row {
    grid-template-columns: 1fr;
  }

  .education-report-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .assistant-widget {
    right: 0;
    top: 50%;
    bottom: auto;
  }

  .assistant-widget.open {
    right: 10px;
    top: auto;
    bottom: 10px;
  }

  .assistant-fab {
    min-width: 0;
  }

  .assistant-fab-text em {
    display: none;
  }

  .assistant-panel form {
    grid-template-columns: 1fr;
  }

  .risk-warning-row b {
    text-align: left;
  }

  .inline-month-filter,
  .integrated-payroll-actions,
  .toolbar-right {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-range {
    grid-template-columns: 1fr;
  }

  .filter-field.range-field {
    grid-column: auto;
  }

  .alert-item {
    align-items: stretch;
    flex-direction: column;
  }

  .main {
    padding: 16px;
  }
}
