* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #f5f8fb;
  color: #142433;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

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

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(135deg, rgba(13, 114, 133, 0.16), rgba(255, 255, 255, 0.1)),
    #eef6f8;
}

.login-card {
  width: min(430px, 100%);
  padding: 34px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(18, 42, 56, 0.14);
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background: #126d7d;
  color: #fff;
  font-weight: 900;
  letter-spacing: 1px;
}

.login-card h1,
.topbar h1 {
  margin: 18px 0 8px;
}

.login-card p,
.topbar p,
.library-head p,
.notice-card p {
  margin: 0;
  color: #667887;
  line-height: 1.6;
}

label {
  display: block;
  margin-top: 16px;
  color: #334553;
  font-weight: 800;
}

input,
textarea,
select {
  width: 100%;
  margin-top: 8px;
  border: 1px solid #dce7ef;
  border-radius: 10px;
  padding: 11px 12px;
  background: #fff;
  color: #142433;
  outline: none;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

.login-card button,
.primary-btn {
  border: 0;
  border-radius: 12px;
  padding: 12px 18px;
  background: #126d7d;
  color: #fff;
  font-weight: 900;
}

.login-card button {
  width: 100%;
  margin-top: 20px;
}

.ghost-btn {
  border: 1px solid #d7e3eb;
  border-radius: 12px;
  padding: 11px 16px;
  background: #fff;
  color: #1d3a4d;
  font-weight: 800;
}

.message {
  min-height: 22px;
  margin-top: 12px;
  color: #c2473e;
}

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

.sidebar {
  border-right: 1px solid #e1e8ef;
  background: #ffffff;
  padding: 24px 18px;
}

.sidebar-title {
  margin-bottom: 24px;
  color: #132736;
  font-size: 20px;
  font-weight: 900;
}

.nav-btn {
  width: 100%;
  margin-bottom: 8px;
  border: 0;
  border-radius: 12px;
  padding: 13px 14px;
  background: transparent;
  color: #526576;
  text-align: left;
  font-weight: 800;
}

.nav-btn.active {
  background: #eaf6f8;
  color: #0d7285;
}

.sidebar-note {
  margin-top: 26px;
  padding: 14px;
  border-radius: 12px;
  background: #f6fafc;
  color: #70808c;
  font-size: 13px;
  line-height: 1.6;
}

.main {
  padding: 28px 34px 56px;
}

.topbar,
.library-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar h1 {
  margin-top: 0;
}

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

.scope-badge {
  min-width: 132px;
  padding: 9px 12px;
  border-radius: 999px;
  color: #0c5f6a;
  background: #e8f7f8;
  border: 1px solid #c4e5e9;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.panel {
  border: 1px solid #e0e9ef;
  border-radius: 18px;
  padding: 24px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(40, 68, 86, 0.06);
}

.settings-subpanel {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid #e0e9ef;
}

.settings-subpanel h2 {
  margin: 0 0 8px;
}

.settings-subpanel p {
  margin: 0 0 8px;
  color: #667887;
  line-height: 1.6;
}

.library-search-input {
  margin: 0 0 18px;
  max-width: 520px;
}

.referral-panel {
  padding-bottom: 22px;
}

.referral-standard-grid {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.referral-standard-card {
  padding: 16px;
  border: 1px solid #dce9ef;
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f6fbfc);
}

.referral-standard-card span {
  display: block;
  color: #657786;
  font-size: 13px;
  font-weight: 800;
}

.referral-standard-card strong {
  display: block;
  margin-top: 8px;
  color: #126d7d;
  font-size: 24px;
}

.dashboard-section + .dashboard-section,
.dashboard-section + .notice-card {
  margin-top: 24px;
}

.dashboard-section-head {
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.dashboard-section-head h2 {
  margin: 0 0 6px;
}

.dashboard-section-head p {
  margin: 0;
  color: #667887;
  line-height: 1.55;
}

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

.member-stats-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.stat-card {
  padding: 20px;
  border-radius: 16px;
  background: #f3fafb;
  border: 1px solid #dcecef;
}

.stat-card span {
  color: #126d7d;
  font-size: 34px;
  font-weight: 900;
}

.stat-card p {
  margin: 8px 0 0;
  color: #647481;
  font-weight: 800;
}

.primary-stat {
  background: linear-gradient(135deg, #126d7d, #1c9b9f);
  border-color: transparent;
}

.primary-stat span,
.primary-stat p {
  color: #fff;
}

.region-stat-list {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.region-stat-row,
.region-stat-empty {
  min-height: 48px;
  padding: 12px 14px;
  border: 1px solid #dcecef;
  border-radius: 14px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #526576;
  font-weight: 800;
}

.region-stat-row strong {
  color: #126d7d;
}

.region-stat-empty {
  grid-column: 1 / -1;
  justify-content: center;
  color: #8b99a5;
}

.notice-card,
.editor-card {
  margin-top: 22px;
  padding: 20px;
  border-radius: 16px;
  background: #f8fbfc;
  border: 1px solid #e4edf3;
}

.editor-head {
  margin-bottom: 8px;
}

.editor-head h2 {
  margin: 0 0 6px;
}

.editor-head p {
  margin: 0;
  color: #667887;
  font-size: 13px;
  line-height: 1.6;
}

.form-grid {
  display: grid;
  gap: 14px;
}

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

.button-row {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.library-tabs {
  display: flex;
  gap: 10px;
  margin: 4px 0 18px;
  padding: 8px;
  border-radius: 14px;
  background: #f3f8fb;
  border: 1px solid #e1eaf0;
}

.library-tab {
  border: 0;
  border-radius: 11px;
  padding: 10px 18px;
  background: transparent;
  color: #536677;
  font-weight: 900;
}

.library-tab.active {
  background: #126d7d;
  color: #fff;
}

.table {
  margin-top: 20px;
  overflow: auto;
  border: 1px solid #e1eaf0;
  border-radius: 14px;
  background: #fff;
}

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

.table th,
.table td {
  padding: 13px 14px;
  border-bottom: 1px solid #edf2f5;
  text-align: left;
  vertical-align: top;
}

.table th {
  background: #f5f8fa;
  color: #526271;
  font-size: 13px;
}

.table td {
  color: #263846;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.row-actions button {
  border: 1px solid #d8e4eb;
  border-radius: 10px;
  padding: 7px 10px;
  background: #fff;
  color: #195266;
  font-weight: 800;
}

.row-actions .danger {
  color: #c2473e;
  border-color: #f1cbc7;
}

.excel-table {
  font-size: 14px;
}

.excel-table th,
.excel-table td {
  border-right: 1px solid #edf2f5;
  white-space: nowrap;
}

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

.excel-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f1f6f8;
  color: #405564;
  font-weight: 900;
}

.sortable-th {
  cursor: pointer;
  user-select: none;
}

.sortable-th:hover {
  color: #0c6f7a;
  background: #e7f4f6;
}

.excel-table .excel-row td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.excel-table .excel-row:hover td {
  background: #f8fcfd;
}

.excel-table .province-row td {
  padding: 9px 14px;
  background: #e8f6f8;
  color: #0d7285;
  font-weight: 900;
  letter-spacing: 0.5px;
  border-right: 0;
}

.excel-table .row-actions button {
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 13px;
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: #e5484d;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.approval-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(229, 72, 77, 0.25);
  border-radius: 12px;
  background: #fff1f1;
  color: #8f1d24;
}

.approval-alert strong {
  display: block;
  margin-bottom: 4px;
  color: #c22930;
  font-size: 16px;
}

.approval-alert p {
  margin: 0;
  color: #944148;
}

.danger-outline-btn {
  border: 1px solid rgba(229, 72, 77, 0.35);
  background: #fff;
  color: #c22930;
  font-weight: 800;
}

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

.approval-row-pending {
  background: #fff8f8;
}

.approval-status {
  display: inline-flex;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.approval-status.pending {
  background: #ffe1e1;
  color: #c22930;
}

.approval-status.approved {
  background: #e4f7ec;
  color: #18794e;
}

.approval-status.rejected {
  background: #eef1f4;
  color: #59636e;
}

.approval-diff-cell {
  min-width: 360px;
  white-space: normal;
}

.approval-diff-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.approval-json {
  max-height: 240px;
  overflow: auto;
  margin: 8px 0 0;
  padding: 10px;
  border-radius: 8px;
  background: #f7fafc;
  color: #20303f;
  font-size: 12px;
  line-height: 1.45;
}

.admin-account-table {
  min-width: 1120px;
}

.admin-account-table input,
.admin-account-table select {
  min-width: 120px;
  margin: 0;
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 13px;
}

.admin-account-table th,
.admin-account-table td {
  padding: 8px 10px;
}

.message-table {
  min-width: 1180px;
}

.message-table .message-content-cell {
  min-width: 300px;
  max-width: 460px;
  white-space: normal;
  line-height: 1.55;
}

.message-table input,
.message-table select {
  min-width: 110px;
  margin: 0;
  padding: 7px 9px;
  border-radius: 6px;
  font-size: 13px;
}

.message-table input[data-message-field="reply"] {
  min-width: 220px;
}

.toast {
  position: fixed;
  right: 24px;
  top: 24px;
  z-index: 10;
  max-width: 380px;
  padding: 13px 16px;
  border-radius: 12px;
  background: #142433;
  color: #fff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

@media (max-width: 900px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .stats-grid,
  .two-col {
    grid-template-columns: 1fr;
  }
}

/* Final Academic Light Scientific admin theme. Visual-only overrides. */
:root {
  --admin-primary: #0f5b46;
  --admin-primary-2: #1f8f6a;
  --admin-ink: #111827;
  --admin-text: #334155;
  --admin-muted: #647488;
  --admin-line: #dde5dd;
  --admin-soft: #f7f7f4;
  --admin-soft-2: #eef6f2;
  --admin-white: #ffffff;
  --admin-warn: #d9322f;
}

body {
  background:
    linear-gradient(90deg, rgba(15, 91, 70, 0.028) 1px, transparent 1px),
    linear-gradient(180deg, rgba(15, 91, 70, 0.024) 1px, transparent 1px),
    #f7f7f4;
  background-size: 28px 28px, 28px 28px, auto;
  color: var(--admin-text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
textarea,
select {
  letter-spacing: 0;
}

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

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

button:active {
  transform: translateY(0);
}

.login-shell {
  background:
    radial-gradient(circle at 18% 14%, rgba(31, 143, 106, 0.14), transparent 28%),
    linear-gradient(90deg, rgba(15, 91, 70, 0.032) 1px, transparent 1px),
    linear-gradient(180deg, rgba(15, 91, 70, 0.028) 1px, transparent 1px),
    #f7f7f4;
  background-size: auto, 28px 28px, 28px 28px, auto;
}

.login-card {
  width: min(460px, 100%);
  padding: 34px;
  border: 1px solid rgba(221, 229, 221, 0.95);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 46px rgba(15, 91, 70, 0.11);
}

.brand-mark {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--admin-primary), var(--admin-primary-2));
  box-shadow: 0 12px 26px rgba(15, 91, 70, 0.2);
  color: #fff;
}

.login-card h1,
.topbar h1,
.library-head h2,
.dashboard-section-head h2,
.notice-card h2,
.settings-subpanel h2,
.editor-head h2 {
  color: var(--admin-ink);
  font-weight: 700;
  letter-spacing: 0;
}

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

.login-card p,
.topbar p,
.library-head p,
.notice-card p,
.settings-subpanel p,
.dashboard-section-head p,
.editor-head p {
  color: var(--admin-muted);
  line-height: 1.65;
}

label {
  color: var(--admin-text);
  font-size: 13px;
  font-weight: 650;
}

input,
textarea,
select {
  border: 1px solid var(--admin-line);
  border-radius: 10px;
  background: #fff;
  color: var(--admin-ink);
  box-shadow: inset 0 1px 0 rgba(15, 91, 70, 0.02);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(15, 91, 70, 0.42);
  box-shadow: 0 0 0 3px rgba(15, 91, 70, 0.08);
}

.login-card button,
.primary-btn {
  border: 1px solid var(--admin-primary);
  border-radius: 12px;
  background: var(--admin-primary);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 22px rgba(15, 91, 70, 0.18);
}

.login-card button:hover,
.primary-btn:hover {
  background: #0a4f3d;
  box-shadow: 0 14px 28px rgba(15, 91, 70, 0.22);
}

.ghost-btn,
.danger-outline-btn {
  border: 1px solid var(--admin-line);
  border-radius: 12px;
  background: #fff;
  color: var(--admin-primary);
  font-weight: 650;
  box-shadow: none;
}

.ghost-btn:hover {
  border-color: rgba(15, 91, 70, 0.28);
  background: var(--admin-soft-2);
}

.danger-outline-btn {
  border-color: rgba(217, 50, 47, 0.25);
  color: var(--admin-warn);
}

.message {
  color: var(--admin-warn);
}

.app-shell {
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--admin-line);
  background: rgba(255, 255, 255, 0.95);
  padding: 22px 16px;
  box-shadow: 12px 0 32px rgba(15, 91, 70, 0.04);
}

.sidebar-title {
  min-height: 54px;
  margin: 0 0 18px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  color: var(--admin-ink);
  font-size: 20px;
  font-weight: 750;
}

.sidebar-title::before {
  content: "LAB";
  width: 42px;
  height: 42px;
  margin-right: 10px;
  border-radius: 13px;
  background: var(--admin-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}

.nav-btn {
  min-height: 42px;
  margin-bottom: 5px;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--admin-muted);
  font-size: 14px;
  font-weight: 650;
}

.nav-btn:hover {
  background: #f2f7f4;
  color: var(--admin-primary);
}

.nav-btn.active {
  border-color: rgba(15, 91, 70, 0.12);
  background: #e6f1ec;
  color: var(--admin-primary);
  box-shadow: inset 3px 0 0 var(--admin-primary);
}

.sidebar-note {
  margin-top: 22px;
  border: 1px solid rgba(15, 91, 70, 0.12);
  border-radius: 12px;
  background: #f1f8f5;
  color: var(--admin-primary);
}

.main {
  padding: 24px 28px 48px;
}

.topbar {
  min-height: 72px;
  margin-bottom: 18px;
  padding: 0 2px;
  align-items: center;
}

.topbar h1 {
  margin: 0 0 4px;
  font-size: 28px;
  line-height: 1.25;
}

.topbar-actions {
  gap: 10px;
}

.scope-badge {
  min-width: 150px;
  border: 1px solid rgba(15, 91, 70, 0.18);
  background: #e6f1ec;
  color: var(--admin-primary);
  font-weight: 650;
}

.panel {
  border: 1px solid var(--admin-line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 14px 34px rgba(15, 91, 70, 0.06);
}

.dashboard-section + .dashboard-section,
.dashboard-section + .notice-card {
  margin-top: 22px;
}

.dashboard-section-head {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(221, 229, 221, 0.72);
}

.stats-grid {
  gap: 14px;
}

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

.stat-card {
  min-height: 112px;
  padding: 18px;
  border: 1px solid var(--admin-line);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff, #f7faf7);
}

.stat-card span {
  color: var(--admin-primary);
  font-size: 32px;
  line-height: 1;
  font-weight: 750;
}

.stat-card p {
  margin-top: 10px;
  color: var(--admin-muted);
  font-size: 13px;
  font-weight: 650;
}

.primary-stat {
  border-color: transparent;
  background: linear-gradient(145deg, var(--admin-primary), #18775b);
  box-shadow: 0 14px 28px rgba(15, 91, 70, 0.18);
}

.primary-stat span {
  color: #ffffff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.16);
}

.primary-stat p {
  color: rgba(255, 255, 255, 0.9);
}

.region-stat-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.region-stat-row,
.region-stat-empty,
.notice-card,
.editor-card,
.referral-standard-card {
  border: 1px solid var(--admin-line);
  border-radius: 14px;
  background: #fbfcfa;
}

.region-stat-row strong,
.referral-standard-card strong {
  color: var(--admin-primary);
}

.notice-card,
.editor-card {
  background: #f8faf8;
}

.form-grid {
  gap: 12px;
}

.two-col {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
}

.settings-subpanel {
  border-top: 1px solid var(--admin-line);
}

.library-tabs {
  border: 1px solid var(--admin-line);
  border-radius: 12px;
  background: #f1f6f3;
}

.library-tab {
  border-radius: 9px;
  color: var(--admin-muted);
  font-weight: 650;
}

.library-tab.active {
  background: var(--admin-primary);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 91, 70, 0.16);
}

.library-search-input {
  max-width: 560px;
  margin-bottom: 16px;
}

.table {
  border: 1px solid var(--admin-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.table table {
  min-width: 900px;
}

.table th,
.table td {
  padding: 12px 14px;
  border-bottom: 1px solid #edf1ec;
}

.table th,
.excel-table th {
  background: #f1f6f3;
  color: var(--admin-text);
  font-size: 13px;
  font-weight: 700;
}

.table td {
  color: var(--admin-text);
  font-size: 14px;
}

.excel-table th,
.excel-table td {
  border-right: 1px solid #edf1ec;
}

.excel-table .excel-row:hover td {
  background: #f7fbf8;
}

.excel-table .province-row td {
  background: #e6f1ec;
  color: var(--admin-primary);
  font-weight: 750;
}

.sortable-th:hover {
  color: var(--admin-primary);
  background: #e6f1ec;
}

.row-actions button {
  border: 1px solid var(--admin-line);
  border-radius: 9px;
  background: #fff;
  color: var(--admin-primary);
  font-weight: 650;
}

.row-actions button:hover {
  background: #f1f8f5;
}

.row-actions .danger {
  color: var(--admin-warn);
  border-color: rgba(217, 50, 47, 0.22);
}

.nav-badge {
  background: var(--admin-warn);
}

.approval-alert {
  border: 1px solid rgba(217, 50, 47, 0.2);
  border-radius: 14px;
  background: #fff6f5;
  color: #9d2826;
}

.approval-alert strong,
.approval-status.pending {
  color: var(--admin-warn);
}

.approval-status {
  border-radius: 999px;
}

.approval-status.pending {
  background: #ffe7e4;
}

/* Compact spreadsheet tables for operational screens. */
.table {
  margin-top: 14px;
  max-width: 100%;
  border-radius: 8px;
  overflow: auto;
  border-color: #d7e0d8;
}

.table table,
.table .excel-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  font-size: 13px;
  line-height: 1.25;
}

.table th,
.table td,
.excel-table th,
.excel-table td {
  height: 34px;
  max-height: 34px;
  padding: 6px 10px;
  border-right: 1px solid #dfe6df;
  border-bottom: 1px solid #dfe6df;
  vertical-align: middle;
  white-space: nowrap;
}

.table th,
.excel-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 36px;
  background: #eef4ef;
  color: #253445;
  font-size: 12px;
  font-weight: 700;
}

.table td,
.excel-table td {
  color: #2f3f4f;
  font-size: 13px;
}

.excel-row:hover td {
  background: #f7faf8;
}

.table th:first-child,
.table td:first-child {
  border-left: 0;
}

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

.table tbody tr:last-child td {
  border-bottom: 0;
}

.row-actions {
  min-width: 0;
  gap: 4px;
  flex-wrap: nowrap;
  white-space: nowrap;
}

.row-actions button,
.excel-table .row-actions button {
  min-height: 24px;
  padding: 3px 7px;
  border-radius: 5px;
  font-size: 12px;
  line-height: 1.2;
}

.excel-table input,
.excel-table select,
.admin-account-table input,
.admin-account-table select,
.message-table input,
.message-table select {
  height: 28px;
  min-height: 28px;
  margin: 0;
  padding: 4px 7px;
  border-radius: 5px;
  font-size: 12px;
}

.message-table .message-content-cell,
.approval-diff-cell,
.library-table td:nth-child(6),
.log-table td:nth-child(5) {
  min-width: 240px;
  max-width: 420px;
  white-space: normal;
  line-height: 1.35;
}

.approval-json {
  max-height: 160px;
  border-radius: 6px;
  font-size: 12px;
}

.excel-table .province-row td {
  height: 30px;
  padding: 5px 10px;
  background: #e7f1eb;
}

.approval-status.approved {
  background: #e6f1ec;
  color: var(--admin-primary);
}

.approval-json {
  border: 1px solid #e4ebe4;
  background: #fbfcfa;
}

.admin-account-table input,
.admin-account-table select,
.message-table input,
.message-table select {
  border-radius: 8px;
}

.toast {
  border: 1px solid rgba(15, 91, 70, 0.14);
  border-radius: 12px;
  background: var(--admin-primary);
  box-shadow: 0 14px 32px rgba(15, 91, 70, 0.22);
}

@media (max-width: 1180px) {
  .member-stats-grid,
  .stats-grid,
  .region-stat-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .sidebar {
    position: static;
    height: auto;
  }

  .main {
    padding: 18px;
  }

  .topbar,
  .library-head,
  .dashboard-section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .member-stats-grid,
  .stats-grid,
  .region-stat-list,
  .two-col {
    grid-template-columns: 1fr;
  }
}
