:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-subtle: #f8fafb;
  --line: #dfe5ea;
  --text: #1f2933;
  --muted: #667085;
  --brand: #087a63;
  --brand-strong: #055e4b;
  --brand-soft: #e8f5f1;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --warning: #a15c00;
  --warning-soft: #fff7e6;
  --info: #176b87;
  --info-soft: #edf7fb;
  --sidebar: #1f2933;
  --sidebar-muted: #aeb9c6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

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

button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  padding: 0 15px;
  background: var(--brand);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

button:hover { background: var(--brand-strong); }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgb(8 122 99 / 24%);
  outline-offset: 2px;
}

button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
}

button.secondary:hover {
  border-color: #b9c4cc;
  background: var(--panel-subtle);
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 14px;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 { font-size: 23px; line-height: 1.25; }
h2 { font-size: 18px; line-height: 1.35; }
h3 { font-size: 15px; }

.app-shell {
  min-height: 100vh;
}

.mobile-shell {
  max-width: 520px;
  margin: 0 auto;
  padding: 20px;
}

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

.login-panel {
  position: relative;
  z-index: 1;
  width: min(440px, calc(100% - 32px));
  margin: 12vh auto;
  padding: 34px;
  border-color: rgb(255 255 255 / 62%);
  border-radius: 14px;
  background: rgb(255 255 255 / 56%);
  box-shadow: 0 18px 42px rgb(31 41 51 / 10%);
  backdrop-filter: blur(16px) saturate(112%);
  -webkit-backdrop-filter: blur(16px) saturate(112%);
}

.login-brand {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  margin-bottom: 28px;
}

.login-brand-icon {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 23px;
}

.login-panel h1 {
  display: block;
  margin: 0;
  color: #172033;
  font-size: 23px;
  font-weight: 700;
  text-shadow: 0 1px 0 rgb(255 255 255 / 38%);
}

.login-brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.login-panel .stack {
  gap: 16px;
}

.login-panel input {
  border-color: rgb(255 255 255 / 74%);
  background: rgb(255 255 255 / 70%);
}

.login-panel button[type="submit"] {
  margin-top: 4px;
  min-height: 42px;
  box-shadow: 0 8px 18px rgb(8 122 99 / 18%);
}

.login-note {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.login-note i {
  margin-right: 4px;
}

.login-version {
  margin: 6px 0 0;
  color: rgb(31 41 51 / 58%);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-align: center;
}

.login-backdrop {
  position: fixed;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgb(239 247 250 / 54%), rgb(228 241 242 / 30%)),
    url("/assets/login-background.png") center / cover no-repeat;
}

.login-backdrop::before,
.login-backdrop::after {
  position: absolute;
  width: 44vw;
  height: 44vw;
  border-radius: 50%;
  content: "";
  filter: blur(10px);
  opacity: 0.46;
}

.login-backdrop::before {
  top: -18vw;
  left: -8vw;
  background: rgb(255 255 255 / 65%);
  animation: login-light-drift 16s ease-in-out infinite alternate;
}

.login-backdrop::after {
  right: -16vw;
  bottom: -20vw;
  background: rgb(163 208 200 / 25%);
  animation: login-light-drift 20s ease-in-out infinite alternate-reverse;
}

#loginPanel.hidden + #loginBackdrop {
  display: none;
}

@keyframes login-light-drift {
  from { transform: translate3d(-1.5vw, 0, 0) scale(1); }
  to { transform: translate3d(2vw, 2vw, 0) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  .login-backdrop::before,
  .login-backdrop::after {
    animation: none;
  }
}

@media (max-width: 620px) {
  .login-panel {
    margin: 8vh auto;
    padding: 28px 24px;
  }

  .login-brand {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 12px;
  }

  .login-brand-icon {
    width: 40px;
    height: 40px;
  }
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.topbar p {
  margin: 4px 0 0;
  color: var(--muted);
}

.tabs {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.tabs button {
  justify-content: flex-start;
  border-radius: 6px;
  min-height: 40px;
  background: transparent;
  color: var(--sidebar-muted);
  text-align: left;
  font-weight: 500;
}

.tabs button:hover { background: rgb(255 255 255 / 9%); color: #fff; }

.tabs button.active {
  background: var(--brand);
  color: #fff;
  box-shadow: inset 3px 0 0 #8de1cb;
}

.tab-panel {
  min-width: 0;
}

.admin-layout {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 30px;
  border-right: 0;
  padding: 28px 14px;
  background: var(--sidebar);
}

.sidebar-brand {
  display: grid;
  gap: 5px;
  padding: 0 10px;
}

.sidebar-brand strong {
  color: #fff;
  font-size: 18px;
}

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

.content-area {
  min-width: 0;
  padding: 26px 32px 42px;
  position: relative;
  isolation: isolate;
  background:
    radial-gradient(circle at 92% 8%, rgb(210 231 235 / 46%), transparent 24rem),
    linear-gradient(135deg, #f7fafb 0%, #f2f7f8 100%);
}

.content-area::before {
  position: absolute;
  z-index: 0;
  inset: 0;
  background: url("/assets/login-background.png") center / cover no-repeat;
  content: "";
  opacity: 0.055;
  pointer-events: none;
}

.content-area > * {
  position: relative;
  z-index: 1;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

#dashboardTotals {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-boards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.dashboard-board {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 1px 2px rgb(31 41 51 / 4%);
}

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

.dashboard-board header p {
  margin: 0;
}

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

.deadline-button {
  min-height: 118px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  padding: 16px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.deadline-button:last-child {
  border-right: 0;
}

.deadline-button strong {
  display: block;
  margin-top: 12px;
  font-size: 32px;
  line-height: 1;
}

.deadline-button.overdue {
  background: var(--danger-soft);
  color: var(--danger);
}

.deadline-button.within_7_days {
  background: var(--warning-soft);
  color: var(--warning);
}

.deadline-button.within_30_days {
  background: var(--info-soft);
  color: var(--info);
}

.dashboard-support {
  max-width: 580px;
}

.summary-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(31 41 51 / 3%);
}

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

.summary-item strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.15;
  color: var(--sidebar);
}

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

.reminder-item.overdue {
  border-left: 4px solid var(--danger);
}

.reminder-item.within_7_days {
  border-left: 4px solid #b87900;
}

.reminder-item.within_30_days {
  border-left: 4px solid #2c72a9;
}

.reminder-item.missing_data {
  border-left: 4px solid #6a5e2d;
}

.toolbar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto auto;
  gap: 8px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(31 41 51 / 3%);
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: #fff;
}

.personnel-table {
  min-width: 1240px;
}

.contract-roster-table {
  min-width: 1180px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  background: #f7f9fb;
  white-space: nowrap;
}

.personnel-table th,
.contract-roster-table th {
  font-size: 12px;
}

.personnel-table td,
.contract-roster-table td {
  font-size: 13px;
  line-height: 1.45;
}

.cell-stack {
  display: grid;
  gap: 3px;
  min-width: 94px;
  overflow-wrap: anywhere;
}

.cell-stack small {
  color: var(--muted);
  font-size: 12px;
}

.identity-cell {
  min-width: 142px;
}

.employment-cell {
  min-width: 164px;
}

tbody tr:hover { background: #f9fcfb; }

td:first-child,
th:first-child { padding-left: 16px; }

td:last-child,
th:last-child { padding-right: 16px; }

small,
p {
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 12px;
}

.grid-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.insurance-item {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-column: span 2;
  gap: 10px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.insurance-item legend {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.manual-section {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
}

.manual-section > legend {
  color: var(--text);
  font-weight: 600;
  padding: 0 4px;
}

.manual-section-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 12px;
  color: var(--text);
}

.manual-section-toggle input {
  width: auto;
  min-height: auto;
}

.readonly-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.readonly-grid input {
  background: #f0f3f5;
  color: var(--muted);
}

.span-2 {
  grid-column: span 2;
}

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

.item {
  padding: 15px;
  box-shadow: 0 1px 2px rgb(31 41 51 / 3%);
}

.item p {
  margin: 6px 0;
}

.qr-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 0;
}

.qr-row img {
  width: 120px;
  height: 120px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.button-like {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-left: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 14px;
  color: var(--text);
  text-decoration: none;
}

.reset-login-link {
  justify-content: center;
  margin-left: 0;
  background: #fff;
}

.reset-success {
  margin: 0;
  border-color: #9fd6c7;
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.success-notice {
  border-color: #b9e2cb;
  background: #effaf3;
  color: #16794b;
}

.notice {
  margin: -4px 0 12px;
  border: 1px solid #e2c16d;
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--warning-soft);
  color: #7a4a00;
}

.plan-preview {
  grid-column: span 2;
  border: 1px solid #b9d8d0;
  border-radius: 6px;
  padding: 10px 12px;
  background: #f1faf7;
}

.plan-preview strong {
  display: block;
  margin-bottom: 7px;
  color: var(--brand-strong);
}

.plan-preview div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
}

.plan-preview span {
  color: var(--text);
  font-size: 14px;
}

.suggestion-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

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

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.button-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.person-dialog {
  width: min(920px, calc(100vw - 28px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 24px 60px rgb(31 41 51 / 22%);
}

.business-panel .toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.business-panel .business-unit-filter {
  min-width: 220px;
  flex: 1 1 260px;
}

.inline-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  color: var(--text);
  white-space: nowrap;
}

.inline-toggle input {
  width: auto;
  min-height: auto;
}

.business-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

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

.business-summary-item.selected {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px var(--brand), 0 2px 4px rgb(8 122 99 / 10%);
}

.business-summary-select {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  border-radius: 0;
  padding: 14px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.business-summary-item.selected .business-summary-select {
  background: var(--brand-soft);
}

.business-summary-select span {
  min-width: 0;
}

.business-summary-select strong,
.business-summary-select small {
  display: block;
  overflow-wrap: anywhere;
}

.business-summary-select small {
  margin-top: 5px;
}

.business-summary-select b {
  flex: 0 0 auto;
  color: var(--brand-strong);
  font-size: 21px;
}

.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  border-top: 1px solid var(--line);
  padding: 8px;
}

.summary-actions:empty {
  display: none;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px;
  }

  .summary-grid,
  .dashboard-boards,
  .grid-form,
  .split,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .business-panel .toolbar {
    align-items: stretch;
  }

  .business-panel .business-unit-filter {
    flex-basis: 100%;
  }

  .business-panel .toolbar button {
    flex: 1 1 150px;
  }

  .business-summary {
    grid-template-columns: 1fr;
  }

  .insurance-item {
    grid-template-columns: 1fr;
    grid-column: span 1;
  }

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

  .deadline-button {
    min-height: 72px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .reminder-item {
    align-items: flex-start;
    flex-direction: column;
  }
}

.person-dialog::backdrop {
  background: rgb(23 32 42 / 42%);
}

.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 14px;
  margin-bottom: 16px;
}

.detail-grid p {
  display: grid;
  gap: 4px;
  margin: 0;
}

.detail-grid strong {
  color: var(--muted);
  font-size: 13px;
}

.detail-section {
  margin: 0 0 18px;
  padding-top: 2px;
}

.detail-section h3 {
  margin: 0 0 10px;
}

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

.attachment-list a {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 10px;
  color: var(--text);
  text-decoration: none;
}

.linked-summaries p {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 10px;
  background: var(--panel-subtle);
}

.insurance-summary-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 104px;
}

.profile-overview {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 17px 18px;
  border: 1px solid #dce5ee;
  border-radius: 10px;
  background: rgb(255 255 255 / 82%);
}

.profile-identity,
.profile-contact {
  display: grid;
  align-content: start;
  gap: 6px;
}

.profile-identity > span,
.profile-contact strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.profile-identity > strong {
  color: var(--text);
  font-size: 22px;
}

.profile-id-number {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.profile-id-number button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 12px;
}

.profile-contact {
  grid-template-columns: repeat(2, minmax(118px, 1fr));
  min-width: min(100%, 290px);
}

.profile-contact p {
  display: grid;
  gap: 4px;
  margin: 0;
}

.profile-section {
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: rgb(255 255 255 / 76%);
}

.profile-section h3 {
  color: #243247;
  font-size: 14px;
}

.profile-grid {
  margin: 0;
}

.profile-grid p {
  min-height: 48px;
  padding: 8px 10px;
  border-radius: 7px;
  background: #f8fafc;
}

@media (max-width: 680px) {
  .profile-overview {
    flex-direction: column;
  }

  .profile-contact,
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 901px) {
  .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; }
  .table-wrap thead th { position: sticky; top: 0; z-index: 1; }
}

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

.import-preview-wrap {
  margin-top: 16px;
}

.row-error {
  background: #fff3f1;
}

.unit-url-toolbar {
  grid-template-columns: 1fr auto;
  margin-bottom: 14px;
}

.hidden {
  display: none !important;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 12px;
  }

  .toolbar,
  .grid-form,
  .split {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .plan-preview {
    grid-column: auto;
  }

  .tabs {
    overflow-x: auto;
  }
}

@media (max-width: 900px) {
  .admin-layout {
    display: block;
  }

  .sidebar {
    gap: 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: 14px 12px;
  }

  .sidebar-brand {
    padding: 0 4px;
  }

  .tabs {
    flex-direction: row;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .tabs button {
    flex: 0 0 auto;
  }

  .content-area {
    padding: 18px 14px 28px;
  }

  .topbar {
    min-height: 0;
    margin-bottom: 16px;
  }
}

/* Apple bright desktop theme */
:root {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --panel-subtle: #f8fafc;
  --line: #e3e8ef;
  --text: #18212f;
  --muted: #6b7789;
  --brand: #1677ff;
  --brand-strong: #0b63d8;
  --brand-soft: #edf5ff;
  --danger: #d92d20;
  --danger-soft: #fff2f0;
  --warning: #b76e00;
  --warning-soft: #fff8e7;
  --info: #2563a9;
  --info-soft: #eef6ff;
  --sidebar: #ffffff;
  --sidebar-muted: #667085;
}

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

button {
  min-height: 36px;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--brand);
  box-shadow: 0 1px 2px rgb(16 24 40 / 5%);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline-color: rgb(22 119 255 / 22%);
}

input,
select,
textarea {
  min-height: 36px;
  border-color: #d8dee8;
  box-shadow: 0 1px 2px rgb(16 24 40 / 3%);
}

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

.sidebar {
  gap: 24px;
  border-right: 1px solid var(--line);
  padding: 24px 12px;
  background: #fff;
}

.sidebar-brand {
  gap: 3px;
  padding: 0 12px 18px;
  border-bottom: 1px solid var(--line);
}

.sidebar-brand strong {
  color: #151b26;
  font-size: 17px;
}

.sidebar-brand span {
  color: #8a95a5;
  font-size: 12px;
}

.tabs {
  gap: 4px;
}

.tabs button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 12px;
  color: #526071;
}

.tabs button:hover {
  background: #f3f6fa;
  color: #1f2937;
}

.tabs button.active {
  background: var(--brand-soft);
  color: var(--brand-strong);
  box-shadow: none;
}

.nav-icon {
  width: 18px;
  font-size: 18px;
  text-align: center;
}

.content-area {
  padding: 0 28px 40px;
}

.topbar {
  min-height: 76px;
  margin-bottom: 22px;
  padding: 14px 0;
  background: transparent;
}

.topbar-title p,
.section-heading p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.topbar-date,
.topbar-user,
.icon-text-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.topbar-meta i {
  font-size: 17px;
}

.summary-grid {
  gap: 14px;
}

.summary-item {
  border-color: #e5e9f0;
  padding: 17px 18px;
  box-shadow: 0 3px 12px rgb(28 39 60 / 4%);
}

.primary-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 108px;
}

.summary-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 21px;
}

.primary-summary:nth-child(2) .summary-icon {
  background: #edf8f1;
  color: #2f9e5b;
}

.primary-summary:nth-child(3) .summary-icon {
  background: #f2efff;
  color: #7257d6;
}

.primary-summary:nth-child(4) .summary-icon {
  background: #ebf9fa;
  color: #1594a3;
}

.primary-summary strong {
  margin-top: 7px;
  font-size: 30px;
}

#dashboardTotals .summary-item strong,
#dashboardTotalsSecondary .summary-item strong,
#dashboardTotalsTertiary .summary-item strong,
#dashboardTotalsQuaternary .summary-item strong {
  color: #172033;
}

.secondary-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0;
}

.secondary-summary {
  min-height: 72px;
  padding: 13px 14px;
  box-shadow: none;
}

.secondary-summary strong {
  margin-top: 4px;
  font-size: 21px;
}

.dashboard-summary-link {
  width: 100%;
  border: 1px solid var(--line);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.dashboard-summary-link:hover {
  border-color: #aeb9ca;
  box-shadow: 0 4px 12px rgb(31 41 51 / 8%);
  transform: translateY(-1px);
}

.dashboard-summary-link.warning strong,
.dashboard-summary-link.warning span {
  color: #c23a2b;
}

.dashboard-board,
.table-wrap,
.toolbar,
.item,
.linked-summaries p {
  border-color: #e5e9f0;
  box-shadow: 0 3px 12px rgb(28 39 60 / 4%);
}

.dashboard-support {
  max-width: none;
}

.dashboard-board header {
  padding: 15px 18px;
}

.deadline-button {
  min-height: 104px;
  transition: background-color 120ms ease;
}

.deadline-button:hover {
  background: #f7f9fc;
}

.deadline-button.overdue:hover { background: #ffe9e6; }
.deadline-button.within_7_days:hover { background: #fff1cf; }
.deadline-button.within_30_days:hover { background: #e3f0ff; }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.toolbar {
  align-items: end;
  grid-template-columns: minmax(240px, 1.6fr) repeat(3, minmax(150px, 1fr)) auto;
  gap: 10px;
  padding: 14px;
  box-shadow: none;
}

.toolbar label > span:first-child {
  font-size: 12px;
  font-weight: 600;
}

.input-with-icon {
  position: relative;
  display: block;
}

.input-with-icon i {
  position: absolute;
  top: 50%;
  left: 11px;
  z-index: 1;
  color: #98a2b3;
  transform: translateY(-50%);
}

.input-with-icon input {
  padding-left: 34px;
}

.table-wrap {
  box-shadow: 0 2px 10px rgb(28 39 60 / 3%);
}

thead th {
  background: #f8fafc;
  color: #5d6a7b;
  font-size: 12px;
  font-weight: 600;
}

tbody td {
  color: #344054;
}

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

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.status-pill.success {
  border-color: #c8ead8;
  background: #edf9f2;
  color: #16794b;
}

.status-pill.warning {
  border-color: #f3dfac;
  background: #fff8e7;
  color: #9a6100;
}

.status-pill.info {
  border-color: #cfe2ff;
  background: #eef6ff;
  color: #1c65aa;
}

.status-pill.neutral {
  border-color: #e1e6ed;
  background: #f7f8fa;
  color: #667085;
}

.table-actions {
  min-width: 132px;
  white-space: normal;
}

.table-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  margin: 1px 5px 1px 0;
  padding: 0 5px;
  background: transparent;
  box-shadow: none;
  color: var(--brand-strong);
  font-size: 12px;
  font-weight: 600;
}

.table-action:hover {
  background: var(--brand-soft);
}

.table-action.danger-action {
  color: var(--danger);
}

.table-action.danger-action:hover {
  background: var(--danger-soft);
}

dialog {
  border-color: var(--line);
  box-shadow: 0 20px 60px rgb(15 23 42 / 18%);
}

@media (max-width: 1180px) {
  .secondary-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

@media (max-width: 900px) {
  .sidebar {
    background: #fff;
  }

  .topbar-meta {
    gap: 8px;
  }

  .topbar-date {
    display: none;
  }
}

@media (max-width: 620px) {
  .topbar-user {
    display: none;
  }

  .summary-grid,
  .secondary-summary-grid,
  .dashboard-boards {
    grid-template-columns: 1fr;
  }
}

/* Square, compact management workspaces */
.management-page {
  max-width: 1280px;
}

.management-work-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.management-card {
  border: 1px solid #e3e8ef;
  border-radius: 8px;
  padding: 18px;
  background: #fff;
  box-shadow: 0 2px 10px rgb(28 39 60 / 3%);
}

.management-card > :last-child {
  margin-bottom: 0;
}

.management-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #edf0f4;
}

.management-card-header h3 {
  margin: 0;
  color: #1d2939;
  font-size: 16px;
}

.management-card-header p,
.management-card > p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.management-card-header > i {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 18px;
}

.management-card .grid-form {
  margin-bottom: 0;
}

.management-card .button-row {
  align-items: center;
  flex-wrap: wrap;
}

.management-card .button-row button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.units-work-grid {
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, 0.9fr);
  align-items: start;
}

.unit-access-card {
  background: #fbfcfe;
}

.unit-access-card .unit-url-toolbar {
  grid-template-columns: 1fr auto;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.unit-access-card .notice {
  margin: 0 0 10px;
}

.unit-list-card {
  margin-top: 0;
}

.unit-list-card .list {
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
}

.unit-list-card .unit-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(168px, 0.42fr);
  align-items: start;
  gap: 16px;
  padding: 18px;
  border-radius: 7px;
  box-shadow: none;
}

.unit-card-info {
  min-width: 0;
}

.unit-card-info strong {
  display: block;
  color: #1d2939;
  font-size: 15px;
}

.unit-card-info p {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
}

.unit-fill-link {
  display: inline-flex;
  margin-top: 10px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.unit-card-actions {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.unit-card-actions label {
  gap: 4px;
  font-size: 12px;
}

.unit-card-actions button,
.unit-card-actions .button-like {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.unit-card-actions .button-like {
  justify-content: center;
  margin-left: 0;
}

.unit-card-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.insurance-summary-line {
  display: grid;
  gap: 3px;
  margin-bottom: 7px;
}

.insurance-summary-line:last-child { margin-bottom: 0; }

.import-work-grid {
  align-items: stretch;
}

.import-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.import-card > p {
  margin: -2px 0 2px;
  line-height: 1.65;
}

.import-card-primary textarea {
  min-height: 164px;
  resize: vertical;
}

.export-card {
  background: #fbfcfe;
}

.export-card .button-row {
  margin-top: 4px;
}

#importResult {
  min-height: 64px;
  margin: auto 0 0;
  border: 1px solid #e8edf3;
  border-radius: 6px;
  padding: 10px;
  background: #fff;
  color: #526071;
  font: 12px/1.55 inherit;
  white-space: pre-wrap;
}

.import-preview-wrap {
  margin-top: 16px;
}

.settings-card + .settings-card {
  margin-top: 16px;
}

.company-settings-card {
  max-width: none;
}

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

.form-action {
  display: flex;
  align-items: end;
}

.form-action button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.company-settings-card #dispatchCompanyList {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-top: 14px;
}

.company-settings-card .item {
  padding: 13px 14px;
  border-radius: 6px;
  box-shadow: none;
}

.company-settings-card .item p {
  margin: 4px 0 0;
  font-size: 12px;
}

.user-settings-card .grid-form {
  max-width: 900px;
}

@media (max-width: 960px) {
  .management-work-grid,
  .units-work-grid {
    grid-template-columns: 1fr;
  }

  .unit-list-card .list { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .management-card {
    padding: 14px;
  }

  .compact-form {
    grid-template-columns: 1fr;
  }

  .unit-access-card .unit-url-toolbar {
    grid-template-columns: 1fr;
  }

  .unit-list-card .unit-card { grid-template-columns: 1fr; }
}

.unit-detail-access-content {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.unit-detail-access-content img {
  width: 148px;
  height: 148px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.unit-detail-access-content .unit-fill-link {
  overflow-wrap: anywhere;
}

@media (max-width: 640px) {
  .unit-detail-access-content { grid-template-columns: 1fr; }
}

/* Consistent workbench layout for every operational module. */
.content-area > .topbar,
.content-area > .tab-panel {
  width: min(100%, 1540px);
  margin-right: auto;
  margin-left: auto;
}

.content-area > .tab-panel > .toolbar,
.business-panel > .toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
}

.content-area > .tab-panel > .toolbar > label,
.business-panel > .toolbar > select {
  flex: 1 1 170px;
  min-width: 0;
}

.content-area > .tab-panel > .toolbar > .search-control {
  flex-basis: 280px;
}

.content-area > .tab-panel > .toolbar > button,
.business-panel > .toolbar > button,
.business-panel > .toolbar > .inline-toggle {
  flex: 0 0 auto;
}

@media (max-width: 760px) {
  .content-area { padding: 18px 14px 30px; }
  .topbar { align-items: flex-start; gap: 12px; }
  .topbar-meta { flex-wrap: wrap; justify-content: flex-end; }
  .unit-card-action-row { grid-template-columns: 1fr; }
}

/* Compact glass dashboard: distinct work areas without oversized cards. */
.dashboard-section {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgb(255 255 255 / 72%);
  border-radius: 14px;
  background: rgb(255 255 255 / 62%);
  box-shadow: 0 12px 28px rgb(38 56 80 / 6%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.content-area:has(#dashboard:not(.hidden)) .topbar {
  margin-top: 18px;
  margin-bottom: 16px;
  padding: 16px 20px;
  border: 1px solid rgb(255 255 255 / 76%);
  border-radius: 14px;
  background:
    linear-gradient(100deg, rgb(255 255 255 / 78%), rgb(234 246 246 / 56%)),
    url("/assets/login-background.png") right 42% / 680px auto no-repeat;
  box-shadow: 0 10px 28px rgb(38 56 80 / 6%);
}

.content-area:has(#dashboard:not(.hidden)) .topbar-title h1 {
  color: #172f35;
}

.dashboard-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 10px;
}

.dashboard-section-header h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
}

.dashboard-section-header h2 > i {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 8px;
  background: #edf5ff;
  color: #2779d9;
  font-size: 16px;
}

.dashboard-risk .dashboard-section-header h2 > i {
  background: #fff5e8;
  color: #c7791d;
}

.dashboard-section-header p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-overview {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.dashboard-overview .summary-grid {
  margin: 0;
}

#dashboardTotals,
.secondary-summary-grid,
.tertiary-summary-grid,
.quaternary-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

#dashboardTotals {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tertiary-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 0;
}

.secondary-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quaternary-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dashboard-section .summary-item {
  min-height: 78px;
  border: 1px solid rgb(218 226 236 / 92%);
  border-radius: 11px;
  background: rgb(255 255 255 / 78%);
  box-shadow: 0 5px 16px rgb(38 56 80 / 4%);
}

#dashboard .dashboard-board {
  background: rgb(255 255 255 / 82%);
  box-shadow: 0 8px 20px rgb(38 56 80 / 5%);
}

.dashboard-section .primary-summary {
  min-height: 108px;
  padding: 16px;
}

.dashboard-section .primary-summary strong {
  font-size: 27px;
}

.dashboard-section .secondary-summary,
.dashboard-section .tertiary-summary,
.dashboard-section .quaternary-summary {
  min-height: 80px;
  padding: 12px 13px;
}

.dashboard-section .compact-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.dashboard-section .compact-summary .summary-icon {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  font-size: 17px;
}

.dashboard-section .secondary-summary:nth-child(2) .summary-icon,
.dashboard-section .tertiary-summary:nth-child(2) .summary-icon,
.dashboard-section .tertiary-summary:nth-child(5) .summary-icon {
  background: #edf8f1;
  color: #2f9e5b;
}

.dashboard-section .secondary-summary:nth-child(3) .summary-icon,
.dashboard-section .tertiary-summary:nth-child(3) .summary-icon,
.dashboard-section .tertiary-summary:nth-child(6) .summary-icon {
  background: #f2efff;
  color: #7257d6;
}

.dashboard-section .tertiary-summary:nth-child(4) .summary-icon {
  background: #fff5e8;
  color: #c7791d;
}

.dashboard-section .tertiary-summary.warning .summary-icon,
.dashboard-section .quaternary-summary.warning .summary-icon {
  background: #fff1ef;
  color: #d55242;
}

.dashboard-section .quaternary-summary.inflow .summary-icon {
  background: #edf8f1;
  color: #2f9e5b;
}

.dashboard-section .quaternary-summary.outflow .summary-icon {
  background: #f2efff;
  color: #7257d6;
}

.dashboard-section .secondary-summary strong {
  font-size: 22px;
}

.dashboard-section .tertiary-summary strong,
.dashboard-section .quaternary-summary strong {
  margin-top: 3px;
  font-size: 19px;
}

.dashboard-section .dashboard-summary-link:hover {
  border-color: #b5c7d5;
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 7px 16px rgb(38 56 80 / 8%);
}

.dashboard-section .dashboard-boards {
  gap: 14px;
  margin-bottom: 0;
}

.dashboard-section .dashboard-board {
  position: relative;
  border: 1px solid rgb(218 226 236 / 92%);
  border-radius: 13px;
  background: rgb(255 255 255 / 72%);
  box-shadow: 0 6px 16px rgb(38 56 80 / 4%);
  overflow: hidden;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.dashboard-section .dashboard-board::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: #5b9cf1;
  content: "";
}

.dashboard-section .dashboard-board:nth-child(2)::before { background: #35a36c; }
.dashboard-section .dashboard-board:nth-child(3)::before { background: #8968d9; }
.dashboard-section .dashboard-board:nth-child(4)::before { background: #d48a2c; }

.dashboard-section .dashboard-board:hover {
  border-color: #bfd0df;
  box-shadow: 0 10px 22px rgb(38 56 80 / 8%);
  transform: translateY(-1px);
}

.dashboard-section .dashboard-board header {
  padding: 15px 16px 11px;
  border-bottom: 0;
}

.dashboard-section .dashboard-board header h2 {
  font-size: 14px;
}

.dashboard-section .dashboard-board header p {
  font-size: 12px;
}

.deadline-board-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.board-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 10px;
  background: #eef5ff;
  color: #357dd2;
  font-size: 18px;
}

.dashboard-board:nth-child(2) .board-icon { background: #edf8f1; color: #2f9e5b; }
.dashboard-board:nth-child(3) .board-icon { background: #f4f0ff; color: #7b5bd2; }
.dashboard-board:nth-child(4) .board-icon { background: #fff5e8; color: #c7791d; }

.dashboard-section .deadline-grid {
  gap: 8px;
  padding: 0 10px 10px;
}

.dashboard-section .deadline-button {
  min-height: 82px;
  border: 1px solid transparent;
  border-radius: 9px;
  padding: 12px;
  background: #f7f9fc;
}

.dashboard-section .deadline-button + .deadline-button { border-right: 1px solid transparent; }

.dashboard-section .deadline-button.overdue { border-color: #f3cfca; background: #fff4f2; }
.dashboard-section .deadline-button.within_7_days { border-color: #f0d6ad; background: #fff8ed; }
.dashboard-section .deadline-button.within_30_days { border-color: #cfe1f4; background: #f3f8ff; }

.deadline-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 650;
}

.deadline-label i { font-size: 8px; }

.dashboard-section .deadline-button strong {
  margin-top: 8px;
  font-size: 26px;
}

.dashboard-risk-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.risk-card {
  display: block;
  min-height: 106px;
  padding: 15px;
  border: 1px solid rgb(207 219 229 / 88%);
  border-radius: 13px;
  background: rgb(255 255 255 / 72%);
  color: var(--ink);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease;
}

.risk-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.risk-card span {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
}

.risk-card span i {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 9px;
  background: #eef3f8;
  color: #5d7084;
  font-size: 16px;
}

.risk-card strong {
  color: #172033;
  font-size: 25px;
  line-height: 1;
}

.risk-card small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.risk-card.has-risk {
  border-color: rgb(219 157 67 / 58%);
  background: rgb(255 250 242 / 78%);
}

.risk-card.has-risk strong {
  color: #b85b13;
}

.risk-card.has-risk span i {
  background: #fff0df;
  color: #c7791d;
}

.risk-card:hover {
  border-color: #b5c7d5;
  background: rgb(255 255 255 / 94%);
}

.dashboard-support {
  padding: 14px;
}

.profile-record-list {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.profile-record {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.profile-record:last-child { border-bottom: 0; }
.profile-record span { flex: 1; color: var(--muted); }
.profile-record button { min-height: 30px; padding: 0 10px; }

@media (max-width: 920px) {
  #dashboardTotals,
  .secondary-summary-grid,
  .tertiary-summary-grid,
  .quaternary-summary-grid,
  .dashboard-risk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

}

@media (max-width: 620px) {
  #dashboardTotals,
  .secondary-summary-grid,
  .tertiary-summary-grid,
  .quaternary-summary-grid,
  .dashboard-risk-grid { grid-template-columns: 1fr; }
  .dashboard-section { padding: 11px; border-radius: 12px; }
  .dashboard-section .dashboard-boards { grid-template-columns: 1fr; }
}

/* Unified glass workbench: visual-only layer for every management workspace. */
:root {
  --workspace-bg: #eef2f6;
  --glass-panel: rgb(255 255 255 / 68%);
  --glass-card: rgb(255 255 255 / 82%);
  --glass-line: rgb(255 255 255 / 78%);
  --glass-shadow: 0 10px 26px rgb(39 54 75 / 7%);
}

body { background: var(--workspace-bg); }

.content-area { padding: 0 clamp(18px, 2.4vw, 36px) 36px; }

.content-area > .topbar,
.content-area > .tab-panel { width: min(100%, 1600px); }

.topbar {
  min-height: 70px;
  margin-bottom: 16px;
  padding: 13px 2px;
  border-bottom-color: rgb(205 215 227 / 80%);
}

.topbar-title h1 { color: #172033; font-size: 22px; }
.section-heading { margin: 0 2px 10px; }
.section-heading h2 { color: #172033; font-size: 17px; }
.section-heading p { margin-top: 2px; }

.content-area > .tab-panel > .toolbar,
.business-panel > .toolbar {
  gap: 9px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  background: var(--glass-panel);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.content-area > .tab-panel > .toolbar label,
.business-panel > .toolbar select { flex-basis: 164px; }

.content-area > .tab-panel > .toolbar input,
.content-area > .tab-panel > .toolbar select,
.business-panel > .toolbar select {
  min-height: 36px;
  background: rgb(255 255 255 / 90%);
}

.content-area > .tab-panel > .toolbar button,
.business-panel > .toolbar button,
.business-panel > .toolbar .inline-toggle { min-height: 36px; }

.table-wrap {
  border-color: var(--glass-line);
  border-radius: 8px;
  background: var(--glass-card);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

table { background: rgb(255 255 255 / 88%); }

thead th {
  height: 40px;
  padding: 9px 10px;
  background: rgb(247 250 252 / 96%);
  color: #5d6a7b;
  font-size: 12px;
}

tbody td { padding: 9px 10px; font-size: 13px; }
.personnel-table td,
.contract-roster-table td { line-height: 1.38; }
.cell-stack { gap: 2px; }

.business-panel .business-summary { gap: 10px; margin-bottom: 12px; }

.business-summary-item {
  border-color: var(--glass-line);
  border-radius: 8px;
  background: var(--glass-card);
  box-shadow: 0 7px 18px rgb(39 54 75 / 5%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.business-summary-select { min-height: 68px; padding: 11px 13px; background: transparent; }

.business-summary-item.selected {
  border-color: rgb(8 122 99 / 42%);
  box-shadow: inset 0 0 0 1px rgb(8 122 99 / 20%), 0 8px 18px rgb(8 122 99 / 9%);
}

.business-summary-item.selected .business-summary-select { background: rgb(232 245 241 / 72%); }

.business-panel > .detail-section {
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--glass-line);
  border-radius: 8px;
  background: var(--glass-panel);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.business-panel > .detail-section > h3 { margin: 0 0 3px; color: #1d2939; }
.business-panel > .detail-section > .muted { margin: 0 0 11px; font-size: 12px; }

.management-page { max-width: 1600px; }
.management-work-grid { gap: 12px; margin-bottom: 12px; }

.management-card,
.dashboard-section,
.dashboard-support {
  border-color: var(--glass-line);
  border-radius: 10px;
  background: var(--glass-panel);
  box-shadow: var(--glass-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.management-card { padding: 15px; }

.management-card-header {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom-color: rgb(214 223 233 / 78%);
}

.management-card-header p,
.management-card > p { line-height: 1.5; }

.management-card .toolbar {
  margin-bottom: 10px;
  padding: 8px;
  border-color: rgb(220 228 237 / 78%);
  background: rgb(255 255 255 / 56%);
  box-shadow: none;
}

.unit-list-card .list { gap: 10px; }

.unit-list-card .unit-card,
.company-settings-card .item,
.item {
  border-color: rgb(218 226 236 / 90%);
  border-radius: 8px;
  background: var(--glass-card);
}

.unit-list-card .unit-card { padding: 14px; }
.import-card { gap: 10px; }
.import-card-primary textarea { min-height: 132px; }

#importResult {
  min-height: 48px;
  padding: 9px 10px;
  background: rgb(255 255 255 / 74%);
}

.dashboard-toolbar { max-width: none; margin-left: 0; }
.dashboard-section { margin-bottom: 12px; padding: 12px; }
.dashboard-overview { gap: 10px; padding: 12px; }

#dashboardTotals,
.secondary-summary-grid,
.tertiary-summary-grid,
.quaternary-summary-grid { gap: 10px; }

.dashboard-section .summary-item {
  min-height: 72px;
  border-color: var(--glass-line);
  border-radius: 8px;
  background: var(--glass-card);
  box-shadow: 0 6px 16px rgb(39 54 75 / 5%);
}

.dashboard-section .primary-summary { min-height: 96px; padding: 14px; }
.dashboard-section .primary-summary strong { font-size: 26px; }

.dashboard-section .secondary-summary,
.dashboard-section .tertiary-summary,
.dashboard-section .quaternary-summary { min-height: 70px; padding: 11px 12px; }

.dashboard-section .dashboard-board {
  border-color: var(--glass-line);
  border-radius: 8px;
  background: var(--glass-card);
}

.dashboard-section .dashboard-board header { padding: 12px 14px 9px; }
.dashboard-section .deadline-grid { gap: 7px; padding: 0 8px 8px; }

.dashboard-section .deadline-button {
  min-height: 72px;
  border-radius: 7px;
  padding: 10px;
}

.dashboard-section .deadline-button strong { margin-top: 5px; font-size: 24px; }

.dashboard-risk-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; }

.risk-card {
  min-height: 92px;
  padding: 12px;
  border-color: var(--glass-line);
  border-radius: 8px;
  background: var(--glass-card);
}

.risk-card small { margin-top: 8px; }

.person-dialog,
dialog {
  border-color: var(--glass-line);
  border-radius: 10px;
  background: rgb(255 255 255 / 92%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.detail-section,
.linked-summaries p,
.profile-record { border-color: rgb(217 225 234 / 88%); }

@media (max-width: 1100px) {
  .dashboard-risk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .management-work-grid,
  .units-work-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .content-area { padding: 0 14px 28px; }
  .topbar { margin-bottom: 12px; }
  .content-area > .tab-panel > .toolbar,
  .business-panel > .toolbar { padding: 9px; }
  .dashboard-section,
  .dashboard-overview { padding: 10px; }
  .dashboard-risk-grid { grid-template-columns: 1fr; }
}
