.internal-body { background: #f3f5f2; min-height: 100vh; }
.internal-header {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 28px;
  grid-template-columns: 230px 1fr auto;
  min-height: 72px;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.internal-header nav { display: flex; gap: 4px; min-width: 0; }
.internal-header nav button {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  padding: 11px 14px;
}
.internal-header nav button.active { background: var(--mint); color: var(--forest-2); }
.internal-account { align-items: center; display: flex; gap: 12px; }
.internal-account a { color: var(--forest-2); font-size: 12px; font-weight: 700; text-decoration: none; }
.internal-account button { background: white; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; height: 34px; width: 34px; }
.internal-main { margin: 0 auto; max-width: 1440px; padding: 38px 32px 80px; }
.internal-intro { align-items: center; display: flex; justify-content: space-between; margin-bottom: 28px; }
.internal-intro h1 { font-family: Georgia, serif; font-size: 44px; font-weight: 400; margin: 8px 0; }
.internal-intro p { color: var(--muted); font-size: 14px; margin: 0; max-width: 720px; }
.metric-grid { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 34px; }
.metric-card { background: #fff; border: 1px solid var(--line); border-radius: 13px; min-width: 0; padding: 19px; }
.metric-card span, .metric-card small { color: var(--muted); display: block; font-size: 12px; }
.metric-card strong { display: block; font-family: Georgia, serif; font-size: clamp(20px, 2.1vw, 28px); font-weight: 400; margin: 9px 0 5px; overflow-wrap: anywhere; }
.metric-card.ok { background: #f4faeb; border-color: #cddf9d; }
.internal-tab { display: none; }
.internal-tab.active { display: block; }
.section-heading { align-items: center; display: flex; justify-content: space-between; margin: 0 0 17px; }
.section-heading h2 { font-family: Georgia, serif; font-size: 31px; font-weight: 400; margin: 7px 0 0; }
.ops-list { display: grid; gap: 13px; }
.ops-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.ops-card-head { align-items: center; display: grid; gap: 18px; grid-template-columns: 1.2fr .9fr .7fr auto; padding: 20px 22px; }
.ops-card-head h3 { font-size: 15px; margin: 0 0 5px; }
.ops-card-head p, .ops-card-head small { color: var(--muted); font-size: 12px; margin: 0; }
.ops-card-head strong { display: block; font-size: 14px; margin-bottom: 4px; }
.ops-status { background: #edf2ee; border-radius: 999px; color: var(--forest-2); font-size: 12px; font-weight: 750; padding: 6px 9px; text-transform: capitalize; width: max-content; }
.ops-actions { display: flex; gap: 7px; }
.ops-actions .button { font-size: 13px; min-height: 40px; padding: 0 14px; }
.ops-criteria {
  background: #fafbf9;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  padding: 12px 22px;
}
.ops-criteria { grid-template-columns: repeat(3, 1fr); }
.ops-criteria span { color: var(--muted); font-size: 12px; line-height: 1.45; }
.ops-criteria strong { color: var(--ink); display: block; font-size: 11px; letter-spacing: .6px; margin-bottom: 3px; text-transform: uppercase; }
.ops-criteria .criteria-note {
  color: #8a958e;
  display: block;
  font-size: 11px;
  margin-top: 4px;
}
.section-subcopy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: 6px 0 0;
  max-width: 52rem;
}
.ops-empty-hint {
  margin-bottom: 14px;
  padding: 18px 20px;
}
.ops-empty-hint strong { display: block; font-size: 14px; margin-bottom: 6px; }

.account-lookup-form {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr auto;
  margin-bottom: 18px;
  padding: 20px 22px;
}
.account-lookup-form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}
.account-lookup-form input {
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  min-height: 44px;
  padding: 0 12px;
}
.account-result-host { display: grid; gap: 14px; }
.account-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}
.account-card h3 { font-size: 18px; margin: 0 0 4px; }
.account-card .meta {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 16px;
}
.account-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}
.account-grid div {
  background: #f7f8f6;
  border-radius: 10px;
  padding: 12px 14px;
}
.account-grid span {
  color: var(--muted);
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.account-grid strong {
  display: block;
  font-size: 14px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
.account-actions {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 1fr;
  margin-top: 8px;
  padding-top: 18px;
}
.account-actions form {
  display: grid;
  gap: 10px;
}
.account-actions h4 {
  font-size: 13px;
  margin: 0;
}
.account-actions p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}
.account-actions input {
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  min-height: 42px;
  padding: 0 12px;
}
.account-actions .danger {
  background: #3a1515;
  border-color: #3a1515;
  color: #fff;
}
.account-actions .danger:hover { filter: brightness(1.08); }
.account-locked {
  background: #fff8e8;
  border: 1px solid #e6d19a;
  border-radius: 12px;
  color: #5c4a12;
  font-size: 13px;
  padding: 14px 16px;
}
@media (max-width: 900px) {
  .account-lookup-form,
  .account-actions,
  .account-grid { grid-template-columns: 1fr; }
}

.brand-directory-panel { margin-bottom: 16px; padding: 0; overflow: hidden; }
.brand-directory-toolbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 14px 16px;
}
.brand-directory-list { max-height: 420px; overflow: auto; }
.brand-directory-row {
  align-items: center;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  display: grid;
  gap: 8px 16px;
  grid-template-columns: 1.4fr 1fr 0.7fr auto;
  padding: 14px 16px;
  text-align: left;
  width: 100%;
}
.brand-directory-row:hover,
.brand-directory-row.active { background: var(--mint); }

/* Admin broadcast notifications */
.notify-admin-layout {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(280px, 380px) 1fr;
}
.notify-compose {
  display: grid;
  gap: 12px;
  padding: 22px;
}
.notify-compose h3 { margin: 0 0 4px; }
.notify-compose label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
}
.notify-compose input,
.notify-compose textarea,
.notify-compose select {
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  padding: 10px 12px;
}
.notify-compose .field-hint {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.notify-history-panel { padding: 0; overflow: hidden; }
.notify-history-panel .ops-list { padding: 14px; }
.notify-history-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 10px;
  padding: 16px 18px;
}
.notify-history-card header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}
.notify-history-card strong {
  display: block;
  font-size: 15px;
  margin-bottom: 6px;
}
.notify-history-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 8px;
  white-space: pre-wrap;
}
.notify-history-card small { color: #8a938c; font-size: 12px; }
.notify-history-card.tone-success { border-left: 3px solid #3d9a5f; }
.notify-history-card.tone-warning { border-left: 3px solid #c9a227; }
.notify-history-card.tone-promo { border-left: 3px solid #5b6fd6; }
.notify-history-card.tone-info { border-left: 3px solid #7aa07a; }
@media (max-width: 960px) {
  .notify-admin-layout { grid-template-columns: 1fr; }
}
.brand-directory-row strong { display: block; font-size: 14px; }
.brand-directory-row small { color: var(--muted); display: block; font-size: 12px; margin-top: 2px; }
.brand-directory-row .brand-credits { font-size: 13px; font-weight: 700; }
@media (max-width: 900px) {
  .brand-directory-row { grid-template-columns: 1fr; }
}

.brand-audit-card { margin-top: 14px; }
.audit-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.brand-audit-timeline {
  border: 1px solid var(--line);
  border-radius: 12px;
  max-height: 480px;
  overflow: auto;
}
.brand-audit-row {
  align-items: start;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: 88px 1fr auto;
  padding: 12px 14px;
}
.brand-audit-row:last-child { border-bottom: 0; }
.brand-audit-row .audit-kind {
  background: #eef2ef;
  border-radius: 6px;
  color: var(--forest-2);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  padding: 4px 6px;
  text-align: center;
  text-transform: uppercase;
}
.brand-audit-row.kind-credit_order .audit-kind,
.brand-audit-row.kind-export .audit-kind { background: #fff4ce; color: #6a5410; }
.brand-audit-row.kind-credit_transaction .audit-kind { background: #e7f0ff; color: #1a4a8a; }
.brand-audit-row strong { display: block; font-size: 13px; }
.brand-audit-row small { color: var(--muted); display: block; font-size: 12px; line-height: 1.4; margin-top: 3px; }
.brand-audit-row time { color: var(--muted); font-size: 11px; white-space: nowrap; }
@media (max-width: 900px) {
  .audit-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand-audit-row { grid-template-columns: 1fr; }
}

.support-admin-layout {
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(280px, 1fr) minmax(320px, 1.2fr);
}
.support-admin-layout .ops-list { max-height: 70vh; overflow: auto; }
.admin-ticket-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  padding: 14px 16px;
  text-align: left;
  width: 100%;
}
.admin-ticket-card.active { border-color: var(--forest-2); box-shadow: 0 0 0 1px var(--forest-2); }
.admin-ticket-card strong { display: block; font-size: 14px; margin: 4px 0; }
.admin-ticket-card small { color: var(--muted); display: block; font-size: 12px; }
.admin-support-thread { padding: 18px; }
.admin-support-thread h3 { margin: 6px 0 12px; }
.admin-support-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
@media (max-width: 960px) {
  .support-admin-layout { grid-template-columns: 1fr; }
}
.ops-empty-hint p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  margin: 0 0 8px;
}
.ops-empty-hint p:last-child { margin-bottom: 0; }
.ops-next-step {
  align-items: baseline;
  background: #f4f7f4;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 10px;
  padding: 10px 22px;
}
.ops-next-step strong {
  color: var(--forest-2);
  font-size: 11px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.ops-next-step span { color: #3d4a43; font-size: 13px; line-height: 1.4; }
.ops-card-closed { opacity: 0.92; }
.ops-card-actionable { box-shadow: 0 0 0 1px rgba(29, 82, 62, 0.12); }
.ops-status.status-rejected { background: #f3e8e8; color: #7a3030; }
.ops-status.status-delivered { background: #e5f3e8; color: #1d523e; }
.ops-status.status-matching,
.ops-status.status-internal_review { background: #eef5d8; color: #3d4a18; }
.ops-status.status-approved { background: #e5f3e8; color: #1d523e; }
.ops-status.status-pending { background: #fff4ce; color: #6a5410; }
.ops-done-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}
.ops-preview {
  background: #f3f3f3;
  border-top: 1px solid var(--line);
  padding: 14px 16px 16px;
}
.ops-preview .sheet-wrap { border-radius: 4px; }
.ops-preview .sheet-scroll { max-height: min(48vh, 520px); }
.internal-results .sheet-host { padding: 0 0 4px; }
.internal-results .sheet-wrap { border-left: 0; border-right: 0; border-radius: 0; }
.internal-search-form { display: grid; gap: 12px; grid-template-columns: 2fr repeat(3, minmax(135px, 1fr)); margin-bottom: 18px; padding: 20px; }
.internal-search-form label { color: var(--muted); font-size: 12px; font-weight: 700; }
.internal-search-form input, .internal-search-form select {
  background: #fff;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  display: block;
  font-size: 14px;
  height: 44px;
  margin-top: 6px;
  padding: 0 12px;
  width: 100%;
}
.internal-search-form .button { align-self: end; height: 44px; }
.search-span { grid-column: span 2; }
.internal-results { overflow: hidden; }
.internal-results table { min-width: 1080px; }
.quality-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; margin-bottom: 18px; }
.quality-card { padding: 24px; }
.quality-card h3 { font-family: Georgia, serif; font-size: 26px; font-weight: 400; margin: 7px 0 18px; }
.quality-facts { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.quality-facts div { background: #f7f8f6; border-radius: 8px; padding: 11px; }
.quality-facts span, .quality-facts strong { display: block; }
.quality-facts span { color: var(--muted); font-size: 11px; }
.quality-facts strong { font-size: 13px; margin-top: 4px; }
@media (max-width: 980px) {
  .internal-header { grid-template-columns: 1fr auto; padding: 10px 18px; }
  .internal-header nav {
    display: flex;
    grid-column: 1 / -1;
    grid-row: 2;
    overflow-x: auto;
    padding-bottom: 2px;
  }
  .internal-header nav button { flex: 0 0 auto; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .ops-card-head { grid-template-columns: 1fr 1fr; }
  .ops-criteria { grid-template-columns: 1fr 1fr; }
  .candidate-strip { grid-template-columns: repeat(2, 1fr); }
  .internal-search-form { grid-template-columns: repeat(2, 1fr); }
  .quality-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .internal-main { padding: 24px 14px 70px; }
  .internal-account a { display: none; }
  .internal-intro { align-items: flex-start; flex-direction: column; gap: 15px; }
  .metric-grid { grid-template-columns: 1fr; }
  .ops-card-head, .internal-search-form { grid-template-columns: 1fr; }
  .ops-criteria { grid-template-columns: 1fr; }
  .search-span { grid-column: auto; }
}
