﻿:root {
  --navy: #102a43;
  --ink: #1f2d3d;
  --muted: #6b7c93;
  --line: #e3e9f0;
  --bg: #f4f7fb;
  --card: #fff;
  --blue: #1677c8;
  --blue-d: #125fa0;
  --teal: #008c95;
  --green: #17785b;
  --amber: #a15c00;
  --red: #b42318;
  --fb: #1877f2;
  --r: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}
.hidden {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 28px;
  background: var(--navy);
  color: #fff;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.logo {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--teal));
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
}
.brand-name {
  font-weight: 600;
  font-size: 16px;
}
.nav {
  display: flex;
  gap: 6px;
  flex: 1;
}
.nav a {
  color: #cfdbe8;
  text-decoration: none;
  padding: 7px 12px;
  border-radius: 8px;
}
.nav a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}
.nav a.active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}
.user {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: #cfdbe8;
}
.topbar .btn-ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
  background: transparent;
}
.wrap {
  max-width: 1040px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 20px;
}
.page-head h1 {
  margin: 0 0 4px;
  font-size: 26px;
  color: var(--navy);
}
.page-head p {
  margin: 0;
}
.head-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.panel {
  background: var(--card);
  border-radius: var(--r);
  padding: 40px;
  box-shadow: 0 6px 24px rgba(16, 42, 67, 0.06);
}
.center {
  text-align: center;
  max-width: 480px;
  margin: 60px auto;
}
button {
  font-family: inherit;
  cursor: pointer;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
  border: 0;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-primary:hover:not(:disabled) {
  background: var(--blue-d);
}
.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-ghost {
  background: #fff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn-ghost:hover {
  background: #f0f4f8;
}
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.stat {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 16px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition:
    border-color 0.15s,
    transform 0.15s;
}
.stat:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
}
.stat.active {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22, 119, 200, 0.12);
}
.stat-num {
  font-size: 26px;
  font-weight: 700;
  color: var(--navy);
}
.stat-label {
  color: var(--muted);
  font-size: 12px;
}
.stat.warn .stat-num {
  color: var(--red);
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.tabs {
  display: flex;
  gap: 4px;
  background: #e9eff5;
  padding: 4px;
  border-radius: 10px;
  flex-wrap: wrap;
}
.tabs button {
  border: 0;
  background: transparent;
  padding: 7px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}
.tabs button.active {
  background: #fff;
  color: var(--navy);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.filters {
  display: flex;
  gap: 8px;
}
.filters select,
.filters input {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13px;
  background: #fff;
}
.filters input {
  width: 240px;
}
.list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px 20px;
  box-shadow: 0 2px 10px rgba(16, 42, 67, 0.04);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.spacer {
  flex: 1;
}
.account {
  font-weight: 600;
  color: var(--navy);
}
.platform {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.platform.facebook {
  background: var(--fb);
}
.platform.instagram {
  background: linear-gradient(45deg, #f58529, #dd2a7b, #8134af);
}
.platform.youtube {
  background: #f00;
}
.platform.other {
  background: var(--muted);
}
.chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef4fa;
  color: var(--blue);
  font-weight: 600;
}
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.stage-review {
  background: #fff4e5;
  color: var(--amber);
}
.stage-ready {
  background: #e7f3f5;
  color: var(--teal);
}
.stage-queued {
  background: #e8f0fb;
  color: var(--blue);
}
.stage-published {
  background: #e7f5ee;
  color: var(--green);
}
.stage-failed {
  background: #fdecea;
  color: var(--red);
}
.stage-rejected {
  background: #eef1f4;
  color: var(--muted);
}
.comment {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: #f7f9fc;
  border-left: 3px solid var(--blue);
  border-radius: 8px;
  font-size: 15px;
  line-height: 1.5;
}
.label {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}
.options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.option:hover {
  border-color: #b8cce0;
}
.option.chosen {
  border-color: var(--blue);
  background: #f2f8fe;
}
.option.locked {
  cursor: default;
  opacity: 0.8;
}
.option input {
  margin-top: 3px;
  accent-color: var(--blue);
}
.opt-num {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 6px;
  background: #eef2f7;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.option.chosen .opt-num {
  background: var(--blue);
  color: #fff;
}
.opt-text {
  line-height: 1.5;
}
.option.custom .opt-num {
  font-size: 12px;
}
.option.custom .opt-text {
  color: var(--muted);
  font-style: italic;
}
.option.custom.chosen .opt-text {
  color: var(--ink);
  font-style: normal;
}
.editor {
  margin-top: 14px;
}
.editor textarea {
  width: 100%;
  min-height: 88px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  line-height: 1.5;
  resize: vertical;
  background: #fff;
}
.editor textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(22, 119, 200, 0.12);
}
.editor textarea:disabled {
  background: #f7f9fc;
}
.editor-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.counter.over {
  color: var(--red);
  font-weight: 600;
}
.chip.edited {
  background: #fff4e5;
  color: var(--amber);
  margin-left: 6px;
}
.published {
  padding: 12px 14px;
  background: #f0faf5;
  border: 1px solid #cfeadc;
  border-radius: 10px;
}
.published p {
  margin: 0 0 6px;
  line-height: 1.5;
}
.error-box {
  margin-top: 12px;
  padding: 10px 12px;
  background: #fdecea;
  color: var(--red);
  border-radius: 8px;
  font-size: 13px;
}
.card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 14px;
}
.card-actions .left {
  margin-right: auto;
}
.btn-danger {
  background: #fff;
  color: var(--red);
  border: 1px solid #f1c4bf;
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
}
.btn-danger:hover {
  background: #fdecea;
}
.card.rejected {
  opacity: 0.85;
}
.empty {
  text-align: center;
  padding: 56px 20px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: var(--r);
}
.empty h3 {
  margin: 10px 0 4px;
  color: var(--navy);
}
.empty p {
  margin: 0;
}
.empty-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  border-radius: 50%;
  background: #e7f5ee;
  color: var(--green);
  display: grid;
  place-items: center;
  font-size: 22px;
}
.skeleton .sk {
  background: linear-gradient(90deg, #eef2f6, #f7f9fb, #eef2f6);
  background-size: 200% 100%;
  animation: sh 1.2s infinite;
  border-radius: 6px;
}
.sk-1 {
  height: 14px;
  width: 30%;
  margin-bottom: 14px;
}
.sk-2 {
  height: 44px;
  margin-bottom: 12px;
}
.sk-3 {
  height: 80px;
}
@keyframes sh {
  to {
    background-position: -200% 0;
  }
}
.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner.dark {
  border-color: rgba(0, 0, 0, 0.2);
  border-top-color: var(--ink);
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.toasts {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}
.toast {
  min-width: 240px;
  max-width: 360px;
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff;
  font-size: 13px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  transform: translateY(8px);
  transition:
    opacity 0.25s,
    transform 0.25s;
}
.toast.show {
  opacity: 1;
  transform: none;
}
.toast.info {
  background: var(--navy);
}
.toast.success {
  background: var(--green);
}
.toast.warn {
  background: var(--amber);
}
.toast.error {
  background: var(--red);
}
@media (max-width: 760px) {
  .topbar {
    flex-wrap: wrap;
    padding: 12px 16px;
    gap: 10px;
  }
  .nav {
    order: 3;
    width: 100%;
  }
  .stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .filters {
    width: 100%;
  }
  .filters input {
    flex: 1;
    width: auto;
  }
  .page-head {
    flex-direction: column;
    align-items: flex-start;
  }
}
/* Phase M v3.1 - append to the END of css/inbox.css */
.bulk-bar {
  background: #fff;
  border: 1px solid #dbe4ef;
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
  align-items: center;
}
.card-actions .btn-ghost + .btn-primary,
.card-actions .btn-ghost + .btn-ghost {
  margin-left: 8px;
}
/* ContentReply Portal - Phase N addon
   Append to the END of css/inbox.css (adds components not yet defined:
   usage bars, plan card, team table, invite form, workspace sub-tabs).
   Reuses existing tokens (--navy --ink --muted --line --bg --card --blue
   --blue-d --teal --green --amber --red --fb --r) - no new tokens added. */

/* ---- Workspace sub-tabs (Overview / Team) ---- */
.subtabs {
  display: flex;
  gap: 4px;
  background: #e9eff5;
  padding: 4px;
  border-radius: 10px;
  margin-bottom: 20px;
  width: fit-content;
}
.subtabs button {
  border: 0;
  background: transparent;
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.subtabs button.active {
  background: #fff;
  color: var(--navy);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* ---- Plan / subscription summary card ---- */
.plan-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 22px 24px;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(16, 42, 67, 0.04);
}
.plan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}
.plan-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
}
.plan-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.plan-badge.trial {
  background: #fff4e5;
  color: var(--amber);
}
.plan-badge.active {
  background: #e7f5ee;
  color: var(--green);
}
.plan-badge.past-due,
.plan-badge.canceled {
  background: #fdecea;
  color: var(--red);
}
.plan-sub {
  color: var(--muted);
  font-size: 13px;
  margin: 2px 0 18px;
}
.trial-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff4e5;
  color: var(--amber);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 18px;
}

/* ---- Usage meters ---- */
.usage-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.usage-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.usage-item-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 13px;
}
.usage-item-head .label {
  margin: 0;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  color: var(--ink);
  font-size: 13px;
}
.usage-item-head .count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.usage-bar {
  height: 8px;
  border-radius: 999px;
  background: #e9eff5;
  overflow: hidden;
}
.usage-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--blue);
  transition: width 0.3s;
}
.usage-bar-fill.warn {
  background: var(--amber);
}
.usage-bar-fill.danger {
  background: var(--red);
}
.usage-item.unlimited .usage-bar {
  background: #e7f5ee;
}
.usage-item.unlimited .usage-bar-fill {
  background: var(--green);
  width: 100% !important;
}

/* ---- Contract details table ---- */
.kv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px 24px;
  margin-top: 6px;
}
.kv-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.kv-item .k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 700;
}
.kv-item .v {
  font-size: 14px;
  color: var(--ink);
  font-weight: 600;
}

/* ---- Team table ---- */
.team-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.team-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  font-weight: 700;
  padding: 12px 16px;
  background: #f7f9fc;
  border-bottom: 1px solid var(--line);
}
.team-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  vertical-align: middle;
}
.team-table tr:last-child td {
  border-bottom: 0;
}
.team-table tr:hover td {
  background: #fafbfd;
}
.member-name {
  font-weight: 600;
  color: var(--navy);
}
.member-you {
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
  margin-left: 6px;
}
.role-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef4fa;
  color: var(--blue);
}
.role-pill.owner {
  background: #f2f0fb;
  color: #5b3ec8;
}
.status-pill {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
}
.status-pill.active {
  background: #e7f5ee;
  color: var(--green);
}
.status-pill.invited,
.status-pill.pending {
  background: #fff4e5;
  color: var(--amber);
}
.status-pill.suspended,
.status-pill.removed {
  background: #eef1f4;
  color: var(--muted);
}
.team-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}
.team-actions select {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
}
.icon-btn {
  background: none;
  border: 0;
  color: var(--muted);
  font-size: 13px;
  padding: 6px 8px;
  border-radius: 6px;
}
.icon-btn:hover {
  background: #fdecea;
  color: var(--red);
}

/* ---- Invite form ---- */
.invite-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.invite-bar input[type="email"] {
  flex: 1;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13px;
}
.invite-bar select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 13px;
  background: #fff;
}
.seat-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.seat-note.warn {
  color: var(--amber);
  font-weight: 600;
}

/* ---- History search bar spacing reuse (mirrors .filters from inbox.css) ---- */
.history-comment {
  font-size: 14px;
  color: var(--ink);
  margin: 0 0 6px;
}
.history-reply {
  margin: 0;
  padding: 10px 12px;
  background: #f0faf5;
  border: 1px solid #cfeadc;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}
.history-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}
.history-meta .dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted);
}

@media (max-width: 760px) {
  .usage-grid {
    grid-template-columns: 1fr;
  }
  .kv-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .team-table {
    font-size: 13px;
  }
  .team-table th,
  .team-table td {
    padding: 10px;
  }
}
