:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --ink: #1d2433;
  --muted: #667085;
  --line: #d8dee8;
  --soft: #eef2f7;
  --blue: #2563eb;
  --blue-soft: #eaf1ff;
  --red: #d92d20;
  --amber: #b54708;
  --green: #16803c;
  --shadow: 0 14px 34px rgba(29, 36, 51, .08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Yu Gothic", "Meiryo", "Noto Sans JP", Arial, sans-serif;
  line-height: 1.45;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 288px 1fr;
}
.side {
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}
.brand {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 6px;
}
.oflow-brand {
  display: block;
  width: min(209px, 100%);
  max-width: 100%;
  line-height: 0;
}
.oflow-logo-card {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 209 / 66;
  max-width: 100%;
}
.subtle { color: var(--muted); font-size: 13px; }
.nav { display: grid; gap: 8px; margin: 22px 0; }
.nav button {
  border: 1px solid transparent;
  background: transparent;
  text-align: left;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
}
.nav button.active {
  border-color: #bfd2ff;
  background: var(--blue-soft);
  color: #1746ad;
  font-weight: 700;
}
.main {
  padding: 24px 28px 40px;
  min-width: 0;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
h1 { margin: 0; font-size: 30px; letter-spacing: 0; }
h2 { margin: 0 0 12px; font-size: 21px; }
h3 { margin: 0 0 10px; font-size: 16px; }

.btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 9px 13px;
  color: var(--ink);
  font-weight: 700;
}
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 9px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: minmax(0, 1fr) 360px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.panel.tight { padding: 12px; box-shadow: none; }
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.day {
  min-height: 70px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 8px;
  text-align: left;
}
.day.active { border-color: var(--blue); background: var(--blue-soft); }
.day .count { color: var(--blue); font-weight: 800; font-size: 12px; }
.week { color: var(--muted); font-size: 12px; text-align: center; padding: 4px; }

.list { display: grid; gap: 8px; }
.list-item {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 10px;
}
.list-item.active { border-color: var(--blue); background: var(--blue-soft); }
.list-title { font-weight: 800; }
.meta { color: var(--muted); font-size: 12px; margin-top: 3px; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
  background: var(--soft);
  color: #475467;
}
.badge.red { background: #fff1f0; color: var(--red); }
.badge.amber { background: #fffbeb; color: var(--amber); }
.badge.green { background: #ecfdf3; color: var(--green); }
.badge.blue { background: var(--blue-soft); color: #1746ad; }
.update-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 21px;
  margin-left: 6px;
  border: 1px solid #2563eb;
  border-radius: 999px;
  background: #ffffff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
  box-shadow: 0 2px 7px rgba(37, 99, 235, .16);
}
.agency-ui .update-marker,
.admin-ui .update-marker {
  color: #1d4ed8;
}
tr.has-update td {
  background: #f5f9ff;
}
tr.has-update td:first-child {
  box-shadow: inset 3px 0 0 #2563eb;
}
.agency-ui tr.is-history-row td {
  background: #f8fafc;
}
.message-line.message-unread,
.message-item.message-unread,
.agency-history-item.message-unread {
  position: relative;
  border: 0;
  border-radius: 8px;
  background: #fff7f7;
  box-shadow: inset 0 0 0 2px #dc2626;
  padding: 6px 8px;
}
.message-line.message-unread {
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 2px 0 5px;
  min-height: 32px;
  padding: 5px 8px;
}
.message-line.message-unread:last-child {
  border-bottom: 0;
}
.message-line.message-unread .message-line-body {
  padding-right: 0;
}
.message-new-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 18px;
  margin: 0 7px 0 0;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  vertical-align: middle;
  white-space: nowrap;
}
.message-line.message-unread .message-new-pin {
  margin: 0;
  align-self: center;
  justify-self: end;
}
.agency-ui .message-line.message-unread,
.admin-ui #activeOrdersView .message-line.message-unread {
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
}
.agency-ui .message-line.message-unread .message-line-body,
.admin-ui #activeOrdersView .message-line.message-unread .message-line-body {
  padding-right: 0;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  min-width: 0;
}
.metric .label { color: var(--muted); font-size: 12px; }
.metric .value {
  font-size: 22px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.import-mapping {
  align-items: end;
  margin: 10px 0;
}
.import-mapping .field {
  min-width: 160px;
}
.import-preview {
  max-height: 280px;
  margin-bottom: 12px;
}
.template-list {
  display: grid;
  gap: 10px;
}
.template-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}
.template-row.muted-row {
  opacity: .68;
  background: #f7f8fb;
}
.template-body-preview {
  margin-top: 8px;
  max-height: 96px;
  overflow: auto;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink);
}
.product-admin-table {
  min-width: 1280px;
}
.product-admin-table textarea {
  min-width: 260px;
  min-height: 70px;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
th, td {
  border-bottom: 1px solid var(--line);
  padding: 9px 10px;
  vertical-align: middle;
}
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f7f9fc;
  color: #475467;
  text-align: left;
  white-space: nowrap;
}
td.num { text-align: right; }
td.name { min-width: 220px; }
tr.highlight { background: #fff8db; }
tr:last-child td { border-bottom: 0; }

.field { display: grid; gap: 5px; }
.field label { color: var(--muted); font-size: 12px; font-weight: 700; }
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 41px;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 9px 12px;
  color: #40566f;
  font-size: 14px;
  font-weight: 800;
}
.check-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--blue);
}
.input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 8px;
  padding: 9px 10px;
}
textarea { min-height: 84px; resize: vertical; }
.form-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
}
.notice {
  border-left: 4px solid var(--amber);
  background: #fffbeb;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
}
.notice.error {
  border-left-color: var(--red);
  background: #fff1f0;
}
.inbox { display: grid; gap: 10px; }
.inbox-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}
.inbox-item.urgent { border-color: #fda29b; background: #fff7f6; }
.change-request-admin-list {
  display: grid;
  gap: 10px;
}
.change-request-admin-section,
.change-request-admin-history {
  display: grid;
  gap: 8px;
}
.change-request-admin-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: #0b1f38;
  font-size: 13px;
  font-weight: 900;
}
.change-request-admin-section-head span {
  color: var(--muted);
  font-size: 12px;
}
.change-request-admin-history {
  margin-top: 4px;
  border-top: 1px solid #e5eaf2;
  padding-top: 10px;
}
.change-request-admin-history-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  border: 1px solid #d7e0ed;
  border-radius: 8px;
  background: #ffffff;
  color: #0b1f38;
  cursor: pointer;
  padding: 8px 10px;
  text-align: left;
}
.change-request-admin-history-toggle span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}
.change-request-admin-history-toggle em {
  border-radius: 999px;
  background: #eff6ff;
  color: #135fdb;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  padding: 3px 8px;
}
.change-request-admin-history-list {
  display: grid;
  gap: 8px;
  max-height: 360px;
  overflow: auto;
}
.change-request-admin-history-item {
  border: 1px solid #d7e0ed;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
}
.change-request-admin-history-item summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  font-size: 12px;
}
.change-request-admin-history-item summary span {
  color: #135fdb;
  font-weight: 900;
  white-space: nowrap;
}
.change-request-admin-history-item summary strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.change-request-admin-history-item summary em {
  color: var(--muted);
  font-style: normal;
  white-space: nowrap;
}
.change-request-admin-item {
  border: 1px solid #cfe0f6;
  border-left: 4px solid #1667d9;
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
}
.change-request-admin-item.active {
  border-color: #2563eb;
  background: #eff6ff;
}
.change-request-admin-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.change-request-admin-body {
  margin: 8px 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.change-request-review {
  margin-top: 10px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}
.change-request-review-title {
  color: #123f8c;
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 6px;
}
.change-request-review-body {
  color: #0b1f38;
  font-size: 13px;
  line-height: 1.55;
}
.change-request-review-body.preview {
  max-height: 138px;
  overflow: hidden;
  border: 1px solid #dbeafe;
  border-radius: 8px;
  background: #f8fbff;
  padding: 9px;
}
.change-request-review-note {
  min-height: 180px;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.55;
}
.change-request-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.change-request-review-modal {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  width: min(1240px, 98vw);
  height: min(920px, 96vh);
  max-height: 96vh;
  overflow: hidden;
  padding: 14px;
}
.change-request-review-source {
  border: 1px solid #d9dee8;
  border-radius: 8px;
  background: #f8fbff;
  padding: 8px 10px;
  margin-bottom: 8px;
  color: #0b1f38;
  font-size: 13px;
  line-height: 1.55;
}
.change-request-review-source summary {
  cursor: pointer;
  font-weight: 850;
}
.change-request-review-source div {
  margin-top: 8px;
  max-height: 90px;
  overflow: auto;
}
.change-request-review-modal-note {
  width: 100%;
  height: 100%;
  min-height: 0;
  font-size: 14px;
  line-height: 1.65;
  resize: none;
}
.change-request-review-modal .modal-head {
  margin-bottom: 8px;
}
.change-request-review-modal .notice.compact {
  margin-bottom: 8px;
  padding: 8px 10px;
}
.change-request-review-modal .modal-actions {
  margin-top: 8px;
}
.copy-box {
  border: 1px dashed #aac0e8;
  background: #f8fbff;
  border-radius: 8px;
  padding: 10px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 13px;
}
.tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.tab {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 700;
}
.tab.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.date-filter .btn.active,
.active-date-filter .btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #ffffff;
  box-shadow: 0 6px 14px rgba(31, 111, 235, .18);
}
.date-filter .btn.active:hover,
.active-date-filter .btn.active:hover {
  background: #0b4eb3;
  border-color: #0b4eb3;
  color: #ffffff;
}
.admin-ui #activeOrdersView .active-date-filter {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.admin-ui #activeOrdersView .active-date-filter .btn {
  justify-content: flex-start;
  width: 100%;
  text-align: left;
}
.login {
  width: min(460px, calc(100vw - 32px));
  margin: 80px auto;
}
.login-logo {
  margin-bottom: 22px;
}
.hidden { display: none !important; }

/* Admin operations UI */
.admin-ui {
  --bg: #eef3f8;
  --panel: #ffffff;
  --ink: #101828;
  --muted: #667085;
  --line: #d5dce8;
  --soft: #f4f7fb;
  --blue: #1667d9;
  --blue-soft: #e8f2ff;
  --red: #d92d20;
  --amber: #d97706;
  --green: #12805c;
  --cyan: #087ea4;
  --navy: #061a33;
  --shadow: 0 18px 45px rgba(16, 24, 40, .08);
  background:
    linear-gradient(180deg, #f7faff 0, #eef3f8 320px) fixed;
}
.admin-ui .admin-shell { grid-template-columns: 252px minmax(0, 1fr); }
.admin-ui .side {
  background: #071a33;
  color: #e5edf8;
  border-right: 0;
  padding: 18px 14px;
  box-shadow: 8px 0 24px rgba(6, 26, 51, .14);
}
.admin-ui .brand {
  padding: 0;
  margin-bottom: 6px;
}
.admin-ui .brand.oflow-brand {
  width: min(209px, 100%);
}
.admin-ui .side .subtle { color: #9fb3cd; }
.admin-ui .nav { gap: 5px; margin: 22px 0 16px; }
.admin-ui .nav-section {
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  margin: 18px 9px 8px;
  padding: 6px 0 5px;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}
.admin-ui .nav button {
  color: #d7e4f5;
  border-radius: 8px;
  padding: 10px 11px;
  border-left: 3px solid transparent;
  background: transparent;
}
.admin-ui .nav button.active {
  background: #ffffff;
  border-color: #4ea1ff;
  color: #0b2a50;
  box-shadow: 0 8px 18px rgba(0, 0, 0, .12);
}
.admin-ui .side .btn { width: 100%; margin-top: 8px; }
.admin-ui .admin-key-box {
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .07);
  border-radius: 10px;
  padding: 10px;
  margin: 18px 0 10px;
}
.admin-ui .admin-key-box .btn { margin-top: 8px; }
.admin-ui .error-text {
  color: #ffb4ab;
  font-weight: 700;
}
.admin-ui .main { padding: 20px 24px 34px; }
.admin-ui > .app-shell { background: transparent; }
.admin-ui h1 {
  font-size: 26px;
  font-weight: 850;
  color: #0b1f38;
}
.admin-ui h2 {
  font-size: 16px;
  font-weight: 850;
  color: #0b1f38;
}
.admin-ui h3 {
  font-size: 14px;
  font-weight: 850;
  color: #243b57;
}
.admin-ui .main > .topbar {
  align-items: center;
  padding: 14px 16px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, .86);
  border: 1px solid rgba(213, 220, 232, .9);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(16, 24, 40, .06);
}
.admin-ui .panel .topbar {
  align-items: center;
  margin-bottom: 10px;
}
.admin-ui .tight-bar { align-items: center; margin-bottom: 10px; }
.admin-ui .admin-metrics-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.admin-ui .admin-metric-card {
  position: relative;
  overflow: hidden;
  min-height: 76px;
  border: 1px solid #d8e0ec;
  background: #ffffff;
  border-radius: 10px;
  padding: 11px 13px;
  box-shadow: 0 8px 22px rgba(16, 24, 40, .05);
}
.admin-ui .admin-metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #1667d9;
}
.admin-ui .admin-metric-card span {
  display: block;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}
.admin-ui .admin-metric-card strong {
  display: inline-block;
  margin-top: 4px;
  font-size: 27px;
  line-height: 1;
  color: #101828;
}
.admin-ui .admin-metric-card em {
  margin-left: 6px;
  color: #667085;
  font-size: 12px;
  font-style: normal;
}
.admin-ui .admin-metric-card.accent-cyan::before { background: var(--cyan); }
.admin-ui .admin-metric-card.accent-orange::before { background: var(--amber); }
.admin-ui .admin-metric-card.accent-red::before { background: var(--red); }
.admin-ui .admin-metric-card.accent-green::before { background: var(--green); }
.admin-ui .panel {
  border-color: #d8e0ec;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(16, 24, 40, .06);
  padding: 14px;
}
.admin-ui #ordersView > .ops-left > .panel:first-child {
  border-top: 4px solid #1667d9;
}
.admin-ui .panel.tight {
  box-shadow: none;
  background: #fbfcfe;
}
.admin-ui .panel > h2,
.admin-ui .panel .topbar h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-ui .panel > h2::before,
.admin-ui .panel .topbar h2::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 999px;
  background: #1667d9;
}
.admin-ui .admin-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 350px;
  gap: 12px;
  align-items: start;
}
.admin-ui .admin-content {
  min-width: 0;
  display: grid;
  gap: 14px;
}
.admin-ui .admin-global-rail {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}
.admin-ui .admin-inbox-card {
  padding: 10px 11px;
  border-radius: 10px;
}
.admin-ui .admin-inbox-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  min-width: 0;
}
.admin-ui .admin-inbox-title strong {
  min-width: 0;
  overflow: hidden;
  color: #0b1f38;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-ui .admin-inbox-time {
  color: #667085;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}
.admin-ui .admin-inbox-meta {
  margin-top: 4px;
  font-size: 11px;
}
.admin-ui .admin-inbox-summary {
  display: grid;
  gap: 4px;
  margin: 6px 0 8px;
  overflow: hidden;
  color: #0b1f38;
  font-size: 12px;
  line-height: 1.42;
}
.admin-ui .admin-update-field {
  color: #475467;
  font-size: 11px;
  font-weight: 900;
}
.admin-ui .admin-diff {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.admin-ui .admin-diff del {
  border-radius: 999px;
  background: #f1f5f9;
  color: #667085;
  padding: 2px 7px;
  text-decoration-thickness: 2px;
}
.admin-ui .admin-diff ins {
  border-radius: 999px;
  background: #ecfdf3;
  color: #027a48;
  font-weight: 900;
  padding: 2px 7px;
  text-decoration: none;
}
.admin-ui .admin-cell-updates {
  display: grid;
  gap: 4px;
  margin-top: 5px;
}
.admin-ui .admin-cell-update {
  display: grid;
  gap: 3px;
  border: 1px solid #bfdbfe;
  border-radius: 7px;
  background: #eff6ff;
  padding: 5px 6px;
}
.admin-ui .admin-cell-update span {
  color: #175cd3;
  font-size: 10px;
  font-weight: 900;
}
.admin-ui .admin-cell-update ins {
  color: #027a48;
  font-weight: 900;
  text-decoration: none;
}
.admin-ui .admin-ops-grid {
  display: block;
}
.admin-ui .active-orders-view {
  min-width: 0;
}
.admin-ui .active-orders-grid {
  display: grid;
  grid-template-columns: minmax(170px, 210px) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.admin-ui .active-orders-side {
  display: grid;
  gap: 10px;
  min-width: 0;
}
.admin-ui .active-order-detail-panel {
  border-top: 4px solid #1667d9;
  min-width: 0;
  padding: 0;
  overflow: hidden;
}
.admin-ui #activeOrdersView .panel {
  padding: 9px;
}
.admin-ui #activeOrdersView .active-order-detail-panel {
  padding: 0;
}
.admin-ui #activeOrdersView .panel.tight {
  padding: 7px;
}
.admin-ui #poDetail {
  min-width: 0;
}
.admin-ui .admin-detail-placeholder {
  padding: 12px;
}
.admin-ui .admin-order-hero {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 12px;
  border-bottom: 1px solid #cfd8e6;
  background: #f8fafc;
}
.admin-ui .admin-order-hero h2 {
  margin: 0;
  font-size: 18px;
}
.admin-ui .admin-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  background: #eef2f7;
}
.admin-ui .admin-main-pane {
  min-width: 0;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}
.admin-ui #activeOrdersView .admin-critical-summary {
  grid-template-columns: minmax(132px, .7fr) minmax(132px, .7fr) minmax(260px, 1.8fr);
  gap: 8px;
  margin-bottom: 10px;
}
.admin-ui #activeOrdersView .critical-card {
  min-height: 72px;
  padding: 9px 10px;
  border-left: 4px solid #2563eb;
}
.admin-ui #activeOrdersView .critical-card.delivery {
  border-left-color: #f97316;
}
.admin-ui #activeOrdersView .critical-card.tracking {
  border-left-color: #f59e0b;
}
.admin-ui #activeOrdersView .critical-card.shipping {
  border-left-color: #2563eb;
}
.admin-ui #activeOrdersView .critical-card.required {
  border-color: #ffcf99;
  border-left-color: #f59e0b;
  background: #fffbeb;
}
.admin-ui #activeOrdersView .critical-card .label {
  font-size: 12px;
}
.admin-ui #activeOrdersView .critical-card .value {
  margin-top: 3px;
  color: #0b1f38;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-ui #activeOrdersView .critical-card.delivery .label,
.admin-ui #activeOrdersView .critical-card.delivery .value {
  color: #c2410c;
}
.admin-ui #activeOrdersView .critical-card.delivery .value,
.agency-ui .critical-card.delivery .value {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
  line-height: 1.16;
}
.admin-ui #activeOrdersView .critical-card.delivery,
.agency-ui .critical-card.delivery {
  position: relative;
}
.admin-ui #activeOrdersView .critical-card.delivery .delivery-badge,
.agency-ui .critical-card.delivery .delivery-badge {
  position: absolute;
  top: 9px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c2410c;
  border-radius: 8px;
  background: #ea580c;
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(194, 65, 12, .22);
  padding: 7px 12px;
  min-height: 30px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.05;
  white-space: nowrap;
  z-index: 1;
}
.admin-ui #activeOrdersView .critical-card.tracking .label,
.admin-ui #activeOrdersView .critical-card.tracking .value {
  color: #92400e;
}
.admin-ui #activeOrdersView .critical-card.shipping .label,
.admin-ui #activeOrdersView .critical-card.shipping .value {
  color: #123f8c;
}
.admin-ui #activeOrdersView .critical-shipping-line {
  min-width: 0;
}
.admin-ui #activeOrdersView .critical-address {
  margin-top: 3px;
  color: #40566f;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.admin-ui #activeOrdersView .admin-section-title {
  margin: 4px 0 8px;
}
.admin-ui #activeOrdersView .admin-section-title h3 {
  font-size: 16px;
}
.admin-ui #activeOrdersView .admin-section-title span {
  font-size: 12px;
}
.admin-ui #activeOrdersView .topbar {
  gap: 8px;
  margin-bottom: 6px;
}
.admin-ui #activeOrdersView h2 {
  margin: 0 0 6px;
  font-size: 15px;
}
.admin-ui #activeOrdersView .admin-order-hero h2 {
  margin: 0;
  font-size: 18px;
}
.admin-ui #activeOrdersView .panel .topbar h2 {
  margin-bottom: 0;
}
.admin-ui #activeOrdersView .calendar {
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
}
.admin-ui #activeOrdersView .day {
  min-height: 42px;
  padding: 6px 7px;
  font-size: 12px;
  line-height: 1.2;
}
.admin-ui #activeOrdersView .day .count {
  font-size: 11px;
}
.admin-ui #activeOrdersView .list {
  gap: 6px;
}
.admin-ui #activeOrdersView .list-item {
  padding: 6px 7px;
}
.admin-ui #activeOrdersView .list-title,
.admin-ui #activeOrdersView .meta {
  line-height: 1.35;
}
.admin-ui #activeOrdersView .list-title {
  font-size: 11.5px;
}
.admin-ui #activeOrdersView .meta {
  font-size: 10.5px;
}
.admin-ui #activeOrdersView .metrics {
  grid-template-columns: repeat(6, minmax(82px, 1fr));
  gap: 6px;
}
.admin-ui #activeOrdersView .metric {
  padding: 6px 7px;
}
.admin-ui #activeOrdersView .metric .label {
  font-size: 10px;
}
.admin-ui #activeOrdersView .metric .value {
  font-size: 14px;
}
.admin-ui #activeOrdersView .compact-shipping-summary {
  gap: 7px;
  margin: 6px 0 8px;
  font-size: 12px;
}
.admin-ui #activeOrdersView .table-wrap {
  max-height: min(50vh, 560px);
  overflow: auto;
}
.admin-ui #activeOrdersView .admin-detail-table {
  min-width: 940px;
  table-layout: fixed;
}
.admin-ui #activeOrdersView table {
  font-size: 11.5px;
}
.admin-ui #activeOrdersView th,
.admin-ui #activeOrdersView td {
  padding: 5px 6px;
  line-height: 1.35;
}
.admin-ui #activeOrdersView .admin-detail-table th:nth-child(1),
.admin-ui #activeOrdersView .admin-detail-table td:nth-child(1) { width: 250px; }
.admin-ui #activeOrdersView .admin-detail-table th:nth-child(2),
.admin-ui #activeOrdersView .admin-detail-table td:nth-child(2) { width: 48px; text-align: center; }
.admin-ui #activeOrdersView .admin-detail-table th:nth-child(3),
.admin-ui #activeOrdersView .admin-detail-table td:nth-child(3) { width: 112px; }
.admin-ui #activeOrdersView .admin-detail-table th:nth-child(4),
.admin-ui #activeOrdersView .admin-detail-table td:nth-child(4) { width: 100px; text-align: center; }
.admin-ui #activeOrdersView .admin-detail-table th:nth-child(5),
.admin-ui #activeOrdersView .admin-detail-table td:nth-child(5) { width: 96px; text-align: center; }
.admin-ui #activeOrdersView .admin-detail-table th:nth-child(6),
.admin-ui #activeOrdersView .admin-detail-table td:nth-child(6) { width: 130px; text-align: center; }
.admin-ui #activeOrdersView .admin-detail-table th:nth-child(7),
.admin-ui #activeOrdersView .admin-detail-table td:nth-child(7) { width: 160px; }
.admin-ui #activeOrdersView .admin-detail-product {
  color: #0b1f38;
  white-space: normal;
  overflow-wrap: anywhere;
}
.admin-ui #activeOrdersView .admin-detail-product strong,
.admin-ui #activeOrdersView .admin-detail-product span {
  display: block;
}
.admin-ui #activeOrdersView .admin-detail-product span {
  margin-top: 3px;
  font-weight: 800;
}
.admin-ui #activeOrdersView .price-cell {
  color: #40566f;
  font-size: 11px;
}
.admin-ui #activeOrdersView .price-cell span {
  display: block;
  white-space: nowrap;
}
.admin-ui #activeOrdersView .price-cell strong {
  display: block;
  white-space: nowrap;
  color: #0b1f38;
  font-weight: 900;
}
.admin-ui #activeOrdersView .tracking-cell,
.admin-ui #activeOrdersView .admin-detail-note {
  overflow-wrap: anywhere;
}
.admin-ui #activeOrdersView .return-pending-btn {
  min-width: 96px;
  white-space: normal;
  line-height: 1.25;
}
.admin-ui #activeOrdersView .admin-detail-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 220px);
  gap: 10px;
  align-items: start;
  margin-top: 10px;
}
.admin-ui #activeOrdersView .admin-detail-message-tabs {
  min-width: 0;
}
.admin-ui #activeOrdersView .admin-message-tab-head .btn.ghost {
  border-color: #fed7aa;
  background: #ffffff;
  color: #9a3412;
  min-height: 28px;
  padding: 4px 9px;
}
.admin-ui #activeOrdersView .admin-detail-message-tabs .admin-message-tab-body {
  grid-template-columns: minmax(210px, 34%) minmax(330px, 66%);
  gap: 8px;
  padding: 8px 9px 9px;
  align-items: stretch;
}
.admin-ui #activeOrdersView .admin-reply-compose {
  display: grid;
  gap: 7px;
}
.admin-ui #activeOrdersView #adminReplyText {
  min-height: 72px;
}
.admin-ui #activeOrdersView .admin-detail-message-history {
  min-height: 118px;
  height: 100%;
  max-height: 170px;
  overflow: auto;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fffdf8;
  padding: 6px 8px;
}
.admin-ui #activeOrdersView .message-line {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  border-bottom: 1px solid #f2dfc7;
  padding: 5px 0;
  color: #0b1f38;
  font-size: 12px;
  line-height: 1.38;
}
.admin-ui #activeOrdersView .message-line:last-child {
  border-bottom: 0;
}
.admin-ui #activeOrdersView .message-line-meta {
  color: #667085;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.admin-ui #activeOrdersView .message-line-body {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
.admin-ui #activeOrdersView .message-line.muted {
  display: block;
  color: #667085;
}
.admin-ui #activeOrdersView .message-line.error {
  display: block;
  color: #b42318;
}
.admin-ui #activeOrdersView .message-line.more {
  display: block;
  color: #9a3412;
  font-weight: 850;
}
.admin-ui #activeOrdersView .admin-detail-price-details {
  padding: 9px 10px;
}
.admin-ui #activeOrdersView .admin-detail-price-details .admin-price-summary {
  grid-template-columns: 1fr;
}
.admin-ui #activeOrdersView .admin-detail-price-details .price-group {
  min-height: 0;
  padding: 7px 8px;
}
.admin-ui #activeOrdersView .admin-detail-price-details .price-pair {
  gap: 6px;
}
.admin-ui #activeOrdersView .admin-detail-price-details .price-pair span {
  font-size: 11px;
}
.admin-ui #activeOrdersView .admin-detail-price-details .price-pair strong {
  font-size: 14px;
}
.admin-ui #activeOrdersView .admin-detail-admin-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.admin-ui #activeOrdersView .admin-action-details {
  margin-top: 8px;
  padding: 8px;
}
.admin-ui #activeOrdersView .form-row {
  gap: 8px;
}
.admin-ui #activeOrdersView .message-panel-head {
  margin-bottom: 6px;
}
.admin-ui #activeOrdersView .message-item {
  padding: 7px 8px;
}
.admin-ui .ops-left,
.admin-ui .ops-right {
  display: grid;
  gap: 14px;
  min-width: 0;
}
.admin-ui .ops-left { min-width: 0; }
.admin-ui .panel { min-width: 0; }
.admin-ui .ops-right {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
}
.admin-ui .ops-right .panel {
  box-shadow: 0 8px 22px rgba(16, 24, 40, .045);
}
.admin-ui .btn {
  border-radius: 7px;
  padding: 8px 11px;
  box-shadow: 0 1px 0 rgba(16, 24, 40, .04);
}
.admin-ui .btn.primary {
  background: #1667d9;
  border-color: #1667d9;
  box-shadow: 0 8px 16px rgba(22, 103, 217, .18);
}
.admin-ui .btn.small { padding: 5px 8px; }
.admin-ui .input,
.admin-ui select,
.admin-ui textarea {
  border-radius: 7px;
  padding: 8px 9px;
  border-color: #cfd8e6;
}
.admin-ui .input:focus,
.admin-ui select:focus,
.admin-ui textarea:focus {
  outline: 2px solid rgba(22, 103, 217, .18);
  border-color: #7db3ff;
}
.admin-ui textarea { min-height: 64px; }
.admin-ui .tall-input { min-height: 96px; }
.admin-ui .form-row {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}
.admin-ui details {
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
}
.admin-ui .compact-shipping-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 12px;
  color: #40566f;
  font-size: 13px;
}
.admin-ui .compact-shipping-summary details {
  padding: 0;
  border: 0;
  background: transparent;
}
.admin-ui .admin-action-details {
  margin-top: 10px;
}
.admin-ui .po-preview-panel {
  margin-top: 14px;
  border: 1px solid #b9d7ff;
  border-radius: 10px;
  background: #f8fbff;
  padding: 12px;
}
.admin-ui .po-preview-empty {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  border: 1px dashed #b9c7d8;
  border-radius: 8px;
  background: #fbfdff;
  color: #40566f;
  padding: 12px 14px;
}
.admin-ui .po-preview-empty strong {
  color: #0b1f38;
  font-size: 14px;
}
.admin-ui .po-preview-empty.error {
  border-color: #fda29b;
  background: #fff8f7;
  color: #b42318;
}
.admin-ui .po-preview-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.admin-ui .preview-table {
  margin-top: 10px;
  max-height: 260px;
}
.admin-ui .preview-table table {
  table-layout: fixed;
  min-width: 960px;
  font-size: 14px;
}
.admin-ui .preview-table th {
  font-size: 13px;
}
.admin-ui .preview-table td {
  font-size: 14px;
  line-height: 1.45;
  padding: 9px 10px;
}
.admin-ui .preview-table .preview-code-col { width: 120px; }
.admin-ui .preview-table .preview-name-col { width: auto; }
.admin-ui .preview-table .preview-qty-col { width: 70px; }
.admin-ui .preview-table .preview-rate-col { width: 72px; }
.admin-ui .preview-table .preview-price-col { width: 120px; }
.admin-ui .preview-table .preview-note-col { width: 200px; }
.admin-ui .preview-table th:nth-child(3),
.admin-ui .preview-table th:nth-child(4),
.admin-ui .preview-table th:nth-child(5),
.admin-ui .preview-table th:nth-child(6),
.admin-ui .preview-table th:nth-child(7),
.admin-ui .preview-table td:nth-child(3),
.admin-ui .preview-table td:nth-child(4),
.admin-ui .preview-table td:nth-child(5),
.admin-ui .preview-table td:nth-child(6),
.admin-ui .preview-table td:nth-child(7) {
  text-align: right;
}
.admin-ui .preview-table td.name {
  min-width: 0;
  white-space: normal;
}
.admin-ui .preview-table .preview-item-note {
  font-size: 13px;
  line-height: 1.45;
  min-height: 48px;
  min-width: 0;
  resize: vertical;
}
.admin-ui .po-preview-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.admin-ui .po-preview-notes textarea {
  min-height: 72px;
}
.admin-ui summary {
  cursor: pointer;
  font-weight: 850;
  color: #0b2a50;
}
.admin-ui .source-maker-top {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid #d8e0ec;
  border-radius: 10px;
  background: #f8fbff;
}
.admin-ui .source-maker-heading {
  margin-bottom: 8px;
  color: #40566f;
  font-size: 12px;
  font-weight: 850;
}
.admin-ui .source-maker-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}
.admin-ui .source-maker {
  border: 1px solid #d8e0ec;
  background: #ffffff;
  border-radius: 8px;
  padding: 8px 10px;
  color: #0b1f38;
  font-weight: 800;
}
.admin-ui .source-maker.active {
  border-color: #1667d9;
  background: #e8f2ff;
  color: #0b4eb3;
}
.admin-ui .source-maker span {
  color: #667085;
  font-weight: 700;
  margin-left: 4px;
}
.admin-ui .custom-address-fields {
  display: grid;
  gap: 6px;
  margin-bottom: 8px;
}
.admin-ui .warning-text {
  color: #b42318;
  font-weight: 850;
}
.admin-ui .admin-maker-workspace {
  margin-top: 12px;
}
.admin-ui .admin-critical-summary {
  display: grid;
  grid-template-columns: minmax(310px, 1.15fr) minmax(230px, .75fr) minmax(360px, 1.3fr);
  gap: 8px;
  margin-bottom: 8px;
  align-items: stretch;
}
.admin-ui .critical-card {
  display: flex;
  align-items: center;
  min-height: 72px;
  box-sizing: border-box;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #ffffff;
  padding: 9px 11px;
}
.admin-ui .critical-card.delivery {
  border-color: #fed7aa;
  background: #fff7ed;
}
.admin-ui .critical-card.tracking {
  border-color: #fde68a;
  background: #fffbeb;
}
.admin-ui .critical-card.shipping {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.admin-ui .critical-card-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  width: 100%;
}
.admin-ui .critical-card.delivery .critical-card-row {
  grid-template-columns: 28px minmax(0, 1fr);
}
.admin-ui .critical-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}
.admin-ui .critical-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.admin-ui .critical-card.delivery .critical-icon {
  color: #c2410c;
}
.admin-ui .critical-card.tracking .critical-icon {
  color: #92400e;
}
.admin-ui .critical-card.shipping .critical-icon {
  color: #123f8c;
}
.admin-ui .admin-delivery-card {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-end;
  min-width: 0;
}
.admin-ui .admin-delivery-card .field {
  flex: 1 1 128px;
  min-width: min(100%, 128px);
}
.admin-ui .admin-delivery-card .delivery-preset-field {
  flex-basis: 116px;
  min-width: min(100%, 116px);
}
.admin-ui .admin-delivery-card .input {
  min-width: 0;
}
.admin-ui .admin-delivery-card .check-row {
  flex: 0 0 auto;
  justify-content: center;
  padding: 6px 8px;
  white-space: nowrap;
}
.admin-ui .po-default-actions {
  display: flex;
  flex: 1 1 100%;
  gap: 5px;
  align-items: center;
  min-width: 0;
}
.admin-ui .po-default-actions .btn.small {
  padding: 5px 8px;
  min-height: 28px;
}
.admin-ui .po-default-actions .subtle {
  min-width: 0;
  overflow: hidden;
  white-space: normal;
  line-height: 1.25;
}
.admin-ui .po-default-hint {
  flex: 1 1 100%;
  color: #475467;
  font-size: 12px;
  line-height: 1.3;
}
.admin-ui .shipping-default-actions {
  flex-wrap: wrap;
}
.admin-ui .critical-card .field {
  margin: 0;
}
.admin-ui .critical-card .label {
  color: #667085;
  font-size: 13px;
  font-weight: 850;
}
.admin-ui .critical-card .check-row {
  min-height: 38px;
  align-items: center;
  margin: 0;
}
.admin-ui .admin-shipping-card {
  display: grid;
  gap: 5px;
  min-width: 0;
}
.admin-ui .po-default-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.8fr);
  gap: 12px;
  margin-top: 12px;
}
.admin-ui .po-default-maker-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}
.admin-ui .po-default-maker-tab {
  display: grid;
  gap: 3px;
  min-width: 136px;
  max-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 11px;
  text-align: left;
  cursor: pointer;
}
.admin-ui .po-default-maker-tab:hover {
  border-color: #1d67d8;
  background: #f8fbff;
}
.admin-ui .po-default-maker-tab.active {
  border-color: #1d67d8;
  box-shadow: inset 3px 0 0 #1d67d8;
  background: #eef6ff;
}
.admin-ui .po-default-maker-tab.configured span {
  color: #14532d;
}
.admin-ui .po-default-maker-tab strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-ui .po-default-maker-tab span {
  color: #667085;
  font-size: 12px;
  line-height: 1.25;
}
.admin-ui .po-default-maker-custom {
  align-items: flex-end;
}
.admin-ui .po-default-maker-custom .field {
  flex: 1 1 220px;
}
.admin-ui .po-default-empty {
  width: 100%;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: #667085;
  padding: 12px;
  background: #f8fbff;
}
.admin-ui .po-default-list {
  margin-top: 12px;
}
.admin-ui .po-default-list h4 {
  margin: 0 0 8px;
  font-size: 14px;
}
.admin-ui .po-default-list-rows {
  display: grid;
  gap: 8px;
}
.admin-ui .po-default-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
  cursor: pointer;
}
.admin-ui .po-default-row:hover {
  border-color: #1d67d8;
  background: #f8fbff;
}
.admin-ui .po-default-row.active {
  border-color: #1d67d8;
  background: #eef6ff;
}
.admin-ui .po-default-row span {
  color: #475467;
  font-size: 13px;
}
.admin-ui .admin-top-work {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(460px, 1fr);
  gap: 10px;
  align-items: stretch;
  margin: 0 0 12px;
}
.admin-ui .admin-bulk-bar {
  display: grid;
  gap: 8px;
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
}
.admin-ui .admin-bulk-bar h3 {
  margin: 0;
  font-size: 14px;
}
.admin-ui .admin-selection-summary {
  display: grid;
  gap: 3px;
  min-height: 44px;
  color: #475467;
  font-size: 13px;
  line-height: 1.45;
}
.admin-ui .admin-selection-summary strong {
  color: #0b1f38;
}
.admin-ui .admin-selection-actions {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.admin-ui .admin-message-tabs {
  min-width: 0;
  border: 1px solid #fdba74;
  border-radius: 10px;
  background: #fff7ed;
}
.admin-ui .admin-message-tab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #fed7aa;
  padding: 7px 10px;
}
.admin-ui .admin-message-tab-head strong {
  color: #c2410c;
  font-size: 13px;
}
.admin-ui .admin-message-tab-head span {
  color: #9a3412;
  font-size: 12px;
  font-weight: 750;
}
.admin-ui .admin-message-tab-body {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, .72fr);
  gap: 8px;
  padding: 9px 10px 10px;
}
.admin-ui .admin-message-tab-body textarea {
  min-height: 74px;
}
.admin-ui .admin-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 10px;
}
.admin-ui .admin-section-title h3 {
  margin: 0;
  font-size: 18px;
}
.admin-ui .admin-section-title span {
  color: #667085;
  font-size: 13px;
}
.admin-ui .admin-response-footer {
  display: grid;
  grid-template-columns: minmax(250px, .9fr) minmax(260px, 360px);
  gap: 10px;
  align-items: stretch;
  margin-top: 8px;
}
.admin-ui .admin-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 4px 2px;
}
.admin-ui .admin-actions span {
  color: #667085;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}
.admin-ui .admin-actions .btn {
  min-width: 180px;
}
.admin-ui .admin-price-details {
  border: 1px solid #d8e0ec;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}
.admin-ui .admin-price-details.compact {
  padding: 9px 10px;
}
.admin-ui .admin-price-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.admin-ui .admin-price-head strong {
  color: #0b1f38;
  font-size: 13px;
}
.admin-ui .admin-price-head span {
  color: #667085;
  font-size: 11px;
  font-weight: 750;
}
.admin-ui .admin-price-details h3 {
  margin: 0 0 8px;
  font-size: 14px;
}
.admin-ui .admin-price-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.admin-ui .admin-price-details.compact .admin-price-summary {
  grid-template-columns: 1fr;
}
.admin-ui .price-group {
  display: grid;
  gap: 4px;
  min-height: 56px;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  background: #ffffff;
  padding: 7px 9px;
}
.admin-ui .price-group.selected {
  border-color: #b9d7ff;
  background: #f8fbff;
}
.admin-ui .price-pair {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.admin-ui .price-pair span {
  color: #667085;
  font-size: 12px;
  font-weight: 750;
}
.admin-ui .price-pair strong {
  color: #0b1f38;
  font-size: 16px;
  font-weight: 900;
}
.admin-ui input[type="file"].input {
  min-height: 41px;
  padding: 5px 8px;
}
.admin-ui .metrics {
  grid-template-columns: repeat(6, minmax(100px, 1fr));
  gap: 8px;
}
.admin-ui .metric { border-radius: 8px; padding: 9px; background: #fbfdff; }
.admin-ui .metric .value { font-size: 18px; }
.admin-ui .calendar { grid-template-columns: repeat(7, minmax(76px, 1fr)); }
.admin-ui .day { border-radius: 8px; min-height: 58px; }
.admin-ui .list-item,
.admin-ui .inbox-item {
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 1px 0 rgba(16, 24, 40, .03);
}
.admin-ui .list-item.active {
  border-color: #88b9ff;
  background: #edf5ff;
  box-shadow: inset 3px 0 0 #1667d9;
}
.admin-ui .badge { border-radius: 6px; padding: 2px 7px; }
.admin-ui .badge.blue { background: #e8f2ff; color: #155eef; }
.admin-ui .badge.green { background: #dcfce7; color: #027a48; }
.admin-ui .badge.red { background: #fee4e2; color: #b42318; }
.admin-ui .badge.stock-badge {
  border: 1px solid currentColor;
  font-size: 12px;
  padding: 4px 8px;
}
.admin-ui .badge.stock-badge.strong {
  box-shadow: 0 0 0 2px rgba(22, 103, 217, .08);
}
.admin-ui .table-wrap {
  border-radius: 8px;
  border-color: #d8e0ec;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65);
}
.admin-ui table { font-size: 12px; }
.admin-ui th {
  background: #f3f7fc;
  color: #40566f;
  font-weight: 850;
}
.admin-ui th,
.admin-ui td { padding: 8px 9px; }
.admin-ui tr:hover td { background: #f8fbff; }
.admin-ui .source-order-table {
  min-width: 940px;
  table-layout: fixed;
}
.admin-ui .source-order-table th,
.admin-ui .source-order-table td {
  vertical-align: middle;
  padding: 5px 6px;
}
.admin-ui .source-order-table th:first-child,
.admin-ui .source-order-table .check-cell {
  width: 34px;
  min-width: 34px;
  padding: 6px;
  text-align: center;
}
.admin-ui .source-order-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #1667d9;
}
.admin-ui .source-order-table .check-cell {
  cursor: pointer;
}
.admin-ui .source-order-table .sort-header {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #40566f;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  padding: 0;
  white-space: nowrap;
}
.admin-ui .source-order-table .sort-header.active {
  color: #0b4eb3;
}
.admin-ui .source-order-table .sort-mark {
  color: #8ea0b8;
  font-size: 10px;
  line-height: 1;
}
.admin-ui .source-order-table .sort-header.active .sort-mark {
  color: #0b4eb3;
}
.admin-ui .source-order-table .source-cell {
  text-align: center;
  padding-left: 5px;
  padding-right: 5px;
}
.admin-ui .source-order-table .name {
  min-width: 150px;
  white-space: normal;
}
.admin-ui .source-order-table th:nth-child(1),
.admin-ui .source-order-table td:nth-child(1) { width: 34px; }
.admin-ui .source-order-table th:nth-child(2),
.admin-ui .source-order-table td:nth-child(2) { width: 78px; }
.admin-ui .source-order-table th:nth-child(3),
.admin-ui .source-order-table td:nth-child(3) { width: 132px; }
.admin-ui .source-order-table th:nth-child(4),
.admin-ui .source-order-table td:nth-child(4) { width: 58px; }
.admin-ui .source-order-table th:nth-child(5),
.admin-ui .source-order-table td:nth-child(5) { width: 44px; }
.admin-ui .source-order-table th:nth-child(6),
.admin-ui .source-order-table td:nth-child(6) { width: 30%; }
.admin-ui .source-order-table th:nth-child(7),
.admin-ui .source-order-table td:nth-child(7) { width: 40px; }
.admin-ui .source-order-table th:nth-child(8),
.admin-ui .source-order-table td:nth-child(8) { width: 130px; }
.admin-ui .source-order-table th:nth-child(9),
.admin-ui .source-order-table td:nth-child(9) { width: 140px; }
.admin-ui .source-order-table th:nth-child(2),
.admin-ui .source-order-table th:nth-child(3),
.admin-ui .source-order-table th:nth-child(4),
.admin-ui .source-order-table th:nth-child(5),
.admin-ui .source-order-table th:nth-child(7),
.admin-ui .source-order-table td:nth-child(7) {
  text-align: center;
}
.admin-ui .source-order-table th:nth-child(2) .sort-header,
.admin-ui .source-order-table th:nth-child(3) .sort-header,
.admin-ui .source-order-table th:nth-child(4) .sort-header,
.admin-ui .source-order-table th:nth-child(5) .sort-header,
.admin-ui .source-order-table th:nth-child(7) .sort-header {
  justify-content: center;
}
.admin-ui .source-order-table th:nth-child(6) .sort-header {
  justify-content: flex-start;
}
.admin-ui .source-order-table th:nth-child(8),
.admin-ui .source-order-table td:nth-child(8) {
  text-align: right;
}
.admin-ui .source-order-table th:nth-child(8) .sort-header {
  justify-content: flex-end;
}
.admin-ui .source-product-cell,
.admin-ui .source-note-cell {
  white-space: normal;
}
.admin-ui .source-product-code {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}
.admin-ui .source-product-code span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  color: #667085;
  font-weight: 750;
}
.admin-ui .source-product-name {
  margin-top: 4px;
  color: #0b1f38;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.admin-ui .source-product-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.admin-ui .source-product-ids {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  min-width: 0;
}
.admin-ui .source-product-ids strong {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}
.admin-ui .source-product-ids span {
  display: inline-flex;
  align-items: center;
  min-height: 17px;
  border-radius: 999px;
  background: #f3f6fa;
  color: #667085;
  font-size: 10.5px;
  font-weight: 750;
  padding: 1px 6px;
}
.admin-ui .source-product-main strong {
  color: #334155;
  font-size: 12px;
  font-weight: 900;
}
.admin-ui .source-product-main span {
  margin-top: 1px;
  color: #0b1f38;
  font-size: 12.5px;
  font-weight: 850;
  line-height: 1.24;
  overflow-wrap: anywhere;
}
.admin-ui .source-product-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}
.admin-ui .source-product-sub span {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  background: #f3f6fa;
  color: #667085;
  font-size: 11px;
  font-weight: 750;
  padding: 2px 7px;
}
.admin-ui .source-order-meta,
.admin-ui .source-price-cell,
.admin-ui .source-date-cell,
.admin-ui .source-order-no-cell {
  color: #475467;
  font-size: 12px;
  line-height: 1.24;
}
.admin-ui .source-price-cell {
  white-space: nowrap;
}
.admin-ui .source-order-meta span,
.admin-ui .source-price-cell span,
.admin-ui .source-price-cell strong {
  display: block;
}
.admin-ui .source-price-cell b,
.admin-ui .source-price-cell em {
  color: #667085;
  font-size: 10.5px;
  font-style: normal;
}
.admin-ui .source-order-meta strong,
.admin-ui .source-price-cell strong {
  color: #0b1f38;
}
.admin-ui .source-order-meta strong {
  display: flex;
  gap: 6px;
  align-items: baseline;
  overflow-wrap: anywhere;
}
.admin-ui .source-order-meta strong span {
  display: inline;
  flex: 0 0 auto;
  color: #334155;
  font-size: 11px;
}
.admin-ui .source-order-meta span {
  color: #667085;
  font-size: 11px;
  font-weight: 750;
}
.admin-ui .source-date-cell,
.admin-ui .source-channel-cell,
.admin-ui .source-deadline-cell {
  text-align: center;
  white-space: nowrap;
}
.admin-ui .source-deadline-cell {
  color: #92400e;
  font-size: 12px;
  font-weight: 900;
}
.admin-ui .source-deadline-cell.muted {
  color: #7a4b00;
}
.admin-ui .source-order-no-cell {
  text-align: center;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.admin-ui .source-order-no-cell strong,
.admin-ui .source-order-no-cell span {
  display: block;
}
.admin-ui .source-order-no-cell strong {
  color: #0b1f38;
  font-size: 11.5px;
  line-height: 1.18;
}
.admin-ui .source-order-no-cell span {
  margin-top: 2px;
  color: #667085;
  font-size: 10.5px;
  font-weight: 750;
}
.admin-ui .source-channel-icon {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid #cfd8e6;
  border-radius: 7px;
  background: #ffffff;
  color: #40566f;
}
.admin-ui a.source-channel-icon {
  text-decoration: none;
  cursor: pointer;
}
.admin-ui a.source-channel-icon:hover {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, .18);
  transform: translateY(-1px);
}
.admin-ui .source-channel-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.admin-ui .source-channel-icon.amazon {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}
.admin-ui .source-channel-icon.amazon {
  position: relative;
  overflow: hidden;
}
.admin-ui .source-channel-icon .amazon-letter {
  color: #111827;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 17px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-2px);
}
.admin-ui .source-channel-icon .amazon-smile {
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 3px;
  width: 18px;
  height: 10px;
  color: #f59e0b;
  stroke-width: 2.2;
}
.admin-ui .source-channel-icon.manual {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #175cd3;
}
.admin-ui .source-item-note {
  min-height: 42px;
  height: 42px;
  padding: 6px 8px;
  font-size: 12px;
}
.admin-ui .source-deadline {
  color: #7a4b00;
  font-weight: 850;
  white-space: nowrap;
}
.admin-ui .source-deadline span {
  display: block;
  color: #9a5a00;
  font-size: 11px;
  font-weight: 750;
}
.admin-ui .source-deadline strong {
  display: block;
  color: #7a4b00;
  font-size: 13px;
  font-weight: 900;
}
.admin-ui .source-note-cell {
  color: #475467;
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.admin-ui .admin-response-table {
  min-width: 1040px;
  table-layout: fixed;
}
.admin-ui .admin-response-table th,
.admin-ui .admin-response-table td {
  padding: 8px 7px;
  font-size: 13px;
  vertical-align: middle;
}
.admin-ui .admin-response-table th {
  font-size: 13px;
  font-weight: 900;
}
.admin-ui .admin-response-table th:nth-child(1),
.admin-ui .admin-response-table td:nth-child(1) { width: 36px; text-align: center; }
.admin-ui .admin-response-table th:nth-child(2),
.admin-ui .admin-response-table td:nth-child(2) { width: 220px; }
.admin-ui .admin-response-table th:nth-child(3),
.admin-ui .admin-response-table td:nth-child(3) { width: 50px; }
.admin-ui .admin-response-table th:nth-child(4),
.admin-ui .admin-response-table td:nth-child(4) { width: 112px; }
.admin-ui .admin-response-table th:nth-child(5),
.admin-ui .admin-response-table td:nth-child(5) { width: 150px; }
.admin-ui .admin-response-table th:nth-child(6),
.admin-ui .admin-response-table td:nth-child(6) { width: 88px; }
.admin-ui .admin-response-table th:nth-child(7),
.admin-ui .admin-response-table td:nth-child(7) { width: 150px; }
.admin-ui .admin-response-table th:nth-child(8),
.admin-ui .admin-response-table td:nth-child(8) { width: 170px; }
.admin-ui .source-order-table.admin-response-table th,
.admin-ui .source-order-table.admin-response-table td {
  vertical-align: middle;
  padding: 5px 6px;
  font-size: 12px;
}
.admin-ui .source-order-table.admin-response-table {
  min-width: 940px;
}
.admin-ui .source-order-table.admin-response-table th {
  vertical-align: middle;
}
.admin-ui .source-order-table.admin-response-table th:nth-child(1),
.admin-ui .source-order-table.admin-response-table td:nth-child(1) { width: 34px; }
.admin-ui .source-order-table.admin-response-table th:nth-child(2),
.admin-ui .source-order-table.admin-response-table td:nth-child(2) { width: 78px; }
.admin-ui .source-order-table.admin-response-table th:nth-child(3),
.admin-ui .source-order-table.admin-response-table td:nth-child(3) { width: 132px; }
.admin-ui .source-order-table.admin-response-table th:nth-child(4),
.admin-ui .source-order-table.admin-response-table td:nth-child(4) { width: 58px; }
.admin-ui .source-order-table.admin-response-table th:nth-child(5),
.admin-ui .source-order-table.admin-response-table td:nth-child(5) { width: 44px; }
.admin-ui .source-order-table.admin-response-table th:nth-child(6),
.admin-ui .source-order-table.admin-response-table td:nth-child(6) { width: 30%; }
.admin-ui .source-order-table.admin-response-table th:nth-child(7),
.admin-ui .source-order-table.admin-response-table td:nth-child(7) { width: 40px; }
.admin-ui .source-order-table.admin-response-table th:nth-child(8),
.admin-ui .source-order-table.admin-response-table td:nth-child(8) { width: 130px; }
.admin-ui .source-order-table.admin-response-table th:nth-child(9),
.admin-ui .source-order-table.admin-response-table td:nth-child(9) { width: 140px; }
.admin-ui .source-item-note {
  min-width: 0;
  min-height: 42px;
  height: 42px;
  font-size: 12px;
  padding: 6px 8px;
}
.admin-ui .tabs .tab {
  border-radius: 8px;
  background: #f8fafd;
}
.admin-ui .tabs .tab.active {
  background: #0b2a50;
  border-color: #0b2a50;
}
.admin-ui .link-btn {
  border: 0;
  background: transparent;
  color: #1f6feb;
  font-weight: 800;
  padding: 0;
}
.admin-ui .inbox-tabs {
  margin-bottom: 10px;
  gap: 6px;
}
.admin-ui .message-thread {
  display: grid;
  gap: 8px;
  margin: 8px 0 12px;
}
.message-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.message-panel-head h3 {
  margin: 0;
}
.admin-ui .message-item {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 8px;
  padding: 9px;
  font-size: 12px;
  line-height: 1.55;
}
.admin-ui .message-item.from-agency {
  border-color: #fed7aa;
  background: #fff7ed;
}
.admin-ui .message-item.from-admin {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.admin-ui .message-item .meta {
  display: block;
  margin: 2px 0 6px;
}
.admin-ui .message-item.compact {
  padding: 8px 9px;
}

@media (max-width: 1280px) {
  .admin-ui .admin-workspace,
  .admin-ui .admin-ops-grid,
  .admin-ui .active-orders-grid { grid-template-columns: 1fr; }
  .admin-ui .admin-critical-summary {
    grid-template-columns: minmax(300px, 1.1fr) minmax(220px, .75fr) minmax(330px, 1.2fr);
  }
  .admin-ui .admin-top-work,
  .admin-ui .admin-response-footer,
  .admin-ui .po-default-settings-grid {
    grid-template-columns: 1fr;
  }
  .admin-ui .admin-global-rail,
  .admin-ui .ops-right {
    position: static;
    max-height: none;
  }
}

@media (max-width: 980px) {
  .admin-ui .admin-critical-summary,
  .admin-ui #activeOrdersView .admin-critical-summary,
  .admin-ui #activeOrdersView .admin-detail-footer,
  .admin-ui #activeOrdersView .admin-detail-message-tabs .admin-message-tab-body,
  .admin-ui #activeOrdersView .admin-detail-admin-tools {
    grid-template-columns: 1fr;
  }
  .admin-ui .admin-order-hero {
    flex-direction: column;
  }
}

@media (max-width: 1100px) {
  .admin-ui .admin-shell,
  .app-shell { grid-template-columns: 1fr; }
  .side { position: relative; height: auto; }
  .grid.two, .grid.three, .form-row, .metrics { grid-template-columns: 1fr; }
  .admin-ui .admin-message-tab-body,
  .admin-ui .admin-price-summary {
    grid-template-columns: 1fr;
  }
  .admin-ui .critical-card.delivery .critical-card-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }
  .admin-ui .admin-delivery-card .check-row {
    justify-content: flex-start;
  }
  .admin-ui .admin-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .admin-ui .admin-actions .btn {
    min-width: 0;
    width: 100%;
  }
  .admin-ui .source-order-table {
    min-width: 940px;
  }
}

/* Agency production UI: Style 1 clean SaaS */
.agency-ui {
  background: #eef2f7;
  color: #172033;
}
.agency-ui .agency-shell {
  grid-template-columns: 204px 1fr;
}
.agency-ui .side {
  background: #10243b;
  border-right: 1px solid #10253d;
  color: #e7eef8;
  padding: 26px 16px 18px;
}
.agency-ui .brand {
  font-size: 18px;
  letter-spacing: 0;
  color: #ffffff;
}
.agency-ui .brand.oflow-brand {
  width: min(170px, 100%);
  margin-bottom: 6px;
}
.agency-ui .side .subtle {
  color: #9fb3cb;
}
.agency-ui .agency-nav {
  display: grid;
  gap: 5px;
  margin: 12px 0 16px;
}
.agency-ui .agency-nav button {
  border: 1px solid transparent;
  background: transparent;
  border-radius: 7px;
  color: #d7e4f5;
  font-weight: 850;
  padding: 9px 10px;
  text-align: left;
}
.agency-ui .agency-nav button.active {
  border-color: #3b82f6;
  background: #123d6b;
  color: #ffffff;
}
.side-search {
  display: grid;
  gap: 8px;
  margin: 14px 0 16px;
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 8px;
  background: rgba(255, 255, 255, .07);
  padding: 10px;
}
.side-search-title {
  color: inherit;
  font-size: 12px;
  font-weight: 900;
}
.side-search .input {
  min-height: 36px;
  font-size: 13px;
}
.admin-ui .side-search {
  border-color: rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .06);
}
.admin-ui .side-search-title {
  color: #ffffff;
}
.agency-ui .agency-nav button:focus-visible,
.agency-ui .btn:focus-visible,
.agency-ui .critical-copy:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}
.agency-ui .main {
  padding: 28px 20px 36px;
}
.agency-ui .topbar {
  align-items: center;
  margin-bottom: 14px;
}
.agency-ui h1 {
  font-size: 27px;
}
.agency-ui h2 {
  font-size: 16px;
  margin-bottom: 10px;
}
.agency-ui .agency-workspace {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) 260px;
  gap: 10px;
  align-items: start;
}
.agency-ui .agency-home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
  align-items: start;
}
.agency-ui .home-update-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}
.agency-ui .home-update-head h2 {
  margin: 0;
}
.agency-ui .home-update-head .rail-tabs {
  margin-bottom: 0;
}
.agency-ui .rail-tabs.compact {
  gap: 6px;
}
.agency-ui .rail-tabs.compact .tab {
  padding: 6px 8px;
}
.agency-ui .agency-home-metrics {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}
.agency-ui .agency-home-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.agency-ui .home-task-lists {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.agency-ui .home-task-list {
  border: 1px solid #d9dee8;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}
.agency-ui .home-task-list.followup-bo-list {
  border-color: #fed7aa;
  background: #fffaf5;
}
.agency-ui .home-task-list.followup-tracking-list {
  border-color: #bfdbfe;
  background: #f8fbff;
}
.agency-ui .home-task-list.followup-combined-list {
  border-color: #cbd7ea;
  background: #fff;
}
.agency-ui .home-task-list h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 8px;
  font-size: 14px;
}
.agency-ui .home-task-list h3 span {
  color: #2563eb;
}
.agency-ui .home-task-list.followup-bo-list h3,
.agency-ui .home-task-list.followup-bo-list h3 span {
  color: #c2410c;
}
.agency-ui .home-task-list.followup-tracking-list h3,
.agency-ui .home-task-list.followup-tracking-list h3 span {
  color: #175cd3;
}
.agency-ui .home-followup-section + .home-followup-section {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #edf0f5;
}
.agency-ui .home-followup-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  font-size: 12px;
  font-weight: 900;
}
.agency-ui .home-followup-section-title span {
  min-width: 22px;
  border-radius: 999px;
  padding: 2px 7px;
  text-align: center;
  font-size: 11px;
}
.agency-ui .home-followup-section.bo .home-followup-section-title {
  color: #c2410c;
}
.agency-ui .home-followup-section.bo .home-followup-section-title span {
  background: #fff7ed;
  color: #c2410c;
}
.agency-ui .home-followup-section.tracking .home-followup-section-title {
  color: #175cd3;
}
.agency-ui .home-followup-section.tracking .home-followup-section-title span {
  background: #eff6ff;
  color: #175cd3;
}
.agency-ui .home-task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  border: 0;
  border-top: 1px solid #edf0f5;
  background: transparent;
  padding: 8px 0;
  color: #0b1f38;
  text-align: left;
  cursor: pointer;
}
.agency-ui .home-task-item.bo-task,
.agency-ui .home-task-item.tracking-task {
  border-radius: 7px;
  border-left: 4px solid transparent;
  padding-left: 8px;
  padding-right: 6px;
  background: #f8fafc;
}
.agency-ui .home-task-item.bo-task {
  border-left-color: #cbd5e1;
}
.agency-ui .home-task-item.tracking-task {
  border-left-color: #cbd5e1;
}
.agency-ui .home-task-item:hover {
  color: #135fdb;
}
.agency-ui .home-task-item.bo-task.overdue,
.agency-ui .home-task-item.tracking-task.overdue,
.agency-ui .home-task-item.bo-task.today,
.agency-ui .home-task-item.tracking-task.today {
  color: #b42318;
  background: #fff6f5;
  border-left-color: #ef4444;
}
.agency-ui .home-task-item.overdue,
.agency-ui .home-task-item.today {
  color: #b42318;
  background: #fff6f5;
}
.agency-ui .home-task-item.bo-task.soon,
.agency-ui .home-task-item.tracking-task.soon {
  color: #b54708;
  background: #fffbeb;
  border-left-color: #f59e0b;
}
.agency-ui .home-task-item.soon {
  color: #b54708;
  background: #fffbeb;
}
.agency-ui .home-task-item.bo-task.future,
.agency-ui .home-task-item.tracking-task.future,
.agency-ui .home-task-item.bo-task.muted,
.agency-ui .home-task-item.tracking-task.muted {
  color: #475467;
  background: #f8fafc;
  border-left-color: #cbd5e1;
}
.agency-ui .home-task-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agency-ui .home-task-item span strong,
.agency-ui .home-task-item span small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agency-ui .home-task-item span small {
  margin-top: 2px;
  color: #667085;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.agency-ui .home-task-item em {
  flex: 0 0 auto;
  border: 1px solid #cbd7ea;
  border-radius: 6px;
  padding: 3px 7px;
  color: #135fdb;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}
.agency-ui .home-task-item.bo-task em {
  border-color: #cbd5e1;
  color: #475467;
  background: #ffffff;
}
.agency-ui .home-task-item.tracking-task em {
  border-color: #cbd5e1;
  color: #475467;
  background: #ffffff;
}
.agency-ui .home-task-more {
  border-top: 1px solid #edf0f5;
  padding-top: 8px;
}
.agency-ui .change-request-dock {
  position: relative;
  margin-top: 56px;
}
.agency-ui .change-request-dock-button {
  display: grid;
  gap: 3px;
  width: 100%;
  border: 1px solid #93c5fd;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .18);
  color: #0b1f38;
  cursor: pointer;
  padding: 12px 14px;
  text-align: left;
}
.agency-ui .change-request-dock-button:hover {
  background: #eff6ff;
  border-color: #60a5fa;
}
.agency-ui .change-request-dock-button span {
  font-size: 14px;
  font-weight: 900;
}
.agency-ui .change-request-dock-button em {
  color: #2563eb;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}
.agency-ui .change-request-dock-button.has-draft {
  border-color: #f59e0b;
  background: #fffbeb;
}
.agency-ui .change-request-dock-button.has-draft em {
  color: #b54708;
}
.agency-ui .change-request-panel {
  position: fixed;
  left: 284px;
  top: 112px;
  z-index: 30;
  width: min(460px, calc(100vw - 316px));
  max-height: min(720px, calc(100vh - 134px));
  overflow: auto;
  margin-top: 0;
  padding: 14px;
  border: 1px solid #d9e4f2;
  border-radius: 8px;
  background: #f8fbff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .16);
}
.agency-ui .change-request-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.agency-ui .change-request-head h2 {
  margin: 0 0 8px;
  font-size: 14px;
}
.agency-ui .change-request-head span {
  color: #667085;
  font-size: 11px;
  font-weight: 700;
}
.agency-ui .change-request-note {
  color: #667085;
  font-size: 11px;
  line-height: 1.5;
}
.agency-ui .change-request-panel .field {
  margin-top: 8px;
}
.agency-ui .change-request-panel textarea {
  min-height: 150px;
}
.agency-ui .change-request-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 8px;
}
.agency-ui .change-request-drafts {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.agency-ui .change-request-draft-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  gap: 6px;
  align-items: center;
}
.agency-ui .change-request-draft-item .draft-load,
.agency-ui .change-request-draft-item .draft-delete {
  border: 1px solid #d7e0ed;
  border-radius: 6px;
  background: #fff;
  color: #0b1f38;
  cursor: pointer;
}
.agency-ui .change-request-draft-item .draft-load {
  min-width: 0;
  padding: 7px 8px;
  text-align: left;
}
.agency-ui .change-request-draft-item .draft-load strong,
.agency-ui .change-request-draft-item .draft-load span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agency-ui .change-request-draft-item .draft-load span {
  margin-top: 2px;
  color: #667085;
  font-size: 11px;
}
.agency-ui .change-request-draft-item .draft-delete {
  width: 28px;
  height: 28px;
  font-weight: 800;
}
.agency-ui .change-request-history {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border-top: 1px solid #e5eaf2;
  padding-top: 10px;
}
.agency-ui .change-request-history-toggle {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  border: 1px solid #cbd7ea;
  border-radius: 8px;
  background: #ffffff;
  color: #0b1f38;
  cursor: pointer;
  padding: 8px 10px;
  text-align: left;
}
.agency-ui .change-request-history-toggle strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agency-ui .change-request-history-toggle span {
  color: #667085;
  font-size: 11px;
  font-weight: 800;
}
.agency-ui .change-request-history-toggle em {
  border-radius: 999px;
  background: #eff6ff;
  color: #135fdb;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  padding: 3px 8px;
}
.agency-ui .change-request-history-list {
  display: grid;
  gap: 8px;
  max-height: 230px;
  overflow: auto;
}
.agency-ui .change-request-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}
.agency-ui .change-request-history-head span {
  color: #667085;
  font-size: 11px;
  font-weight: 700;
}
.agency-ui .change-request-history-item {
  border: 1px solid #d7e0ed;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
  font-size: 12px;
}
.agency-ui .change-request-history-item summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  cursor: pointer;
}
.agency-ui .change-request-history-item summary span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}
.agency-ui .change-request-history-item summary em {
  color: #667085;
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}
.agency-ui .change-request-history-item div {
  margin-top: 8px;
  color: #0b1f38;
  line-height: 1.55;
  word-break: break-word;
}
.agency-ui .nav-badge {
  display: inline-flex;
  min-width: 20px;
  height: 20px;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.agency-ui .agency-notification-view {
  max-width: 920px;
}

.agency-ui .agency-notification-head,
.agency-ui .agency-notification-card-head,
.agency-ui .agency-notification-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.agency-ui .agency-notification-form,
.agency-ui .agency-notification-card {
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.agency-ui .agency-notification-form {
  display: grid;
  gap: 14px;
  margin-top: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.agency-ui .agency-notification-form-main,
.agency-ui .agency-notification-section,
.agency-ui .agency-notification-controls {
  border-top: 1px solid #e6edf6;
  padding-top: 12px;
}

.agency-ui .agency-notification-form-main {
  border-top: 0;
  padding-top: 0;
}

.agency-ui .agency-notification-section.compact {
  margin-top: 12px;
}

.agency-ui .agency-notification-card-email {
  border-top: 1px solid #e6edf6;
  margin-top: 12px;
  padding-top: 12px;
}

.agency-ui .agency-notification-section.alert {
  background: #f8fafc;
  border: 1px solid #e1e8f2;
  border-radius: 8px;
  padding: 12px;
}

.agency-ui .agency-notification-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.agency-ui .agency-notification-section-title strong {
  font-size: 13px;
  color: #172033;
}

.agency-ui .agency-notification-section-title span,
.agency-ui .agency-notification-card-head span {
  color: #667085;
  font-size: 12px;
}

.agency-ui .agency-notification-email-row,
.agency-ui .agency-notification-alert-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.agency-ui .agency-notification-alert-controls {
  grid-template-columns: 150px minmax(220px, 1fr);
}

.agency-ui .agency-notification-option-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.agency-ui .agency-notification-option-grid.single {
  grid-template-columns: minmax(220px, 1fr);
  margin-bottom: 10px;
}

.agency-ui .agency-notification-option {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid #d6e0ee;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px 12px;
  color: #24324a;
  font-weight: 700;
}

.agency-ui .agency-notification-option:has(input:checked) {
  border-color: #8fb4ff;
  background: #f3f7ff;
  color: #1d4ed8;
}

.agency-ui .agency-notification-option input {
  width: 18px;
  height: 18px;
}

.agency-ui .agency-notification-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.agency-ui .agency-notification-list > .subtle {
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  padding: 16px;
  text-align: center;
}

.agency-ui .agency-notification-card.muted {
  opacity: 0.62;
}

.agency-ui .agency-notification-card-head strong {
  display: block;
  color: #101828;
  font-size: 15px;
}

.agency-ui .agency-notification-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 150px minmax(220px, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.agency-ui .agency-notification-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

@media (max-width: 980px) {
  .agency-ui .agency-notification-email-row,
  .agency-ui .agency-notification-alert-controls,
  .agency-ui .agency-notification-option-grid,
  .agency-ui .agency-notification-controls {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .agency-ui .agency-notification-email-row,
  .agency-ui .agency-notification-alert-controls,
  .agency-ui .agency-notification-option-grid,
  .agency-ui .agency-notification-controls {
    grid-template-columns: 1fr;
  }
}

.agency-ui .agency-followup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.agency-ui .agency-followup-list {
  display: grid;
  gap: 8px;
}
.agency-ui .followup-card {
  border: 1px solid #d9e4f4;
  border-left: 4px solid #7db3ff;
  border-radius: 8px;
  background: #ffffff;
  padding: 0;
}
.agency-ui .followup-card[open] {
  border-color: #9cc7ff;
  background: #f8fbff;
}
.agency-ui .followup-card.muted,
.agency-ui .followup-card.overdue {
  border-left-color: #ef4444;
}
.agency-ui .followup-card.today {
  border-left-color: #f59e0b;
}
.agency-ui .followup-card.soon {
  border-left-color: #2563eb;
}
.agency-ui .followup-card.has-bo {
  border-left-color: #f97316;
}
.agency-ui .followup-card summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
}
.agency-ui .followup-card summary::-webkit-details-marker {
  display: none;
}
.agency-ui .followup-card summary .meta {
  display: block;
}
.agency-ui .followup-summary-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 3px;
  align-items: center;
  min-width: 0;
}
.agency-ui .followup-summary-main .list-title,
.agency-ui .followup-summary-main .meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agency-ui .followup-summary-main .list-title {
  font-size: 18px;
  font-weight: 900;
}
.agency-ui .followup-summary-main .meta {
  grid-column: 2;
}
.agency-ui .followup-reason-row {
  grid-column: 2;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}
.agency-ui .followup-summary-side {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}
.agency-ui .followup-toggle-hint {
  color: #667085;
  font-size: 11px;
  font-weight: 800;
}
.agency-ui .followup-detail {
  border-top: 1px solid #d9dee8;
  padding: 8px 10px 10px;
}
.agency-ui .followup-mini-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.agency-ui .followup-mini-grid div {
  border: 1px solid #d9dee8;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
}
.agency-ui .followup-mini-grid span {
  display: block;
  color: #667085;
  font-size: 11px;
  font-weight: 800;
}
.agency-ui .followup-mini-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 14px;
}
.agency-ui .followup-tracking-box {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 160px;
  gap: 10px;
  align-items: end;
}
.agency-ui .followup-item-table table th,
.agency-ui .followup-item-table table td,
.agency-ui .agency-response-table th,
.agency-ui .agency-response-table td {
  vertical-align: middle;
}
.agency-ui .followup-item-table.compact table th,
.agency-ui .followup-item-table.compact table td {
  padding: 6px 8px;
}
.agency-ui .followup-item-table.compact table {
  min-width: 760px;
  table-layout: fixed;
}
.agency-ui .followup-item-table.compact th:nth-child(1),
.agency-ui .followup-item-table.compact td:nth-child(1) { width: 36%; }
.agency-ui .followup-item-table.compact th:nth-child(2),
.agency-ui .followup-item-table.compact td:nth-child(2) { width: 18%; }
.agency-ui .followup-item-table.compact th:nth-child(3),
.agency-ui .followup-item-table.compact td:nth-child(3) { width: 7%; text-align: center; }
.agency-ui .followup-item-table.compact th:nth-child(4),
.agency-ui .followup-item-table.compact td:nth-child(4) { width: 13%; text-align: center; }
.agency-ui .followup-item-table.compact th:nth-child(5),
.agency-ui .followup-item-table.compact td:nth-child(5) { width: 26%; }
.agency-ui .followup-item-table.compact td.name strong,
.agency-ui .followup-item-table.compact td.name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agency-ui .followup-item-table.compact td.name span {
  margin-top: 2px;
  color: #334155;
  font-size: 12px;
}
.agency-ui .followup-tracking-inline {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) minmax(120px, 150px) 54px;
  gap: 6px;
  align-items: center;
}
.agency-ui .followup-date-section {
  display: grid;
  gap: 10px;
}
.agency-ui .followup-date-section h3 {
  margin: 4px 0 0;
  font-size: 15px;
}
.agency-ui .followup-po-tracking {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(140px, 180px) 150px;
  gap: 8px;
  align-items: end;
  margin-bottom: 10px;
}
.agency-ui .followup-po-tracking.compact {
  grid-template-columns: minmax(260px, 1fr) minmax(150px, 190px) 140px;
  padding: 8px 10px;
  border: 1px solid #d9e4f4;
  border-radius: 8px;
  background: #ffffff;
}
.agency-ui .carrier-select {
  min-width: 110px;
}
.agency-ui .carrier-field {
  display: grid;
  gap: 6px;
}
.agency-ui .carrier-other {
  min-width: 120px;
}
.due-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}
.due-badge.followup-due-main {
  grid-row: 1 / span 2;
  min-width: 144px;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 15px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, .08);
}
.due-badge.mini {
  min-width: 0;
  padding: 4px 8px;
  border-radius: 7px;
  font-size: 11px;
  box-shadow: none;
}
.due-badge.overdue {
  border: 1px solid #fecdca;
  background: #fff1f0;
  color: #b42318;
}
.due-badge.today {
  border: 1px solid #fedf89;
  background: #fffbeb;
  color: #b54708;
}
.due-badge.soon {
  border: 1px solid #b2ddff;
  background: #eff8ff;
  color: #175cd3;
}
.due-badge.future {
  border: 1px solid #bbf7d0;
  background: #ecfdf3;
  color: #027a48;
}
.due-badge.muted {
  border: 1px solid #d9dee8;
  background: #f8fafc;
  color: #64748b;
}
.followup-reason-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border: 1px solid #d9e4f4;
  border-radius: 999px;
  background: #f8fafc;
  color: #334155;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
  white-space: nowrap;
}
.followup-reason-badge.bo {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #c2410c;
}
.followup-reason-badge.tracking {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #175cd3;
}
.followup-reason-badge.amazon {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #175cd3;
}
.followup-order-state {
  display: inline-flex;
  align-items: center;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  background: #f0f9ff;
  color: #0369a1;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.admin-ui .admin-followup-section {
  display: grid;
  gap: 10px;
}
.admin-ui .admin-followup-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 0;
  font-size: 15px;
}
.admin-ui .admin-followup-section h3 span,
.admin-ui .admin-followup-date-group h4 span {
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}
.admin-ui .admin-followup-list {
  display: grid;
  gap: 12px;
}
.admin-ui .admin-followup-date-group {
  display: grid;
  gap: 8px;
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
}
.admin-ui .admin-followup-date-group:first-child {
  border-top: 0;
  padding-top: 0;
}
.admin-ui .admin-followup-date-group h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: #334155;
  font-size: 14px;
}
.admin-ui .admin-followup-date-group h4::before {
  content: "";
  width: 4px;
  height: 14px;
  border-radius: 999px;
  background: #1667d9;
}
.admin-ui .admin-followup-card {
  border: 1px solid #d9e4f4;
  border-left: 4px solid #7db3ff;
  border-radius: 10px;
  background: #fff;
  padding: 0;
  overflow: hidden;
}
.admin-ui .admin-followup-card.overdue {
  border-left-color: #ef4444;
}
.admin-ui .admin-followup-card.today {
  border-left-color: #f59e0b;
}
.admin-ui .admin-followup-card.soon {
  border-left-color: #2563eb;
}
.admin-ui .admin-followup-card.muted {
  border-left-color: #94a3b8;
}
.admin-ui .admin-followup-card[open] {
  background: #f8fbff;
}
.admin-ui .admin-followup-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f8fbff;
  border-bottom: 1px solid #e6edf7;
  cursor: pointer;
  list-style: none;
}
.admin-ui .admin-followup-title::-webkit-details-marker {
  display: none;
}
.admin-ui .admin-followup-title-main {
  min-width: 0;
}
.admin-ui .admin-followup-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.admin-ui .admin-followup-title-main strong,
.admin-ui .admin-followup-title-main span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-ui .admin-followup-title span {
  display: block;
  margin-top: 2px;
  color: #667085;
  font-size: 12px;
}
.admin-ui .admin-followup-title .followup-reason-row {
  display: flex;
}
.admin-ui .admin-followup-title .followup-reason-badge {
  display: inline-flex;
  margin-top: 0;
}
.admin-ui .admin-followup-title .due-badge {
  display: inline-flex;
  margin-top: 0;
  color: inherit;
}
.admin-ui .admin-followup-title .due-badge.overdue { color: #b42318; }
.admin-ui .admin-followup-title .due-badge.today { color: #b54708; }
.admin-ui .admin-followup-title .due-badge.soon { color: #175cd3; }
.admin-ui .admin-followup-title .due-badge.future { color: #027a48; }
.admin-ui .admin-followup-title .due-badge.muted { color: #64748b; }
.admin-ui .admin-followup-toggle-hint {
  color: #175cd3;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}
.admin-ui .admin-followup-card[open] .admin-followup-toggle-hint {
  color: #64748b;
}
.admin-ui .admin-followup-card[open] .admin-followup-toggle-hint::before {
  content: "表示中";
}
.admin-ui .admin-followup-card[open] .admin-followup-toggle-hint {
  font-size: 0;
}
.admin-ui .admin-followup-card[open] .admin-followup-toggle-hint::before {
  font-size: 12px;
}
.admin-ui .admin-followup-body {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 132px 132px minmax(180px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
}
.admin-ui .admin-followup-product {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: #334155;
  font-size: 13px;
}
.admin-ui .admin-followup-card .followup-memo {
  min-height: 38px;
  resize: vertical;
}
.admin-ui .admin-followup-order-detail {
  border-top: 1px solid #e6edf7;
  padding: 10px 12px 12px;
}
.admin-ui .admin-followup-order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.admin-ui .admin-followup-order-head strong,
.admin-ui .admin-followup-order-head span {
  display: block;
}
.admin-ui .admin-followup-order-head strong {
  color: #0b1f38;
  font-size: 13px;
  font-weight: 900;
}
.admin-ui .admin-followup-order-head span {
  margin-top: 2px;
  color: #667085;
  font-size: 12px;
  font-weight: 750;
}
.admin-ui .admin-followup-order-table table {
  min-width: 980px;
  table-layout: fixed;
}
.admin-ui .admin-followup-order-table th,
.admin-ui .admin-followup-order-table td {
  padding: 6px 8px;
  font-size: 12px;
  vertical-align: middle;
}
.admin-ui .admin-followup-order-table th:nth-child(1),
.admin-ui .admin-followup-order-table td:nth-child(1) { width: 24%; }
.admin-ui .admin-followup-order-table th:nth-child(2),
.admin-ui .admin-followup-order-table td:nth-child(2) { width: 16%; }
.admin-ui .admin-followup-order-table th:nth-child(3),
.admin-ui .admin-followup-order-table td:nth-child(3) { width: 54px; text-align: center; }
.admin-ui .admin-followup-order-table th:nth-child(4),
.admin-ui .admin-followup-order-table td:nth-child(4) { width: 13%; text-align: center; }
.admin-ui .admin-followup-order-table th:nth-child(5),
.admin-ui .admin-followup-order-table td:nth-child(5) { width: 12%; text-align: center; }
.admin-ui .admin-followup-order-table th:nth-child(6),
.admin-ui .admin-followup-order-table td:nth-child(6) { width: 15%; }
.admin-ui .admin-followup-order-table th:nth-child(7),
.admin-ui .admin-followup-order-table td:nth-child(7) { width: 20%; }
.admin-ui .admin-followup-order-table tr.is-focus td {
  background: #fff8eb;
}
.admin-ui .admin-followup-order-table td.name strong,
.admin-ui .admin-followup-order-table td.name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-ui .admin-followup-order-table td.name span {
  margin-top: 2px;
  color: #334155;
}
.admin-ui .admin-followup-source-links {
  display: grid;
  gap: 4px;
}
.admin-ui .admin-source-link-chip {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}
.admin-ui a.admin-source-link-chip:hover strong {
  color: #135fdb;
  text-decoration: underline;
}
.admin-ui .admin-source-link-chip span {
  min-width: 0;
}
.admin-ui .admin-source-link-chip strong,
.admin-ui .admin-source-link-chip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.admin-ui .admin-source-link-chip strong {
  color: #0b1f38;
  font-size: 11.5px;
}
.admin-ui .admin-source-link-chip small {
  color: #667085;
  font-size: 10.5px;
  font-weight: 750;
}
@media (max-width: 1320px) {
  .admin-ui .admin-followup-body {
    grid-template-columns: minmax(240px, 1fr) 132px 132px;
  }
  .admin-ui .admin-followup-card .followup-memo {
    grid-column: 1 / -1;
  }
}
@media (max-width: 760px) {
  .admin-ui .admin-followup-title,
  .admin-ui .admin-followup-body {
    grid-template-columns: 1fr;
  }
  .admin-ui .admin-followup-title .due-badge {
    justify-self: start;
  }
  .admin-ui .admin-followup-toggle-hint {
    justify-self: start;
  }
  .admin-ui .admin-followup-order-head {
    align-items: stretch;
    flex-direction: column;
  }
}
.agency-ui .agency-queue,
.agency-ui .agency-right-rail {
  display: grid;
  gap: 14px;
  position: sticky;
  top: 20px;
}
.agency-ui .agency-right-rail {
  max-height: calc(100vh - 56px);
  overflow: auto;
}
.agency-ui .panel {
  border-color: #cfd8e6;
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(29, 36, 51, .06);
  padding: 12px;
}
.agency-ui .agency-queue .panel {
  box-shadow: none;
}
.agency-ui .agency-detail-card {
  padding: 0;
  overflow: hidden;
}
.agency-ui .agency-order-hero {
  padding: 12px 14px;
  border-bottom: 1px solid #cfd8e6;
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.agency-ui .agency-order-hero h2 {
  margin: 0;
  font-size: 20px;
}
.agency-ui .agency-detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  background: #eef2f7;
}
.agency-ui .agency-main-pane,
.agency-ui .agency-context-pane {
  background: #ffffff;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  padding: 12px;
}
.agency-ui .agency-context-pane {
  align-self: start;
}
.agency-ui .agency-context-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
}
.agency-ui .date-filter,
.agency-ui .rail-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.agency-ui .date-filter .btn {
  max-width: 100%;
  white-space: normal;
  text-align: left;
  line-height: 1.25;
}
.agency-ui .date-filter .btn.date-filter-two-line {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.agency-ui .date-filter .btn.date-filter-two-line span {
  display: block;
}
.agency-ui .rail-tabs .tab {
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12px;
}
.agency-ui .list-item {
  border-radius: 7px;
  padding: 10px;
  text-align: left;
  width: 100%;
}
.agency-ui .list-item.active {
  border-color: #2563eb;
  background: #e8f2ff;
  box-shadow: inset 3px 0 0 #2563eb;
}
.agency-ui .inbox-item {
  border-radius: 10px;
  padding: 12px;
}
.agency-ui .agency-inbox-card {
  padding: 10px 11px;
}
.agency-ui .agency-inbox-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
  align-items: start;
  min-width: 0;
}
.agency-ui .agency-inbox-title .agency-inbox-time {
  grid-row: 2;
  color: #667085;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.1;
}
.agency-ui .agency-inbox-title strong {
  min-width: 0;
  overflow: hidden;
  color: #0b1f38;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.22;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agency-ui .agency-inbox-meta {
  margin-top: 4px;
  font-size: 11px;
}
.agency-ui .agency-inbox-summary {
  display: -webkit-box;
  margin: 6px 0 8px;
  overflow: hidden;
  color: #0b1f38;
  font-size: 12px;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.agency-ui .agency-inbox-summary .agency-inbox-skus {
  display: grid;
  gap: 1px;
  margin-top: 3px;
}
.agency-ui .agency-inbox-summary .agency-inbox-skus span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.agency-ui .inbox-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.agency-ui .inbox-actions .btn.small {
  min-height: 30px;
  padding: 5px 9px;
}
.agency-ui .btn {
  border-radius: 7px;
  font-weight: 800;
}
.agency-ui .btn.primary {
  background: #2563eb;
  border-color: #2563eb;
}
.agency-ui .link-btn {
  margin-left: 8px;
  border: 0;
  background: transparent;
  color: #2563eb;
  font-weight: 800;
}
.agency-ui .password-reset-confirm {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #d9dee8;
}
.agency-ui .password-reset-confirm h2 {
  margin: 0 0 6px;
  font-size: 16px;
}
.agency-ui .password-reset-confirm .btn.primary {
  margin-top: 2px;
}
.agency-ui .btn.success {
  background: #16803c;
  border-color: #16803c;
  color: #ffffff;
}
.agency-ui .input,
.agency-ui select,
.agency-ui textarea {
  border-radius: 7px;
  padding: 8px 9px;
}
.agency-ui .metrics {
  grid-template-columns: repeat(5, minmax(108px, 1fr));
}
.agency-ui .metric {
  border-radius: 7px;
  padding: 9px;
}
.agency-ui .metric .value {
  font-size: 19px;
}
.agency-ui .metric .hint {
  margin-top: 3px;
  color: #667085;
  font-size: 11px;
  line-height: 1.35;
}
.agency-ui .agency-critical-summary {
  display: grid;
  grid-template-columns: minmax(140px, .75fr) minmax(140px, .75fr) minmax(240px, 1.5fr);
  gap: 10px;
  align-items: start;
  margin-bottom: 16px;
}
.agency-ui .critical-card {
  border: 1px solid #b9d7ff;
  border-left: 4px solid #2563eb;
  border-radius: 9px;
  background: #f8fbff;
  padding: 12px;
  min-width: 0;
  min-height: 84px;
}
.agency-ui .critical-card.delivery {
  border-color: #fed7aa;
  border-left-color: #f97316;
  background: #fff7ed;
}
.agency-ui .critical-card.tracking {
  border-color: #fde68a;
  border-left-color: #f59e0b;
  background: #fffbeb;
}
.agency-ui .critical-card.shipping {
  border-color: #bfdbfe;
  border-left-color: #2563eb;
  background: #f8fbff;
}
.agency-ui .critical-card.required {
  border-color: #ffcf99;
  border-left-color: #f59e0b;
  background: #fffbeb;
}
.agency-ui .critical-card .label {
  color: #40566f;
  font-size: 12px;
  font-weight: 850;
}
.agency-ui .critical-card .value {
  margin-top: 4px;
  color: #0b1f38;
  font-size: 21px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agency-ui .critical-card.delivery .label,
.agency-ui .critical-card.delivery .value {
  color: #c2410c;
}
.agency-ui .critical-card.tracking .label,
.agency-ui .critical-card.tracking .value {
  color: #92400e;
}
.agency-ui .critical-card.shipping .label,
.agency-ui .critical-card.shipping .value {
  color: #123f8c;
}
.agency-ui .critical-card .hint {
  margin-top: 6px;
  color: #667085;
  font-size: 12px;
  font-weight: 800;
}
.agency-ui .critical-card.wide .value {
  font-size: 18px;
}
.agency-ui .critical-shipping-line {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 28px;
  gap: 8px;
  align-items: start;
}
.agency-ui .critical-address {
  color: #40566f;
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
  overflow-wrap: anywhere;
}
.agency-ui .critical-copy {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #b9d7ff;
  border-radius: 8px;
  background: #ffffff;
  color: #1746ad;
  font-weight: 900;
  line-height: 1;
  padding: 0;
}
.agency-ui .agency-price-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(130px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.agency-ui .agency-admin-note {
  border: 1px solid #fed7aa;
  border-left: 5px solid #f59e0b;
  background: #fffbeb;
  border-radius: 10px;
  padding: 11px 12px;
  margin-bottom: 14px;
  color: #7a4b00;
  line-height: 1.55;
}
.agency-ui .agency-input-zone {
  display: grid;
  grid-template-columns: minmax(330px, 420px) minmax(260px, 1fr);
  gap: 12px;
  align-items: stretch;
  margin: 14px 0;
}
.agency-ui .agency-section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 8px;
}
.agency-ui .agency-section-title h3 {
  margin: 0;
  color: #0b1f38;
  font-size: 16px;
}
.agency-ui .agency-section-title span {
  color: #667085;
  font-size: 12px;
  font-weight: 700;
}
.agency-ui .agency-response-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
  align-items: start;
  margin-top: 12px;
}
.agency-ui .agency-response-left {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(360px, 1fr);
  gap: 12px;
  align-items: start;
}
.agency-ui .agency-bulk-bar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  align-items: end;
  border: 1px solid #d9dee8;
  border-radius: 7px;
  background: #f8fbff;
  padding: 10px;
}
.agency-ui .agency-bulk-bar h3 {
  grid-column: 1 / -1;
  margin: 0;
  color: #0b1f38;
  font-size: 14px;
}
.agency-ui .agency-bulk-bar .btn {
  grid-column: 1 / -1;
  justify-self: start;
}
.agency-ui .agency-message-tabs {
  border: 1px solid #fed7aa;
  border-radius: 9px;
  background: #fffbeb;
  overflow: hidden;
}
.agency-ui .agency-message-tab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid #fed7aa;
  background: #fff7ed;
  padding: 8px 10px;
}
.agency-ui .agency-message-tab-head .tab {
  border-color: #f97316;
  background: #ffffff;
  color: #9a3412;
  font-weight: 900;
}
.agency-ui .agency-message-tab-head span {
  color: #9a3412;
  font-size: 12px;
  font-weight: 800;
}
.agency-ui .agency-message-tab-body {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(220px, .8fr);
  gap: 10px;
  padding: 10px;
}
.agency-ui .agency-message-tab-body .message-panel {
  min-height: 0;
}
.agency-ui .table-wrap {
  border-radius: 7px;
}
.agency-ui table {
  font-size: 12px;
  min-width: 1080px;
}
.agency-ui th {
  background: #eef3f9;
  color: #334155;
}
.agency-ui .agency-response-table {
  table-layout: fixed;
  min-width: 0;
}
.agency-ui .agency-response-table th,
.agency-ui .agency-response-table td {
  padding: 7px 6px;
  text-align: center;
  vertical-align: middle;
}
.agency-ui .agency-response-table th:nth-child(1),
.agency-ui .agency-response-table td:nth-child(1) { width: 4%; text-align: center; }
.agency-ui .agency-response-table th:nth-child(2),
.agency-ui .agency-response-table td:nth-child(2) { width: 5%; }
.agency-ui .agency-response-table th:nth-child(3),
.agency-ui .agency-response-table td:nth-child(3) { width: 10%; }
.agency-ui .agency-response-table th:nth-child(4),
.agency-ui .agency-response-table td:nth-child(4) { width: 16%; }
.agency-ui .agency-response-table th:nth-child(5),
.agency-ui .agency-response-table td:nth-child(5) { width: 8%; }
.agency-ui .agency-response-table th:nth-child(6),
.agency-ui .agency-response-table td:nth-child(6) { width: 6%; }
.agency-ui .agency-response-table th:nth-child(7),
.agency-ui .agency-response-table td:nth-child(7) { width: 8%; }
.agency-ui .agency-response-table th:nth-child(8),
.agency-ui .agency-response-table td:nth-child(8) { width: 11%; }
.agency-ui .agency-response-table th:nth-child(9),
.agency-ui .agency-response-table td:nth-child(9) { width: 11%; }
.agency-ui .agency-response-table th:nth-child(10),
.agency-ui .agency-response-table td:nth-child(10) { width: 10%; }
.agency-ui .agency-response-table th:nth-child(11),
.agency-ui .agency-response-table td:nth-child(11) { width: 10%; }
.agency-ui td {
  background: #ffffff;
  vertical-align: top;
}
.agency-ui td.name { min-width: 260px; }
.agency-ui .agency-response-table td.name {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}
.agency-ui .agency-item-message {
  min-width: 0;
  max-width: none;
  color: #7a4b00;
  background: #fffbeb;
  white-space: normal;
  line-height: 1.5;
  text-align: center;
  vertical-align: middle;
}
.agency-ui .agency-response-table .input,
.agency-ui .agency-response-table select,
.agency-ui .agency-response-table textarea {
  text-align: center;
}
.agency-ui .agency-response-table textarea {
  min-height: 48px;
}
.agency-ui .agency-price-details {
  margin-top: 0;
  border: 1px solid #d9dee8;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px 12px;
}
.agency-ui .agency-price-details h3 {
  margin: 0;
  color: #0b1f38;
  font-size: 15px;
}
.agency-ui .agency-price-details .metric .value {
  font-size: 17px;
}
.agency-ui .agency-search-results {
  padding: 4px;
}
.agency-ui .agency-search-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.agency-ui .agency-search-head h2 {
  margin: 0;
}
.agency-ui .search-date-group {
  border: 1px solid #cfd8e6;
  border-radius: 10px;
  background: #ffffff;
  margin-bottom: 10px;
  overflow: hidden;
}
.agency-ui .search-date-group > summary {
  cursor: pointer;
  list-style: none;
  padding: 12px 14px;
  background: #f8fbff;
}
.agency-ui .search-date-group > summary::-webkit-details-marker,
.agency-ui .search-order-card > summary::-webkit-details-marker {
  display: none;
}
.agency-ui .search-date-title {
  display: block;
  color: #0b1f38;
  font-size: 16px;
  font-weight: 900;
}
.agency-ui .search-order-list {
  display: grid;
  gap: 8px;
  padding: 10px;
}
.agency-ui .search-order-card {
  border: 1px solid #d9dee8;
  border-radius: 8px;
  background: #ffffff;
}
.agency-ui .search-order-card > summary {
  cursor: pointer;
  list-style: none;
  padding: 10px 12px;
}
.agency-ui .search-order-detail {
  border-top: 1px solid #d9dee8;
  padding: 10px 12px 12px;
}
.agency-ui .search-order-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 8px;
}
.agency-ui .agency-price-summary .metric.selected {
  border-color: #b9d7ff;
  background: #f8fbff;
}
.agency-ui .agency-price-empty {
  margin-top: 8px;
}
.agency-ui .agency-price-table-wrap {
  margin-top: 10px;
}
.agency-ui .agency-price-table {
  min-width: 760px;
}
.agency-ui .agency-price-table tr.selected td {
  background: #eff6ff;
}
.agency-ui .agency-completed-table {
  min-width: 920px;
}
.agency-ui .completed-filter-panel,
.admin-ui .completed-filter-panel {
  display: grid;
  gap: 12px;
  margin: 0 0 12px;
  border: 1px solid #d9dee8;
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px;
}
.agency-ui .completed-filter-head,
.admin-ui .completed-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.agency-ui .completed-filter-panel .date-filter,
.admin-ui .completed-filter-panel .date-filter {
  margin-bottom: 0;
}
.agency-ui .completed-date-field,
.admin-ui .completed-date-field {
  margin: 0;
}
.agency-ui .completed-calendar,
.admin-ui .completed-calendar {
  border: 1px solid #d9dee8;
  border-radius: 8px;
  background: #ffffff;
  padding: 10px;
}
.agency-ui .completed-calendar-head,
.admin-ui .completed-calendar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}
.agency-ui .completed-calendar-weekdays,
.agency-ui .completed-calendar-grid,
.admin-ui .completed-calendar-weekdays,
.admin-ui .completed-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(44px, 1fr));
  gap: 5px;
}
.agency-ui .completed-calendar-weekdays span,
.admin-ui .completed-calendar-weekdays span {
  color: #667085;
  font-size: 12px;
  font-weight: 850;
  text-align: center;
}
.agency-ui .completed-calendar-day,
.agency-ui .completed-calendar-empty,
.admin-ui .completed-calendar-day,
.admin-ui .completed-calendar-empty {
  min-height: 34px;
  border-radius: 8px;
}
.agency-ui .completed-calendar-day,
.admin-ui .completed-calendar-day {
  position: relative;
  border: 1px solid #d9dee8;
  background: #ffffff;
  color: #0b1f38;
  font-weight: 850;
}
.agency-ui .completed-calendar-day.has-order,
.admin-ui .completed-calendar-day.has-order {
  border-color: #7db3ff;
  background: #eff6ff;
}
.agency-ui .completed-calendar-day.active,
.admin-ui .completed-calendar-day.active {
  border-color: #2563eb;
  box-shadow: inset 0 0 0 2px #2563eb;
}
.agency-ui .completed-calendar-day em,
.admin-ui .completed-calendar-day em {
  position: absolute;
  right: 5px;
  bottom: 4px;
  display: inline-grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 10px;
  font-style: normal;
}
.agency-ui .agency-completed-table tr.is-expanded td {
  background: #eff6ff;
}
.agency-ui .completed-inline-row td {
  background: #f8fbff;
}
.agency-ui .completed-inline-detail {
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
}
.agency-ui .completed-inline-head,
.admin-ui .completed-inline-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.agency-ui .completed-inline-detail table,
.admin-ui .completed-inline-detail table {
  min-width: 760px;
}
.agency-ui .row-note {
  min-width: 0;
  min-height: 54px;
}
.agency-ui .row-status {
  min-width: 0;
}
.agency-ui .inbox-summary {
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.5;
}
.agency-ui tr.highlight td {
  background: #fff8db;
}
.agency-ui .copy-box {
  border-color: #aac0e8;
  background: #f8fbff;
  border-radius: 10px;
}
.agency-ui .agency-history {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}
.agency-ui .agency-history-item {
  border: 1px solid #d9dee8;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
  font-size: 12px;
}
.agency-ui .message-panel {
  gap: 8px;
}
.agency-ui .message-panel.inline {
  border: 1px solid #d9dee8;
  border-radius: 10px;
  background: #ffffff;
  padding: 10px;
}
.agency-ui .message-panel.inline .agency-history-item {
  margin-top: 0;
}
.agency-ui .agency-history-item.compact {
  padding: 9px 10px;
}
.agency-ui .agency-history-item.compact .meta {
  display: block;
  margin: 3px 0 6px;
}
.agency-ui .agency-history-item.from-admin {
  border-color: #bfdbfe;
  background: #eff6ff;
}
.agency-ui .agency-history-item.from-agency {
  border-color: #fed7aa;
  background: #fff7ed;
}
.agency-ui .agency-history-item.error {
  border-color: #fecaca;
  background: #fef2f2;
}
.agency-ui .agency-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  border: 1px solid #d9dee8;
  border-radius: 8px;
  background: #f8fbff;
  padding: 10px 12px;
}
.agency-ui .agency-actions .btn {
  min-width: 180px;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .45);
  padding: 24px;
}
.modal-card {
  width: min(900px, 94vw);
  max-height: 88vh;
  overflow: auto;
  border: 1px solid #cfd8e6;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 22px 70px rgba(15, 23, 42, .24);
  padding: 16px;
}
.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.modal-head h2 {
  margin: 0;
  font-size: 20px;
}
.modal-table {
  margin-top: 12px;
}
.modal-table table {
  min-width: 760px;
}
.modal-note {
  margin-top: 12px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fffbeb;
  padding: 10px;
  color: #7a4b00;
  line-height: 1.5;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}
.password-reset-modal {
  width: min(620px, 94vw);
}
.message-log-modal {
  width: min(760px, 94vw);
}
.modal-card.change-request-review-modal {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  width: min(1280px, 98vw);
  height: min(940px, 96vh);
  max-height: 96vh;
  overflow: hidden;
  padding: 14px;
}
.modal-card.change-request-review-modal .modal-head {
  grid-row: 1;
  margin-bottom: 8px;
}
.modal-card.change-request-review-modal .notice.compact {
  grid-row: 2;
  margin-bottom: 8px;
  padding: 8px 10px;
}
.modal-card.change-request-review-modal .change-request-review-source {
  grid-row: 3;
  margin-bottom: 8px;
}
.modal-card.change-request-review-modal .change-request-review-modal-note {
  grid-row: 4;
  align-self: stretch;
  justify-self: stretch;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  min-height: 360px;
  overflow: auto;
  resize: none;
}
.modal-card.change-request-review-modal [data-modal-review-status] {
  grid-row: 5;
  min-height: 18px;
}
.modal-card.change-request-review-modal .modal-actions {
  grid-row: 6;
  margin-top: 8px;
}
.modal-message-thread {
  max-height: 68vh;
  overflow: auto;
}
.reset-password-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.reset-password-value {
  font-family: Consolas, "Courier New", monospace;
  font-weight: 700;
  letter-spacing: .02em;
}
.reset-copy-text {
  margin-top: 12px;
  white-space: pre-wrap;
  user-select: text;
}
.agency-ui .agency-order-note {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
}
.agency-ui .agency-order-note textarea {
  min-height: 86px;
}
.agency-ui .agency-status-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Agency order workspace: C-style product-first layout */
.agency-ui .agency-main-pane {
  padding: 14px;
}
.agency-ui .agency-critical-summary {
  grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr) minmax(280px, 2fr);
  gap: 10px;
  margin-bottom: 12px;
  align-items: stretch;
}
.agency-ui .critical-card {
  display: flex;
  align-items: center;
  min-height: 86px;
  box-sizing: border-box;
  padding: 12px 14px;
  border-left-width: 0;
  border-radius: 8px;
}
.agency-ui .critical-card-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
}
.agency-ui .critical-icon {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .86);
}
.agency-ui .critical-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.agency-ui .critical-card .label {
  font-size: 13px;
}
.agency-ui .critical-card .value {
  margin-top: 5px;
  font-size: 23px;
  line-height: 1.12;
}
.agency-ui .critical-card.wide .value {
  font-size: 19px;
}
.agency-ui .critical-shipping-line {
  position: relative;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 4px 8px;
}
.agency-ui .critical-shipping-line .label,
.agency-ui .critical-shipping-line .value,
.agency-ui .critical-address {
  grid-column: 1;
}
.agency-ui .critical-copy {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: start;
}
.agency-ui .agency-top-work {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(460px, 1fr);
  gap: 10px;
  align-items: stretch;
  margin: 0 0 12px;
}
.agency-ui .agency-bulk-bar {
  border-radius: 8px;
  padding: 10px;
  gap: 8px;
}
.agency-ui .agency-bulk-bar h3 {
  font-size: 14px;
}
.agency-ui .agency-bulk-bar .btn {
  min-height: 38px;
  font-size: 14px;
}
.agency-ui .agency-message-tabs {
  border-color: #fdba74;
  border-radius: 10px;
  background: #fff7ed;
  min-width: 0;
}
.agency-ui .agency-message-tab-head {
  padding: 7px 10px;
}
.agency-ui .agency-message-tab-head strong {
  color: #c2410c;
  font-size: 13px;
}
.agency-ui .agency-message-tab-head .btn.ghost {
  border-color: #fed7aa;
  background: #fff;
  color: #9a3412;
  min-height: 28px;
  padding: 4px 9px;
}
.agency-ui .agency-message-tab-body {
  grid-template-columns: minmax(220px, 38%) minmax(360px, 62%);
  gap: 8px;
  padding: 9px 10px 10px;
  align-items: stretch;
}
.agency-ui .agency-order-note textarea {
  min-height: 78px;
  font-size: 14px;
}
.agency-ui .message-panel.inline {
  max-height: 82px;
  overflow: auto;
  border-color: #fed7aa;
  background: #fffdf8;
  padding: 6px 8px;
}
.agency-ui .message-line {
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  border-bottom: 1px solid #f2dfc7;
  padding: 4px 0;
  color: #0b1f38;
  font-size: 12px;
  line-height: 1.35;
}
.agency-ui .message-line:last-child {
  border-bottom: 0;
}
.agency-ui .message-line-meta {
  color: #667085;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.agency-ui .message-line-body {
  min-width: 0;
  overflow-wrap: anywhere;
  white-space: normal;
}
.agency-ui .message-line.muted {
  display: block;
  color: #667085;
}
.agency-ui .message-line.error {
  display: block;
  color: #b42318;
}
.agency-ui .message-line.more {
  display: block;
  color: #9a3412;
  font-weight: 850;
}
.agency-ui .agency-section-title {
  align-items: center;
  margin: 6px 0 10px;
}
.agency-ui .agency-section-title h3 {
  font-size: 18px;
}
.agency-ui .agency-section-title span {
  font-size: 13px;
}
.agency-ui .agency-response-table {
  table-layout: fixed;
  min-width: 1040px;
}
.agency-ui .agency-response-table th,
.agency-ui .agency-response-table td {
  padding: 8px 7px;
  font-size: 13px;
  vertical-align: middle;
}
.agency-ui .agency-response-table th {
  font-size: 13px;
  font-weight: 900;
}
.agency-ui .agency-response-table td.name {
  min-width: 0;
  max-width: none;
  color: #0b1f38;
  font-size: 14px;
  font-weight: 850;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.agency-ui .agency-response-table th:nth-child(1),
.agency-ui .agency-response-table td:nth-child(1) { width: 36px; }
.agency-ui .agency-response-table th:nth-child(2),
.agency-ui .agency-response-table td:nth-child(2) { width: 50px; }
.agency-ui .agency-response-table th:nth-child(3),
.agency-ui .agency-response-table td:nth-child(3) { width: 96px; }
.agency-ui .agency-response-table th:nth-child(4),
.agency-ui .agency-response-table td:nth-child(4) { width: 200px; }
.agency-ui .agency-response-table th:nth-child(5),
.agency-ui .agency-response-table td:nth-child(5) { width: 82px; }
.agency-ui .agency-response-table th:nth-child(6),
.agency-ui .agency-response-table td:nth-child(6) { width: 58px; }
.agency-ui .agency-response-table th:nth-child(7),
.agency-ui .agency-response-table td:nth-child(7) { width: 82px; }
.agency-ui .agency-response-table th:nth-child(8),
.agency-ui .agency-response-table td:nth-child(8) { width: 106px; }
.agency-ui .agency-response-table th:nth-child(9),
.agency-ui .agency-response-table td:nth-child(9) { width: 130px; }
.agency-ui .agency-response-table th:nth-child(10),
.agency-ui .agency-response-table td:nth-child(10) { width: 118px; }
.agency-ui .agency-response-table th:nth-child(11),
.agency-ui .agency-response-table td:nth-child(11) { width: 118px; }
.agency-ui .agency-response-table .input,
.agency-ui .agency-response-table select {
  min-height: 36px;
  font-size: 12px;
  padding: 6px 8px;
}
.agency-ui .agency-response-table textarea {
  min-height: 44px;
  font-size: 12px;
  padding: 6px 8px;
}
.agency-ui .agency-item-message {
  min-width: 0;
  line-height: 1.55;
}
.agency-ui .agency-price-details {
  margin-top: 0;
  padding: 10px;
}
.agency-ui .agency-price-details h3 {
  font-size: 14px;
  margin-bottom: 8px;
}
.agency-ui .agency-price-summary {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 0;
}
.agency-ui .price-group {
  display: grid;
  gap: 5px;
  min-height: 76px;
  border: 1px solid #cfd8e6;
  border-radius: 8px;
  background: #ffffff;
  padding: 8px 10px;
}
.agency-ui .price-group.selected {
  border-color: #b9d7ff;
  background: #f8fbff;
}
.agency-ui .price-pair {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.agency-ui .price-pair span {
  color: #667085;
  font-size: 12px;
  font-weight: 750;
}
.agency-ui .price-pair strong {
  color: #0b1f38;
  font-size: 18px;
  font-weight: 900;
}
.agency-ui .agency-price-empty {
  margin-top: 6px;
}
.agency-ui .agency-response-footer {
  display: grid;
  grid-template-columns: minmax(260px, .9fr) minmax(420px, 1.1fr);
  gap: 10px;
  align-items: start;
  margin-top: 12px;
}
.agency-ui .agency-actions {
  position: static;
  bottom: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: minmax(150px, 220px) minmax(190px, 1fr);
  align-content: start;
  align-items: start;
  margin-top: 0;
  padding: 10px 12px;
  box-shadow: none;
}
.agency-ui .agency-actions .btn {
  min-width: 0;
}

@media (max-width: 1200px) {
  .agency-ui .agency-workspace,
  .agency-ui .agency-detail-layout,
  .agency-ui .agency-context-grid {
    grid-template-columns: 1fr;
  }
  .agency-ui .agency-queue,
  .agency-ui .agency-right-rail {
    position: static;
    max-height: none;
  }
  .agency-ui .change-request-panel {
    left: 16px;
    right: 16px;
    top: 84px;
    width: auto;
    max-height: calc(100vh - 110px);
  }
  .agency-ui .agency-top-work,
  .agency-ui .agency-critical-summary {
    grid-template-columns: 1fr;
  }
}

/* Agency refinement: keep the order detail product-first at production width. */
.agency-ui .agency-workspace {
  grid-template-columns: 190px minmax(0, 1fr) minmax(230px, 260px);
  gap: 8px;
}
.agency-ui .agency-detail-card {
  grid-column: 2;
  grid-row: 1;
}
.agency-ui .agency-right-rail {
  grid-column: 3;
  grid-row: 1;
  position: sticky;
  top: 14px;
  max-height: calc(100vh - 28px);
  overflow: auto;
}
.agency-ui .agency-right-rail .panel {
  box-shadow: none;
  border-color: #bfdbfe;
  background: #f8fbff;
}
.agency-ui .change-request-panel {
  width: min(460px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 134px));
}
.agency-ui .agency-detail-layout {
  padding: 10px;
}
.agency-ui .agency-main-pane {
  padding: 12px;
}
.agency-ui .agency-critical-summary {
  grid-template-columns: minmax(132px, .7fr) minmax(132px, .7fr) minmax(260px, 1.8fr);
  gap: 8px;
  margin-bottom: 10px;
}
.agency-ui .critical-card {
  min-height: 76px;
  padding: 10px 12px;
}
.agency-ui .critical-card .value {
  font-size: 19px;
}
.agency-ui .critical-card.wide .value {
  font-size: 17px;
}
.agency-ui .agency-top-work {
  grid-template-columns: minmax(230px, 300px) minmax(390px, 1fr);
  gap: 8px;
  align-items: start;
}
.agency-ui .agency-bulk-bar {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: end;
  padding: 8px 10px;
  gap: 6px 8px;
}
.agency-ui .agency-bulk-bar h3 {
  grid-column: 1 / -1;
  margin-bottom: 0;
  line-height: 1.25;
}
.agency-ui .agency-bulk-bar .field {
  gap: 3px;
  grid-column: auto;
}
.agency-ui .agency-bulk-bar label {
  font-size: 12px;
  line-height: 1.2;
}
.agency-ui .agency-bulk-bar select,
.agency-ui .agency-bulk-bar .input {
  min-height: 36px;
  padding: 7px 9px;
  font-size: 13px;
}
.agency-ui .agency-bulk-bar .btn {
  grid-column: 1 / -1;
  width: 100%;
  min-height: 36px;
}
.agency-ui .agency-bulk-bar .field,
.agency-ui .agency-bulk-bar select,
.agency-ui .agency-bulk-bar .input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
}
.agency-ui .agency-message-tab-body {
  grid-template-columns: minmax(190px, 30%) minmax(360px, 70%);
  align-items: stretch;
}
.agency-ui .agency-order-note textarea {
  min-height: 104px;
  height: 100%;
}
.agency-ui .message-panel.inline {
  min-height: 104px;
  height: 100%;
  max-height: none;
}
.agency-ui .agency-response-table {
  min-width: 760px;
}
.agency-ui .agency-response-table th:nth-child(2),
.agency-ui .agency-response-table td:nth-child(2) { width: 190px; }
.agency-ui .agency-response-table th:nth-child(3),
.agency-ui .agency-response-table td:nth-child(3) { width: 42px; }
.agency-ui .agency-response-table th:nth-child(4),
.agency-ui .agency-response-table td:nth-child(4) { width: 140px; }
.agency-ui .agency-response-table th:nth-child(5),
.agency-ui .agency-response-table td:nth-child(5) { width: 90px; }
.agency-ui .agency-response-table th:nth-child(6),
.agency-ui .agency-response-table td:nth-child(6) { width: 96px; }
.agency-ui .agency-response-table th:nth-child(7),
.agency-ui .agency-response-table td:nth-child(7) { width: 70px; }
.agency-ui .agency-response-table th:nth-child(8),
.agency-ui .agency-response-table td:nth-child(8) { width: 100px; }
.agency-ui .agency-response-table td.name {
  text-align: left;
}
.agency-ui .agency-response-table td.name strong,
.agency-ui .agency-response-table td.name span {
  display: block;
}
.agency-ui .agency-response-table td.name strong {
  margin-bottom: 3px;
  color: #334155;
  font-size: 12px;
}
.agency-ui .agency-response-table td.name span {
  color: #0b1f38;
}
.agency-ui .price-cell {
  color: #334155;
  font-size: 11px;
  line-height: 1.32;
  text-align: right;
  white-space: nowrap;
}
.agency-ui .price-cell span,
.agency-ui .price-cell strong {
  display: block;
}
.agency-ui .price-cell strong {
  color: #0b1f38;
  font-size: 12px;
  font-weight: 900;
}
.agency-ui .agency-response-footer {
  grid-template-columns: minmax(260px, .9fr) minmax(320px, 1.1fr);
  margin-top: 10px;
}
.agency-ui .price-group {
  min-height: 58px;
  padding: 7px 9px;
}
.agency-ui .price-pair strong {
  font-size: 15px;
}
.agency-ui .followup-date-section {
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
}
.agency-ui .followup-date-section:first-child {
  border-top: 0;
  padding-top: 0;
}
.agency-ui .followup-date-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #334155;
}
.agency-ui .followup-date-section h3 span {
  color: #667085;
  font-size: 12px;
}

@media (max-width: 1200px) {
  .agency-ui .agency-right-rail {
    grid-column: 1;
    grid-row: 2;
    position: static;
    max-height: none;
    overflow: visible;
  }
  .agency-ui .agency-detail-card {
    grid-column: 1;
    grid-row: 3;
  }
}

.source-mail-profit-cell {
  min-width: 86px;
  text-align: right;
  white-space: nowrap;
}
.mail-profit {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 70px;
  min-height: 26px;
  border-radius: 6px;
  padding: 4px 7px;
  border: 1px solid #d7dee8;
  background: #f8fafc;
  color: #334155;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}
.mail-profit.positive {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}
.mail-profit.negative {
  border-color: #fecaca;
  background: #fff1f2;
  color: #b91c1c;
}
.mail-profit.warning {
  justify-content: center;
  border-color: #fde68a;
  background: #fffbeb;
  color: #92400e;
  cursor: help;
}
.mail-profit.pending {
  justify-content: center;
  color: #667085;
}
.source-internal-note {
  display: grid;
  gap: 3px;
  margin-bottom: 6px;
  border: 1px solid #fde68a;
  border-radius: 7px;
  background: #fffbeb;
  color: #713f12;
  padding: 6px 7px;
  font-size: 11px;
  line-height: 1.35;
}
.source-internal-note strong {
  color: #92400e;
  font-size: 10.5px;
  font-weight: 900;
}
.source-internal-note span {
  max-height: 92px;
  overflow: auto;
  overflow-wrap: anywhere;
}
