/* ============================================================
   makeSMMeasy — Design System v2
   Refined SaaS UI: Nunito Sans headings, Nunito Sans body, teal primary,
   dark sidebar, warm off-white canvas.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Nunito Sans:wght@600;700;800&family=Nunito+Sans:wght@200;300;400;500;600;700;800;900&display=swap');

/* ─── Design tokens ─────────────────────────────────────────── */
:root {
  /* Primary palette — deep teal */
  --c-primary:        #0D9488;
  --c-primary-hover:  #0F766E;
  --c-primary-light:  #CCFBF1;
  --c-primary-ring:   rgba(13,148,136,.22);

  /* Agency / post editor accent (blue) — matches dashboard --primary */
  --c-agency-blue:       rgb(37, 99, 235);
  --c-agency-blue-hover: rgb(29, 78, 216);
  --c-agency-blue-soft:  rgba(37, 99, 235, 0.1);

  /* Semantic */
  --c-success:        #16A34A;
  --c-success-light:  #DCFCE7;
  --c-warning:        #D97706;
  --c-warning-light:  #FEF3C7;
  --c-danger:         #DC2626;
  --c-danger-light:   #FEE2E2;
  --c-info:           #2563EB;
  --c-info-light:     #DBEAFE;

  /* Surface */
  --c-bg:             #fafafa;
  --c-surface:        #FFFFFF;
  --c-surface-muted:  #FAFAF8;

  /* Text */
  --c-text:           #1C1917;
  --c-text-muted:     #78716C;
  --c-text-subtle:    #A8A29E;

  /* Borders */
  --c-border:         #E7E5E4;
  --c-border-strong:  #D6D3D1;

  /* Sidebar — warm dark */
  --c-sidebar:        #18181B;
  --c-sidebar-hover:  rgba(255,255,255,.06);
  --c-sidebar-active: rgba(13,148,136,.18);
  --c-sidebar-border: rgba(255,255,255,.08);
  --c-sidebar-text:   #D4D4D8;
  --c-sidebar-muted:  #71717A;
  --c-sidebar-label:  #52525B;

  /* Shadows */
  --shadow-xs:        0 1px 2px rgba(28,25,23,.04);
  --shadow-sm:        0 1px 3px rgba(28,25,23,.06), 0 1px 2px rgba(28,25,23,.04);
  --shadow-md:        0 4px 12px rgba(28,25,23,.08), 0 2px 4px rgba(28,25,23,.04);
  --shadow-lg:        0 12px 32px rgba(28,25,23,.10), 0 4px 8px rgba(28,25,23,.04);
  --shadow-primary:   0 4px 14px rgba(13,148,136,.28);

  /* Radius */
  --r-sm:   6px;
  --r-md:   10px;
  --r-lg:   14px;
  --r-xl:   20px;
  --r-full: 9999px;

  /* Sidebar width */
  --sidebar-w: 256px;
  --navbar-h:  60px;

  /* Transitions */
  --t-fast: .15s ease;
  --t-base: .2s ease;
}

/* Share / client-facing pages: override primary to brand blue so buttons read as blue not green */
body.share-page {
  --c-primary:       #2563EB;
  --c-primary-hover: #1D4ED8;
  --c-primary-light: #DBEAFE;
  --c-primary-ring:  rgba(37,99,235,.22);
}

/* ─── Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  background: var(--c-bg) !important;
  color: var(--c-text);
}

body {
  font-family: 'Nunito Sans', -apple-system, sans-serif !important;
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background-image: none !important;
}

/* ─── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: 'Nunito Sans', sans-serif !important;
  color: var(--c-text) !important;
  letter-spacing: -.025em;
}

h1, .h1 { font-size: clamp(1.4rem,2vw,1.875rem); font-weight: 700; }
h2, .h2 { font-size: clamp(1.15rem,1.6vw,1.375rem); font-weight: 700; }
h3, .h3 { font-size: 1.125rem; font-weight: 700; }
h4, .h4 { font-size: 1rem; font-weight: 600; }
h5, .h5 { font-size: .9375rem; font-weight: 600; }
h6, .h6 { font-size: .875rem; font-weight: 600; }

p { color: var(--c-text-muted); }

.text-muted, small { color: var(--c-text-muted) !important; }

/* ─── Layout — sidebar + content ────────────────────────────── */
.agency-main-content {
  margin-left: var(--sidebar-w) !important;
  margin-top: var(--navbar-h) !important;
  padding: 1.75rem 2rem !important;
  min-height: 100vh;
  background: var(--c-bg) !important;
}

/* Non-agency pages */
main:not(.agency-main-content) {
  padding-top: calc(var(--navbar-h) + 1.5rem) !important;
  padding-bottom: 2rem;
  background: var(--c-bg);
}

/* ─── Navbar ──────────────────────────────────────────────────── */
.navbar {
  height: var(--navbar-h);
  background: var(--c-surface) !important;
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--c-border) !important;
  box-shadow: var(--shadow-xs);
}

.agency-navbar {
  width: calc(100% - var(--sidebar-w)) !important;
  height: var(--navbar-h);
  background: var(--c-surface) !important;
  border-bottom: 1px solid var(--c-border) !important;
  box-shadow: none;
}

.navbar .nav-link {
  font-family: 'Nunito Sans', sans-serif !important;
  font-weight: 600;
  font-size: .85rem;
  color: var(--c-text-muted) !important;
  border-radius: var(--r-sm);
  padding: .4rem .7rem !important;
  transition: background var(--t-fast), color var(--t-fast);
  display: flex;
  align-items: center;
  gap: .35rem;
}

.navbar .nav-link:hover {
  background: var(--c-bg);
  color: var(--c-text) !important;
}

.navbar .nav-link.active {
  background: var(--c-primary-light);
  color: var(--c-primary-hover) !important;
  font-weight: 700;
}

.navbar .nav-link i {
  font-size: 1.05rem;
  flex-shrink: 0;
}

/* Navbar brand in sidebar header (non-agency) */
.navbar-brand {
  font-family: 'Nunito Sans', sans-serif !important;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--c-text) !important;
  letter-spacing: -.03em;
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
}

.navbar-brand-icon {
  color: var(--c-primary);
}

/* ─── Dark Sidebar ───────────────────────────────────────────── */
.agency-sidebar {
  width: var(--sidebar-w) !important;
  background: var(--c-sidebar) !important;
  border-right: 1px solid var(--c-sidebar-border) !important;
  box-shadow: 2px 0 16px rgba(0,0,0,.12);
}

.sidebar-header {
  padding: .875rem 1.125rem;
  border-bottom: 1px solid var(--c-sidebar-border) !important;
  background: transparent !important;
}

.sidebar-header .navbar-brand {
  color: #ffffff !important;
}

.sidebar-header .navbar-brand-icon {
  color: var(--c-primary);
  font-size: 1.3rem;
}

/* Agency brand area in sidebar header (passed from header.php) */
.agency-sidebar .sidebar-brand {
  color: #ffffff !important;
}

.agency-sidebar .sidebar-brand:hover { opacity: .85; }

.agency-sidebar .sidebar-logo {
  background: rgba(13,148,136,.25);
  color: #fff;
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .02em;
  border: 1px solid rgba(13,148,136,.3);
}

.agency-sidebar .sidebar-brand-name {
  color: #ffffff !important;
  font-family: 'Nunito Sans', sans-serif !important;
  font-weight: 700;
  font-size: .9375rem;
  letter-spacing: -.02em;
}

.agency-sidebar .sidebar-brand-plan {
  color: var(--c-sidebar-muted) !important;
  font-size: .7rem;
  font-weight: 500;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Sidebar search */
.sidebar-search {
  padding: .875rem 1rem .75rem;
  border-bottom: 1px solid var(--c-sidebar-border);
}

.sidebar-search-input {
  position: relative;
}

.sidebar-search-input i {
  position: absolute;
  left: .6rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--c-sidebar-muted);
  font-size: 1rem;
  pointer-events: none;
}

.sidebar-search-input input {
  width: 100%;
  background: rgba(255,255,255,.06) !important;
  border: 1px solid rgba(255,255,255,.09) !important;
  border-radius: var(--r-sm);
  padding: .45rem .75rem .45rem 2.1rem;
  font-size: .8125rem;
  color: #E4E4E7 !important;
  outline: none;
  font-family: 'Nunito Sans', sans-serif;
  transition: border-color var(--t-fast), background var(--t-fast);
}

.sidebar-search-input input::placeholder {
  color: var(--c-sidebar-muted);
}

.sidebar-search-input input:focus {
  border-color: rgba(13,148,136,.5) !important;
  background: rgba(255,255,255,.1) !important;
  box-shadow: none !important;
}

/* Sidebar sections */
.sidebar-section-label {
  color: var(--c-sidebar-label) !important;
  font-family: 'Nunito Sans', sans-serif;
  font-size: .6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
}

/* Client items */
.sidebar-client-item {
  color: var(--c-sidebar-text) !important;
  border-radius: var(--r-sm) !important;
  padding: .425rem .75rem !important;
  font-size: .8375rem;
  font-weight: 500;
  transition: background var(--t-fast), color var(--t-fast);
}

.sidebar-client-item:hover {
  background: var(--c-sidebar-hover) !important;
  color: #ffffff !important;
}

.sidebar-client-item.active {
  background: var(--c-sidebar-active) !important;
  color: #5EEAD4 !important;
  font-weight: 600;
}

.sidebar-client-icon {
  background: rgba(255,255,255,.1) !important;
  color: #E4E4E7;
  font-size: .7rem;
  font-weight: 700;
  border-radius: 50%;
}

.sidebar-client-icon-deactivated {
  opacity: .5;
}

.sidebar-client-deactivated .sidebar-client-item {
  opacity: .55;
}

/* Sidebar badges */
.sidebar-badge {
  background: rgba(13,148,136,.3) !important;
  color: #5EEAD4 !important;
  border-radius: var(--r-full);
  font-size: .65rem;
  font-weight: 700;
  padding: .1rem .45rem;
  line-height: 1.4;
}

.sidebar-badge-feedback {
  background: rgba(217,119,6,.25) !important;
  color: #FCD34D !important;
}

/* Add client / manage clients button */
.sidebar-add-client-btn {
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: .45rem .75rem !important;
  margin: .25rem .75rem;
  border-radius: var(--r-sm);
  color: var(--c-sidebar-muted) !important;
  font-size: .8125rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast);
}

.sidebar-add-client-btn:hover {
  background: var(--c-sidebar-hover);
  color: var(--c-sidebar-text) !important;
}

/* Sidebar empty state */
.sidebar-empty-state p {
  color: var(--c-sidebar-muted) !important;
}

/* Sidebar no-results */
.sidebar-no-results p {
  color: var(--c-sidebar-muted) !important;
}

/* Sidebar context menu */
.sidebar-context-menu {
  background: var(--c-sidebar) !important;
  border: 1px solid var(--c-sidebar-border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
}

.sidebar-context-item {
  color: var(--c-sidebar-text) !important;
}

.sidebar-context-item:hover {
  background: var(--c-sidebar-hover);
  color: #fff !important;
}

/* Deactivated section label */
.sidebar-deactivated-section .sidebar-section-label {
  color: var(--c-sidebar-label) !important;
}

/* ─── Cards ───────────────────────────────────────────────────── */
.card {
  background: var(--c-surface) !important;
  border: 1px solid var(--c-border) !important;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-base), border-color var(--t-base);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--c-border-strong) !important;
  transform: none; /* override the translateY(-1px) which can feel jittery */
}

.card-header {
  background: var(--c-surface) !important;
  border-bottom: 1px solid var(--c-border) !important;
  border-radius: var(--r-lg) var(--r-lg) 0 0 !important;
  padding: 1rem 1.25rem;
}

.card-body { padding: 1.25rem; }

.card h5, .card h5.mb-0 {
  font-size: .9375rem;
  font-weight: 700;
  color: var(--c-text) !important;
}

/* ─── Stat Cards ──────────────────────────────────────────────── */
.stat-card {
  background: var(--c-surface) !important;
  border: 1px solid var(--c-border) !important;
  border-radius: var(--r-lg) !important;
  padding: 1.125rem 1.25rem !important;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--t-base), transform var(--t-base);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--c-border);
  transition: background var(--t-base);
}

a:hover .stat-card,
.stat-card:hover {
  box-shadow: var(--shadow-md) !important;
  transform: translateY(-2px);
}

/* Accent top bars */
.stat-card.accent-primary::before { background: var(--c-primary); }
.stat-card.accent-warning::before { background: var(--c-warning); }
.stat-card.accent-success::before { background: var(--c-success); }
.stat-card.accent-info::before    { background: var(--c-info); }
.stat-card.accent-feedback::before { background: #F59E0B; }
.stat-card.accent-live::before    { background: #06B6D4; }

.stat-label {
  font-family: 'Nunito Sans', sans-serif;
  font-size: .7rem;
  font-weight: 600;
  color: var(--c-text-subtle) !important;
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: .375rem;
}

.stat-value {
  font-family: 'Nunito Sans', sans-serif !important;
  font-size: 1.875rem !important;
  font-weight: 800 !important;
  color: var(--c-text) !important;
  line-height: 1.1;
  letter-spacing: -.04em;
  margin-bottom: 0;
}

.stat-icon {
  border-radius: var(--r-md) !important;
  font-size: 1.25rem !important;
  flex-shrink: 0;
}

.stat-icon.primary {
  background: var(--c-primary-light) !important;
  color: var(--c-primary-hover) !important;
}

.stat-icon.warning {
  background: var(--c-warning-light) !important;
  color: var(--c-warning) !important;
}

.stat-icon.success {
  background: var(--c-success-light) !important;
  color: var(--c-success) !important;
}

.stat-icon.info {
  background: var(--c-info-light) !important;
  color: var(--c-info) !important;
}

/* ─── Buttons ─────────────────────────────────────────────────── */
.btn {
  font-family: 'Nunito Sans', sans-serif !important;
  font-weight: 600;
  font-size: .85rem;
  border-radius: var(--r-sm) !important;
  padding: .45rem 1rem;
  transition: all var(--t-fast);
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  line-height: 1.4;
  letter-spacing: .01em;
}

.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--c-primary) !important;
  border-color: var(--c-primary) !important;
  color: #fff !important;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--c-primary-hover) !important;
  border-color: var(--c-primary-hover) !important;
  box-shadow: 0 6px 18px rgba(13,148,136,.36);
}

.btn-outline-primary {
  border-color: var(--c-border-strong) !important;
  color: var(--c-text) !important;
  background: var(--c-surface) !important;
}

.btn-outline-primary:hover {
  border-color: var(--c-primary) !important;
  color: var(--c-primary) !important;
  background: var(--c-primary-light) !important;
}

.btn-outline-secondary {
  border-color: var(--c-border) !important;
  color: var(--c-text-muted) !important;
  background: var(--c-surface) !important;
}

.btn-outline-secondary:hover {
  background: var(--c-bg) !important;
  border-color: var(--c-border-strong) !important;
  color: var(--c-text) !important;
}

.btn-outline-danger {
  border-color: var(--c-border) !important;
  color: var(--c-danger) !important;
  background: var(--c-surface) !important;
}

.btn-outline-danger:hover {
  background: var(--c-danger-light) !important;
  border-color: var(--c-danger) !important;
}

.btn-danger {
  background: var(--c-danger) !important;
  border-color: var(--c-danger) !important;
}

.btn-secondary {
  background: var(--c-text) !important;
  border-color: var(--c-text) !important;
  color: #fff !important;
}

.btn-sm { font-size: .8125rem; padding: .3rem .7rem; }
.btn-lg { font-size: .9375rem; padding: .625rem 1.375rem; }

/* ─── Forms ───────────────────────────────────────────────────── */
.form-control,
.form-select,
.modern-input,
textarea.form-control {
  font-family: 'Nunito Sans', sans-serif !important;
  font-size: .875rem;
  border: 1px solid var(--c-border) !important;
  border-radius: var(--r-sm) !important;
  background: var(--c-surface);
  color: var(--c-text);
  padding: .5rem .8rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.form-control:focus,
.form-select:focus,
.modern-input:focus,
textarea.form-control:focus {
  border-color: var(--c-primary) !important;
  box-shadow: 0 0 0 3px var(--c-primary-ring) !important;
  outline: none;
  background: var(--c-surface);
}

.form-control::placeholder { color: var(--c-text-subtle); }

.form-label, .modern-label {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--c-text) !important;
  margin-bottom: .375rem;
}

.input-group-text {
  background: var(--c-bg) !important;
  border-color: var(--c-border) !important;
  color: var(--c-text-muted);
  font-size: .875rem;
}

.modern-field-group {
  margin-bottom: 1rem;
}

/* ─── Tables ──────────────────────────────────────────────────── */
.table {
  border-collapse: separate;
  border-spacing: 0;
}

.table thead th {
  font-family: 'Nunito Sans', sans-serif;
  font-size: .7rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--c-text-subtle) !important;
  background: var(--c-surface-muted) !important;
  border-bottom: 1px solid var(--c-border) !important;
  padding: .7rem 1rem !important;
  white-space: nowrap;
}

.table tbody td {
  font-size: .875rem;
  color: var(--c-text);
  border-bottom: 1px solid var(--c-border) !important;
  background: var(--c-surface) !important;
  padding: .65rem 1rem !important;
  vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none !important; }

.table tbody tr:hover td {
  background: #FAFAF8 !important;
}

.table-hover > tbody > tr:hover > * {
  background: #FAFAF8 !important;
}

/* ─── Badges ──────────────────────────────────────────────────── */
.badge {
  font-family: 'Nunito Sans', sans-serif;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .02em;
  border-radius: var(--r-full) !important;
  padding: .25rem .65rem;
  text-transform: capitalize;
}

.badge-success {
  background: var(--c-success-light) !important;
  color: var(--c-success) !important;
  box-shadow: 0 0 0 1px rgba(22,163,74,.15) !important;
}

.badge-warning {
  background: var(--c-warning-light) !important;
  color: var(--c-warning) !important;
  box-shadow: 0 0 0 1px rgba(217,119,6,.15) !important;
}

.badge-danger {
  background: var(--c-danger-light) !important;
  color: var(--c-danger) !important;
  box-shadow: 0 0 0 1px rgba(220,38,38,.15) !important;
}

.badge-info {
  background: var(--c-info-light) !important;
  color: var(--c-info) !important;
  box-shadow: 0 0 0 1px rgba(37,99,235,.15) !important;
}

.badge-secondary {
  background: #F4F4F5 !important;
  color: #71717A !important;
  box-shadow: 0 0 0 1px rgba(113,113,122,.15) !important;
}

/* ─── Alerts ──────────────────────────────────────────────────── */
.alert {
  border-radius: var(--r-md) !important;
  font-size: .875rem;
  border: none;
  font-family: 'Nunito Sans', sans-serif;
}

.alert-success {
  background: var(--c-success-light) !important;
  color: #15803D !important;
  box-shadow: 0 0 0 1px rgba(22,163,74,.15) !important;
}

.alert-danger {
  background: var(--c-danger-light) !important;
  color: #B91C1C !important;
  box-shadow: 0 0 0 1px rgba(220,38,38,.15) !important;
}

.alert-warning {
  background: var(--c-warning-light) !important;
  color: #92400E !important;
  box-shadow: 0 0 0 1px rgba(217,119,6,.15) !important;
}

.alert-info {
  background: var(--c-info-light) !important;
  color: #1D4ED8 !important;
  box-shadow: 0 0 0 1px rgba(37,99,235,.15) !important;
}

/* ─── Dropdowns ───────────────────────────────────────────────── */
.dropdown-menu {
  border: 1px solid var(--c-border) !important;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  background: var(--c-surface) !important;
  padding: .375rem;
}

.dropdown-item {
  border-radius: var(--r-sm);
  font-size: .875rem;
  color: var(--c-text);
  padding: .5rem .75rem;
  transition: background var(--t-fast);
  font-family: 'Nunito Sans', sans-serif;
  display: flex;
  align-items: center;
  gap: .5rem;
}

.dropdown-item:hover {
  background: var(--c-bg) !important;
  color: var(--c-text) !important;
}

.dropdown-divider { border-color: var(--c-border); }

/* ─── Modals ──────────────────────────────────────────────────── */
.modal-content {
  border: 1px solid var(--c-border) !important;
  border-radius: var(--r-xl) !important;
  box-shadow: var(--shadow-lg) !important;
  background: var(--c-surface) !important;
}

.modal-header {
  border-bottom: 1px solid var(--c-border) !important;
  padding: 1.25rem 1.5rem;
}

.modal-footer {
  border-top: 1px solid var(--c-border) !important;
  padding: 1rem 1.5rem;
}

.modal-body { padding: 1.25rem 1.5rem; }

/* ─── Page header pattern ──────────────────────────────────────── */
.dashboard-page-header,
.row.mb-5.align-items-end {
  background: var(--c-surface) !important;
  border: 1px solid var(--c-border) !important;
  border-radius: var(--r-lg) !important;
  padding: 1rem 1.25rem !important;
  margin-bottom: 1.25rem !important;
  box-shadow: var(--shadow-xs);
}

.dashboard-page-header h1,
.row.mb-5.align-items-end h1 {
  margin-bottom: .25rem !important;
  font-size: 1.25rem !important;
}

.dashboard-page-header p,
.row.mb-5.align-items-end p {
  font-size: .875rem;
}

/* ─── Section headings ─────────────────────────────────────────── */
.dashboard-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem;
}

.dashboard-section-heading h2 {
  font-size: 1.125rem !important;
  margin-bottom: .15rem;
}

.dashboard-section-heading p {
  font-size: .8125rem;
}

.card-header-link {
  color: var(--c-primary) !important;
  font-size: .8125rem;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  transition: color var(--t-fast);
}

.card-header-link:hover { color: var(--c-primary-hover) !important; }

/* ─── Action icon buttons ─────────────────────────────────────── */
.queue-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  color: var(--c-text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  font-size: .95rem;
}

.queue-icon-btn:hover {
  background: var(--c-bg);
  border-color: var(--c-border);
  color: var(--c-text);
}

.queue-icon-btn.btn-outline-danger:hover {
  background: var(--c-danger-light) !important;
  border-color: var(--c-danger) !important;
  color: var(--c-danger) !important;
}

/* ─── Notification dropdown ───────────────────────────────────── */
.notification-dropdown {
  min-width: 360px;
  max-height: 460px;
  border-radius: var(--r-lg) !important;
}

.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .875rem 1rem;
  border-bottom: 1px solid var(--c-border);
}

.notif-title {
  font-family: 'Nunito Sans', sans-serif;
  font-size: .9375rem;
  font-weight: 700;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: .5rem;
}

.notif-unread-pill {
  font-family: 'Nunito Sans', sans-serif;
  font-size: .65rem;
  font-weight: 700;
  background: var(--c-primary);
  color: #fff;
  border-radius: var(--r-full);
  padding: .15rem .55rem;
  letter-spacing: .02em;
}

.notif-mark-all {
  font-size: .75rem;
  font-weight: 600;
  color: var(--c-primary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: 'Nunito Sans', sans-serif;
  transition: color var(--t-fast);
}

.notif-mark-all:hover { color: var(--c-primary-hover); }

/* Bell icon */
.navbar-bell-toggle {
  position: relative;
  padding: .4rem !important;
  border-radius: var(--r-sm);
}

.notification-count-badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 17px;
  height: 17px;
  background: var(--c-danger);
  color: #fff;
  border-radius: var(--r-full);
  font-size: .6rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 .3rem;
  border: 2px solid var(--c-surface);
}

/* ─── View switch group ───────────────────────────────────────── */
.view-switch-group { display: flex; }

.view-switch-btn {
  border: 1px solid var(--c-border) !important;
  background: var(--c-surface) !important;
  color: var(--c-text-muted);
  font-size: .8125rem;
  font-weight: 600;
  padding: .375rem .75rem;
  transition: all var(--t-fast);
  cursor: pointer;
  font-family: 'Nunito Sans', sans-serif;
}

.view-switch-btn:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm) !important; }
.view-switch-btn:last-child  { border-radius: 0 var(--r-sm) var(--r-sm) 0 !important; }

.view-switch-btn:not(:first-child) { border-left: none !important; }

.view-switch-btn:hover {
  background: var(--c-bg) !important;
  color: var(--c-agency-blue);
}

.view-switch-btn.active {
  background: var(--c-agency-blue) !important;
  border-color: var(--c-agency-blue) !important;
  color: #fff;
}

/* ─── Client cards ────────────────────────────────────────────── */
.client-card {
  border-radius: var(--r-lg) !important;
  overflow: hidden;
  transition: box-shadow var(--t-base), transform var(--t-base);
}

.client-card:hover {
  box-shadow: var(--shadow-md) !important;
  transform: translateY(-2px);
}

.client-card-title {
  font-family: 'Nunito Sans', sans-serif !important;
  font-weight: 700;
  color: var(--c-text) !important;
}

/* ─── Kanban cards ────────────────────────────────────────────── */
.kanban-column {
  background: var(--c-surface) !important;
  border: 1px solid var(--c-border) !important;
  border-radius: var(--r-lg) !important;
}

.kanban-column-header {
  background: var(--c-surface-muted) !important;
  border-radius: var(--r-md) !important;
}

.kanban-column-title {
  font-family: 'Nunito Sans', sans-serif !important;
  color: var(--c-text) !important;
}

.kanban-task-card {
  background: var(--c-surface) !important;
  border: 1px solid var(--c-border) !important;
  border-radius: var(--r-md) !important;
}

.kanban-task-card:hover {
  box-shadow: var(--shadow-md) !important;
  border-color: var(--c-border-strong) !important;
}

.kanban-task-title {
  font-family: 'Nunito Sans', sans-serif !important;
  color: var(--c-text) !important;
}

/* ─── Platform colors (preserved) ────────────────────────────── */
.platform-icon.platform-instagram {
  background: linear-gradient(45deg,#f09433,#e6683c 25%,#dc2743 50%,#cc2366 75%,#bc1888);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.platform-icon.platform-facebook  { color: #1877F2 !important; }
.platform-icon.platform-linkedin  { color: #0A66C2 !important; }
.platform-icon.platform-tiktok    { color: #000 !important; }
.platform-icon.platform-snapchat  { color: #FFD700 !important; filter: drop-shadow(0 0 1px rgba(0,0,0,.4)); }
.platform-icon.platform-x         { color: #000 !important; font-size: .8rem; }

/* ─── Recent posts specific ────────────────────────────────────── */
.recent-posts-client-badge {
  display: inline-flex;
  align-items: center;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  padding: .1rem .6rem;
  font-size: .75rem;
  font-weight: 600;
  color: var(--c-text-muted);
  transition: background var(--t-fast), color var(--t-fast);
}

.recent-posts-client-badge:hover {
  background: var(--c-primary-light);
  color: var(--c-primary-hover);
  border-color: transparent;
}

.recent-posts-status-badge {
  font-size: .7rem !important;
  padding: .2rem .6rem !important;
}

.post-link {
  color: var(--c-text) !important;
  text-decoration: none;
  font-weight: 600;
  transition: color var(--t-fast);
}

.post-link:hover { color: var(--c-primary) !important; }

.post-created-name { font-size: .8rem; color: var(--c-text-muted); }
.post-created-date { font-size: .75rem; color: var(--c-text-subtle); }

/* ─── Toasts ──────────────────────────────────────────────────── */
#globalToastContainer .toast {
  border: 1px solid var(--c-border) !important;
  border-radius: var(--r-md) !important;
  box-shadow: var(--shadow-lg) !important;
  font-family: 'Nunito Sans', sans-serif;
  font-size: .875rem;
}

/* ─── Empty states ────────────────────────────────────────────── */
.empty-state .empty-icon,
.table-empty-state .empty-icon {
  background: var(--c-primary-light) !important;
  color: var(--c-primary) !important;
  border-radius: var(--r-lg) !important;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

/* ─── User avatar (navbar) ────────────────────────────────────── */
.user-avatar,
.navbar-user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--r-full);
  background: var(--c-primary-light);
  color: var(--c-primary-hover);
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 700;
  font-size: .825rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--c-border);
  cursor: pointer;
}

/* ─── Footer ──────────────────────────────────────────────────── */
footer {
  background: transparent !important;
  border-top: 1px solid var(--c-border);
  padding: 1.25rem 0 !important;
}

footer p { font-size: .8125rem; }

/* ─── Scrollbar ───────────────────────────────────────────────── */
.agency-sidebar::-webkit-scrollbar { width: 4px; }
.agency-sidebar::-webkit-scrollbar-track { background: transparent; }
.agency-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }
.agency-sidebar:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); }

/* ─── Accessibility ───────────────────────────────────────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--c-primary-ring) !important;
}

/* ─── Animation — entrance ─────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card,
.stat-card,
.client-card {
  animation: fadeUp .25s ease both;
}

.row .col-md-2:nth-child(1) .stat-card { animation-delay: .03s; }
.row .col-md-2:nth-child(2) .stat-card { animation-delay: .06s; }
.row .col-md-2:nth-child(3) .stat-card { animation-delay: .09s; }
.row .col-md-2:nth-child(4) .stat-card { animation-delay: .12s; }
.row .col-md-2:nth-child(5) .stat-card { animation-delay: .15s; }
.row .col-md-2:nth-child(6) .stat-card { animation-delay: .18s; }

.row .col-lg-3:nth-child(1) .card { animation-delay: .04s; }
.row .col-lg-3:nth-child(2) .card { animation-delay: .08s; }
.row .col-lg-3:nth-child(3) .card { animation-delay: .12s; }
.row .col-lg-3:nth-child(4) .card { animation-delay: .16s; }

/* ─── Reduced motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 992px) {
  :root { --sidebar-w: 0px; }

  .agency-sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
  }

  .agency-sidebar.open {
    transform: translateX(0);
  }

  .agency-main-content {
    margin-left: 0 !important;
  }

  .agency-navbar {
    width: 100% !important;
  }
}

@media (max-width: 768px) {
  .agency-main-content {
    padding: 1.25rem 1rem !important;
  }

  .stat-value {
    font-size: 1.5rem !important;
  }

  .dashboard-page-header {
    flex-direction: column;
    align-items: flex-start !important;
  }
}

/* ================================================================
   Exact top navbar (no left sidebar)
   ================================================================ */
.no-sidebar-layout.agency-main-content {
  margin-left: 0 !important;
  margin-top: 73px !important;
  padding: 2rem !important;
}

.sf-header {
  height: 73px;
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px -1px rgba(0,0,0,.1), 0 1px 3px 0 rgba(0,0,0,.1);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
}

.sf-header-left { display: flex; align-items: center; gap: 40px; }
.sf-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #0f172a; }
.sf-brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgb(37, 99, 235);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px -2px rgba(37,99,235,.3), 0 4px 6px -1px rgba(37,99,235,.3);
}
.sf-brand-name {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.5px;
}

.sf-nav { display: flex; gap: 8px; align-items: center; }
.sf-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  color: rgb(100,116,139);
  text-decoration: none;
}
.sf-nav-btn:hover { background: rgb(241,245,249); color: rgb(15,23,42); }
.sf-nav-btn.active { background: rgba(37,99,235,.1); color: rgb(37,99,235); }

.sf-header-right { display: flex; align-items: center; gap: 20px; }
.sf-search {
  position: relative;
  width: 256px;
  height: 40px;
  border-radius: 20px;
  background: rgba(241,245,249,.5);
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgb(100,116,139);
}
.sf-search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  color: rgb(15,23,42);
  font-size: 14px;
}
.sf-kbd {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  min-height: 22px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  font-size: 11px;
  color: rgb(100,116,139);
  flex-shrink: 0;
  line-height: 1;
}

.sf-kbd .sf-kbd-mod {
  font-size: 10px;
  font-weight: 800;
  opacity: 0.9;
}

.sf-kbd .sf-kbd-key {
  font-weight: 800;
}

.sf-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  z-index: 1200;
  max-height: 320px;
  overflow-y: auto;
  padding: 8px;
}

.sf-search-group + .sf-search-group {
  border-top: 1px solid #f1f5f9;
  margin-top: 6px;
  padding-top: 6px;
}

.sf-search-group-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 6px 8px;
}

.sf-search-item {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #0f172a;
  padding: 8px;
  border-radius: 8px;
  font-size: 13px;
}

.sf-search-item:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.sf-search-item i {
  color: #64748b;
  font-size: 16px;
}

.sf-search-empty {
  padding: 12px 10px;
  font-size: 13px;
  color: #64748b;
}
.sf-divider-v { width: 1px; height: 32px; background: #e2e8f0; }

.sf-client-switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 12px;
  border-radius: 14px;
  text-decoration: none;
  color: rgb(15,23,42);
}
.sf-client-switch:hover { background: rgb(241,245,249); color: rgb(15,23,42); }
.sf-client-name { font-weight: 700; }

/* Client switch — same dot / logo treatment as dashboard recent posts .client-cell */
.sf-header .sf-client-switch .client-dot.sf-client-switch-dot,
.sf-header .sf-client-switch .client-dot {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11px;
  line-height: 1;
  flex-shrink: 0;
}
.sf-header .sf-client-switch .client-dot.has-logo {
  background: #fff;
  padding: 2px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.sf-header .sf-client-switch .client-dot.has-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.sf-header .sf-client-switch .dot-ads { background: rgb(254, 243, 199); color: rgb(245, 158, 11); }
.sf-header .sf-client-switch .dot-nep { background: rgb(209, 250, 229); color: rgb(16, 185, 129); }
.sf-header .sf-client-switch .dot-gm { background: rgb(224, 242, 254); color: rgb(14, 165, 233); }
.sf-header .sf-client-switch .dot-lm { background: rgb(237, 233, 254); color: rgb(139, 92, 246); }

.sf-icon-btn,
.sf-avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.sf-icon-btn {
  position: relative;
  background: rgb(241,245,249);
  color: rgb(100,116,139);
}
.sf-avatar {
  background: rgb(237,233,254);
  color: rgb(139,92,246);
  font-weight: 800;
  font-size: 14px;
}

/* Guide user to client selector before opening posts */
body.sf-guide-open::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 999;
}

.sf-client-switch-wrap.sf-client-switch-spotlight {
  position: relative;
  z-index: 1001;
}

.sf-client-switch-wrap.sf-client-switch-spotlight .sf-client-switch {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.35), 0 10px 26px rgba(2, 6, 23, 0.35);
  background: #fff;
}

.sf-client-switch-wrap.sf-client-switch-spotlight .dropdown-menu {
  z-index: 1002;
}

/* ─── Login page overrides (additional) ─────────────────────────
   Main login layout is in login.php itself; this handles wrapper.
   ─────────────────────────────────────────────────────────────── */
.login-split-layout {
  display: block;
  min-height: 100vh;
  background: #fafafa;
}

.login-brand-panel {
  flex: 0 0 420px;
  background: linear-gradient(145deg, #1D4ED8 0%, #1E40AF 58%, #172554 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem 3.5rem;
  position: relative;
  overflow: hidden;
}

.login-brand-panel::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(59,130,246,.35) 0%, transparent 65%);
  pointer-events: none;
}

.login-brand-panel::after {
  content: '';
  position: absolute;
  bottom: -80px; left: -80px;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(96,165,250,.22) 0%, transparent 65%);
  pointer-events: none;
}

.login-brand-logo {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 1.25rem;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: .5rem;
  letter-spacing: -.04em;
  position: relative;
  z-index: 1;
}

.login-brand-logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgb(37, 99, 235);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px -2px rgba(37,99,235,.3), 0 4px 6px -1px rgba(37,99,235,.3);
  flex-shrink: 0;
}
.login-brand-logo-mark i {
  font-size: 16px;
  transform: translateY(-0.5px);
}

.login-brand-headline {
  font-family: 'Nunito Sans', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
  letter-spacing: -.04em;
  margin-bottom: 1rem;
  position: relative;
  z-index: 1;
}

.login-brand-headline span {
  color: #fff;
}

.login-brand-tagline {
  font-size: .9375rem;
  color: #fff;
  line-height: 1.55;
  margin-bottom: 2.5rem;
  position: relative;
  z-index: 1;
}

.login-feature-list {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
  z-index: 1;
}

.login-feature-list li {
  display: flex;
  align-items: center;
  gap: .75rem;
  color: rgba(255,255,255,.8);
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: .875rem;
}

.login-feature-list li i {
  width: 28px;
  height: 28px;
  background: rgba(191,219,254,.18);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #BFDBFE;
  font-size: .95rem;
  flex-shrink: 0;
}

.login-brand-footer {
  font-size: .75rem;
  color: rgba(255,255,255,.35);
  position: relative;
  z-index: 1;
}

.login-form-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3.5rem 1.25rem;
  background: #fafafa;
  min-height: 100vh;
}

.login-form-inner {
  width: 100%;
  max-width: 430px;
}
.login-brand-logo-top {
  color: rgb(15, 23, 42);
  margin-bottom: 18px;
  justify-content: center;
}

.login-auth-card {
  background: #fff;
  border: 1px solid rgb(226, 232, 240);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  padding: 28px 28px 24px;
}

.login-form-title {
  font-family: "Inter", system-ui, sans-serif !important;
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--c-text) !important;
  letter-spacing: -0.02em;
  margin-bottom: .375rem;
}

.login-form-subtitle {
  font-size: .9rem;
  color: var(--c-text-muted);
  margin-bottom: 2rem;
}

.login-divider {
  border-top: 1px solid var(--c-border);
  margin: 1.5rem 0;
  position: relative;
  text-align: center;
}

.login-divider::after {
  content: 'or';
  position: absolute;
  top: -.65rem;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  padding: 0 .75rem;
  font-size: .75rem;
  color: var(--c-text-subtle);
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.login-client-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .6rem 1rem;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  color: var(--c-text-muted);
  font-size: .875rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--t-fast);
  font-family: 'Nunito Sans', sans-serif;
  cursor: pointer;
}

.login-client-btn:hover {
  border-color: var(--c-border-strong);
  color: var(--c-text);
  background: var(--c-bg);
}

.login-submit-btn {
  width: 100%;
  min-height: 42px;
  border-radius: 14px !important;
  padding: .65rem 1rem;
  font-size: .95rem;
  font-weight: 700 !important;
  justify-content: center;
}
.login-auth-card .btn-primary {
  background: rgb(37, 99, 235) !important;
  border-color: rgb(37, 99, 235) !important;
  box-shadow: var(--shadow-sm);
}
.login-auth-card .btn-primary:hover,
.login-auth-card .btn-primary:focus {
  background: rgb(29, 78, 216) !important;
  border-color: rgb(29, 78, 216) !important;
}
.login-auth-card .btn-primary:focus {
  box-shadow: 0 0 0 3px rgba(37,99,235,.2) !important;
}
.login-auth-card .form-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.login-auth-card .form-control {
  height: 42px;
  border: 1px solid rgb(226, 232, 240);
  border-radius: 12px;
  padding: 0 12px;
  font-size: 14px;
}
.login-auth-card .form-control:focus {
  border-color: #93C5FD;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.login-auth-card a {
  color: rgb(37, 99, 235);
}
.login-auth-card a:hover {
  color: rgb(29, 78, 216);
}
.login-register-link-accent {
  color: rgb(37, 99, 235);
}

@media (max-width: 768px) {
  .login-form-panel { padding: 2rem 1rem; }
  .login-auth-card { padding: 22px 18px 18px; }
}

/* ─── Bootstrap primary override → teal ──────────────────────── */
:root {
  --bs-primary: #0D9488;
  --bs-primary-rgb: 13, 148, 136;
  --bs-link-color: #0D9488;
  --bs-link-hover-color: #0F766E;
}

.text-primary { color: var(--c-primary) !important; }
a { color: var(--c-primary); }
a:hover { color: var(--c-primary-hover); }

/* ─── Navbar avatar ───────────────────────────────────────────── */
.navbar-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--c-primary-light);
  color: var(--c-primary-hover);
  font-family: 'Nunito Sans', sans-serif;
  font-weight: 700;
  font-size: .8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--c-border);
  cursor: pointer;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.navbar-avatar-toggle:hover .navbar-avatar,
.navbar-avatar-toggle[aria-expanded="true"] .navbar-avatar {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-ring);
}

.dropdown-header {
  padding: .75rem 1rem;
}

.dropdown-header .fw-semibold {
  font-size: .875rem;
  color: var(--c-text);
  font-family: 'Nunito Sans', sans-serif;
}

/* ─── Notification list items ─────────────────────────────────── */
.notif-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 320px;
  overflow-y: auto;
}

.notif-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem 1rem;
  text-decoration: none;
  color: var(--c-text);
  border-bottom: 1px solid var(--c-border);
  transition: background var(--t-fast);
  position: relative;
}

.notif-item:last-child { border-bottom: none; }

.notif-item:hover {
  background: var(--c-bg);
  color: var(--c-text);
}

.notif-item.unread { background: #F0FDF9; }
.notif-item.unread:hover { background: #CCFBF1; }

.notif-unread-dot {
  position: absolute;
  top: 1rem; left: .5rem;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--c-primary);
}

.notif-icon-wrap {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.notif-icon-wrap.approved { background: var(--c-success-light); color: var(--c-success); }
.notif-icon-wrap.rejected { background: var(--c-danger-light); color: var(--c-danger); }
.notif-icon-wrap.warning  { background: var(--c-warning-light); color: var(--c-warning); }
.notif-icon-wrap.info     { background: var(--c-primary-light); color: var(--c-primary); }

.notif-body {
  display: flex;
  flex-direction: column;
  gap: .15rem;
  min-width: 0;
}

.notif-event {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.3;
  font-family: 'Nunito Sans', sans-serif;
}

.notif-msg {
  font-size: .75rem;
  color: var(--c-text-muted);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 240px;
}

.notif-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  gap: .5rem;
  color: var(--c-text-muted);
}

.notif-empty i { font-size: 1.75rem; opacity: .5; }
.notif-empty span { font-size: .8125rem; font-weight: 500; }

.notif-footer {
  padding: .65rem 1rem;
  border-top: 1px solid var(--c-border);
  text-align: center;
}

.notif-footer a {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--c-primary);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}

.notif-footer a:hover { color: var(--c-primary-hover); }

/* ─── Register / client-login card centering ─────────────────── */
.row.justify-content-center.min-vh-100 {
  background: var(--c-bg);
  padding: 2rem 1rem;
}

.row.justify-content-center.min-vh-100 .card {
  border-radius: var(--r-xl) !important;
  box-shadow: var(--shadow-md) !important;
}

.row.justify-content-center.min-vh-100 h2 {
  font-size: 1.5rem;
  letter-spacing: -.04em;
}

/* ─── Stat card accent on hover ───────────────────────────────── */
.stat-card.accent-primary:hover::before { background: var(--c-primary); }
.stat-card.accent-success:hover::before { background: var(--c-success); }
.stat-card.accent-warning:hover::before { background: var(--c-warning); }

/* ─── Sticky header ───────────────────────────────────────────── */
.navbar:not(.agency-navbar) { position: fixed !important; top: 0; left: 0; right: 0; z-index: 1000; }
.agency-navbar { position: fixed !important; top: 0; right: 0; left: var(--sidebar-w); z-index: 1000; }

/* ─── Sidebar deactivated opacity ─────────────────────────────── */
.sidebar-client-deactivated {
  opacity: .5;
}
.sidebar-client-deactivated:hover {
  opacity: .75;
}

/* ─── Search input (non-sidebar) ──────────────────────────────── */
.input-group-sm .form-control,
.input-group-sm .input-group-text {
  font-size: .8125rem;
  border-radius: var(--r-sm) !important;
}

/* ─── Bulk action bar ─────────────────────────────────────────── */
.bulk-action-bar {
  background: var(--c-primary-light);
  border-bottom: 1px solid rgba(13,148,136,.2);
  font-size: .875rem;
}

/* ─── Checkbox styling ─────────────────────────────────────────── */
.form-check-input:checked {
  background-color: var(--c-primary) !important;
  border-color: var(--c-primary) !important;
}

.form-check-input:focus {
  box-shadow: 0 0 0 3px var(--c-primary-ring) !important;
  border-color: var(--c-primary) !important;
}

/* ─── Spinner ─────────────────────────────────────────────────── */
.spinner-border { color: var(--c-primary); }

/* ─── Nav pills / tabs ─────────────────────────────────────────── */
.nav-pills .nav-link.active {
  background: var(--c-primary) !important;
}
.nav-tabs .nav-link.active {
  border-bottom-color: var(--c-agency-blue) !important;
  color: var(--c-agency-blue) !important;
}

/* ─── Progress bar ─────────────────────────────────────────────── */
.progress-bar { background: var(--c-primary) !important; }

/* ─── Pagination ──────────────────────────────────────────────── */
.page-link { color: var(--c-primary); }
.page-item.active .page-link {
  background: var(--c-primary) !important;
  border-color: var(--c-primary) !important;
}

/* ─── Post preview sidebar — light background ─────────────────── */
.post-sidebar,
.post-sidebar .offcanvas-body,
.post-sidebar .post-sidebar-content,
.post-sidebar .tab-content,
.post-sidebar .tab-pane,
.post-sidebar .post-sidebar-details,
.post-sidebar .post-sidebar-section,
.post-sidebar .post-sidebar-tabs-section {
  background: #ffffff !important;
  color: var(--c-text) !important;
}

.post-sidebar .post-sidebar-detail-label,
.post-sidebar .post-sidebar-detail-value,
.post-sidebar .post-sidebar-section-title,
.post-sidebar .post-sidebar-title,
.post-sidebar .post-sidebar-description {
  color: var(--c-text) !important;
}

/* ─── Post sidebar theme pass (dashboard-aligned) ─────────────── */
.post-sidebar {
  border-left: 1px solid rgb(226, 232, 240) !important;
  box-shadow: -10px 0 30px rgba(15, 23, 42, 0.08) !important;
}
.post-sidebar .offcanvas-header {
  padding: 14px 16px !important;
}
.post-sidebar .post-sidebar-header-tabs {
  border-bottom: 0 !important;
  gap: 8px;
}
.post-sidebar .post-sidebar-header-tabs .nav-link {
  border: 0 !important;
  border-radius: 10px !important;
  height: 34px;
  padding: 0 12px !important;
  font-size: 13px;
  font-weight: 700;
  color: rgb(100, 116, 139) !important;
}
.post-sidebar .post-sidebar-header-tabs .nav-link:hover {
  background: rgb(241, 245, 249) !important;
  color: rgb(15, 23, 42) !important;
}
.post-sidebar .post-sidebar-header-tabs .nav-link.active {
  background: rgba(37, 99, 235, 0.1) !important;
  color: rgb(37, 99, 235) !important;
}
.post-sidebar .post-sidebar-header .btn-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgb(226, 232, 240);
  background: #fff;
  color: rgb(100, 116, 139);
}
.post-sidebar .post-sidebar-header .btn-icon:hover {
  background: rgb(241, 245, 249) !important;
  color: rgb(15, 23, 42) !important;
  border-color: rgb(226, 232, 240) !important;
}
.post-sidebar .post-sidebar-title-section {
  border-bottom: 1px solid rgb(241, 245, 249);
}
.post-sidebar .post-sidebar-title {
  font-family: "Inter", system-ui, sans-serif !important;
  font-weight: 700 !important;
}
.post-sidebar .post-sidebar-section-title {
  color: rgb(100, 116, 139) !important;
}

/* Conversation tab */
#sidebarConversation .conversation-message-item {
  margin-bottom: 12px !important;
}
#sidebarConversation .conversation-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgb(241, 245, 249);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
#sidebarConversation .conversation-avatar-initials {
  font-size: 11px;
  font-weight: 800;
  color: rgb(51, 65, 85);
}
#sidebarConversation .conversation-message-content {
  background: #fff;
  border: 1px solid rgb(226, 232, 240);
  border-radius: 12px;
  padding: 10px 12px;
}
#sidebarConversation .conversation-message-name {
  color: rgb(15, 23, 42);
  font-size: 13px;
}
#sidebarConversation .conversation-message-time {
  color: rgb(100, 116, 139) !important;
}
#sidebarConversation .conversation-message-text {
  margin-top: 4px;
  color: rgb(30, 41, 59);
  font-size: 13px;
  line-height: 1.45;
}
.post-sidebar-comment-composer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgb(241, 245, 249);
}
.post-sidebar .post-sidebar-comment-input {
  border: 1px solid rgb(226, 232, 240) !important;
  border-radius: 12px !important;
  font-size: 13px;
  min-height: 40px;
}
.post-sidebar .post-sidebar-comment-input:focus {
  border-color: #93C5FD !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12) !important;
}
.post-sidebar .post-sidebar-comment-send {
  border-radius: 11px !important;
  height: 34px;
  padding: 0 12px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  background: var(--editor-primary, rgb(37, 99, 235)) !important;
  border-color: var(--editor-primary, rgb(37, 99, 235)) !important;
  color: #fff !important;
}
.post-sidebar .post-sidebar-comment-send:hover,
.post-sidebar .post-sidebar-comment-send:focus {
  filter: brightness(1.08);
}

/* Activity tab */
#sidebarActivity .activity-item {
  border: 1px solid rgb(226, 232, 240);
  background: #fff;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px !important;
}
#sidebarActivity .activity-time {
  font-size: 11px;
  color: rgb(100, 116, 139) !important;
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
}
#sidebarActivity .activity-content {
  font-size: 13px;
  color: rgb(30, 41, 59);
}

/* Share popups */
#sidebarShareTypeModal .modal-content,
#sidebarShareModal .modal-content,
#sidebarApproveModal .modal-content {
  border: 1px solid rgb(226, 232, 240) !important;
  border-radius: 16px !important;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12) !important;
}
#sidebarShareTypeModal .modal-header,
#sidebarShareModal .modal-header,
#sidebarApproveModal .modal-header {
  border-bottom: 1px solid rgb(241, 245, 249) !important;
}
#sidebarShareTypeModal .modal-footer,
#sidebarShareModal .modal-footer,
#sidebarApproveModal .modal-footer {
  border-top: 1px solid rgb(241, 245, 249) !important;
}
#sidebarShareTypeModal .btn,
#sidebarShareModal .btn,
#sidebarApproveModal .btn {
  border-radius: 11px !important;
  font-weight: 700 !important;
}
#sidebarShareModal .modal-footer .btn {
  height: 40px;
  padding: 0 16px !important;
  border-radius: 14px !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px !important;
}
#sidebarShareModal .modal-footer .btn.btn-secondary {
  background: #fff !important;
  border-color: rgb(226, 232, 240) !important;
  color: rgb(15, 23, 42) !important;
  box-shadow: var(--shadow-sm);
}
#sidebarShareModal .modal-footer .btn.btn-secondary:hover {
  background: rgb(241, 245, 249) !important;
}
#sidebarShareModal .modal-footer .btn.btn-primary {
  background: rgb(37, 99, 235) !important;
  border-color: rgb(37, 99, 235) !important;
  color: #fff !important;
  box-shadow: var(--shadow-sm);
}
#sidebarShareModal .modal-footer .btn.btn-primary:hover {
  filter: brightness(1.05);
}
#sidebarShareModal .form-select,
#sidebarShareModal .form-control {
  border: 1px solid rgb(226, 232, 240) !important;
  border-radius: 12px !important;
}
#sidebarShareModal .form-select:focus,
#sidebarShareModal .form-control:focus {
  border-color: #93C5FD !important;
  box-shadow: 0 0 0 3px rgba(37,99,235,.12) !important;
}
#sidebarShareModal .btn-outline-secondary {
  border-color: rgb(226, 232, 240) !important;
  color: rgb(71, 85, 105) !important;
}
#sidebarShareTypeModal .btn-outline-primary {
  border-color: var(--c-agency-blue) !important;
  color: var(--c-agency-blue) !important;
  background: var(--c-surface) !important;
}
#sidebarShareTypeModal .btn-outline-primary:hover,
#sidebarShareTypeModal .btn-outline-primary:focus {
  background: var(--c-agency-blue-soft) !important;
  border-color: var(--c-agency-blue) !important;
}

/* Mention dropdown */
.mention-dropdown {
  border: 1px solid rgb(226, 232, 240) !important;
  border-radius: 10px !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12) !important;
}
.mention-item::before {
  color: rgb(37, 99, 235) !important;
}
.mention-item:hover,
.mention-item.active {
  background: rgba(37, 99, 235, 0.08) !important;
  color: rgb(30, 64, 175) !important;
}

.post-sidebar-header .btn-icon:hover {
  background: var(--c-primary-light) !important;
  color: var(--c-primary) !important;
}

/* Post sidebar header — light */
.post-sidebar-header {
  background: var(--c-surface) !important;
  border-bottom: 1px solid var(--c-border) !important;
}

/* Fix invalid hex + tab colors in lower tabs */
.post-sidebar-tabs .nav-link.active {
  color: var(--c-agency-blue) !important;
  border-bottom-color: var(--c-agency-blue) !important;
}

/* ================================================================
   UI Fine-Tuning Pass — comprehensive polish
   ================================================================ */

/* ─── Stat card accent top bar — use border-top approach ────── */
.stat-card {
  overflow: hidden !important;
  border-top: 3px solid var(--c-border) !important;
}

/* Remove the ::before pseudo-element approach */
.stat-card::before {
  display: none !important;
}

.stat-card.accent-primary  { border-top-color: var(--c-primary) !important; }
.stat-card.accent-warning  { border-top-color: var(--c-warning) !important; }
.stat-card.accent-success  { border-top-color: var(--c-success) !important; }
.stat-card.accent-info     { border-top-color: var(--c-info) !important; }
.stat-card.accent-feedback { border-top-color: #F59E0B !important; }
.stat-card.accent-live     { border-top-color: #06B6D4 !important; }

/* ─── Stat card label — slightly more readable ───────────────── */
.stat-label {
  font-size: .72rem !important;
  letter-spacing: .08em;
  margin-bottom: .5rem !important;
}

/* ─── Dashboard page header — tighten the filter section ─────── */
.dashboard-page-header {
  gap: 1rem;
  align-items: center !important;
  flex-wrap: wrap;
}

.dashboard-page-header .form-select,
.dashboard-page-header .modern-input {
  min-width: 130px;
  font-size: .8125rem !important;
  padding: .4rem .7rem !important;
  height: 34px;
}

.dashboard-page-header .form-label.small {
  font-size: .7rem !important;
  font-weight: 600 !important;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--c-text-subtle) !important;
  margin-bottom: .25rem !important;
}

/* ─── Client cards — better placeholder when no cover image ──── */
.client-card .card-img-top[src=""],
.client-card .card-img-top:not([src]) {
  background: linear-gradient(135deg, #E6FAF8 0%, #CCFBF1 100%);
}

/* Client card cover area placeholder gradient */
.client-cover-placeholder {
  background: linear-gradient(135deg, #E6FAF8 0%, #D1FAE5 100%) !important;
}

/* ─── Posts table — action buttons ───────────────────────────── */
.queue-icon-btn {
  width: 28px !important;
  height: 28px !important;
  font-size: .875rem !important;
}

/* Tighten action column spacing */
.table tbody td:last-child {
  padding-right: 1rem !important;
}

.table tbody td .d-flex.gap-1,
.table tbody td .d-flex.gap-2 {
  gap: .2rem !important;
}

/* ─── Status badges — more polished pills ─────────────────────── */
.badge-success,
span.badge[class*="approved" i],
.badge.bg-success {
  background: #DCFCE7 !important;
  color: #15803D !important;
  border: 1px solid rgba(22,163,74,.15) !important;
}

.badge-warning,
span.badge[class*="pending" i],
.badge.bg-warning {
  background: #FEF3C7 !important;
  color: #92400E !important;
  border: 1px solid rgba(217,119,6,.15) !important;
}

.badge-feedback,
span.badge[class*="feedback" i] {
  background: #FEF3C7 !important;
  color: #92400E !important;
  border: 1px solid rgba(217,119,6,.15) !important;
}

/* ─── Post sidebar detail section — add subtle dividers ─────── */
.post-sidebar-detail-item {
  padding: .6rem 0 !important;
  border-bottom: 1px solid var(--c-border);
}

.post-sidebar-detail-item:last-child {
  border-bottom: none;
}

.post-sidebar-detail-label {
  font-size: .8rem !important;
  font-weight: 600 !important;
  color: var(--c-text-subtle) !important;
  min-width: 140px !important;
  text-transform: uppercase;
  letter-spacing: .05em;
}

.post-sidebar-detail-label i {
  color: var(--c-text-subtle) !important;
}

.post-sidebar-detail-value {
  font-size: .875rem !important;
  font-weight: 500 !important;
  color: var(--c-text) !important;
}

/* ─── Post sidebar section titles ─────────────────────────────── */
.post-sidebar-section-title {
  font-family: 'Nunito Sans', sans-serif !important;
  font-size: .7rem !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: .08em !important;
  color: var(--c-text-subtle) !important;
}

/* ─── Post sidebar title ──────────────────────────────────────── */
.post-sidebar-title {
  font-family: 'Nunito Sans', sans-serif !important;
  font-size: 1.25rem !important;
  font-weight: 700 !important;
  color: var(--c-text) !important;
  letter-spacing: -.02em;
}

/* Sidebar live preview uses .agency-post-editor (same as /agency/posts/edit); disable sticky card inside offcanvas */
.post-sidebar .post-sidebar-preview-root.agency-post-editor .post-preview-card {
  position: relative !important;
  top: auto !important;
}
.post-sidebar .post-sidebar-preview-root #sidebarLivePreview.post-preview-container,
.post-sidebar .post-sidebar-preview-root .post-sidebar-live-preview.post-preview-container {
  overflow: hidden;
  max-width: 100%;
}

/* ─── Platform icon selector in sidebar ──────────────────────── */
#sidebarLivePlatformTabs {
  display: flex;
  gap: .375rem;
  flex-wrap: wrap;
}

#sidebarLivePlatformTabs .btn,
.post-sidebar-live-preview + * .btn {
  border-radius: var(--r-sm) !important;
}

/* ─── View switch buttons ─────────────────────────────────────── */
.view-switch-btn {
  font-size: .78rem !important;
  padding: .35rem .65rem !important;
  letter-spacing: .01em;
}

/* ─── Breadcrumb — cleaner ────────────────────────────────────── */
.breadcrumb-item {
  font-size: .8125rem !important;
  font-weight: 500;
}

.breadcrumb-item a:hover {
  color: var(--c-primary) !important;
  text-decoration: none !important;
}

.breadcrumb-item.active,
.breadcrumb-item.active strong {
  color: var(--c-text) !important;
  font-weight: 600;
}

/* ─── Recent posts section heading ─────────────────────────────── */
.card-header .bx,
.card h5 .bx {
  color: var(--c-primary);
}

/* ─── Navbar — active nav link pill ──────────────────────────── */
.navbar .nav-link.active {
  background: var(--c-primary-light) !important;
  color: var(--c-primary-hover) !important;
  font-weight: 700 !important;
}

/* ─── Dropdown selects — use Bootstrap default arrow, just style borders ── */
.form-select {
  border-color: var(--c-border) !important;
  color: var(--c-text) !important;
}

/* ─── Posts board/list page header area ──────────────────────── */
.dashboard-section-heading h2,
.agency-main-content > h1,
.agency-main-content > h2 {
  letter-spacing: -.03em;
}

/* ─── Client card — View Posts / Reports buttons ────────────── */
.client-card .btn-outline-primary,
.client-card .btn-outline-secondary {
  font-size: .8rem !important;
  padding: .3rem .65rem !important;
  font-weight: 600 !important;
}

/* ─── Table search input ─────────────────────────────────────── */
.input-group .form-control[placeholder*="Search"] {
  border-radius: var(--r-sm) !important;
  font-size: .8125rem;
  padding: .4rem .75rem;
}

/* ─── "Posts" card header row ───────────────────────────────── */
.card-header, .d-flex.align-items-center.mb-3 {
  gap: .5rem;
}

/* ─── Navbar brand in dark sidebar ──────────────────────────── */
.agency-sidebar .sidebar-header .navbar-brand {
  color: #fff !important;
}

/* ─── Manage Clients button in sidebar ──────────────────────── */
.sidebar-add-client-btn {
  border-radius: var(--r-sm) !important;
  font-size: .78rem !important;
}

/* ─── "ACTIVE CLIENTS" section label in sidebar ─────────────── */
.sidebar-section-label {
  font-size: .65rem !important;
  padding: 0 .75rem;
  margin-bottom: .125rem;
}

/* ─── Page title on board/list pages ────────────────────────── */
.agency-main-content > div > h1,
.agency-main-content h1.mb-1 {
  font-size: 1.375rem !important;
  font-weight: 700 !important;
  letter-spacing: -.03em;
}

/* ─── Post row title link ─────────────────────────────────────── */
.post-link {
  font-size: .9rem !important;
}

/* ─── Created date + author in table ─────────────────────────── */
.post-created-name {
  font-weight: 600;
  font-size: .8rem !important;
}

.post-created-date {
  font-size: .72rem !important;
}

/* ─── Column header text ──────────────────────────────────────── */
.table thead th {
  font-size: .68rem !important;
  letter-spacing: .09em;
}

/* ─── Improved card elevation on hover ─────────────────────────── */
.stat-card:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 24px rgba(28,25,23,.1) !important;
}

/* ─── Red delete button — tone it down ───────────────────────── */
.queue-icon-btn.btn-outline-danger,
.queue-icon-btn[class*="danger"] {
  color: var(--c-text-subtle) !important;
  border-color: transparent !important;
}

.queue-icon-btn.btn-outline-danger:hover,
.queue-icon-btn[class*="danger"]:hover {
  background: var(--c-danger-light) !important;
  border-color: var(--c-danger) !important;
  color: var(--c-danger) !important;
}

/* ─── Smooth sidebar scrollbar ──────────────────────────────── */
.post-sidebar-content {
  scrollbar-width: thin;
  scrollbar-color: var(--c-border) transparent;
}

.post-sidebar-content::-webkit-scrollbar {
  width: 4px;
}

.post-sidebar-content::-webkit-scrollbar-thumb {
  background: var(--c-border);
  border-radius: 4px;
}

/* ─── Posts board list — sticky actions column ─────────────── */
.table .actions-col,
.table thead th:last-child,
.table tbody td:last-child {
  text-align: right;
}

/* ================================================================
   Polish Pass 2 — Create Post, Reports, Global refinements
   ================================================================ */

/* ─── Platform cards — teal selected state ───────────────────── */
.platform-card {
  border: 1.5px solid var(--c-border) !important;
  border-radius: var(--r-md) !important;
  background: var(--c-surface) !important;
  transition: border-color var(--t-fast), background var(--t-fast), transform var(--t-fast), box-shadow var(--t-fast) !important;
}

.platform-card:hover {
  border-color: var(--c-border-strong) !important;
  background: var(--c-surface-muted) !important;
  box-shadow: var(--shadow-sm) !important;
  transform: translateY(-1px) !important;
}

.platform-card.selected {
  border-color: var(--c-primary) !important;
  background: var(--c-primary-light) !important;
  box-shadow: 0 0 0 3px var(--c-primary-ring) !important;
}

.platform-card.selected .platform-card-text strong {
  color: var(--c-primary-hover) !important;
}

/* ─── File upload zone — teal tint ───────────────────────────── */
.file-upload-zone {
  border-color: var(--c-border) !important;
  background: var(--c-surface-muted) !important;
  border-radius: var(--r-lg) !important;
}

.file-upload-zone:hover {
  border-color: var(--c-primary) !important;
  background: var(--c-primary-light) !important;
}

.file-upload-zone.dragover {
  border-color: var(--c-primary) !important;
  background: var(--c-primary-light) !important;
  box-shadow: 0 0 0 3px var(--c-primary-ring) !important;
}

.file-upload-icon {
  background: var(--c-primary-light) !important;
  color: var(--c-primary) !important;
}

.file-upload-icon i {
  color: var(--c-primary) !important;
}

/* ─── Emoji trigger button — lighter style ──────────────────── */
.emoji-trigger.btn.btn-secondary {
  background: var(--c-surface) !important;
  border: 1.5px solid var(--c-border) !important;
  color: var(--c-text-muted) !important;
  border-color: var(--c-border) !important;
  box-shadow: none !important;
}

.emoji-trigger.btn.btn-secondary:hover {
  background: var(--c-bg) !important;
  border-color: var(--c-border-strong) !important;
  color: var(--c-text) !important;
  transform: translateY(-1px) !important;
}

/* ─── Select2 — teal focus/selection ─────────────────────────── */
.select2-container--default .select2-selection--single {
  border: 1px solid var(--c-border) !important;
  border-radius: var(--r-sm) !important;
  background: var(--c-surface) !important;
  height: 42px !important;
  min-height: 42px !important;
  display: flex !important;
  align-items: center !important;
  font-family: 'Nunito Sans', sans-serif !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--c-text) !important;
  font-weight: 500 !important;
  font-family: 'Nunito Sans', sans-serif !important;
  line-height: 40px !important;
}

.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
  border-color: var(--c-primary) !important;
  box-shadow: 0 0 0 3px var(--c-primary-ring) !important;
  background: var(--c-surface) !important;
}

.select2-dropdown {
  border: 1px solid var(--c-border) !important;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  font-family: 'Nunito Sans', sans-serif !important;
  overflow: hidden !important;
}

.select2-results__option {
  font-family: 'Nunito Sans', sans-serif !important;
  font-size: .875rem !important;
  color: var(--c-text) !important;
  padding: .55rem 1rem !important;
}

.select2-results__option.select2-results__option--highlighted {
  background: var(--c-primary-light) !important;
  color: var(--c-primary-hover) !important;
}

.select2-results__option--selected {
  background: var(--c-bg) !important;
  color: var(--c-text-muted) !important;
}

/* ─── Reports page — card improvements ────────────────────────── */
.card.border-0.shadow-sm {
  border: 1px solid var(--c-border) !important;
  box-shadow: var(--shadow-sm) !important;
  border-radius: var(--r-lg) !important;
}

/* ─── Reports filter row ─────────────────────────────────────── */
.reports-filter-card .form-control,
.reports-filter-card .form-select {
  height: 38px;
  font-size: .875rem;
}

/* ─── Reports stat card labels ───────────────────────────────── */
.metric-label, .reports-metric-label {
  font-size: .7rem !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--c-text-subtle) !important;
}

.metric-value, .reports-metric-value {
  font-family: 'Nunito Sans', sans-serif !important;
  font-size: 1.75rem !important;
  font-weight: 800 !important;
  color: var(--c-text) !important;
  letter-spacing: -.04em;
}

/* ─── Chart.js chart areas ──────────────────────────────────── */
canvas { border-radius: var(--r-md); }

/* ─── Create post form layout ───────────────────────────────── */
.create-post-form .modern-field-group,
#createPostForm .modern-field-group {
  margin-bottom: 1.25rem;
}

/* ─── Page secondary button (Add User, Create Client etc.) ──── */
/* btn-secondary is intentionally dark — this is a high-contrast CTA */
/* No change needed; dark buttons on light page give good contrast  */

/* ─── Create post page — scheduled date picker ──────────────── */
.flatpickr-input {
  font-family: 'Nunito Sans', sans-serif !important;
  font-size: .875rem !important;
}

.flatpickr-calendar {
  border: 1px solid var(--c-border) !important;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--shadow-lg) !important;
  font-family: 'Nunito Sans', sans-serif !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: var(--c-primary) !important;
  border-color: var(--c-primary) !important;
}

.flatpickr-day:hover {
  background: var(--c-primary-light) !important;
  border-color: var(--c-primary-light) !important;
}

/* ─── Users / Clients table row avatar initials ──────────────── */
.user-avatar-sm,
.table td .rounded-circle.d-flex {
  background: var(--c-primary-light) !important;
  color: var(--c-primary-hover) !important;
  font-family: 'Nunito Sans', sans-serif !important;
  font-weight: 700 !important;
}

/* ─── Role badges (Owner/Member) ─────────────────────────────── */
.badge.bg-secondary,
.badge.badge-secondary {
  background: #F1F5F9 !important;
  color: #475569 !important;
  font-size: .7rem !important;
  font-weight: 600 !important;
  letter-spacing: .02em !important;
  border: 1px solid #E2E8F0 !important;
}

/* ─── Active status badge ─────────────────────────────────────── */
.badge.bg-success,
.badge.badge-success {
  background: var(--c-success-light) !important;
  color: var(--c-success) !important;
  border: 1px solid rgba(22,163,74,.15) !important;
}

/* ─── Post creation — Live Preview panel ────────────────────── */
.post-preview-panel,
#postPreview {
  background: var(--c-surface) !important;
  border-radius: var(--r-lg) !important;
  box-shadow: var(--shadow-sm) !important;
}

/* ─── Sticky create post preview ────────────────────────────── */
.post-preview-sticky {
  position: sticky;
  top: calc(var(--navbar-h) + 1.25rem);
}

/* ================================================================
   Exact dashboard style layer
   ================================================================ */
.agency-dashboard-exact {
  --bg: rgb(250, 250, 250);
  --surface: #ffffff;
  --border: rgb(226, 232, 240);
  --border-soft: rgb(241, 245, 249);
  --text: rgb(15, 23, 42);
  --muted: rgb(100, 116, 139);
  --primary: rgb(37, 99, 235);
  --primary-soft: rgba(37, 99, 235, 0.1);
  --amber: rgb(245, 158, 11);
  --amber-soft: rgb(254, 243, 199);
  --green: rgb(16, 185, 129);
  --green-soft: rgb(209, 250, 229);
  --violet: rgb(139, 92, 246);
  --violet-soft: rgb(237, 233, 254);
  --sky: rgb(14, 165, 233);
  --sky-soft: rgb(224, 242, 254);
  --red: rgb(239, 68, 68);
  --red-soft: rgba(239, 68, 68, 0.12);
  /* Draft stat — indigo, distinct from primary blue and violet feedback */
  --indigo: rgb(79, 70, 229);
  --indigo-soft: rgba(79, 70, 229, 0.12);
  --shadow-sm: 0 1px 2px -1px rgba(0,0,0,0.1), 0 1px 3px 0 rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.05), 0 2px 4px -2px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  gap: 24px;
  font-family: "Nunito Sans", "Nimbus Sans", system-ui, sans-serif;
  font-size: 14px;
  line-height: 20px;
}

.agency-dashboard-exact h1,
.agency-dashboard-exact h2,
.agency-dashboard-exact h3 {
  font-family: "Inter", system-ui, sans-serif !important;
  margin: 0;
}

.agency-dashboard-exact .hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.agency-dashboard-exact .breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 6px;
}

.agency-dashboard-exact .hero h1 {
  font-size: 30px;
  font-weight: 700;
  line-height: 36px;
  color: var(--text);
  margin-top: 8px;
}

.agency-dashboard-exact .hero p {
  color: var(--muted);
  margin: 8px 0 0;
  max-width: 600px;
}

.agency-dashboard-exact .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border-radius: 14px !important;
  font-family: inherit !important;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid transparent;
  cursor: pointer;
}

.agency-dashboard-exact .btn-secondary {
  background: #fff !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
  box-shadow: var(--shadow-sm);
}

.agency-dashboard-exact .btn-primary {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
  box-shadow: var(--shadow-sm);
}

.agency-dashboard-exact .hero-actions { display: flex; align-items: center; gap: 12px; }

.agency-dashboard-exact .filters {
  display: flex;
  gap: 16px;
  justify-content: flex-end;
}
.agency-dashboard-exact .dashboard-exact-filters-form {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}
.agency-dashboard-exact .filter { display: flex; flex-direction: column; gap: 6px; flex: 0 0 220px; }
.agency-dashboard-exact .filter-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-transform: uppercase;
}
.agency-dashboard-exact .select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  height: 40px;
  width: 100%;
  padding: 0 40px 0 14px;
  border-radius: 12px !important;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 14px 14px;
  border: 1px solid var(--border) !important;
  color: var(--text);
  cursor: pointer;
  font-family: "Nunito Sans", "Nimbus Sans", system-ui, sans-serif;
  font-size: 14px;
  line-height: 20px;
}

.agency-dashboard-exact .select:hover {
  border-color: #cbd5e1 !important;
}

.agency-dashboard-exact .select:focus {
  border-color: #cbd5e1 !important;
  box-shadow: none !important;
  outline: none;
}

.agency-dashboard-exact .select:disabled {
  opacity: 1;
  color: var(--text);
  cursor: default;
}

.agency-dashboard-exact .stat-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 16px;
}
.agency-dashboard-exact .stat-card {
  position: relative;
  overflow: hidden;
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px !important;
  box-shadow: var(--shadow-sm);
  padding: 20px !important;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

/*
 * Left accent stripe — scoped to agency dashboard only.
 * Global `.stat-card::before { display: none !important }` (UI polish block) hides all
 * stat ::before by default; we must override with higher specificity + !important.
 * Reset top-bar rule dimensions (right/height) so the stripe is a left column, not a 2px bar.
 */
.agency-dashboard-exact .stat-card::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  left: 0 !important;
  top: 0 !important;
  bottom: 0 !important;
  right: auto !important;
  width: 5px !important;
  height: auto !important;
  background: var(--border);
  pointer-events: none;
  border-radius: 16px 0 0 16px;
  z-index: 0;
}

/* Match each stat icon pill (same hues as .stat-icon.* background + stroke) */
.agency-dashboard-exact .stat-card:has(.stat-icon.blue)::before {
  background: var(--primary);
}

.agency-dashboard-exact .stat-card:has(.stat-icon.amber)::before {
  background: var(--amber);
}

.agency-dashboard-exact .stat-card:has(.stat-icon.violet)::before {
  background: var(--violet);
}

.agency-dashboard-exact .stat-card:has(.stat-icon.green)::before {
  background: var(--green);
}

.agency-dashboard-exact .stat-card:has(.stat-icon.sky)::before {
  background: var(--sky);
}

.agency-dashboard-exact .stat-card:has(.stat-icon.slate)::before {
  background: var(--muted);
}

.agency-dashboard-exact .stat-card:has(.stat-icon.draft)::before {
  background: var(--indigo);
}

.agency-dashboard-exact .stat-card:has(.stat-icon.cancelled)::before {
  background: var(--red);
}

.agency-dashboard-exact .stat-card:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.25) !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.agency-dashboard-exact .stat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.agency-dashboard-exact .stat-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.agency-dashboard-exact .stat-icon i {
  font-size: 13px !important;
  line-height: 1 !important;
  display: block;
}
.agency-dashboard-exact .stat-icon.blue { background: var(--primary-soft); color: var(--primary); }
.agency-dashboard-exact .stat-icon.amber { background: var(--amber-soft); color: var(--amber); }
.agency-dashboard-exact .stat-icon.violet { background: var(--violet-soft); color: var(--violet); }
.agency-dashboard-exact .stat-icon.violet i { font-size: 12px !important; transform: translateY(0.5px); }
.agency-dashboard-exact .stat-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}
.agency-dashboard-exact .stat-icon.green { background: var(--green-soft); color: var(--green); }
.agency-dashboard-exact .stat-icon.sky { background: var(--sky-soft); color: var(--sky); }
.agency-dashboard-exact .stat-icon.slate { background: var(--border-soft); color: var(--muted); }
.agency-dashboard-exact .stat-icon.draft { background: var(--indigo-soft); color: var(--indigo); }
.agency-dashboard-exact .stat-icon.cancelled { background: var(--red-soft); color: var(--red); }
.agency-dashboard-exact .stat-value {
  font-family: "Inter", system-ui, sans-serif !important;
  font-weight: 700 !important;
  font-size: 30px !important;
  line-height: 36px;
  margin-top: 10px;
}
.agency-dashboard-exact .stat-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* Client list queue — tab counts & row status pills (same tokens as dashboard stat cards) */
.agency-dashboard-exact .queue-exact-count {
  border: 0 !important;
  box-shadow: none !important;
}

.agency-dashboard-exact .queue-exact-count--all {
  background: var(--border-soft) !important;
  color: var(--muted) !important;
}

.agency-dashboard-exact .queue-exact-count--draft {
  background: var(--indigo-soft) !important;
  color: var(--indigo) !important;
}

.agency-dashboard-exact .queue-exact-count--pending {
  background: var(--amber-soft) !important;
  color: var(--amber) !important;
}

.agency-dashboard-exact .queue-exact-count--feedback {
  background: var(--violet-soft) !important;
  color: var(--violet) !important;
}

.agency-dashboard-exact .queue-exact-count--approved {
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
}

.agency-dashboard-exact .queue-exact-count--scheduled {
  background: var(--sky-soft) !important;
  color: var(--sky) !important;
}

.agency-dashboard-exact .queue-exact-count--live {
  background: var(--green-soft) !important;
  color: var(--green) !important;
}

.agency-dashboard-exact .queue-exact-count--cancelled {
  background: var(--red-soft) !important;
  color: var(--red) !important;
}

.agency-dashboard-exact .queue-exact-inline-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.35;
  text-transform: none;
  border: 0;
}

.agency-dashboard-exact .queue-exact-inline-badge--draft {
  background: var(--indigo-soft);
  color: var(--indigo);
}

.agency-dashboard-exact .queue-exact-inline-badge--pending {
  background: var(--amber-soft);
  color: var(--amber);
}

.agency-dashboard-exact .queue-exact-inline-badge--feedback {
  background: var(--violet-soft);
  color: var(--violet);
}

.agency-dashboard-exact .queue-exact-inline-badge--approved {
  background: var(--primary-soft);
  color: var(--primary);
}

.agency-dashboard-exact .queue-exact-inline-badge--scheduled {
  background: var(--sky-soft);
  color: var(--sky);
}

.agency-dashboard-exact .queue-exact-inline-badge--live {
  background: var(--green-soft);
  color: var(--green);
}

.agency-dashboard-exact .queue-exact-inline-badge--cancelled {
  background: var(--red-soft);
  color: var(--red);
}

/* Active queue tab: solid fill per status (dashboard-aligned), not global teal */
.agency-dashboard-exact .queue-status-tabs .queue-tab.active {
  background: var(--muted) !important;
  color: #fff !important;
}

.agency-dashboard-exact .queue-status-tabs .queue-tab.active[data-queue-tab="all"] {
  background: var(--muted) !important;
}

.agency-dashboard-exact .queue-status-tabs .queue-tab.active[data-queue-tab="draft"] {
  background: var(--indigo) !important;
}

.agency-dashboard-exact .queue-status-tabs .queue-tab.active[data-queue-tab="pending"] {
  background: var(--amber) !important;
}

.agency-dashboard-exact .queue-status-tabs .queue-tab.active[data-queue-tab="feedback"] {
  background: var(--violet) !important;
}

.agency-dashboard-exact .queue-status-tabs .queue-tab.active[data-queue-tab="approved"] {
  background: var(--primary) !important;
}

.agency-dashboard-exact .queue-status-tabs .queue-tab.active[data-queue-tab="scheduled"] {
  background: var(--sky) !important;
}

.agency-dashboard-exact .queue-status-tabs .queue-tab.active[data-queue-tab="live"] {
  background: var(--green) !important;
  color: #fff !important;
}

.agency-dashboard-exact .queue-status-tabs .queue-tab.active[data-queue-tab="cancelled"] {
  background: var(--red) !important;
}

.agency-dashboard-exact .queue-status-tabs .queue-tab.active .queue-tab-label {
  color: #fff !important;
}

.agency-dashboard-exact .queue-status-tabs .queue-tab.active .queue-exact-count {
  background: #fff !important;
}

.agency-dashboard-exact .queue-status-tabs .queue-tab.active[data-queue-tab="all"] .queue-exact-count {
  color: var(--muted) !important;
}

.client-posts-list-exact .queue-status-tabs .queue-tab.active[data-queue-tab="all"] {
  background: var(--primary) !important;
}

.client-posts-list-exact .queue-status-tabs .queue-tab.active[data-queue-tab="all"] .queue-exact-count {
  color: var(--primary) !important;
}

.client-dashboard-exact .stat-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

@media (max-width: 1400px) {
  .client-dashboard-exact .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .client-dashboard-exact .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 576px) {
  .client-dashboard-exact .stat-grid {
    grid-template-columns: 1fr;
  }
}

.client-reports-load-btn {
  background: var(--c-agency-blue) !important;
  border-color: var(--c-agency-blue) !important;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24) !important;
}

.client-reports-load-btn:hover,
.client-reports-load-btn:focus {
  background: var(--c-agency-blue-hover) !important;
  border-color: var(--c-agency-blue-hover) !important;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.30) !important;
}

.create-agency-user-page .create-post-actions .btn-primary {
  background: var(--c-agency-blue) !important;
  border-color: var(--c-agency-blue) !important;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.24) !important;
}

.create-agency-user-page .create-post-actions .btn-primary:hover,
.create-agency-user-page .create-post-actions .btn-primary:focus {
  background: var(--c-agency-blue-hover) !important;
  border-color: var(--c-agency-blue-hover) !important;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.30) !important;
}

.create-agency-user-page .form-check-input:checked {
  background-color: var(--c-agency-blue) !important;
  border-color: var(--c-agency-blue) !important;
}

.create-agency-user-page .form-check-input:focus {
  border-color: var(--c-agency-blue) !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22) !important;
}

.agency-dashboard-exact .queue-status-tabs .queue-tab.active[data-queue-tab="draft"] .queue-exact-count {
  color: var(--indigo) !important;
}

.agency-dashboard-exact .queue-status-tabs .queue-tab.active[data-queue-tab="pending"] .queue-exact-count {
  color: var(--amber) !important;
}

.agency-dashboard-exact .queue-status-tabs .queue-tab.active[data-queue-tab="feedback"] .queue-exact-count {
  color: var(--violet) !important;
}

.agency-dashboard-exact .queue-status-tabs .queue-tab.active[data-queue-tab="approved"] .queue-exact-count {
  color: var(--primary) !important;
}

.agency-dashboard-exact .queue-status-tabs .queue-tab.active[data-queue-tab="scheduled"] .queue-exact-count {
  color: var(--sky) !important;
}

.agency-dashboard-exact .queue-status-tabs .queue-tab.active[data-queue-tab="live"] .queue-exact-count {
  color: var(--green) !important;
}

.agency-dashboard-exact .queue-status-tabs .queue-tab.active[data-queue-tab="cancelled"] .queue-exact-count {
  color: var(--red) !important;
}

.agency-dashboard-exact .card {
  background: #fff !important;
  border: 1px solid var(--border) !important;
  border-radius: 20px !important;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.agency-dashboard-exact .card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
}
.agency-dashboard-exact .card-title { display: flex; align-items: center; gap: 12px; }
.agency-dashboard-exact .card-head-right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.agency-dashboard-exact .card-title h2 {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.agency-dashboard-exact .icon-badge {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.agency-dashboard-exact .icon-badge svg {
  width: 18px;
  height: 18px;
  display: block;
}
.agency-dashboard-exact .link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.agency-dashboard-exact .table-search {
  width: 260px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  color: var(--muted);
  background: #fff;
}
.agency-dashboard-exact .table-search input {
  border: 0;
  outline: 0;
  width: 100%;
  font: inherit;
  color: var(--text);
  background: transparent;
}
.agency-dashboard-exact .table-bulk-bar {
  width: 100%;
  display: none;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  background: #fbfcff;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border);
}
.agency-dashboard-exact .table-bulk-count {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
}
.agency-dashboard-exact .table-bulk-select {
  height: 34px;
  min-width: 170px;
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 0 32px 0 12px;
  font-size: 13px;
  color: var(--text);
  background: #fff;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' width='14' height='14' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
.agency-dashboard-exact .table-bulk-apply {
  height: 34px !important;
  border-radius: 11px !important;
  padding: 0 14px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}
.agency-dashboard-exact .table-bulk-clear {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin-left: auto;
  padding: 0;
}
.agency-dashboard-exact .table-bulk-clear:hover {
  color: var(--text);
  text-decoration: underline;
}
.agency-dashboard-exact .posts-select-all,
.agency-dashboard-exact .post-row-cb {
  width: 14px;
  height: 14px;
  accent-color: var(--primary);
}

/* Agency users list — avatar tint matches post editor platform card selected bg */
.agency-dashboard-exact .user-avatar {
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
  border-color: var(--border) !important;
}

/* Agency user edit — permission checkboxes match dashboard recent-posts checkboxes */
.agency-dashboard-exact .agency-post-editor .form-check-input {
  accent-color: var(--primary);
}
.agency-dashboard-exact .agency-post-editor .form-check-input:checked {
  background-color: var(--primary) !important;
  border-color: var(--primary) !important;
}
.agency-dashboard-exact .agency-post-editor .form-check-input:focus {
  box-shadow: 0 0 0 3px var(--primary-soft) !important;
  border-color: var(--primary) !important;
}
.agency-dashboard-exact .badge-soft {
  background: var(--border-soft);
  color: var(--muted);
  border-radius: 999px;
  height: 26px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  font-weight: 600;
}

.agency-dashboard-exact table { width: 100%; border-collapse: collapse; }
.agency-dashboard-exact thead th {
  text-align: left;
  font-size: 11px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em;
  color: var(--muted) !important;
  text-transform: uppercase;
  padding: 14px 24px !important;
  background: #fafafa !important;
  border-bottom: 1px solid var(--border) !important;
}
.agency-dashboard-exact tbody td {
  padding: 18px 24px !important;
  border-bottom: 1px solid var(--border) !important;
  vertical-align: middle;
}
.agency-dashboard-exact tbody tr:last-child td { border-bottom: 0 !important; }
.agency-dashboard-exact tbody tr { position: relative; }
.agency-dashboard-exact tbody tr:hover { background: #fafbfc; z-index: 2; }

.agency-dashboard-exact .post-title { display: flex; align-items: center; gap: 12px; }
.agency-dashboard-exact .post-thumb {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  flex: 0 0 44px;
  background: linear-gradient(135deg, #e0e7ff, #fce7f3);
  position: relative;
  overflow: hidden;
}
.agency-dashboard-exact .post-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0) 0 8px, rgba(255,255,255,0.25) 8px 9px);
}
.agency-dashboard-exact .post-thumb.has-image::after { display: none; }
.agency-dashboard-exact .post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.agency-dashboard-exact .post-thumb.grad-b { background: linear-gradient(135deg, #dbeafe, #cffafe); }
.agency-dashboard-exact .post-thumb.grad-c { background: linear-gradient(135deg, #fef3c7, #fde68a); }
.agency-dashboard-exact .post-thumb.grad-d { background: linear-gradient(135deg, #ecfccb, #d1fae5); }
.agency-dashboard-exact .post-thumb.grad-e { background: linear-gradient(135deg, #fae8ff, #ede9fe); }
.agency-dashboard-exact .post-thumb.grad-f { background: linear-gradient(135deg, #fee2e2, #fed7aa); }
.agency-dashboard-exact .post-meta .t { font-weight: 700; color: var(--text); }
.agency-dashboard-exact .post-meta .d { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Recent posts table: text links (title, client, creator) — theme blue on hover */
.agency-dashboard-exact .recent-posts-inline-link {
  text-decoration: none;
  color: inherit;
  transition: color 0.12s ease;
}
.agency-dashboard-exact .post-meta .t .recent-posts-inline-link {
  color: var(--text);
}
.agency-dashboard-exact .recent-posts-created-by .recent-posts-inline-link {
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.agency-dashboard-exact .post-meta .t .recent-posts-inline-link:hover,
.agency-dashboard-exact .client-cell > .recent-posts-inline-link:hover,
.agency-dashboard-exact .recent-posts-created-by .recent-posts-inline-link:hover {
  color: var(--primary) !important;
}

.agency-dashboard-exact .client-cell { display: inline-flex; align-items: center; gap: 8px; }
.agency-dashboard-exact .client-dot {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 11px;
}
.agency-dashboard-exact .client-dot.has-logo {
  background: #fff;
  padding: 2px;
  overflow: hidden;
}
.agency-dashboard-exact .client-dot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}
.agency-dashboard-exact .dot-ads { background: var(--amber-soft); color: var(--amber); }
.agency-dashboard-exact .dot-nep { background: var(--green-soft); color: var(--green); }
.agency-dashboard-exact .dot-gm { background: var(--sky-soft); color: var(--sky); }
.agency-dashboard-exact .dot-lm { background: var(--violet-soft); color: var(--violet); }

.agency-dashboard-exact .platforms { display: inline-flex; align-items: center; gap: 0; }
.agency-dashboard-exact .platform {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: -6px;
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}
.agency-dashboard-exact .platform:first-child { margin-left: 0; }
.agency-dashboard-exact .platform.ig { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af); color: #fff; }
.agency-dashboard-exact .platform.fb { background: #1877f2; color: #fff; }
.agency-dashboard-exact .platform.sc { background: #fffc00; color: #111827; }
.agency-dashboard-exact .platform.tw { background: #0f172a; color: #fff; }
.agency-dashboard-exact .platform.li { background: #0a66c2; color: #fff; }
.agency-dashboard-exact .platform.yt { background: #ef4444; color: #fff; }
.agency-dashboard-exact .platform.tk { background: #0f172a; color: #fff; }

.agency-dashboard-exact .badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px !important;
  font-weight: 700;
  font-size: 12px;
}
.agency-dashboard-exact .badge .bdot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
}
.agency-dashboard-exact .badge.pending { background: var(--amber-soft); color: var(--amber); }
.agency-dashboard-exact .badge.feedback { background: #fee2e2; color: #dc2626; }
.agency-dashboard-exact .badge.approved { background: var(--primary-soft); color: var(--primary); }
.agency-dashboard-exact .badge.scheduled { background: var(--violet-soft); color: var(--violet); }
.agency-dashboard-exact .badge.live { background: var(--green-soft); color: var(--green); }
.agency-dashboard-exact .badge.draft { background: #f3f4f6; color: #374151; border: 1px solid #9ca3af; }

/* Generate Link button — site primary blue */
.btn-generate-link {
  background-color: #2563EB;
  border-color: #2563EB;
  color: #fff;
  font-weight: 600;
  white-space: nowrap;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn-generate-link:hover:not(:disabled) {
  background-color: #1D4ED8;
  border-color: #1D4ED8;
  color: #fff;
  box-shadow: 0 2px 8px rgba(37,99,235,0.35);
}
.btn-generate-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.3);
}
.btn-generate-link:disabled {
  background-color: #93c5fd;
  border-color: #93c5fd;
  color: #fff;
  opacity: 0.7;
  cursor: not-allowed;
}
.agency-dashboard-exact .badge-info {
  background: var(--primary-soft) !important;
  color: var(--primary) !important;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15) !important;
}

.agency-dashboard-exact th.sortable-col {
  cursor: pointer;
  user-select: none;
}

.agency-dashboard-exact th.sortable-col .sortable-label {
  display: inline-block;
  vertical-align: middle;
}

.agency-dashboard-exact th.sortable-col .sort-icon {
  display: inline-block;
  margin-left: 6px;
  vertical-align: middle;
  font-size: 15px;
  color: var(--muted);
  opacity: 0.55;
  line-height: 1;
}

.agency-dashboard-exact th.sortable-col.sort-asc .sort-icon {
  color: var(--primary);
  opacity: 1;
}

.agency-dashboard-exact th.sortable-col.sort-asc .sort-icon::before {
  content: "↑";
}

.agency-dashboard-exact th.sortable-col.sort-desc .sort-icon {
  color: var(--primary);
  opacity: 1;
}

.agency-dashboard-exact th.sortable-col.sort-desc .sort-icon::before {
  content: "↓";
}

.agency-dashboard-exact th.sortable-col .sort-icon::before {
  content: "↕";
}

.agency-dashboard-exact .actions-cell { display: inline-flex; gap: 6px; }
.agency-dashboard-exact .queue-icon-btn.recent-posts-action-btn {
  width: 32px !important;
  height: 32px !important;
  border-radius: 10px !important;
  border: 1px solid var(--border) !important;
  background: #fff !important;
  color: var(--muted) !important;
  font-size: 14px !important;
}
.agency-dashboard-exact .queue-icon-btn.recent-posts-action-btn:hover {
  background: var(--border-soft) !important;
  border-color: var(--border) !important;
  color: var(--text) !important;
}
.agency-dashboard-exact .queue-icon-btn.recent-posts-action-btn.btn-outline-danger,
.agency-dashboard-exact .queue-icon-btn.recent-posts-action-btn.border-danger {
  border-color: var(--red) !important;
  color: var(--red) !important;
}
.agency-dashboard-exact .queue-icon-btn.recent-posts-action-btn.btn-outline-danger:hover,
.agency-dashboard-exact .queue-icon-btn.recent-posts-action-btn.border-danger:hover {
  background: #fee2e2 !important;
  border-color: var(--red) !important;
  color: #dc2626 !important;
}
.agency-dashboard-exact .recent-posts-action-btn {
  position: relative;
  z-index: 1;
}
.agency-dashboard-exact .recent-posts-action-btn:hover {
  z-index: 1100;
}
.agency-dashboard-exact .recent-posts-action-btn::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  background: #0f172a;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 7px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 1100;
}
.agency-dashboard-exact .recent-posts-action-btn::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  transform: translateX(-50%) translateY(4px);
  border-width: 5px 5px 0 5px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 1100;
}
.agency-dashboard-exact .recent-posts-action-btn:hover::after,
.agency-dashboard-exact .recent-posts-action-btn:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.agency-dashboard-exact .iconbtn-sm {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.agency-dashboard-exact .iconbtn-sm:hover { background: var(--border-soft); color: var(--text); }
.agency-dashboard-exact .iconbtn-sm svg {
  width: 14px;
  height: 14px;
  display: block;
}

.agency-dashboard-exact .table-foot {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 13px;
}
.agency-dashboard-exact .pager { display: inline-flex; gap: 6px; }
.agency-dashboard-exact .page {
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
}
.agency-dashboard-exact .page.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Client board hero controls (date/status + view switch) */
.agency-dashboard-exact .client-board-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}
.agency-dashboard-exact .client-board-hero-copy h1 {
  font-size: 30px;
  font-weight: 700;
  line-height: 36px;
  color: var(--text);
}
.agency-dashboard-exact .client-board-hero-copy p {
  color: var(--muted) !important;
  margin-top: 6px;
}
.agency-dashboard-exact .client-board-hero-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: nowrap;
}
.agency-dashboard-exact .client-board-filter-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-left: 0;
  justify-content: flex-start;
}
.agency-dashboard-exact .client-board-filter-form .filter {
  flex: 0 0 220px;
}
.agency-dashboard-exact .client-board-filter-form #boardDateRangeInput {
  min-width: 250px;
}
.agency-dashboard-exact .client-board-filter-form #boardStatusSelect,
.agency-dashboard-exact .client-board-filter-form #boardPlatformSelect {
  min-width: 170px;
}
.agency-dashboard-exact .client-board-view-switch {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px;
  box-shadow: var(--shadow-sm);
  background: #fff;
  overflow: visible !important;
}
.agency-dashboard-exact .client-board-view-switch .view-switch-btn {
  border: 0 !important;
  border-radius: 8px !important;
  min-width: 34px;
  height: 32px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}
.agency-dashboard-exact .client-board-view-switch .view-switch-btn:not(:first-child) {
  border-left: 0 !important;
}
.agency-dashboard-exact .client-board-view-switch .view-switch-btn.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  color: #fff !important;
}
.agency-dashboard-exact .client-board-view-switch .view-switch-btn.active i {
  color: #fff !important;
}
.agency-dashboard-exact .client-board-view-switch .view-switch-btn {
  position: relative;
}
.agency-dashboard-exact .client-board-view-switch .view-switch-btn::after {
  content: attr(data-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%) translateY(4px);
  background: #0f172a;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  font-weight: 600;
  padding: 6px 8px;
  border-radius: 7px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 8;
}
.agency-dashboard-exact .client-board-view-switch .view-switch-btn::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  transform: translateX(-50%) translateY(4px);
  border-width: 5px 5px 0 5px;
  border-style: solid;
  border-color: #0f172a transparent transparent transparent;
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease, transform .15s ease;
  z-index: 8;
}
.agency-dashboard-exact .client-board-view-switch .view-switch-btn:hover::after,
.agency-dashboard-exact .client-board-view-switch .view-switch-btn:hover::before {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Client calendar reference-like styling */
.agency-dashboard-exact .calendar-container {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 0;
  overflow: hidden;
}

.agency-dashboard-exact .calendar-container .fc .fc-toolbar.fc-header-toolbar {
  margin: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.agency-dashboard-exact .calendar-container .fc .fc-toolbar-title {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #0f172a;
}

.agency-dashboard-exact .calendar-container .fc .fc-button {
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  color: #0f172a;
  box-shadow: none;
  padding: 0 14px;
  font-weight: 600;
  font-size: 14px;
}

.agency-dashboard-exact .calendar-container .fc .fc-button:hover {
  background: var(--border-soft);
}

.agency-dashboard-exact .calendar-container .fc .fc-button-primary:not(:disabled):active,
.agency-dashboard-exact .calendar-container .fc .fc-button-primary:not(:disabled).fc-button-active {
  background: #fff;
  color: #0f172a;
  border-color: var(--border);
}

.agency-dashboard-exact .calendar-container .fc .fc-prev-button,
.agency-dashboard-exact .calendar-container .fc .fc-next-button {
  width: 36px;
  min-width: 36px;
  padding: 0;
}

.agency-dashboard-exact .calendar-container .fc .fc-daygrid-day-top {
  justify-content: flex-start;
  padding: 10px 12px 0;
}

.agency-dashboard-exact .calendar-container .fc .fc-daygrid-day-number {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  padding: 0;
}

.agency-dashboard-exact .calendar-container .fc .fc-day-other .fc-daygrid-day-number {
  color: #cbd5e1;
}

.agency-dashboard-exact .calendar-container .fc .fc-day-today .fc-daygrid-day-number {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.agency-dashboard-exact .calendar-container .fc .fc-col-header-cell {
  background: var(--border-soft);
}

.agency-dashboard-exact .calendar-container .fc .fc-col-header-cell-cushion {
  padding: 14px 16px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
}

.agency-dashboard-exact .calendar-container .fc .fc-daygrid-day-frame {
  min-height: 148px;
}

.agency-dashboard-exact .calendar-container .fc .fc-daygrid-day-events {
  margin: 6px 8px 8px;
}

.agency-dashboard-exact .calendar-container .fc .fc-daygrid-event {
  border: 0;
  margin-top: 4px;
}

.agency-dashboard-exact .calendar-ref-event {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  width: 100%;
}

.agency-dashboard-exact .calendar-ref-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 14px;
}

.agency-dashboard-exact .calendar-ref-dot i {
  font-size: 11px;
}

.agency-dashboard-exact .calendar-ref-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agency-dashboard-exact .calendar-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: flex-start;
  text-align: left;
  color: #64748b;
  font-size: 13px;
  padding: 10px 2px 0;
}

.agency-dashboard-exact .calendar-legend-inline {
  padding: 0;
  margin-left: 0;
  margin-right: auto;
  flex: 0 0 auto;
}

.agency-dashboard-exact .calendar-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.agency-dashboard-exact .calendar-legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.agency-dashboard-exact .calendar-legend-swatch.live { background: #10b981; }
.agency-dashboard-exact .calendar-legend-swatch.scheduled { background: #6366f1; }
.agency-dashboard-exact .calendar-legend-swatch.pending { background: #f59e0b; }
.agency-dashboard-exact .calendar-legend-swatch.feedback { background: #ef4444; }
.agency-dashboard-exact .calendar-legend-swatch.draft { background: #6b7280; }

.agency-dashboard-exact .tweaks {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(15,23,42,0.12);
  padding: 14px 16px;
  display: none;
  min-width: 240px;
}

@media (max-width: 1400px) {
  .agency-dashboard-exact .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 768px) {
  .agency-dashboard-exact .hero { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .agency-dashboard-exact .stat-grid { grid-template-columns: repeat(2, 1fr); }
}

.agency-post-editor {
  --editor-border: #e2e8f0;
  --editor-border-soft: #f1f5f9;
  --editor-text: #0f172a;
  --editor-muted: #64748b;
  /* Match .agency-dashboard-exact --primary / --primary-soft (blue buttons) */
  --editor-primary: rgb(37, 99, 235);
  --editor-primary-soft: rgba(37, 99, 235, 0.1);
}

.agency-post-editor .page-hero {
  background: #fff;
  border: 1px solid var(--editor-border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 18px 24px;
  margin-bottom: 16px;
}

.agency-post-editor .page-hero h1 {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 28px;
  margin: 0;
}

.agency-post-editor .page-hero .sub {
  color: var(--editor-muted);
  margin-top: 4px;
  font-size: 13px;
}

.agency-post-editor .post-form-card,
.agency-post-editor .post-preview-card {
  border: 1px solid var(--editor-border) !important;
  border-radius: 18px !important;
  overflow: hidden;
}

.agency-post-editor .post-form-card .card-body {
  padding: 22px 24px !important;
}

.agency-post-editor .modern-field-group {
  margin-bottom: 18px;
}

.agency-post-editor .modern-label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  color: var(--editor-text);
  margin-bottom: 6px;
}

.agency-post-editor .modern-input,
.agency-post-editor .form-select.modern-input,
.agency-post-editor textarea.form-control {
  border-radius: 10px !important;
  border: 1px solid var(--editor-border) !important;
  background: #fff;
  color: var(--editor-text) !important;
  min-height: 40px;
  box-shadow: none !important;
}

.agency-post-editor .modern-input:focus,
.agency-post-editor .form-select.modern-input:focus,
.agency-post-editor textarea.form-control:focus {
  border-color: var(--editor-primary) !important;
  box-shadow: 0 0 0 3px var(--editor-primary-soft) !important;
}

.agency-post-editor .modern-input:disabled,
.agency-post-editor .form-select.modern-input:disabled,
.agency-post-editor textarea.form-control:disabled {
  background: #f1f5f9 !important;
  color: #64748b !important;
  cursor: not-allowed;
}

.agency-post-editor textarea.form-control {
  min-height: 140px !important;
  padding: 12px 14px;
}

.agency-post-editor .select2-container--default .select2-selection--single {
  border-radius: 10px !important;
  border: 1px solid var(--editor-border) !important;
  background: #fff !important;
  height: 40px !important;
  min-height: 40px !important;
  padding: 0 12px !important;
}

.agency-post-editor .select2-container--default .select2-selection--single .select2-selection__rendered {
  line-height: 38px !important;
  font-size: 14px;
  font-weight: 600;
  color: var(--editor-text);
}

.agency-post-editor .select2-container--default .select2-selection--single .select2-selection__arrow {
  height: 38px !important;
}

.agency-post-editor #platformCardsContainer {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.agency-post-editor .platform-card {
  border-radius: 10px !important;
  border: 1px solid var(--editor-border) !important;
  background: #fff !important;
  min-height: 44px;
  padding: 10px 12px !important;
}

.agency-post-editor .platform-card.selected {
  border-color: var(--editor-primary) !important;
  background: var(--editor-primary-soft) !important;
}

.agency-post-editor .platform-card.selected .platform-card-text strong {
  color: var(--editor-primary) !important;
}

/* Edit client — platform tabs: theme blue (icons + label), not per-network brand colors */
.agency-post-editor .client-status-heading-icon {
  color: var(--editor-primary) !important;
}

.agency-post-editor .platform-tabs-wrapper {
  overflow-x: visible;
  min-width: 0;
}
.agency-post-editor ul.platform-info-tabs {
  display: flex !important;
  flex-wrap: wrap !important;
  overflow-x: visible;
  width: 100%;
  row-gap: 8px;
  column-gap: 2px;
  border-bottom: 1px solid var(--editor-border) !important;
}
.agency-post-editor ul.platform-info-tabs .nav-link.platform-tab-nav-btn {
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: 8px 8px 0 0;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  color: var(--editor-muted) !important;
  background: transparent !important;
  border: 1px solid transparent !important;
  border-bottom: none !important;
  text-decoration: none !important;
}
.agency-post-editor ul.platform-info-tabs .nav-link.platform-tab-nav-btn .platforms {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.agency-post-editor ul.platform-info-tabs .nav-link.platform-tab-nav-btn .platform-tab-nav-label {
  font-weight: 600;
}
.agency-post-editor ul.platform-info-tabs .nav-link.platform-tab-nav-btn:hover:not(.active) {
  background: var(--editor-border-soft) !important;
  color: var(--editor-primary) !important;
}
.agency-post-editor ul.platform-info-tabs .nav-link.platform-tab-nav-btn.active {
  background: #fff !important;
  color: var(--editor-primary) !important;
  border: 1px solid var(--editor-border) !important;
  border-bottom-color: #fff !important;
  margin-bottom: -1px;
  font-weight: 700;
}

.agency-post-editor .emoji-trigger {
  margin-top: 10px;
  height: 34px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 14px !important;
  border: 1px solid var(--editor-border) !important;
  background: #fff !important;
  color: var(--editor-text) !important;
  box-shadow: var(--shadow-sm);
}

.agency-post-editor .emoji-trigger:hover,
.agency-post-editor .emoji-trigger:focus {
  background: var(--editor-border-soft) !important;
  color: var(--editor-text) !important;
}

.agency-post-editor .modern-field-group:has(+ .create-post-actions) {
  margin-bottom: 0;
}

.agency-post-editor .file-upload-zone {
  border: 2px dashed #cbd5e1 !important;
  border-radius: 14px !important;
  background: #fafbfc !important;
  padding: 32px 20px !important;
}

.agency-post-editor .file-upload-icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: var(--editor-primary-soft) !important;
  color: var(--editor-primary) !important;
  font-size: 22px;
}

/* Override global .file-upload-icon i { color: var(--c-primary) !important } (teal) */
.agency-post-editor .file-upload-icon i {
  color: var(--editor-primary) !important;
}

.agency-post-editor .create-post-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.agency-post-editor .create-post-actions .btn {
  border-radius: 14px;
  height: 40px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 600;
}

.agency-post-editor .create-post-actions .btn-primary {
  background: var(--editor-primary) !important;
  border-color: var(--editor-primary) !important;
  color: #fff !important;
  box-shadow: var(--shadow-sm);
}

.agency-post-editor .create-post-actions .btn-primary:hover,
.agency-post-editor .create-post-actions .btn-primary:focus {
  background: var(--editor-primary) !important;
  border-color: var(--editor-primary) !important;
  color: #fff !important;
  filter: brightness(1.05);
}

.agency-post-editor .create-post-actions .btn-outline-secondary {
  background: #fff !important;
  border-color: var(--editor-border) !important;
  color: var(--editor-text) !important;
  box-shadow: var(--shadow-sm);
}

.agency-post-editor .create-post-actions .btn-outline-secondary:hover,
.agency-post-editor .create-post-actions .btn-outline-secondary:focus {
  background: var(--editor-border-soft) !important;
  border-color: var(--editor-border) !important;
  color: var(--editor-text) !important;
}

.agency-post-editor .post-preview-card {
  position: sticky;
  top: 92px;
}

.agency-post-editor .post-live-preview-card .preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--editor-border);
  background: #fff;
}

.agency-post-editor .preview-head-title {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  line-height: 1.25;
  color: var(--editor-text);
}

.agency-post-editor .preview-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.agency-post-editor .preview-status-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: currentColor;
  flex-shrink: 0;
}

.agency-post-editor .preview-status-pill--teal {
  background: var(--editor-primary-soft);
  color: var(--editor-primary);
}

.agency-post-editor .preview-status-pill--sky {
  background: #e0f2fe;
  color: #0369a1;
}

.agency-post-editor .preview-status-pill--amber {
  background: #fef3c7;
  color: #b45309;
}

.agency-post-editor .preview-status-pill--danger {
  background: #fee2e2;
  color: #b91c1c;
}

.agency-post-editor .preview-status-pill--neutral {
  background: var(--editor-border-soft);
  color: var(--editor-muted);
}

.agency-post-editor .preview-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--editor-border);
  background: #fff;
}

.agency-post-editor .preview-pt {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--editor-border);
  background: #fff;
  cursor: pointer;
  color: var(--editor-muted);
  padding: 0;
  line-height: 1;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.agency-post-editor .preview-pt:hover {
  background: var(--editor-border-soft);
  color: var(--editor-text);
}

.agency-post-editor .preview-pt.active {
  background: var(--editor-primary-soft);
  border-color: var(--editor-primary);
  color: var(--editor-primary);
}

.agency-post-editor .preview-gicon {
  width: 18px;
  height: 18px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 10px;
  line-height: 1;
}

.agency-post-editor .preview-pt.active .preview-gicon {
  outline: 2px solid var(--editor-primary);
  outline-offset: 1px;
}

.agency-post-editor .preview-gicon.ig {
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
}

.agency-post-editor .preview-gicon.fb {
  background: #1877f2;
}

.agency-post-editor .preview-gicon.li {
  background: #0a66c2;
}

.agency-post-editor .preview-gicon.tw {
  background: #0f172a;
}

.agency-post-editor .preview-gicon.tk {
  background: #000;
}

.agency-post-editor .preview-gicon.yt {
  background: #ef4444;
}

.agency-post-editor .preview-gicon.sc {
  background: #fffc00;
  color: #000;
}

.agency-post-editor .post-live-preview-pane {
  padding: 0;
  background: #fff;
}

.agency-post-editor .post-preview-empty {
  padding: 28px 20px;
  font-size: 13px;
}

@media (max-width: 1400px) {
  .agency-post-editor #platformCardsContainer {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 991px) {
  .agency-post-editor .post-preview-card {
    position: static;
    top: auto;
  }
}

.agency-post-editor .agency-post-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  align-items: start;
  gap: 24px;
  --bs-gutter-x: 0;
  --bs-gutter-y: 0;
  margin-left: 0;
  margin-right: 0;
}

.agency-post-editor .agency-post-layout > .col-lg-8,
.agency-post-editor .agency-post-layout > .col-lg-4 {
  width: 100%;
  max-width: 100%;
  flex: 0 0 auto;
  padding: 0;
}

.agency-post-editor .agency-post-layout > .col-lg-4 {
  grid-column: 2;
}

.agency-post-editor .agency-post-layout > .col-lg-8 {
  grid-column: 1;
}

.agency-post-editor .post-preview-card .card-body {
  padding: 0 !important;
}

.agency-post-editor .post-preview-container {
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  min-height: 0 !important;
  padding: 0 !important;
}

/* Share views use the same IG preview markup but are outside .agency-post-editor */
#view-pending,
#view-single {
  --editor-border: #e2e8f0;
  --editor-border-soft: #f1f5f9;
  --editor-text: #0f172a;
  --editor-muted: #64748b;
  --editor-primary: rgb(37, 99, 235);
  --editor-primary-soft: rgba(37, 99, 235, 0.1);
}

/* Live preview — Instagram-style body (reference-aligned) */
.agency-post-editor .post-ig-preview,
#view-pending .post-ig-preview,
#view-single .post-ig-preview {
  max-width: 100%;
  margin: 0;
  font-family: "Nunito Sans", system-ui, sans-serif;
  font-size: 14px;
  line-height: 20px;
  color: var(--editor-text);
}

.agency-post-editor .post-ig-preview .ig-card,
#view-pending .post-ig-preview .ig-card,
#view-single .post-ig-preview .ig-card {
  padding: 14px 16px 18px;
}

.agency-post-editor .post-ig-preview .ig-row,
#view-pending .post-ig-preview .ig-row,
#view-single .post-ig-preview .ig-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.agency-post-editor .post-ig-preview .ig-user,
#view-pending .post-ig-preview .ig-user,
#view-single .post-ig-preview .ig-user {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.agency-post-editor .post-ig-preview .ig-avatar,
#view-pending .post-ig-preview .ig-avatar,
#view-single .post-ig-preview .ig-avatar {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: linear-gradient(135deg, #0f172a, #475569);
  color: #fff;
  font-weight: 800;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}

.agency-post-editor .post-ig-preview .ig-avatar-img,
#view-pending .post-ig-preview .ig-avatar-img,
#view-single .post-ig-preview .ig-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.agency-post-editor .post-ig-preview .ig-avatar-initials,
#view-pending .post-ig-preview .ig-avatar-initials,
#view-single .post-ig-preview .ig-avatar-initials {
  line-height: 1;
}

.agency-post-editor .post-ig-preview .ig-username,
#view-pending .post-ig-preview .ig-username,
#view-single .post-ig-preview .ig-username {
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agency-post-editor .post-ig-preview .ig-follow-btn,
#view-pending .post-ig-preview .ig-follow-btn,
#view-single .post-ig-preview .ig-follow-btn {
  height: 26px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--editor-primary);
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  border: 0;
  cursor: default;
  flex-shrink: 0;
}

.agency-post-editor .post-ig-preview .ig-photo,
#view-pending .post-ig-preview .ig-photo,
#view-single .post-ig-preview .ig-photo {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #fb923c, #f97316, #ea580c);
}

.agency-post-editor .post-ig-preview .ig-photo > *,
#view-pending .post-ig-preview .ig-photo > *,
#view-single .post-ig-preview .ig-photo > * {
  position: absolute;
  inset: 0;
}

.agency-post-editor .post-ig-preview .ig-photo-placeholder,
#view-pending .post-ig-preview .ig-photo-placeholder,
#view-single .post-ig-preview .ig-photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 120px;
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  font-size: 13px;
}

.agency-post-editor .post-ig-preview .ig-media-frame,
#view-pending .post-ig-preview .ig-media-frame,
#view-single .post-ig-preview .ig-media-frame {
  position: absolute;
  inset: 0;
  background: #000;
}

.agency-post-editor .post-ig-preview .ig-media-frame--video,
#view-pending .post-ig-preview .ig-media-frame--video,
#view-single .post-ig-preview .ig-media-frame--video {
  aspect-ratio: auto;
}

.agency-post-editor .post-ig-preview .ig-media-img,
#view-pending .post-ig-preview .ig-media-img,
#view-single .post-ig-preview .ig-media-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.agency-post-editor .post-ig-preview .ig-video-badge,
#view-pending .post-ig-preview .ig-video-badge,
#view-single .post-ig-preview .ig-video-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.agency-post-editor .post-ig-preview .ig-photo .carousel,
#view-pending .post-ig-preview .ig-photo .carousel,
#view-single .post-ig-preview .ig-photo .carousel {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.agency-post-editor .post-ig-preview .ig-photo .carousel-inner,
#view-pending .post-ig-preview .ig-photo .carousel-inner,
#view-single .post-ig-preview .ig-photo .carousel-inner,
.agency-post-editor .post-ig-preview .ig-photo .carousel-item,
#view-pending .post-ig-preview .ig-photo .carousel-item,
#view-single .post-ig-preview .ig-photo .carousel-item {
  height: 100%;
}

.agency-post-editor .post-ig-preview .ig-photo .carousel-control-prev,
#view-pending .post-ig-preview .ig-photo .carousel-control-prev,
#view-single .post-ig-preview .ig-photo .carousel-control-prev,
.agency-post-editor .post-ig-preview .ig-photo .carousel-control-next,
#view-pending .post-ig-preview .ig-photo .carousel-control-next,
#view-single .post-ig-preview .ig-photo .carousel-control-next {
  width: 28px;
  height: 28px;
  min-width: 28px;
  top: 50%;
  transform: translateY(-50%);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(4px);
  opacity: 1;
}

.agency-post-editor .post-ig-preview .ig-photo .carousel-control-prev,
#view-pending .post-ig-preview .ig-photo .carousel-control-prev,
#view-single .post-ig-preview .ig-photo .carousel-control-prev {
  left: 8px;
}

.agency-post-editor .post-ig-preview .ig-photo .carousel-control-next,
#view-pending .post-ig-preview .ig-photo .carousel-control-next,
#view-single .post-ig-preview .ig-photo .carousel-control-next {
  right: 8px;
}

.agency-post-editor .post-ig-preview .ig-photo .carousel-control-prev-icon,
#view-pending .post-ig-preview .ig-photo .carousel-control-prev-icon,
#view-single .post-ig-preview .ig-photo .carousel-control-prev-icon,
.agency-post-editor .post-ig-preview .ig-photo .carousel-control-next-icon,
#view-pending .post-ig-preview .ig-photo .carousel-control-next-icon,
#view-single .post-ig-preview .ig-photo .carousel-control-next-icon {
  filter: brightness(0) invert(1);
  width: 14px;
  height: 14px;
}

.agency-post-editor .post-ig-preview .ig-photo .carousel-indicators,
#view-pending .post-ig-preview .ig-photo .carousel-indicators,
#view-single .post-ig-preview .ig-photo .carousel-indicators {
  bottom: 10px;
  margin: 0;
  gap: 4px;
}

.agency-post-editor .post-ig-preview .ig-photo .carousel-indicators [data-bs-target],
#view-pending .post-ig-preview .ig-photo .carousel-indicators [data-bs-target],
#view-single .post-ig-preview .ig-photo .carousel-indicators [data-bs-target] {
  width: 5px;
  height: 5px;
  border-radius: 999px;
  border: 0;
  margin: 0;
  background: rgba(255, 255, 255, 0.55);
}

.agency-post-editor .post-ig-preview .ig-photo .carousel-indicators .active,
#view-pending .post-ig-preview .ig-photo .carousel-indicators .active,
#view-single .post-ig-preview .ig-photo .carousel-indicators .active {
  background: #fff;
}

.agency-post-editor .post-ig-preview .ig-actions,
#view-pending .post-ig-preview .ig-actions,
#view-single .post-ig-preview .ig-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 2px 6px;
  color: var(--editor-text);
}

.agency-post-editor .post-ig-preview .ig-actions-left,
#view-pending .post-ig-preview .ig-actions-left,
#view-single .post-ig-preview .ig-actions-left {
  display: inline-flex;
  gap: 14px;
  align-items: center;
}

.agency-post-editor .post-ig-preview .ig-action-icon,
#view-pending .post-ig-preview .ig-action-icon,
#view-single .post-ig-preview .ig-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--editor-text);
  line-height: 0;
}

.agency-post-editor .post-ig-preview .ig-likes,
#view-pending .post-ig-preview .ig-likes,
#view-single .post-ig-preview .ig-likes {
  font-weight: 700;
  font-size: 13px;
  padding: 4px 2px;
}

.agency-post-editor .post-ig-preview .ig-caption,
#view-pending .post-ig-preview .ig-caption,
#view-single .post-ig-preview .ig-caption {
  font-size: 13px;
  line-height: 20px;
  color: var(--editor-text);
  padding: 4px 2px;
}

.agency-post-editor .post-ig-preview .ig-caption p,
#view-pending .post-ig-preview .ig-caption p,
#view-single .post-ig-preview .ig-caption p {
  margin: 0 0 8px;
}

.agency-post-editor .post-ig-preview .ig-caption-user,
#view-pending .post-ig-preview .ig-caption-user,
#view-single .post-ig-preview .ig-caption-user {
  font-weight: 700;
  margin-right: 4px;
}

.agency-post-editor .post-ig-preview .ig-view-comments,
#view-pending .post-ig-preview .ig-view-comments,
#view-single .post-ig-preview .ig-view-comments {
  color: var(--editor-muted);
  font-size: 13px;
  padding: 6px 2px 0;
}

/* Hashtags / mentions in live preview (align with dashboard primary blue) */
.post-preview-tag {
  color: rgb(37, 99, 235);
  font-weight: 600;
}

.agency-post-editor .status-banner-readonly {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--editor-primary-soft);
  color: var(--editor-primary);
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
}

.agency-post-editor .status-banner-readonly .check {
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: var(--editor-primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
}

.agency-post-editor .status-banner-readonly .check i {
  font-size: 14px;
  line-height: 1;
}

.agency-post-editor .file-upload-title {
  font-size: 14px;
  font-weight: 700;
}

.agency-post-editor .file-upload-subtitle,
.agency-post-editor .supported {
  font-size: 12px;
  color: var(--editor-muted);
}

.agency-post-editor .file-upload-zone .btn.btn-primary {
  border-radius: 14px;
  height: 36px;
  padding: 0 16px;
  font-weight: 600;
  background: var(--editor-primary) !important;
  border-color: var(--editor-primary) !important;
  color: #fff !important;
  box-shadow: var(--shadow-sm);
}

.agency-post-editor .file-upload-zone .btn.btn-primary:hover,
.agency-post-editor .file-upload-zone .btn.btn-primary:focus {
  background: var(--editor-primary) !important;
  border-color: var(--editor-primary) !important;
  color: #fff !important;
  filter: brightness(1.05);
}

/* Remaining primary actions in editor (matches dashboard .btn-primary) */
.agency-post-editor .btn-primary:not(:disabled):not(.disabled) {
  background: var(--editor-primary) !important;
  border-color: var(--editor-primary) !important;
  color: #fff !important;
  box-shadow: var(--shadow-sm);
}

.agency-post-editor .btn-primary:not(:disabled):not(.disabled):hover,
.agency-post-editor .btn-primary:not(:disabled):not(.disabled):focus {
  background: var(--editor-primary) !important;
  border-color: var(--editor-primary) !important;
  color: #fff !important;
  filter: brightness(1.05);
}

@media (max-width: 1399px) {
  .agency-post-editor .agency-post-layout {
    grid-template-columns: minmax(0, 1fr) 380px;
  }
}

@media (max-width: 1199px) {
  .agency-post-editor .agency-post-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .agency-post-editor .agency-post-layout > .col-lg-8,
  .agency-post-editor .agency-post-layout > .col-lg-4 {
    grid-column: 1;
  }
}

/* Post editor left column — reference-aligned */
.agency-post-editor .hint {
  display: block;
  color: var(--editor-muted);
  font-size: 12px;
  margin-top: 6px;
  line-height: 1.45;
}

.agency-post-editor .status-banner-readonly.banner {
  background: var(--editor-primary-soft);
  color: var(--editor-primary);
}

.agency-post-editor .status-banner-readonly.banner .check {
  background: var(--editor-primary);
}

.agency-post-editor .form-select.modern-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.agency-post-editor .input-with-icon.input-icon-field {
  position: relative;
}

.agency-post-editor .input-with-icon .lead-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--editor-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 1;
}

.agency-post-editor .input-with-icon .lead-icon i {
  position: static;
  transform: none;
  font-size: 16px;
}

.agency-post-editor .input-with-icon .form-control {
  padding-left: 38px;
}

.agency-post-editor .tab-row.post-editor-media-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.agency-post-editor .chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid var(--editor-border);
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--editor-text);
  cursor: pointer;
  line-height: 1;
  box-shadow: var(--shadow-sm);
}

.agency-post-editor .chip-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.agency-post-editor .chip-btn-media.active,
.agency-post-editor .chip-btn-media.active:focus-visible {
  background: var(--editor-primary-soft);
  color: var(--editor-primary);
  border-color: var(--editor-primary);
}

.agency-post-editor .chip-btn-media:not(.active):hover:not(:disabled) {
  background: var(--editor-border-soft);
}

.agency-post-editor .chip-btn i {
  font-size: 14px;
}

.agency-post-editor .file-upload-link {
  color: var(--editor-primary);
  font-weight: 700;
}

.agency-post-editor .post-editor-media-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 18px;
}

.agency-post-editor .post-editor-media-thumb {
  position: relative;
  width: 90px;
  height: 90px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--editor-border);
  flex: 0 0 auto;
}

.agency-post-editor .draggable-media-item[draggable="true"] {
  cursor: move;
}

.agency-post-editor .draggable-media-item[draggable="false"] {
  cursor: default;
}

.agency-post-editor .post-editor-media-thumb--a { background: linear-gradient(135deg, #fef3c7, #fed7aa); }
.agency-post-editor .post-editor-media-thumb--b { background: linear-gradient(135deg, #d1fae5, #a7f3d0); }
.agency-post-editor .post-editor-media-thumb--c { background: linear-gradient(135deg, #dbeafe, #e0e7ff); }
.agency-post-editor .post-editor-media-thumb--d { background: linear-gradient(135deg, #fae8ff, #fecaca); }
.agency-post-editor .post-editor-media-thumb--e { background: linear-gradient(135deg, #ccfbf1, #bae6fd); }
.agency-post-editor .post-editor-media-thumb--f { background: linear-gradient(135deg, #fed7aa, #fecaca); }

.agency-post-editor .post-editor-media-thumb-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.agency-post-editor .post-editor-thumb-move {
  position: absolute;
  left: 6px;
  top: 6px;
  z-index: 2;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.6);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
}

.agency-post-editor .post-editor-thumb-del {
  position: absolute;
  right: 6px;
  top: 6px;
  z-index: 2;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  background: #ef4444;
  color: #fff;
  border: 0;
  padding: 0;
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.agency-post-editor .post-editor-thumb-del:hover {
  filter: brightness(1.05);
}

.agency-post-editor .platform-card {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
  text-align: left;
}

.agency-post-editor .platform-icon-badge {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 8px;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: transparent;
}

/* Same badge look as dashboard recent posts (.platform.ig, .fb, …) */
.agency-post-editor .platform-icon-badge .platform.platform-editor-pill {
  width: 28px;
  height: 28px;
  min-width: 28px;
  margin: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.agency-post-editor .platform-icon-badge .platform.platform-editor-pill.ig {
  background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af);
  color: #fff;
}

.agency-post-editor .platform-icon-badge .platform.platform-editor-pill.fb {
  background: #1877f2;
  color: #fff;
}

.agency-post-editor .platform-icon-badge .platform.platform-editor-pill.tw {
  background: #0f172a;
  color: #fff;
}

.agency-post-editor .platform-icon-badge .platform.platform-editor-pill.li {
  background: #0a66c2;
  color: #fff;
}

.agency-post-editor .platform-icon-badge .platform.platform-editor-pill.tk {
  background: #0f172a;
  color: #fff;
}

.agency-post-editor .platform-icon-badge .platform.platform-editor-pill.yt {
  background: #ef4444;
  color: #fff;
}

.agency-post-editor .platform-icon-badge .platform.platform-editor-pill.sc {
  background: #fffc00;
  color: #111827;
}

.agency-post-editor .platform-card-text strong {
  font-weight: 600;
  font-size: 14px;
}

.agency-post-editor .form-foot {
  margin-top: 10px;
}

.agency-post-editor .form-foot .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 14px !important;
  font-weight: 600 !important;
  background: var(--editor-primary) !important;
  border-color: var(--editor-primary) !important;
  color: #fff !important;
  box-shadow: var(--shadow-sm);
}

.agency-post-editor .form-foot .btn-primary:hover,
.agency-post-editor .form-foot .btn-primary:focus {
  background: var(--editor-primary) !important;
  border-color: var(--editor-primary) !important;
  color: #fff !important;
  filter: brightness(1.05);
}

.agency-post-editor .form-foot .btn-lg {
  padding-top: 0;
  padding-bottom: 0;
  font-size: 14px;
}

.agency-post-editor .post-editor-btn-ghost {
  height: 40px;
  padding: 0 18px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff !important;
  border: 1px solid var(--editor-border) !important;
  color: var(--editor-text) !important;
  box-shadow: var(--shadow-sm);
}

.agency-post-editor .post-editor-btn-ghost:hover,
.agency-post-editor .post-editor-btn-ghost:focus {
  background: var(--editor-border-soft) !important;
  border-color: var(--editor-border) !important;
  color: var(--editor-text) !important;
}

.agency-post-editor .select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--editor-primary) !important;
  box-shadow: 0 0 0 3px var(--editor-primary-soft) !important;
}

/* ─── Agency reports (reference layout; global header unchanged) ─── */
.agency-reports-page {
  --bg: rgb(250, 250, 250);
  --surface: #ffffff;
  --border: rgb(226, 232, 240);
  --border-soft: rgb(241, 245, 249);
  --text: rgb(15, 23, 42);
  --muted: rgb(100, 116, 139);
  --primary: rgb(37, 99, 235);
  --primary-soft: rgba(37, 99, 235, 0.1);
  --amber: rgb(245, 158, 11);
  --green: rgb(16, 185, 129);
  --violet: rgb(139, 92, 246);
  --sky: rgb(14, 165, 233);
  --red: rgb(239, 68, 68);
  --teal: rgb(13, 148, 136);
  --pink: rgb(236, 72, 153);
  --shadow-sm: 0 1px 2px -1px rgba(0, 0, 0, 0.1), 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  display: flex;
  flex-direction: column;
  gap: 20px;
  font-family: "Nunito Sans", "Nimbus Sans", system-ui, sans-serif;
  font-size: 14px;
  line-height: 20px;
  color: var(--text);
  padding-bottom: 32px;
}

.agency-reports-page h1 {
  font-family: "Inter", system-ui, sans-serif;
  margin: 0;
}

.agency-reports-page .page-hero--reports,
.agency-dashboard-exact .page-hero--reports {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.agency-reports-page .page-hero--reports h1,
.agency-dashboard-exact .page-hero--reports h1 {
  font-size: 24px;
  font-weight: 700;
  line-height: 30px;
}

.agency-reports-page .page-hero--reports .sub,
.agency-dashboard-exact .page-hero--reports .sub {
  color: var(--muted);
  margin-top: 4px;
  font-size: 13px;
}

.agency-reports-page .hero-actions,
.agency-dashboard-exact .page-hero--reports .hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.agency-reports-page .reports-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 700;
  font-size: 13px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.agency-reports-page .reports-hero-btn:hover:not(:disabled):not(.disabled) {
  background: var(--border-soft);
  color: var(--text);
}

.agency-reports-page .reports-hero-btn:disabled,
.agency-reports-page .reports-hero-btn.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.agency-reports-page .reports-hero-btn--dark,
.agency-reports-page .reports-hero-btn--dark.disabled {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
  opacity: 1;
}

.agency-reports-page a.reports-hero-btn--dark.disabled {
  opacity: 0.45;
}

.agency-reports-page .reports-hero-btn--dark:not(.disabled):hover {
  background: #1e293b;
  color: #fff;
}

.agency-reports-page .filters-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 16px 20px;
}

.agency-reports-page .reports-filters-form {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
}

.agency-reports-page .reports-filters-form .filter {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 180px;
  min-width: 0;
}

.agency-reports-page .filter-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.agency-reports-page .reports-filter-input {
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
  font: inherit;
  color: var(--text);
  width: 100%;
  box-shadow: none;
}

.agency-reports-page .reports-filter-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
  outline: 0;
}

.agency-reports-page .form-select.reports-filter-input {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='m6 9 6 6 6-6'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.agency-reports-page .reports-btn-load {
  height: 40px;
  padding: 0 16px;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  border: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.agency-reports-page .reports-btn-load:hover {
  filter: brightness(1.05);
}

.agency-reports-page .kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.agency-reports-page .kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
}

.agency-reports-page .kpi-label-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.agency-reports-page .kpi-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.agency-reports-page .kpi-platform-badge {
  display: none;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent !important;
}

.agency-reports-page .kpi-value {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 700;
  font-size: 26px;
  line-height: 32px;
  margin-top: 6px;
}

.agency-reports-page .kpi-value.sm {
  font-size: 22px;
}

.agency-reports-page .kpi-source {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.agency-reports-page .kpi-delta {
  color: var(--green);
  font-size: 12px;
  margin-top: 6px;
  font-weight: 700;
}

.agency-reports-page .kpi-delta.down,
.agency-reports-page .kpi-delta.text-danger {
  color: var(--red) !important;
}

.agency-reports-page .kpi-delta.text-success {
  color: var(--green) !important;
}

.agency-reports-page .kpi-delta.text-muted {
  color: var(--muted) !important;
  font-weight: 600;
}

.agency-reports-page .chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.agency-reports-page .chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.agency-reports-page .chart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.agency-reports-page .chart-title {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}

.agency-reports-page .chart-menu {
  color: var(--muted);
  flex-shrink: 0;
  display: inline-flex;
}

.agency-reports-page .chart-wrap {
  position: relative;
  min-height: 300px;
}

.agency-reports-page .reports-export-menu .dropdown-item {
  font-weight: 600;
  font-size: 13px;
}

@media (max-width: 1199px) {
  .agency-reports-page .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .agency-reports-page .chart-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 575px) {
  .agency-reports-page .kpi-grid {
    grid-template-columns: 1fr;
  }
}


