:root {
  color: #14181f;
  background: #f5f7f8;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; min-height: 100vh; }
button, input, select, textarea { font: inherit; letter-spacing: 0; }
button { cursor: pointer; }

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(300px, 0.85fr) minmax(420px, 1.15fr);
  background: #f5f7f8;
}

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: 56px;
  color: #f8fafc;
  background: #16292a;
}

.login-brand h1 { margin: 0 0 8px; font-size: 34px; }
.login-brand p { margin: 0; color: #b9cecc; }
.brand-mark {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #0e2525;
  background: #4ad9c5;
  font-weight: 800;
  font-size: 20px;
}

.brand-mark-small { width: 36px; height: 36px; font-size: 13px; }
.login-panel {
  width: min(420px, calc(100% - 48px));
  align-self: center;
  justify-self: center;
  display: grid;
  gap: 22px;
  padding: 34px;
  background: #fff;
  border: 1px solid #dde3e7;
  border-radius: 8px;
  box-shadow: 0 16px 48px rgba(19, 38, 43, 0.1);
}

.login-heading { display: flex; gap: 14px; }
.login-heading > svg { width: 30px; color: #148f80; flex: 0 0 auto; }
.login-heading h2 { margin: 0 0 6px; font-size: 22px; }
.login-heading p { margin: 0; color: #68727e; font-size: 14px; line-height: 1.6; }
.login-panel label { display: grid; gap: 8px; color: #4c5864; font-size: 13px; }
.login-panel input,
.table-toolbar input,
.table-toolbar select,
.channel-toolbar input,
.channel-toolbar select,
.channel-dialog input,
.channel-dialog select,
.channel-dialog textarea {
  width: 100%;
  height: 40px;
  border: 1px solid #cfd7dc;
  border-radius: 6px;
  padding: 0 12px;
  color: #171b21;
  background: #fff;
  outline: none;
}
.channel-dialog textarea { min-height: 92px; resize: vertical; padding-block: 10px; line-height: 1.5; }

.login-panel input:focus,
.table-toolbar input:focus,
.table-toolbar select:focus,
.channel-toolbar input:focus,
.channel-toolbar select:focus,
.channel-dialog input:focus,
.channel-dialog select:focus,
.channel-dialog textarea:focus { border-color: #148f80; box-shadow: 0 0 0 3px rgba(20, 143, 128, 0.12); }
.primary-button,
.secondary-button,
.pagination button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  font-weight: 650;
}

.primary-button { color: #fff; background: #137d72; }
.primary-button:hover { background: #106c63; }
.primary-button:disabled { cursor: wait; opacity: 0.55; }
.form-error { margin: -6px 0 0; color: #c83d45; font-size: 13px; }

.admin-shell { min-height: 100vh; display: grid; grid-template-columns: 224px minmax(0, 1fr); }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 18px 12px;
  color: #dce8e7;
  background: #152728;
}

.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand span { margin-top: 3px; color: #94aaa8; font-size: 11px; }
.sidebar nav { min-height: 0; display: grid; gap: 4px; overflow-y: auto; padding-right: 2px; }
.nav-item {
  width: 100%;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  color: #c6d6d5;
  background: transparent;
  text-align: left;
}

.nav-item svg { width: 19px; }
.nav-item:hover { color: #fff; background: #203839; }
.nav-item-active { color: #0f2c2a; background: #63ddcb; }
.nav-item-active:hover { color: #0f2c2a; background: #63ddcb; }
.sidebar-account {
  margin-top: auto;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 32px;
  gap: 9px;
  align-items: center;
  padding: 14px 8px 0;
  border-top: 1px solid #294143;
}

.operator-avatar { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: #152728; background: #f3c563; font-weight: 800; }
.operator-copy { min-width: 0; }
.operator-copy strong, .operator-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.operator-copy strong { font-size: 13px; }
.operator-copy span { color: #91a5a4; font-size: 11px; }
.icon-button { width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 5px; color: #b8cbca; background: transparent; }
.icon-button:hover { color: #fff; background: #294143; }
.icon-button svg { width: 18px; }

.workspace { min-width: 0; padding: 28px clamp(22px, 3vw, 44px) 36px; }
.workspace-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 26px; }
.workspace-header h1 { margin: 0; font-size: 25px; }
.workspace-header p { margin: 6px 0 0; color: #77818b; font-size: 13px; }
.secondary-button { display: inline-flex; align-items: center; gap: 7px; border: 1px solid #cfd7dc; color: #36424c; background: #fff; }
.secondary-button:hover { border-color: #93a2aa; }
.secondary-button svg { width: 17px; }

.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(170px, 1fr)); gap: 14px; }
.metric-card { min-width: 0; min-height: 108px; display: flex; align-items: center; gap: 14px; padding: 18px; border: 1px solid #dde3e7; border-radius: 8px; background: #fff; }
.metric-card p { margin: 0 0 7px; color: #6f7983; font-size: 12px; }
.metric-card strong { display: block; overflow: hidden; text-overflow: ellipsis; font-size: 23px; }
.metric-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 7px; flex: 0 0 auto; }
.metric-icon svg { width: 21px; }
.metric-teal { color: #117b70; background: #dff7f2; }
.metric-blue { color: #3867ae; background: #e7effb; }
.metric-violet { color: #7857a7; background: #f0eafb; }
.metric-amber { color: #a66d13; background: #fff0d2; }
.metric-red { color: #b83b44; background: #fde8e8; }

.runtime-summary { margin-top: 18px; min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 20px 22px; border: 1px solid #dde3e7; border-radius: 8px; background: #fff; }
.runtime-summary > div:first-child { display: flex; align-items: center; gap: 14px; }
.section-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 7px; color: #245f78; background: #e5f3f8; }
.section-icon svg { width: 21px; }
.runtime-summary h2 { margin: 0 0 5px; font-size: 15px; }
.runtime-summary p { margin: 0; color: #77818b; font-size: 12px; }
.runtime-values { display: grid; gap: 5px; text-align: right; }
.runtime-values span { color: #77818b; font-size: 12px; }
.runtime-alert { color: #c03a43 !important; }

.table-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.table-toolbar form { position: relative; width: min(390px, 100%); }
.table-toolbar form svg { position: absolute; top: 11px; left: 12px; width: 17px; color: #7d8790; }
.table-toolbar form input { padding-left: 38px; }
.table-toolbar .promotion-search input { padding-right: 45px; }
.promotion-search button { position: absolute; top: 4px; right: 5px; color: #42605c; }
.promotion-search button:hover { color: #123e38; background: #e4efec; }
.table-toolbar .promotion-search button svg { position: static; width: 17px; }
.table-toolbar select { width: 180px; }
.table-toolbar > span { color: #77818b; font-size: 12px; }
.channel-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 170px auto auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.channel-toolbar form { position: relative; }
.channel-toolbar form svg { position: absolute; top: 11px; left: 12px; width: 17px; color: #7d8790; }
.channel-toolbar form input { padding-left: 38px; }
.channel-toolbar > span { color: #77818b; font-size: 12px; text-align: right; }
.toolbar-action { display: inline-flex; align-items: center; justify-content: center; gap: 7px; white-space: nowrap; }
.toolbar-action svg { width: 17px; }
.table-frame { overflow: auto; border: 1px solid #dde3e7; border-radius: 8px; background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { height: 42px; padding: 0 16px; color: #66717b; background: #f7f9fa; text-align: left; font-size: 11px; font-weight: 650; white-space: nowrap; }
td { min-height: 54px; padding: 12px 16px; border-top: 1px solid #edf0f2; color: #313a43; white-space: nowrap; }
td strong, td small { display: block; }
td small { margin-top: 4px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; color: #89929b; font-size: 10px; }
.table-action { display: inline-flex; align-items: center; gap: 5px; border: 0; color: #126f66; background: transparent; font-weight: 650; }
.table-action:hover { color: #0c514b; }
.table-action svg { width: 16px; }
.empty-cell { height: 160px; color: #89929b; text-align: center; }
.status-badge { display: inline-flex; align-items: center; min-height: 24px; padding: 0 8px; border-radius: 999px; font-size: 11px; }
.status-positive { color: #166d58; background: #e1f5ed; }
.status-negative { color: #ae333c; background: #fde9ea; }
.status-warning { color: #8e610f; background: #fff1d2; }
.status-neutral { color: #5f6972; background: #edf0f2; }

.phase-bc-shell { min-width: 0; }
.phase-bc-sections { display: grid; gap: 28px; }
.phase-bc-sections > section { min-width: 0; }
.section-heading-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.section-heading { min-width: 0; display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.section-heading > span { width: 34px; height: 34px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 7px; color: #146f67; background: #e1f4f0; }
.section-heading svg { width: 18px; }
.section-heading h2 { margin: 1px 0 4px; font-size: 16px; }
.section-heading p { margin: 0; max-width: 720px; color: #76818a; font-size: 12px; line-height: 1.55; }
.success-banner { min-height: 44px; display: flex; align-items: center; gap: 9px; margin-bottom: 18px; padding: 9px 13px; border: 1px solid #a9d9cb; border-radius: 7px; color: #176451; background: #edf9f5; font-size: 13px; }
.success-banner svg { width: 19px; }
.storage-band { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 18px 0 20px; border-bottom: 1px solid #dde3e7; }
.storage-band > div:first-child { display: flex; align-items: center; gap: 12px; }
.storage-band > div:first-child > svg { width: 28px; color: #347295; }
.storage-band h2 { margin: 0 0 5px; font-size: 16px; }
.storage-band p { margin: 0; color: #74808a; font-size: 12px; }
.storage-band dl { display: grid; grid-template-columns: repeat(5, minmax(90px, 1fr)); gap: 20px; margin: 0; }
.storage-band dl > div { min-width: 0; }
.storage-band dt { margin-bottom: 6px; color: #7a858e; font-size: 11px; }
.storage-band dd { margin: 0; color: #263039; font-size: 13px; font-weight: 650; }
.action-cell { display: flex; align-items: center; gap: 10px; }
.table-action-danger { color: #b43843; }
.table-action-danger:hover { color: #842831; }
.settlement-controls { display: flex; align-items: center; gap: 9px; }
.settlement-controls select { height: 40px; min-width: 160px; border: 1px solid #cfd7dc; border-radius: 6px; padding: 0 10px; color: #303a43; background: #fff; }
.approval-target { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding: 12px 14px; border-left: 3px solid #168b7e; color: #44515a; background: #f2f7f7; font-size: 12px; }
.approval-target span { min-width: 0; overflow-wrap: anywhere; text-align: right; }
.decision-warning { display: flex; align-items: center; gap: 9px; margin-bottom: 18px; padding: 12px 14px; border: 1px solid #efd39b; border-radius: 7px; color: #80590f; background: #fff7e5; font-size: 12px; }
.decision-warning svg { width: 20px; flex: 0 0 auto; }
.dialog-textarea-label { display: grid; gap: 8px; color: #48535c; font-size: 13px; }
.danger-button { min-height: 40px; border: 0; border-radius: 6px; padding: 0 16px; color: #fff; background: #ae3540; font-weight: 650; }
.danger-button:hover { background: #922d36; }
.danger-button:disabled { cursor: wait; opacity: 0.55; }

.loading-state { min-height: 300px; display: flex; align-items: center; justify-content: center; gap: 9px; color: #78838c; }
.loading-state svg { width: 20px; animation: spin 0.9s linear infinite; }
.error-banner { min-height: 48px; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; padding: 10px 14px; border: 1px solid #f2b8bc; border-radius: 7px; color: #9f2f37; background: #fff1f1; font-size: 13px; }
.error-banner svg { width: 20px; flex: 0 0 auto; }
.error-banner button { margin-left: auto; border: 0; color: #9f2f37; background: transparent; font-weight: 700; }
.pagination { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: 14px; color: #77818b; font-size: 12px; }
.pagination button { min-height: 34px; border: 1px solid #cfd7dc; color: #35414b; background: #fff; }
.pagination button:disabled { cursor: default; opacity: 0.45; }
.pagination button svg { width: 16px; height: 16px; }
.resolution-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 24, 28, 0.52);
}
.channel-dialog {
  width: min(620px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 24px;
  border: 1px solid #d8dfe3;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 70px rgba(8, 21, 24, 0.24);
}
.channel-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.channel-dialog h2 { margin: 0 0 6px; font-size: 21px; }
.channel-dialog header p { margin: 0; color: #717c85; font-size: 13px; line-height: 1.55; }
.dialog-close { width: 34px; height: 34px; display: grid; place-items: center; border: 0; color: #69747d; background: transparent; }
.dialog-close svg { width: 22px; }
.channel-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.channel-form-grid label { display: grid; align-content: start; gap: 7px; color: #48535c; font-size: 13px; }
.channel-form-grid label > small { color: #7b858d; font-size: 11px; }
.channel-form-wide { grid-column: 1 / -1; }
.channel-dialog footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid #e5e9eb; }
.refund-review-summary { margin-block: 16px; border-block: 1px solid #e5e9eb; padding-block: 14px; }
.refund-review-summary dl { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 9px 14px; margin: 0; font-size: 13px; }
.refund-review-summary dt { color: #69747d; }
.refund-review-summary dd { margin: 0; overflow-wrap: anywhere; }
.refund-review-summary .refund-review-amount { color: #972f35; font-size: 18px; font-weight: 700; }
.refund-review-summary p, .refund-review-note { font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.refund-review-summary details { color: #69747d; font-size: 12px; }
.refund-review-summary summary { cursor: pointer; }
.refund-review-summary code { display: block; margin-top: 8px; overflow-wrap: anywhere; }
.refund-confirm { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; font-size: 13px; line-height: 1.6; }
.channel-dialog .refund-confirm input { width: 18px; height: 18px; min-height: 18px; margin: 2px 0 0; padding: 0; flex: 0 0 18px; accent-color: #148f80; }
.refund-dialog .table-action { margin-bottom: 16px; }
.refund-dialog header > div, .decision-dialog header > div { min-width: 0; }
.refund-dialog .dialog-close, .decision-dialog .dialog-close { flex: 0 0 34px; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 1100px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(170px, 1fr)); }
  .storage-band { align-items: flex-start; flex-direction: column; }
  .storage-band dl { width: 100%; }
}

@media (max-width: 760px) {
  .refund-review-summary dl { grid-template-columns: 1fr; gap: 4px; }
  .refund-review-summary dd { margin-bottom: 9px; }
  .refund-dialog footer, .decision-dialog footer { flex-wrap: wrap; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { min-height: 210px; padding: 34px 24px; }
  .login-panel { margin: 28px auto; }
  .admin-shell { grid-template-columns: 72px minmax(0, 1fr); }
  .sidebar { padding-inline: 9px; }
  .sidebar-brand { justify-content: center; padding-inline: 0; }
  .sidebar-brand > div:last-child, .nav-item span, .operator-copy { display: none; }
  .nav-item { justify-content: center; padding: 0; }
  .sidebar-account { grid-template-columns: 1fr; justify-items: center; padding-inline: 0; }
  .workspace { padding: 22px 14px 28px; }
  .workspace-header { align-items: flex-start; }
  .workspace-header p { max-width: 270px; }
  .metric-grid { grid-template-columns: 1fr; }
  .runtime-summary { align-items: flex-start; flex-direction: column; }
  .runtime-values { text-align: left; }
  .table-toolbar { align-items: stretch; flex-direction: column; }
  .table-toolbar form, .table-toolbar select { width: 100%; }
  .channel-toolbar { grid-template-columns: 1fr; }
  .channel-toolbar > span { text-align: left; }
  .channel-form-grid { grid-template-columns: 1fr; }
  .channel-form-wide { grid-column: auto; }
  .section-heading-row { align-items: stretch; flex-direction: column; }
  .storage-band dl { grid-template-columns: repeat(2, minmax(100px, 1fr)); }
  .settlement-controls { align-items: stretch; flex-direction: column; }
  .settlement-controls select { width: 100%; }
}
.approval-recovery-history {
  margin: 0;
  padding-left: 24px;
}
.approval-recovery-history li {
  margin-bottom: 12px;
  overflow-wrap: anywhere;
}
.approval-recovery-history span {
  display: block;
  font-size: 12px;
  color: var(--text-secondary, #666);
}
