:root {
  --bg-page: #e7f7fd;
  --bg-surface: #d9d9db;
  --bg-panel: #efefef;
  --bg-dark: #5b5b5b;
  --bg-pill: #e6ecff;
  --line: #c6c9cf;
  --text: #1e2228;
  --text-muted: #5f6673;
  --accent: #84df9f;
  --accent-strong: #3ea65f;
  --warning: #ffb8b8;
  --error: #c23333;
  --error-bg: #fff0f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 1.25rem;
  min-height: 100vh;
  background: radial-gradient(circle at top left, #dff4fb 0%, var(--bg-page) 45%, #dceff6 100%);
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  background: var(--bg-surface);
  border: 1px solid #d0d0d0;
  border-radius: 8px;
  box-shadow: 0 18px 55px rgba(54, 62, 73, 0.14);
  overflow: hidden;
}

.topbar {
  background: #f3f3f3;
  border-bottom: 1px solid var(--line);
  padding: 0.75rem 0.85rem;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.company-select {
  background: #9ee5b3;
  border: 1px solid #8fd7a3;
  border-radius: 6px;
  color: #0f341a;
  font-weight: 600;
  font-size: 0.79rem;
  padding: 0.3rem 1.65rem 0.3rem 0.5rem;
}

.admin-link {
  margin-left: auto;
  border: 1px solid #ccd4e4;
  border-radius: 5px;
  background: #f8fbff;
  color: #2f425a;
  font-size: 0.68rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.35rem 0.64rem;
}

.admin-link:hover {
  background: #edf3ff;
}

.breadcrumbs {
  min-height: 2rem;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.crumb {
  background: var(--bg-pill);
  color: #3663c1;
  border: 1px solid #c6d7ff;
  border-radius: 5px;
  font-size: 0.68rem;
  padding: 0.28rem 0.46rem;
  white-space: nowrap;
}

.crumb-button {
  cursor: pointer;
  font-family: inherit;
}

.crumb-button:hover {
  background: #dce8ff;
}

.crumb-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.top-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-top: 0.45rem;
}

.tab-chip {
  border: 0;
  border-radius: 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--bg-dark);
  color: #fff;
  padding: 0.4rem 0.85rem;
}

.tab-chip.active {
  background: #404040;
}

.demo-panel {
  background: linear-gradient(120deg, #f6fbff 0%, #ecf3ff 100%);
  border-bottom: 1px solid var(--line);
  padding: 0.72rem 0.85rem 0.82rem;
}

.demo-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.demo-field {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: #4f5763;
  font-weight: 600;
}

.role-select {
  min-width: 9rem;
  height: 1.9rem;
  border: 1px solid #cdd8ee;
  border-radius: 5px;
  background: #fff;
  font-size: 0.76rem;
  color: #1d2a3a;
  padding: 0.2rem 0.45rem;
}

.role-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.9rem;
  border-radius: 999px;
  border: 1px solid #d0dae6;
  padding: 0.2rem 0.68rem;
  font-size: 0.71rem;
  font-weight: 700;
  background: #eef2f8;
  color: #2f3946;
}

.role-pill.role-planner {
  background: #e5f7ea;
  border-color: #bfe8cb;
  color: #205f33;
}

.role-pill.role-operations {
  background: #eef1f6;
  border-color: #d7dde6;
  color: #364150;
}

.role-pill.role-finance {
  background: #edf5ff;
  border-color: #cadfff;
  color: #1f4f8f;
}

.role-pill.role-sales {
  background: #fff4e8;
  border-color: #ffd9b4;
  color: #8c4b18;
}

.role-pill.role-admin {
  background: #f5ebff;
  border-color: #e2cef8;
  color: #56358a;
}

.demo-jump {
  border: 1px solid #cad6eb;
  border-radius: 5px;
  background: #fff;
  color: #2c3b4f;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.35rem 0.56rem;
  cursor: pointer;
}

.demo-jump:hover {
  background: #f0f5ff;
}

.demo-hint {
  margin: 0.5rem 0 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #334660;
}

.demo-steps {
  margin: 0.35rem 0 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.2rem;
}

.demo-steps li {
  font-size: 0.67rem;
  color: #526178;
}

.planning-panel {
  background: #ededee;
  padding: 0.72rem 0.85rem 0.95rem;
  border-bottom: 1px solid var(--line);
}

.load-status {
  min-height: 1.2rem;
  margin-bottom: 0.42rem;
  font-size: 0.71rem;
  font-weight: 600;
  color: #5c6470;
}

.load-status.success {
  color: #22663a;
}

.load-status.error {
  color: var(--error);
}

.rate-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.field-inline {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: #48505d;
}

.field-inline input {
  width: 5.2rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  height: 1.7rem;
  font-size: 0.77rem;
  padding: 0.2rem 0.42rem;
}

.primary-btn {
  border: 0;
  border-radius: 5px;
  background: #2f2f2f;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.42rem 0.85rem;
  cursor: pointer;
}

.primary-btn:hover {
  background: #171717;
}

.primary-btn.danger {
  background: #a33939;
}

.primary-btn.danger:hover {
  background: #8b2f2f;
}

.primary-btn:disabled {
  background: #8a8f97;
  cursor: not-allowed;
}

.secondary-btn {
  border: 1px solid #c7cfdd;
  border-radius: 5px;
  background: #f8fbff;
  color: #304051;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.38rem 0.7rem;
  cursor: pointer;
}

.secondary-btn:hover {
  background: #edf4ff;
}

.secondary-btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.planning-grid {
  display: grid;
  grid-template-columns: 2fr 1.2fr 1.4fr;
  gap: 0.85rem;
}

.metric-column {
  display: grid;
  gap: 0.31rem;
}

.metric-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(80px, 135px);
  align-items: center;
  gap: 0.48rem;
}

.metric-row label {
  font-size: 0.67rem;
  color: #4e555f;
  font-weight: 600;
}

.metric-value {
  height: 1.6rem;
  border-radius: 4px;
  border: 1px solid #d6d8dd;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 0.48rem;
  font-size: 0.72rem;
  color: #2b3139;
  font-weight: 500;
}

.section-banner {
  background: var(--bg-dark);
  color: #fff;
  font-size: 0.66rem;
  font-weight: 600;
  padding: 0.4rem 0.85rem;
}

.order-panel {
  background: #ececed;
  border-bottom: 1px solid var(--line);
  padding: 0.85rem;
}

.order-panel h2 {
  margin: 0 0 0.55rem;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0.012em;
  font-size: 1.13rem;
}

.order-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 0.85rem;
}

.kv-table {
  border: 1px solid var(--line);
  background: #f5f5f6;
}

.kv-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(110px, 1.35fr);
  border-bottom: 1px solid #dadce2;
}

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

.kv-key,
.kv-val {
  font-size: 0.67rem;
  padding: 0.33rem 0.5rem;
}

.kv-key {
  color: #5c6670;
  border-right: 1px solid #dadce2;
}

.kv-val {
  color: #1f2530;
}

.ghost-btn {
  margin-top: 0.68rem;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.44rem;
  border: 0;
  background: transparent;
  color: #4b525c;
  font-size: 0.73rem;
  font-weight: 600;
  cursor: pointer;
}

.ghost-btn:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.menu-icon {
  font-size: 1rem;
}

.table-panel {
  padding: 0.82rem;
  background: #e8e8ea;
}

.table-hint {
  margin-bottom: 0.5rem;
  font-size: 0.67rem;
  color: #5a6778;
}

.table-scroll {
  overflow: auto;
  border: 1px solid var(--line);
  background: #f6f6f7;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

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

.room-table thead th {
  position: sticky;
  top: 0;
  background: #f8f8f9;
  color: #646b78;
  font-size: 0.62rem;
  font-weight: 700;
  text-align: left;
  padding: 0.34rem 0.34rem;
  border-bottom: 1px solid #cfd3db;
  white-space: nowrap;
}

.room-table tbody td {
  font-size: 0.65rem;
  border-bottom: 1px solid #e0e2e7;
  padding: 0.26rem 0.34rem;
  color: #2d3440;
  background: #fff;
  white-space: nowrap;
}

.room-table tbody tr:hover td {
  background: #f8fbff;
}

.room-input {
  width: 5rem;
  height: 1.45rem;
  border-radius: 4px;
  border: 1px solid #d6d9df;
  background: #fff;
  font-size: 0.66rem;
  padding: 0.2rem 0.34rem;
}

.room-input:disabled,
.weekday:disabled {
  cursor: not-allowed;
  opacity: 0.7;
}

.room-input.small {
  width: 3.6rem;
}

.recurrence {
  width: 7rem;
}

.input-error {
  border-color: var(--error);
  background: var(--error-bg);
}

.room-row.is-pending td {
  background: #f7f8fd;
}

.room-row.is-failed td {
  background: #fff7f7;
}

.weekday {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: #4f8fff;
  cursor: pointer;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.2rem;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.16rem 0.28rem;
}

.tag.ok {
  background: #b4f0c8;
  color: #054517;
}

.tag.warn {
  background: var(--warning);
  color: #691414;
}

.save-btn {
  border: 0;
  border-radius: 4px;
  background: #5b87ff;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.25rem 0.45rem;
  cursor: pointer;
}

.save-btn:hover {
  background: #3366e8;
}

.save-btn:disabled {
  background: #97a8d9;
  cursor: wait;
}

.save-btn.retry {
  background: #b74d4d;
}

.save-btn.retry:hover {
  background: #983636;
}

.save-cell {
  min-width: 5.5rem;
}

.room-table thead th:last-child,
.room-table tbody td:last-child,
.room-table tfoot td:last-child {
  position: sticky;
  right: 0;
}

.room-table tbody td:last-child {
  background: #fefefe;
}

.row-error-text {
  margin-top: 0.2rem;
  font-size: 0.57rem;
  color: var(--error);
  white-space: normal;
  max-width: 8rem;
}

.empty-state {
  text-align: center;
  font-size: 0.72rem;
  color: #667182;
  padding: 1rem 0.5rem;
}

.workflow-panel {
  background: #ececef;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 0.82rem;
}

.workflow-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(280px, 1fr));
  gap: 0.82rem;
}

.workflow-card {
  border: 1px solid #cfd3dc;
  background: #f7f8fb;
  border-radius: 8px;
  padding: 0.72rem;
  display: grid;
  gap: 0.58rem;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-head h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.93rem;
}

.status-pill {
  border-radius: 999px;
  border: 1px solid #cad4e6;
  padding: 0.18rem 0.54rem;
  background: #ebf0f9;
  color: #2f3f56;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
}

.status-pill.status-draft {
  background: #ecf2ff;
  border-color: #ccdcff;
  color: #2d5494;
}

.status-pill.status-submitted {
  background: #fff3e8;
  border-color: #ffdcb9;
  color: #995b23;
}

.status-pill.status-approved,
.status-pill.status-published {
  background: #e7f8eb;
  border-color: #c9ebd1;
  color: #2f6f3f;
}

.status-pill.status-rejected {
  background: #fdecec;
  border-color: #f5cccc;
  color: #8f3535;
}

.status-pill.status-archived {
  background: #eff1f5;
  border-color: #d7dbe4;
  color: #505d70;
}

.workflow-controls {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.workflow-select {
  min-width: 10rem;
  border: 1px solid #ccd4e2;
  border-radius: 4px;
  background: #fff;
  height: 1.8rem;
  font-size: 0.74rem;
  color: #273545;
  padding: 0.2rem 0.4rem;
}

.workflow-field {
  display: grid;
  gap: 0.25rem;
  font-size: 0.7rem;
  color: #4a5565;
  font-weight: 600;
}

.workflow-field textarea {
  border: 1px solid #d1d7e1;
  border-radius: 5px;
  background: #fff;
  font-size: 0.72rem;
  color: #263343;
  padding: 0.34rem 0.44rem;
  resize: vertical;
}

.workflow-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.workflow-actions .primary-btn,
.workflow-actions .secondary-btn {
  font-size: 0.68rem;
  padding: 0.36rem 0.6rem;
}

.event-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.34rem;
  max-height: 14rem;
  overflow: auto;
}

.event-item {
  border: 1px solid #d9deea;
  border-radius: 6px;
  background: #fff;
  padding: 0.38rem 0.44rem;
  display: grid;
  gap: 0.18rem;
}

.event-item.empty {
  color: #5a6677;
  font-size: 0.68rem;
}

.event-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.event-action {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #24374f;
}

.event-time {
  font-size: 0.61rem;
  color: #6a7484;
}

.event-note {
  font-size: 0.64rem;
  color: #435163;
}

.event-links {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.event-link {
  font-size: 0.64rem;
  font-weight: 700;
  color: #2f61c1;
  text-decoration: none;
}

.event-link:hover {
  text-decoration: underline;
}

.event-link-btn {
  border: 1px solid #d4d9e6;
  border-radius: 4px;
  background: #f7f8fb;
  color: #364457;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.18rem 0.35rem;
  cursor: pointer;
}

.event-link-btn:hover {
  background: #edf1f8;
}

.kpi-grid {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(110px, 1fr));
  gap: 0.35rem;
}

.kpi-item {
  margin: 0;
  border: 1px solid #d8deea;
  border-radius: 6px;
  background: #fff;
  padding: 0.35rem 0.4rem;
  display: grid;
  gap: 0.12rem;
}

.kpi-item dt {
  font-size: 0.6rem;
  color: #647084;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.kpi-item dd {
  margin: 0;
  font-size: 0.73rem;
  color: #1f2d3d;
  font-weight: 700;
}

.export-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.68rem;
  color: #445261;
  font-weight: 600;
}

.room-table tfoot td {
  font-size: 0.66rem;
  font-weight: 700;
  border-top: 2px solid #cfd5df;
  background: #f0f5ff;
  padding: 0.34rem 0.34rem;
}

.workflow-modules-panel {
  border-top: 1px solid #c9cfdb;
  border-bottom: 1px solid #c9cfdb;
  background: #f3f5fa;
  padding: 0.72rem 0.82rem;
  display: grid;
  gap: 0.55rem;
}

.workflow-module-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.workflow-module-head h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.9rem;
  color: #22334a;
}

.module-scope-pill {
  border: 1px solid #cad5e8;
  border-radius: 999px;
  background: #e8eef9;
  color: #35557d;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.14rem 0.52rem;
  text-transform: uppercase;
}

.workflow-module-description {
  margin: 0;
  font-size: 0.68rem;
  color: #41536b;
  font-weight: 600;
}

.workflow-module-content {
  display: grid;
  gap: 0.5rem;
}

.module-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 0.45rem;
}

.module-metric {
  border: 1px solid #d5ddeb;
  border-radius: 6px;
  background: #fff;
  padding: 0.36rem 0.45rem;
  display: grid;
  gap: 0.1rem;
}

.module-metric-label {
  font-size: 0.58rem;
  color: #61738d;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  font-weight: 700;
}

.module-metric-value {
  font-size: 0.77rem;
  color: #1f3249;
  font-weight: 700;
}

.module-metric-hint {
  font-size: 0.58rem;
  color: #627184;
}

.module-rows-wrap {
  border: 1px solid #d4dbe8;
  border-radius: 6px;
  background: #fff;
  padding: 0.4rem 0.48rem;
  display: grid;
  gap: 0.3rem;
}

.module-rows-wrap h4 {
  margin: 0;
  font-size: 0.67rem;
  color: #30455f;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.module-rows {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.24rem;
  max-height: 12rem;
  overflow: auto;
}

.module-row {
  border: 1px solid #e1e6ef;
  border-radius: 5px;
  padding: 0.28rem 0.32rem;
  background: #fafbfd;
}

.module-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.module-row-label {
  font-size: 0.66rem;
  color: #334a64;
  font-weight: 600;
}

.module-row-value {
  font-size: 0.66rem;
  color: #1f3148;
  font-weight: 700;
}

.module-row-meta {
  margin-top: 0.11rem;
  font-size: 0.59rem;
  color: #5b6f87;
}

.module-empty {
  border: 1px dashed #c7cfdd;
  border-radius: 6px;
  padding: 0.5rem 0.55rem;
  font-size: 0.65rem;
  color: #5a6c81;
  background: #f8fafe;
}

.workflow-tab-help {
  border-top: 1px solid #bfc3cd;
  background: #dedee0;
  padding: 0.58rem 0.82rem 0;
  font-size: 0.66rem;
  font-weight: 600;
  color: #364355;
  min-height: 1.5rem;
}

.workflow-tab-help.ready {
  color: #1f5f35;
}

.workflow-tabs {
  padding: 0.44rem 0.82rem 0.72rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  background: #dedee0;
}

.workflow-chip {
  border: 1px solid #4f5968;
  border-radius: 4px;
  padding: 0.3rem 0.5rem;
  font-size: 0.6rem;
  font-weight: 600;
  color: #ebebeb;
  background: #5d5d5d;
  cursor: pointer;
}

.workflow-chip.is-ready {
  border-color: #516174;
}

.workflow-chip.active {
  background: #40bf65;
  border-color: #2f9e52;
  color: #f6fffa;
}

.toast {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  background: #17263e;
  color: #fff;
  padding: 0.56rem 0.78rem;
  border-radius: 6px;
  font-size: 0.75rem;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.admin-body {
  background: radial-gradient(circle at top left, #e8f2ff 0%, #d5e8f8 40%, #d7ebf5 100%);
  color: #182335;
}

.admin-shell {
  max-width: 1420px;
  margin: 0 auto;
  background: #edf2f8;
  border: 1px solid #ced9e4;
  border-radius: 12px;
  box-shadow: 0 20px 48px rgba(32, 55, 89, 0.2);
  overflow: hidden;
}

.admin-topbar {
  padding: 1rem 1.1rem;
  border-bottom: 1px solid #cfd9e4;
  background: linear-gradient(125deg, #f8fbff 0%, #ebf4ff 52%, #f4f8ff 100%);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.admin-eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #2f5483;
  text-transform: uppercase;
}

.admin-topbar h1 {
  margin: 0;
  font-size: 1.45rem;
  font-family: "Space Grotesk", sans-serif;
}

.admin-subtitle {
  margin: 0.3rem 0 0;
  color: #3a4f67;
  font-size: 0.78rem;
  max-width: 35rem;
}

.admin-home-link {
  white-space: nowrap;
}

.admin-controls {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding: 0.72rem 1.1rem;
  border-bottom: 1px solid #d2dbe7;
  background: #f7fafe;
}

.admin-status {
  min-height: 1.6rem;
  padding: 0.26rem 0.5rem;
  border-radius: 4px;
  font-size: 0.71rem;
  font-weight: 600;
  color: #43556c;
}

.admin-status.success {
  background: #e8faef;
  color: #1f6d3b;
}

.admin-status.error {
  background: #fdeeee;
  color: #8f2f2f;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
  padding: 0.78rem 1.1rem 0.88rem;
  border-bottom: 1px solid #d3dce8;
  background: #edf4fb;
}

.admin-metric-card {
  border: 1px solid #cfdae8;
  border-radius: 8px;
  background: #f8fbff;
  padding: 0.58rem 0.68rem;
}

.admin-metric-card h2 {
  margin: 0;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #506782;
}

.admin-metric-value {
  margin: 0.28rem 0 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #223a5b;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(215px, 250px) minmax(0, 1fr) minmax(310px, 360px);
  gap: 0.72rem;
  padding: 0.8rem 1.1rem 1rem;
  background: #eef3f9;
}

.admin-sidebar,
.admin-grid-panel,
.admin-editor-panel {
  border: 1px solid #d0dae7;
  border-radius: 8px;
  background: #f9fbfe;
}

.admin-sidebar {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 36rem;
}

.admin-sidebar-head {
  padding: 0.56rem 0.62rem;
  border-bottom: 1px solid #d7dfea;
}

.admin-sidebar-head h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.84rem;
  color: #294669;
}

.admin-table-list {
  margin: 0;
  padding: 0.5rem;
  list-style: none;
  display: grid;
  gap: 0.38rem;
  max-height: 34rem;
  overflow: auto;
}

.admin-table-item {
  width: 100%;
  border: 1px solid #cfd8e5;
  border-radius: 6px;
  background: #fff;
  color: #26384f;
  font-size: 0.7rem;
  padding: 0.38rem 0.44rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  cursor: pointer;
}

.admin-table-item strong {
  font-size: 0.67rem;
  color: #385a83;
}

.admin-table-item:hover {
  background: #eef5ff;
}

.admin-table-item.active {
  background: #dfeeff;
  border-color: #abc8f3;
  color: #17375e;
}

.admin-table-list-empty {
  font-size: 0.7rem;
  color: #62748a;
  padding: 0.4rem;
}

.admin-grid-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 36rem;
}

.admin-table-head {
  border-bottom: 1px solid #d7dfeb;
  padding: 0.64rem 0.7rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.admin-table-head h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.94rem;
  color: #233e5f;
}

.admin-table-meta {
  margin: 0.25rem 0 0;
  color: #52667f;
  font-size: 0.67rem;
}

.admin-page-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.admin-page-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.5rem;
  padding: 0.28rem 0.46rem;
  border: 1px solid #d0d9e7;
  border-radius: 6px;
  background: #eef3fa;
  font-size: 0.67rem;
  font-weight: 600;
  color: #30435b;
}

.admin-table-wrap {
  overflow: auto;
}

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

.admin-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #eef3fb;
  color: #4f627c;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  text-align: left;
  border-bottom: 1px solid #d3dce8;
  padding: 0.32rem 0.35rem;
  white-space: nowrap;
}

.admin-table tbody td {
  font-size: 0.67rem;
  color: #27384f;
  border-bottom: 1px solid #e0e7f1;
  padding: 0.3rem 0.35rem;
  vertical-align: top;
  max-width: 16rem;
  word-break: break-word;
}

.admin-table tbody tr:hover td {
  background: #f2f7ff;
}

.admin-table tbody tr.is-selected td {
  background: #e6f1ff;
}

.admin-edit-btn {
  font-size: 0.62rem;
  padding: 0.22rem 0.44rem;
}

.admin-editor-panel {
  padding: 0.72rem;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 0.5rem;
  min-height: 36rem;
}

.admin-editor-panel h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.89rem;
  color: #29486d;
}

.admin-editor-hint {
  margin: 0;
  font-size: 0.67rem;
  color: #566f8c;
}

.admin-editor {
  width: 100%;
  min-height: 24rem;
  border: 1px solid #cfd8e7;
  border-radius: 7px;
  background: #fff;
  color: #1c2f47;
  font-family: "IBM Plex Mono", "SFMono-Regular", ui-monospace, monospace;
  font-size: 0.66rem;
  line-height: 1.45;
  padding: 0.55rem;
  resize: vertical;
}

.admin-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

@media (max-width: 1080px) {
  body {
    padding: 0.4rem;
  }

  .app-shell {
    border-radius: 0;
  }

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

  .metric-column:last-child {
    grid-column: span 2;
  }

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

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

  .demo-toolbar {
    gap: 0.4rem;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar,
  .admin-grid-panel,
  .admin-editor-panel {
    min-height: auto;
  }

  .admin-editor {
    min-height: 16rem;
  }
}

@media (max-width: 720px) {
  body {
    padding: 0;
  }

  .topbar,
  .demo-panel,
  .planning-panel,
  .order-panel,
  .table-panel,
  .workflow-panel,
  .workflow-modules-panel,
  .workflow-tab-help,
  .workflow-tabs {
    padding-left: 0.55rem;
    padding-right: 0.55rem;
  }

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

  .module-row-main {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.12rem;
  }

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

  .metric-column:last-child {
    grid-column: auto;
  }

  .metric-row {
    grid-template-columns: 1fr minmax(96px, 124px);
  }

  .rate-controls {
    align-items: stretch;
  }

  .field-inline {
    flex-direction: column;
    align-items: flex-start;
  }

  .field-inline input {
    width: 100%;
  }

  .primary-btn {
    width: 100%;
  }

  .company-select {
    width: 100%;
  }

  .role-select {
    width: 100%;
  }

  .demo-field {
    width: 100%;
    justify-content: space-between;
  }

  .demo-jump {
    flex: 1;
    text-align: center;
  }

  .workflow-controls {
    align-items: stretch;
  }

  .workflow-select {
    width: 100%;
  }

  .workflow-actions .primary-btn,
  .workflow-actions .secondary-btn {
    flex: 1;
    min-width: 8.5rem;
  }

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

  .room-table {
    min-width: 1320px;
  }

  .toast {
    right: 0.5rem;
    left: 0.5rem;
    bottom: 0.6rem;
    font-size: 0.71rem;
  }

  .admin-topbar,
  .admin-controls,
  .admin-metrics,
  .admin-layout {
    padding-left: 0.6rem;
    padding-right: 0.6rem;
  }

  .admin-topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-home-link {
    width: 100%;
    text-align: center;
  }

  .admin-controls {
    align-items: stretch;
  }

  .admin-status {
    width: 100%;
  }

  .admin-metrics {
    grid-template-columns: 1fr;
  }

  .admin-page-controls {
    width: 100%;
  }

  .admin-page-controls .secondary-btn {
    flex: 1;
  }

  .admin-page-label {
    min-width: 6rem;
    flex: 1;
  }

  .admin-editor-actions .primary-btn,
  .admin-editor-actions .secondary-btn {
    flex: 1;
  }
}
