:root {
  color-scheme: light;
  --bg: #f3f5f7;
  --panel: #ffffff;
  --ink: #111827;
  --muted: #667085;
  --subtle: #98a2b3;
  --line: #e5e7eb;
  --brand: #ff6b35;
  --brand-soft: #fff3e8;
  --brand-line: #ffd9c8;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --warning: #d97706;
  --warning-soft: #fff7ed;
  --success: #16a34a;
  --success-soft: #ecfdf3;
  --shadow: 0 16px 36px rgba(15, 23, 42, 0.06);
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  border: 0;
  font: inherit;
}

button { cursor: pointer; }

.hidden { display: none !important; }

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(17, 24, 39, 0.08);
}

.login-brand,
.brand span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
}

.login-card h1,
.login-card p {
  margin: 14px 0 0;
}

.login-card p {
  color: var(--muted);
}

.login-card label {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: var(--muted);
  font-weight: 800;
}

.login-card input,
.top-actions input {
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.login-card button {
  width: 100%;
  height: 44px;
  margin-top: 22px;
  border-radius: 10px;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
}

.form-error {
  min-height: 20px;
  margin-top: 12px;
  color: var(--danger);
  font-size: 13px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  padding: 22px 18px;
  border-right: 1px solid var(--line);
  background: #fff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 2px 2px 18px;
  border-bottom: 1px solid var(--line);
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

nav {
  display: grid;
  gap: 18px;
}

.nav-group {
  display: grid;
  gap: 7px;
}

.nav-title {
  padding: 0 10px;
  color: var(--subtle);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

nav button,
.topbar button,
.panel-head button,
.toolbar button,
td button {
  min-height: 38px;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-weight: 850;
}

nav button {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  text-align: left;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

nav button strong,
nav button small {
  display: block;
}

nav button strong {
  color: inherit;
  font-size: 14px;
}

nav button small {
  max-width: 202px;
  overflow: hidden;
  color: var(--subtle);
  font-size: 11px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

nav button:hover {
  transform: translateX(2px);
  background: #f9fafb;
}

nav button.active,
.topbar button,
.toolbar button,
td button {
  color: var(--brand);
  background: var(--brand-soft);
}

nav button.active {
  box-shadow: inset 3px 0 0 var(--brand);
}

nav button.active small {
  color: #c36a45;
}

.workspace {
  min-width: 0;
  padding: 28px 30px 48px;
}

.topbar,
.panel-head,
.module-head,
.config-list div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 { font-size: 28px; }
h2 { font-size: 19px; }

.topbar p {
  margin-top: 6px;
  color: var(--muted);
}

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

.topbar button,
.toolbar button,
td button {
  padding: 0 14px;
}

.toolbar button.active {
  color: #fff;
  background: var(--brand);
}

#logout {
  color: var(--danger);
  background: #fee2e2;
}

.notice {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.notice.success {
  color: var(--success);
  background: #ecfdf3;
}

.notice.danger {
  color: var(--danger);
  border-color: #fecaca;
  background: var(--danger-soft);
}

.content-area {
  margin-top: 20px;
}

.module-head {
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #fbfcfe);
  box-shadow: var(--shadow);
}

.module-head p {
  margin-top: 6px;
  color: var(--muted);
}

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

.inline-search {
  display: flex;
  gap: 8px;
}

.inline-search input {
  height: 38px;
  min-width: 240px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.inline-search button,
.module-actions button {
  height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
}

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

.metrics article,
.panel,
.state-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metrics article,
.panel,
.state-card {
  padding: 18px;
}

.metrics span,
.metrics small,
.muted-line {
  display: block;
  color: var(--muted);
}

.metrics strong {
  display: block;
  margin: 10px 0 6px;
  font-size: 30px;
}

.metrics article.success {
  border-color: #bbf7d0;
  background: linear-gradient(180deg, #fff, var(--success-soft));
}

.metrics article.warning {
  border-color: #fed7aa;
  background: linear-gradient(180deg, #fff, var(--warning-soft));
}

.metrics article.danger {
  border-color: #fecaca;
  background: linear-gradient(180deg, #fff, var(--danger-soft));
}

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

.ops-grid button {
  display: grid;
  gap: 7px;
  min-height: 82px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  text-align: left;
}

.ops-grid strong {
  font-size: 15px;
}

.ops-grid span {
  color: var(--muted);
  font-size: 12px;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.panel {
  margin-top: 16px;
}

.panel.soft {
  color: var(--muted);
  background: #fff;
}

.conversation-audit {
  border-color: var(--brand-line);
  background: linear-gradient(180deg, #fff, #fffaf7);
}

.conversation-stream {
  display: grid;
  gap: 12px;
  max-height: 720px;
  padding: 4px;
  overflow: auto;
}

.audit-message {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.audit-message.risk {
  border-color: #fed7aa;
  background: #fffaf2;
}

.audit-message.deleted {
  opacity: 0.72;
  background: #f8fafc;
}

.audit-message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.audit-message-meta strong {
  color: var(--ink);
  font-size: 14px;
}

.audit-message p {
  margin: 0;
  color: var(--ink);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.conversation-pagination {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.panel-head small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.coupon-admin-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(260px, 1fr));
  gap: 16px;
  align-items: start;
}

.coupon-admin-card {
  display: grid;
  gap: 12px;
}

.coupon-admin-card label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 850;
}

.coupon-admin-card input,
.coupon-admin-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 12px 13px;
  color: var(--ink);
  font: inherit;
  outline: none;
}

.coupon-admin-card textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.5;
}

.coupon-admin-card .switch-line {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}

.coupon-admin-card .switch-line input {
  width: 18px;
  height: 18px;
}

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

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

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

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

th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: var(--muted);
  background: #f9fafb;
  font-size: 12px;
  font-weight: 900;
}

tbody tr:hover {
  background: #fcfcfd;
}

.actions-col,
.row-actions {
  min-width: 190px;
}

.row-actions {
  white-space: normal;
}

td button + button {
  margin-left: 6px;
  margin-top: 6px;
}

td button.success {
  color: var(--success);
  background: var(--success-soft);
}

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

td button:hover,
.toolbar button:hover,
.topbar button:hover {
  filter: brightness(0.98);
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

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

.workflow-grid button {
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 150px;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: #fff;
  box-shadow: var(--shadow);
  text-align: left;
}

.workflow-grid button:hover {
  border-color: var(--brand-line);
  transform: translateY(-1px);
}

.workflow-grid strong {
  font-size: 17px;
}

.workflow-grid small {
  color: var(--muted);
  line-height: 1.55;
}

.step-index {
  display: grid;
  place-items: center;
  width: 36px;
  height: 28px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 12px;
  font-weight: 900;
}

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

.safeguard-list p {
  display: grid;
  gap: 7px;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
}

.safeguard-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.health-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) auto minmax(260px, 1.4fr);
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

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

.health-row > span:first-child {
  font-weight: 850;
}

.health-row small {
  color: var(--muted);
  word-break: break-all;
}

.inline-search select {
  height: 38px;
  min-width: 140px;
  padding: 0 34px 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

.action-dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 20px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
}

.action-dialog::backdrop {
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(3px);
}

.action-dialog form {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  padding: 24px;
}

.dialog-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 950;
}

.dialog-icon.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.dialog-copy {
  min-width: 0;
}

.dialog-copy p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.65;
}

.dialog-note,
.dialog-error,
.dialog-actions {
  grid-column: 1 / -1;
}

.dialog-note {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.dialog-note textarea {
  width: 100%;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #f8fafc;
  font: inherit;
  line-height: 1.5;
  outline: none;
}

.dialog-note textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.12);
}

.dialog-error {
  min-height: 18px;
  color: var(--danger);
  font-size: 13px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.dialog-actions button {
  min-width: 96px;
  height: 42px;
  padding: 0 16px;
  border-radius: 10px;
  color: #fff;
  background: var(--brand);
  font-weight: 900;
}

.dialog-actions button.secondary {
  color: var(--muted);
  background: #f2f4f7;
}

.dialog-actions button.danger {
  background: var(--danger);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 900;
  font-size: 12px;
}

.pill.success {
  color: var(--success);
  background: var(--success-soft);
}

.pill.warning {
  color: var(--warning);
  background: var(--warning-soft);
}

.pill.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.pill.neutral {
  color: var(--muted);
  background: #f2f4f7;
}

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

.thumb-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 156px;
}

.image-thumb {
  width: 52px;
  height: 52px;
  padding: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #f8fafc;
  box-shadow: none;
  cursor: zoom-in;
}

.image-thumb.small {
  width: 44px;
  height: 44px;
  margin-top: 6px;
}

.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.thumb-fallback,
.thumb-more {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: #f2f4f7;
  font-size: 12px;
  font-weight: 850;
}

.contact-cell {
  display: grid;
  gap: 4px;
  min-width: 150px;
}

.contact-cell strong {
  color: var(--ink);
  font-size: 12px;
}

.contact-cell span {
  color: var(--muted);
  word-break: break-all;
}

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

.config-list div {
  padding: 14px;
  border-radius: 8px;
  background: #f9fafb;
}

.config-list dt,
.config-list dd {
  display: block;
}

.config-list dt {
  color: var(--muted);
  font-size: 13px;
}

.config-list dd {
  max-width: 360px;
  margin: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.state-card.error {
  color: var(--danger);
}

@media (max-width: 1100px) {
  .admin-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar {
    position: static;
    min-width: 0;
    height: auto;
    overflow: visible;
  }

  .metrics,
  .ops-grid,
  .coupon-admin-grid,
  .grid,
  .workflow-grid,
  .safeguard-list {
    grid-template-columns: 1fr;
  }

  nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
  }

  .topbar,
  .module-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-actions,
  .module-actions,
  .inline-search {
    width: 100%;
  }

  .top-actions input,
  .inline-search input {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 720px) {
  .workspace {
    padding: 20px 14px 36px;
  }

  .sidebar {
    padding: 14px;
  }

  .brand {
    margin-bottom: 12px;
    padding-bottom: 12px;
  }

  .brand span {
    width: 38px;
    height: 38px;
    border-radius: 10px;
  }

  nav {
    display: flex;
    gap: 8px;
    margin: 0 -14px;
    padding: 0 14px 4px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  nav::-webkit-scrollbar {
    display: none;
  }

  .nav-group {
    display: contents;
  }

  .nav-title,
  nav button small {
    display: none;
  }

  nav button {
    display: block;
    flex: 0 0 auto;
    min-height: 38px;
    padding: 9px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    white-space: nowrap;
  }

  nav button:hover {
    transform: none;
  }

  nav button.active {
    border-color: var(--brand-line);
    box-shadow: none;
  }

  .health-row {
    grid-template-columns: 1fr;
  }

  .top-actions,
  .inline-search,
  .dialog-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .top-actions input,
  .top-actions button,
  .inline-search input,
  .inline-search select,
  .inline-search button,
  .dialog-actions button {
    width: 100%;
  }
}

/* 2026 launch operations console */
:root {
  --bg: #f5f6f2;
  --panel: #ffffff;
  --ink: #17211d;
  --muted: #68736e;
  --subtle: #98a19d;
  --line: #e3e7e2;
  --brand: #f36b3f;
  --brand-strong: #d9552f;
  --brand-soft: #fff0e8;
  --brand-line: #facdbb;
  --sidebar: #17231f;
  --sidebar-soft: #23312c;
  --sidebar-ink: #f4f7f4;
  --danger: #c93f45;
  --danger-soft: #fff0f0;
  --warning: #b76b14;
  --warning-soft: #fff5dd;
  --success: #1d7a50;
  --success-soft: #eaf7f0;
  --shadow: 0 18px 50px rgba(29, 43, 36, 0.08);
  --shadow-soft: 0 8px 24px rgba(29, 43, 36, 0.06);
  --radius: 18px;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 0;
  background:
    radial-gradient(circle at 78% -20%, rgba(243, 107, 63, 0.08), transparent 30%),
    var(--bg);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(243, 107, 63, 0.24);
  outline-offset: 2px;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 1000;
  padding: 9px 14px;
  border-radius: 10px;
  color: #fff;
  background: var(--ink);
  transform: translate(-50%, -160%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

.login-view {
  position: relative;
  min-height: 100vh;
  padding: 34px;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 15%, rgba(255,255,255,0.12), transparent 27%),
    radial-gradient(circle at 82% 90%, rgba(243,107,63,0.22), transparent 28%),
    var(--sidebar);
}

.login-view::before,
.login-view::after {
  position: absolute;
  width: 340px;
  height: 340px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
  content: "";
}

.login-view::before { top: -190px; right: 12%; }
.login-view::after { bottom: -250px; left: 8%; width: 480px; height: 480px; }

.login-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 470px);
  align-items: center;
  gap: clamp(40px, 8vw, 130px);
  width: min(1180px, 100%);
  margin: auto;
}

.login-story {
  color: #fff;
}

.login-brand,
.brand .brand-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 16px 16px 16px 5px;
  color: #fff;
  background: linear-gradient(135deg, #ff875e, var(--brand));
  box-shadow: 0 12px 30px rgba(243,107,63,0.25);
  font-size: 14px;
  font-weight: 950;
  letter-spacing: -1px;
}

.login-story .eyebrow {
  margin-top: 38px;
  color: #f6bca8;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.login-story h1 {
  max-width: 720px;
  margin: 18px 0 0;
  font-size: clamp(36px, 4.4vw, 64px);
  line-height: 1.14;
  letter-spacing: -0.045em;
}

.login-capabilities {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 34px;
}

.login-capabilities span {
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 999px;
  color: #d9e1dd;
  background: rgba(255,255,255,0.04);
  font-size: 13px;
  font-weight: 750;
}

.login-card {
  width: 100%;
  padding: 38px;
  border: 1px solid rgba(255,255,255,0.55);
  border-radius: 28px;
  background: rgba(255,255,255,0.97);
  box-shadow: 0 34px 90px rgba(0,0,0,0.22);
}

.login-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--success);
  font-size: 12px;
  font-weight: 850;
}

.status-dot,
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #48c78e;
  box-shadow: 0 0 0 4px rgba(72,199,142,0.13);
}

.login-card h2 {
  margin-top: 20px;
  font-size: 32px;
  letter-spacing: -0.03em;
}

.login-card > p {
  margin-top: 10px;
  line-height: 1.65;
}

.login-card label {
  gap: 9px;
  margin-top: 22px;
  color: #3f4a45;
  font-size: 13px;
}

.login-card input {
  height: 50px;
  border-color: #dbe1dc;
  border-radius: 13px;
  background: #fafbf9;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.login-card input:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(243,107,63,0.10);
  outline: 0;
}

.login-card button {
  height: 50px;
  border-radius: 13px;
  background: linear-gradient(135deg, #fb7a50, var(--brand-strong));
  box-shadow: 0 12px 28px rgba(217,85,47,0.22);
}

.login-security {
  display: block;
  margin-top: 14px;
  color: var(--subtle);
  font-size: 11px;
  line-height: 1.55;
  text-align: center;
}

.admin-shell {
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
  transition: grid-template-columns 180ms ease;
}

.sidebar {
  z-index: 40;
  padding: 20px 14px 16px;
  border: 0;
  color: var(--sidebar-ink);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.025), transparent 16%),
    var(--sidebar);
  scrollbar-color: rgba(255,255,255,0.14) transparent;
}

.brand {
  min-height: 62px;
  margin: 0 2px 16px;
  padding: 4px 4px 17px;
  border-color: rgba(255,255,255,0.09);
}

.brand > div {
  min-width: 0;
  flex: 1;
}

.brand strong {
  color: #fff;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand small {
  color: #8fa098;
  font-size: 11px;
}

.brand .brand-mark {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 13px 13px 13px 4px;
  font-size: 12px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 11px;
}

.sidebar-collapse {
  width: 30px;
  height: 30px;
  min-height: 30px;
  color: #91a097;
  background: rgba(255,255,255,0.05);
}

.sidebar-collapse:hover { color: #fff; background: rgba(255,255,255,0.1); }

.nav-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  height: 42px;
  margin: 0 2px 18px;
  padding: 0 11px;
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: 12px;
  color: #82938b;
  background: rgba(255,255,255,0.045);
}

.nav-search input {
  width: 100%;
  padding: 0;
  color: #f5f7f6;
  background: transparent;
  outline: 0;
}

.nav-search input::placeholder { color: #74877e; }

.nav-search kbd {
  display: grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  border: 1px solid rgba(255,255,255,0.11);
  border-radius: 6px;
  color: #71827a;
  background: rgba(0,0,0,0.12);
  font: 11px inherit;
}

nav {
  gap: 22px;
  padding-bottom: 78px;
}

.nav-group { gap: 5px; }

.nav-title {
  padding: 0 10px 5px;
  color: #71827a;
  font-size: 10px;
  letter-spacing: 0.12em;
}

nav button {
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 7px 9px;
  border-radius: 12px;
  color: #aebbb4;
}

nav button:hover {
  color: #fff;
  background: rgba(255,255,255,0.055);
  transform: none;
}

nav button.active {
  color: #fff;
  background: linear-gradient(90deg, rgba(243,107,63,0.24), rgba(243,107,63,0.09));
  box-shadow: inset 3px 0 0 var(--brand);
}

nav button.active small { color: #e2a48e; }

nav button small {
  max-width: 178px;
  color: #71827a;
  font-size: 10px;
}

.nav-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #9cadA4;
  background: rgba(255,255,255,0.055);
  font-size: 12px;
  font-weight: 900;
}

nav button.active .nav-icon {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 7px 16px rgba(243,107,63,0.22);
}

.nav-copy { min-width: 0; }

.nav-empty {
  padding: 20px 10px;
  color: #82938b;
  font-size: 12px;
  text-align: center;
}

.sidebar-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 264px;
  min-height: 70px;
  padding: 13px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  background: rgba(23,35,31,0.95);
  backdrop-filter: blur(12px);
  transition: width 180ms ease;
}

.sidebar-footer div { min-width: 0; }
.sidebar-footer strong,
.sidebar-footer small { display: block; }
.sidebar-footer strong { color: #d7dfdb; font-size: 11px; }
.sidebar-footer small { margin-top: 3px; color: #71827a; font-size: 9px; white-space: nowrap; }

.sidebar-backdrop { display: none; }

.workspace {
  min-width: 0;
  padding: 28px clamp(24px, 3vw, 46px) 60px;
}

.topbar {
  align-items: flex-start;
  gap: 28px;
  width: min(1600px, 100%);
  margin: 0 auto;
}

.page-identity {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 7px;
  color: var(--subtle);
  font-size: 11px;
  font-weight: 800;
}

.breadcrumb b { color: #c8ceca; font-weight: 500; }

h1 { font-size: clamp(27px, 3vw, 36px); letter-spacing: -0.04em; }

.topbar p#pageDesc {
  max-width: 760px;
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.55;
}

.mobile-menu { display: none; }

.top-actions {
  flex: 0 0 auto;
  padding-top: 4px;
}

.topbar button,
.scope-controls button,
.module-actions button,
.inline-search button {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 850;
}

.topbar .refresh-button {
  color: var(--ink);
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-soft);
}

.refresh-button span {
  display: inline-block;
  margin-right: 5px;
  font-size: 17px;
}

.refresh-button.is-refreshing span { animation: spin 700ms linear infinite; }

#logout {
  color: #8d4b4e;
  background: #fff4f4;
  box-shadow: inset 0 0 0 1px #f1dddd;
}

.scope-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1600px, 100%);
  margin: 28px auto 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.76);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
}

.scope-copy {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 180px;
}

.scope-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 10px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 18px;
  font-weight: 900;
}

.scope-copy strong,
.scope-copy small { display: block; }
.scope-copy strong { font-size: 12px; }
.scope-copy small { margin-top: 2px; color: var(--muted); font-size: 10px; }

.scope-controls {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.scope-controls label {
  display: grid;
  gap: 5px;
  color: var(--subtle);
  font-size: 9px;
  font-weight: 850;
  letter-spacing: 0.04em;
}

.scope-controls input,
.inline-search input,
.inline-search select,
.coupon-admin-card input,
.coupon-admin-card textarea {
  min-width: 150px;
  height: 38px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  outline: 0;
}

.scope-controls input:focus,
.inline-search input:focus,
.inline-search select:focus,
.coupon-admin-card input:focus,
.coupon-admin-card textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(243,107,63,0.09);
}

.scope-controls button,
.module-actions button,
.inline-search button {
  min-height: 38px;
  color: #fff;
  background: var(--ink);
}

.scope-controls button.secondary {
  color: var(--muted);
  background: #edf0ed;
}

.notice {
  position: fixed;
  top: 20px;
  right: 22px;
  z-index: 100;
  max-width: min(430px, calc(100vw - 32px));
  margin: 0;
  padding: 13px 16px;
  border-color: #dfe4df;
  border-radius: 13px;
  background: rgba(255,255,255,0.96);
  box-shadow: 0 18px 50px rgba(23,33,29,0.18);
  animation: toast-in 180ms ease-out;
}

.content-area {
  display: grid;
  gap: 18px;
  width: min(1600px, 100%);
  margin: 24px auto 0;
}

.module-head {
  min-height: 78px;
  padding: 2px 2px 4px;
}

.module-head h2 {
  font-size: 21px;
  letter-spacing: -0.025em;
}

.module-head p {
  max-width: 800px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.module-actions,
.inline-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

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

.metrics article {
  position: relative;
  min-height: 126px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.metrics article::after {
  position: absolute;
  right: -26px;
  bottom: -34px;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: #f3f5f2;
  content: "";
}

.metrics article.success::after { background: var(--success-soft); }
.metrics article.warning::after { background: var(--warning-soft); }
.metrics article.danger::after { background: var(--danger-soft); }

.metrics span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.metrics strong {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 13px;
  font-size: 29px;
  line-height: 1;
  letter-spacing: -0.04em;
}

.metrics small {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 9px;
  color: var(--subtle);
  font-size: 10px;
}

.panel,
.coupon-admin-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.panel-head {
  padding-bottom: 14px;
  border-bottom: 1px solid #edf0ed;
}

.panel-head h2 { font-size: 16px; }
.panel-head small { color: var(--subtle); font-size: 10px; }

.ops-grid,
.workflow-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ops-grid button,
.workflow-grid button {
  min-height: 126px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.ops-grid button:hover,
.workflow-grid button:hover {
  border-color: var(--brand-line);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.toolbar {
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  padding: 5px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.toolbar button {
  flex: 0 0 auto;
  min-height: 34px;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
}

.toolbar button.active {
  color: #fff;
  background: var(--ink);
}

.data-table {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.panel .data-table {
  margin-top: 15px;
  border-right: 0;
  border-bottom: 0;
  border-left: 0;
  border-radius: 0;
  box-shadow: none;
}

.table-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.table-meta strong { color: var(--ink); }

.table-meta button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--muted);
  background: #f2f4f2;
  font-size: 10px;
  font-weight: 850;
}

.table-wrap {
  max-width: 100%;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

table { min-width: 760px; }

th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 44px;
  padding: 0 14px;
  color: #7a8580;
  background: #f7f8f6;
  font-size: 10px;
  letter-spacing: 0.025em;
}

td {
  min-width: 100px;
  padding: 13px 14px;
  border-color: #edf0ed;
  color: #35403b;
  font-size: 12px;
  line-height: 1.5;
  vertical-align: middle;
}

tbody tr { transition: background 120ms ease; }
tbody tr:hover { background: #fbfcfa; }

.row-actions {
  min-width: 170px;
  gap: 6px;
}

td button {
  min-height: 31px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 10px;
  box-shadow: none;
}

.pill {
  min-height: 23px;
  border: 1px solid rgba(243,107,63,0.09);
  font-size: 10px;
}

.state-card {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  min-height: 128px;
  padding: 22px;
  border: 1px dashed #d9dfda;
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255,255,255,0.72);
  text-align: left;
}

.state-card > div { flex: 1; }
.state-card strong { display: block; color: var(--ink); }
.state-card p { margin-top: 5px; font-size: 12px; }

.state-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  border-radius: 12px;
  color: var(--muted);
  background: #edf0ed;
  font-size: 18px;
  font-weight: 900;
}

.state-card.error {
  border-color: #f0cfd0;
  color: #8d4b4e;
  background: #fff9f9;
}

.state-card.error .state-icon { color: var(--danger); background: var(--danger-soft); }

.state-card button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 10px;
  color: #fff;
  background: var(--ink);
  font-weight: 850;
}

.loading-state {
  position: relative;
  display: grid;
  gap: 14px;
  overflow: hidden;
}

.loading-state::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,0.75) 50%, transparent 80%);
  content: "";
  animation: shimmer 1.25s infinite;
}

.loading-head { display: flex; justify-content: space-between; }
.loading-head span,
.loading-metrics i,
.loading-panel { display: block; border-radius: 14px; background: #e9ece8; }
.loading-head span:first-child { width: 240px; height: 28px; }
.loading-head span:last-child { width: 170px; height: 38px; }
.loading-metrics { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.loading-metrics i { height: 122px; }
.loading-panel { height: 260px; }
.loading-state p { color: var(--subtle); font-size: 11px; }

.action-dialog {
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 24px;
}

.action-dialog::backdrop { background: rgba(14,24,20,0.56); }

body.sidebar-collapsed .admin-shell { grid-template-columns: 82px minmax(0, 1fr); }
body.sidebar-collapsed .brand > div,
body.sidebar-collapsed .nav-copy,
body.sidebar-collapsed .nav-title,
body.sidebar-collapsed .nav-search input,
body.sidebar-collapsed .nav-search kbd,
body.sidebar-collapsed .sidebar-footer div { display: none; }
body.sidebar-collapsed .brand { justify-content: center; gap: 4px; flex-wrap: wrap; }
body.sidebar-collapsed .brand .brand-mark { width: 38px; height: 38px; }
body.sidebar-collapsed .sidebar-collapse { width: 38px; }
body.sidebar-collapsed .nav-search { grid-template-columns: 1fr; justify-items: center; padding: 0; }
body.sidebar-collapsed nav button { grid-template-columns: 1fr; justify-items: center; padding: 7px; }
body.sidebar-collapsed .sidebar-footer { width: 82px; justify-content: center; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

@media (max-width: 1380px) {
  .metrics { grid-template-columns: repeat(4, minmax(150px, 1fr)); }
  .scope-bar { align-items: flex-start; }
  .scope-controls { max-width: 620px; }
}

@media (max-width: 1180px) {
  .admin-shell,
  body.sidebar-collapsed .admin-shell { display: block; }

  .sidebar,
  body.sidebar-collapsed .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(300px, calc(100vw - 54px));
    height: 100vh;
    padding: 20px 14px 16px;
    overflow: auto;
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open { overflow: hidden; }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: block;
    visibility: hidden;
    background: rgba(9,17,13,0.52);
    opacity: 0;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  body.sidebar-open .sidebar-backdrop { visibility: visible; opacity: 1; }

  body.sidebar-collapsed .brand > div,
  body.sidebar-collapsed .nav-copy,
  body.sidebar-collapsed .nav-title,
  body.sidebar-collapsed .nav-search input,
  body.sidebar-collapsed .nav-search kbd,
  body.sidebar-collapsed .sidebar-footer div { display: block; }
  body.sidebar-collapsed .brand { justify-content: flex-start; flex-wrap: nowrap; }
  body.sidebar-collapsed .nav-search { grid-template-columns: auto minmax(0,1fr) auto; padding: 0 11px; }
  body.sidebar-collapsed nav button { grid-template-columns: 32px minmax(0,1fr); justify-items: stretch; padding: 7px 9px; }

  .sidebar-collapse { display: none; }
  .sidebar-footer,
  body.sidebar-collapsed .sidebar-footer { position: sticky; bottom: -16px; width: calc(100% + 28px); margin: 0 -14px -16px; }
  nav { display: grid; grid-template-columns: 1fr; gap: 22px; margin: 0; padding: 0 0 20px; overflow: visible; }
  .nav-group { display: grid; }
  .nav-title,
  nav button small { display: block; }
  nav button,
  nav button.active { border: 0; border-radius: 12px; box-shadow: none; }
  nav button.active { box-shadow: inset 3px 0 0 var(--brand); }

  .workspace { padding-top: 22px; }
  .mobile-menu { display: inline-grid; flex: 0 0 auto; color: var(--ink); background: #fff; box-shadow: inset 0 0 0 1px var(--line); }
  .scope-bar { flex-direction: column; }
  .scope-controls { width: 100%; max-width: none; justify-content: flex-start; }
  .ops-grid,
  .workflow-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 820px) {
  .workspace { padding: 18px 16px 44px; }
  .topbar,
  .module-head { align-items: flex-start; flex-direction: column; }
  .top-actions { width: 100%; padding: 0; }
  .top-actions button { flex: 1; }
  .scope-bar { margin-top: 20px; }
  .scope-controls label { flex: 1 1 180px; }
  .scope-controls input { width: 100%; min-width: 0; }
  .metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .safeguard-list { grid-template-columns: 1fr; }
  .loading-metrics { grid-template-columns: repeat(2, 1fr); }
  .loading-metrics i:nth-child(n+5) { display: none; }
}

@media (max-width: 620px) {
  html,
  body,
  .admin-shell,
  .workspace,
  .content-area { max-width: 100%; overflow-x: hidden; }
  .login-view { padding: 18px; background: var(--sidebar); }
  .login-stage { display: block; }
  .login-story { margin-bottom: 22px; }
  .login-story .eyebrow,
  .login-capabilities { display: none; }
  .login-story h1 { margin-top: 18px; font-size: 27px; line-height: 1.2; }
  .login-story h1 br { display: none; }
  .login-card { padding: 27px 22px; border-radius: 22px; }
  .login-card h2 { font-size: 27px; }

  .workspace { padding: 16px 12px 38px; }
  .page-identity { gap: 9px; }
  h1 { font-size: 26px; }
  .breadcrumb { margin-top: 2px; }
  .topbar p#pageDesc { font-size: 12px; }
  .top-actions { flex-direction: row; }
  .top-actions button { width: auto; font-size: 12px; }

  .scope-bar { padding: 13px; border-radius: 14px; }
  .scope-controls { display: grid; grid-template-columns: 1fr 1fr; align-items: end; }
  .scope-controls label { grid-column: 1 / -1; }
  .scope-controls button { width: 100%; }

  .content-area { gap: 14px; margin-top: 18px; }
  .module-head { min-height: 0; gap: 14px; }
  .module-actions,
  .inline-search { width: 100%; }
  .inline-search input,
  .inline-search select,
  .inline-search button { width: 100%; }

  .metrics { gap: 9px; }
  .metrics article { min-height: 112px; padding: 15px; }
  .metrics strong { font-size: 25px; }
  .ops-grid,
  .workflow-grid { grid-template-columns: 1fr; }
  .ops-grid button,
  .workflow-grid button { min-height: 106px; }
  .panel { padding: 15px; border-radius: 15px; }

  .config-list div {
    display: grid;
    grid-template-columns: minmax(76px, 0.36fr) minmax(0, 1fr);
    align-items: start;
    gap: 10px;
  }

  .config-list dd {
    max-width: 100%;
    overflow: visible;
    white-space: normal;
    word-break: break-all;
  }

  .health-row {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .health-row small { min-width: 0; word-break: break-word; }

  .data-table { overflow: visible; border: 0; background: transparent; box-shadow: none; }
  .table-meta { min-height: 42px; margin-bottom: 8px; border: 1px solid var(--line); border-radius: 11px; background: #fff; }
  .table-wrap { overflow: visible; }
  table,
  thead,
  tbody,
  tr,
  td { display: block; width: 100%; min-width: 0; }
  thead { display: none; }
  tbody { display: grid; gap: 10px; }
  tbody tr { padding: 8px 13px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: var(--shadow-soft); }
  td {
    display: grid;
    grid-template-columns: minmax(74px, 0.38fr) minmax(0, 1fr);
    gap: 12px;
    min-height: 38px;
    padding: 9px 0;
    border-bottom: 1px solid #edf0ed;
    word-break: break-word;
  }
  td::before { color: var(--subtle); content: attr(data-label); font-size: 10px; font-weight: 850; }
  td:last-child { border-bottom: 0; }
  td.row-actions { display: flex; min-width: 0; padding-top: 12px; }
  td.row-actions::before { display: none; }
  td.row-actions button { flex: 1 1 auto; min-height: 36px; }

  .notice { top: 12px; right: 12px; }
  .action-dialog form { grid-template-columns: 1fr; padding: 20px; }
  .dialog-icon { display: none; }
  .dialog-copy,
  .dialog-note,
  .dialog-error,
  .dialog-actions { grid-column: 1; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Operations dashboard */
.dashboard-actions,
.range-tabs,
.trend-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-actions > button,
.range-tabs button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--muted);
  background: #fff;
  font-weight: 850;
}

.range-tabs {
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8faf9;
}

.range-tabs button {
  min-height: 32px;
  border: 0;
  background: transparent;
}

.range-tabs button.active {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 5px 14px rgba(255, 107, 53, 0.2);
}

.launch-banner {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 17px 19px;
  border: 1px solid;
  border-radius: 16px;
}

.launch-banner.ready { border-color: #b7e4c7; background: #f1fbf4; }
.launch-banner.blocked { border-color: #fecaca; background: #fff6f5; }
.launch-banner strong,
.launch-banner p { display: block; margin: 0; }
.launch-banner p { margin-top: 3px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.launch-banner button { min-height: 38px; padding: 0 14px; border-radius: 10px; color: #fff; background: var(--danger); font-weight: 850; }

.launch-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  font-weight: 950;
}

.launch-banner.ready .launch-mark { background: var(--success); }
.launch-banner.blocked .launch-mark { background: var(--danger); }

.dashboard-primary-grid,
.dashboard-secondary-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.9fr);
  gap: 16px;
}

.dashboard-secondary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dashboard-primary-grid > *,
.dashboard-secondary-grid > * { min-width: 0; }

.trend-legend { justify-content: flex-end; margin: 2px 0 12px; color: var(--muted); font-size: 12px; font-weight: 750; }
.trend-legend span { display: inline-flex; align-items: center; gap: 6px; }
.trend-legend i { width: 9px; height: 9px; border-radius: 3px; }
.trend-legend i.active,
.trend-bars i.active { background: #ff7b4b; }
.trend-legend i.content,
.trend-bars i.content { background: #2f7d67; }

.trend-scroll { max-width: 100%; overflow-x: auto; padding: 3px 0 2px; }
.trend-chart {
  display: flex;
  align-items: stretch;
  gap: 7px;
  min-width: max-content;
  height: 238px;
  padding: 10px 3px 0;
  border-bottom: 1px solid var(--line);
  background-image: linear-gradient(to bottom, rgba(229, 231, 235, 0.7) 1px, transparent 1px);
  background-size: 100% 25%;
}

.trend-day {
  display: grid;
  grid-template-rows: minmax(0, 1fr) 25px;
  width: 34px;
  min-width: 34px;
  height: 100%;
}

.trend-bars { display: flex; align-items: end; justify-content: center; gap: 3px; height: 100%; }
.trend-bars i { display: block; width: 10px; min-height: 0; border-radius: 5px 5px 2px 2px; transition: height 160ms ease; }
.trend-day small { align-self: end; color: var(--subtle); font-size: 9px; text-align: center; transform: rotate(-38deg); transform-origin: center; }

.finance-ledger dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 14px 0 0;
}

.finance-ledger dl div {
  min-width: 0;
  padding: 13px;
  border: 1px solid #ecefeb;
  border-radius: 12px;
  background: #fafcfb;
}

.finance-ledger dt { color: var(--muted); font-size: 11px; font-weight: 850; }
.finance-ledger dd { margin: 5px 0 3px; color: var(--ink); font-size: 20px; font-weight: 950; letter-spacing: -0.03em; }
.finance-ledger small { color: var(--subtle); font-size: 10px; line-height: 1.4; }

.alert-list { display: grid; gap: 8px; margin-top: 12px; }
.alert-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.alert-item > i { width: 8px; height: 8px; border-radius: 50%; background: var(--warning); }
.alert-item.danger > i { background: var(--danger); }
.alert-item span strong,
.alert-item span small { display: block; }
.alert-item span small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.alert-item > b { color: var(--brand); font-size: 11px; white-space: nowrap; }

.all-clear { display: flex; align-items: center; gap: 12px; min-height: 90px; padding: 15px; border-radius: 13px; background: var(--success-soft); }
.all-clear > span { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; color: #fff; background: var(--success); font-weight: 950; }
.all-clear strong,
.all-clear small { display: block; }
.all-clear small { margin-top: 4px; color: var(--muted); }

.readiness-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.readiness-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 61px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafcfb;
}

.readiness-item > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; color: #fff; font-size: 11px; font-weight: 950; }
.readiness-item.ready > span { background: var(--success); }
.readiness-item.blocked > span { background: var(--danger); }
.readiness-item strong,
.readiness-item small { display: block; }
.readiness-item strong { font-size: 12px; }
.readiness-item small { margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.system-readiness { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 0; }
.system-readiness .readiness-item { background: #fff; box-shadow: var(--shadow-soft); }

.content-breakdown {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 13px;
}

.content-breakdown article { min-width: 0; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: #fafcfb; }
.content-breakdown span,
.content-breakdown strong,
.content-breakdown small { display: block; }
.content-breakdown span { color: var(--muted); font-size: 11px; font-weight: 850; }
.content-breakdown strong { margin-top: 5px; font-size: 22px; }
.content-breakdown small { margin-top: 3px; color: var(--subtle); font-size: 10px; }
.content-breakdown i,
.funnel-stage > i { display: block; height: 5px; margin-top: 10px; overflow: hidden; border-radius: 999px; background: #e8edea; }
.content-breakdown i b,
.funnel-stage > i b { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #ff9a73); }

.funnel-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 13px; }
.funnel-card { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #fafcfb; }
.funnel-title { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.funnel-title small { color: var(--subtle); font-size: 9px; }
.funnel-stages { display: grid; gap: 12px; margin-top: 14px; }
.funnel-stage > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 5px; }
.funnel-stage span { min-width: 0; overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.funnel-stage strong { font-size: 14px; }
.funnel-stage small { grid-column: 1 / -1; color: var(--subtle); font-size: 9px; }
.funnel-stage > i b { background: linear-gradient(90deg, #2f7d67, #73b7a3); }

.quick-ops { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.definitions-panel { padding: 0; overflow: hidden; }
.definitions-panel summary { padding: 17px 19px; cursor: pointer; font-weight: 900; }
.definitions-panel > div { display: grid; gap: 0; padding: 0 19px 18px; }
.definitions-panel p { display: grid; grid-template-columns: minmax(110px, 0.22fr) minmax(0, 1fr); gap: 12px; margin: 0; padding: 10px 0; border-top: 1px solid var(--line); }
.definitions-panel p strong { font-size: 12px; }
.definitions-panel p span { color: var(--muted); font-size: 12px; line-height: 1.65; }

@media (max-width: 1180px) {
  .dashboard-primary-grid { grid-template-columns: 1fr; }
  .system-readiness { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .funnel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .dashboard-actions { width: 100%; }
  .dashboard-actions > button { flex: 1 1 auto; }
  .dashboard-secondary-grid { grid-template-columns: 1fr; }
  .system-readiness,
  .content-breakdown { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-ops { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .range-tabs { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; }
  .range-tabs button { padding: 0 6px; }
  .launch-banner { grid-template-columns: auto minmax(0, 1fr); padding: 14px; }
  .launch-banner button { grid-column: 1 / -1; width: 100%; }
  .finance-ledger dl,
  .readiness-grid,
  .system-readiness,
  .content-breakdown,
  .funnel-grid,
  .quick-ops { grid-template-columns: 1fr; }
  .trend-chart { height: 210px; }
  .definitions-panel p { grid-template-columns: 1fr; gap: 4px; }
}
