/* ============================================================
   Marketing Hub — styles.css  (Light Mode · Sidebar Layout)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&display=swap');

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  --primary:        #1877F2;
  --primary-hover:  #1565D8;
  --primary-light:  #E7F0FD;
  --primary-soft:   #F0F6FF;
  --success:        #22C55E;
  --success-light:  #DCFCE7;
  --warning:        #F59E0B;
  --warning-light:  #FEF3C7;
  --danger:         #EF4444;
  --danger-light:   #FEE2E2;
  --purple:         #8B5CF6;
  --purple-light:   #EDE9FE;
  --fukuba:         #D4364B;
  --fukuba-light:   #FDECEA;
  --psoul:          #8B5CF6;
  --psoul-light:    #EDE9FE;

  --bg:             #F4F6FB;
  --bg-alt:         #EBEEf5;
  --surface:        #FFFFFF;
  --surface-hover:  #F8FAFD;
  --sidebar-bg:     #FFFFFF;

  --text:           #111827;
  --text-secondary: #6B7280;
  --text-muted:     #9CA3AF;

  --border:         #E5E7EB;

  --shadow-sm:   0 1px 3px rgba(0,0,0,.05);
  --shadow:      0 4px 16px rgba(0,0,0,.08);
  --shadow-lg:   0 8px 32px rgba(0,0,0,.12);
  --shadow-card: 0 2px 8px rgba(17,24,39,.06);
  --shadow-side: 2px 0 20px rgba(0,0,0,.06);

  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   14px;
  --radius-xl:   20px;
  --radius-full: 9999px;

  --sidebar-w:   240px;
  --topbar-h:    56px;
  --t:           180ms ease;
}

/* ============================================================
   2. RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; -webkit-font-smoothing: antialiased; }
body {
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  font-size: 14px; line-height: 1.65;
  color: var(--text); background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }

/* ============================================================
   3. APP SHELL — Sidebar + Main
   ============================================================ */
.app-layout { display: flex; min-height: 100vh; }

/* ---- SIDEBAR ---- */
.sidebar {
  position: fixed; top: 0; left: 0;
  width: var(--sidebar-w); height: 100vh;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  box-shadow: var(--shadow-side);
  display: flex; flex-direction: column;
  z-index: 100; overflow: hidden;
}

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, #1877F2, #42A4F5);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(24,119,242,.3);
}
.sidebar-logo-text {
  font-size: 15px; font-weight: 800; color: var(--text); white-space: nowrap;
}
.sidebar-logo-text span { color: var(--primary); }

/* Brand section */
.sidebar-brand {
  padding: 10px 12px 8px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
}
.sidebar-brand-btn {
  width: 100%; display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 7px 10px;
  cursor: pointer; transition: all var(--t);
}
.sidebar-brand-btn:hover { background: var(--primary-soft); border-color: var(--primary); }

.brand-avatar {
  width: 28px; height: 28px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: white;
  flex-shrink: 0; background: var(--primary);
}
.brand-select-name {
  flex: 1; font-size: 13px; font-weight: 600; color: var(--text);
  text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand-select-chevron { width: 14px; height: 14px; color: var(--text-secondary); flex-shrink: 0; }

.brand-dropdown-menu {
  position: absolute; top: calc(100% + 4px); left: 12px; right: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  z-index: 200; overflow: hidden; display: none;
}
.brand-dropdown-menu.open { display: block; }
.brand-option {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 9px 12px;
  background: none; border: none; cursor: pointer;
  transition: background var(--t); text-align: left;
}
.brand-option:hover { background: var(--primary-soft); }
.brand-option.active { background: var(--primary-light); }
.brand-option-info { flex: 1; overflow: hidden; }
.brand-option-name  { font-size: 13px; font-weight: 600; color: var(--text); }
.brand-option-tag   { font-size: 11px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-option-check { color: var(--primary); font-weight: 700; font-size: 13px; }
.brand-dropdown-footer { padding: 8px; border-top: 1px solid var(--border); }
.brand-empty { padding: 12px; color: var(--text-muted); font-size: 12px; text-align: center; }

/* Nav */
.sidebar-nav {
  flex: 1; padding: 8px 10px;
  overflow-y: auto; scrollbar-width: none;
}
.sidebar-nav::-webkit-scrollbar { display: none; }

.nav-section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 10px 8px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 10px;
  background: none; border: none; border-radius: var(--radius);
  cursor: pointer; transition: background var(--t), color var(--t);
  color: var(--text-secondary);
  font-family: inherit; font-size: 13.5px; font-weight: 500;
  text-align: left; white-space: nowrap;
}
.nav-item:hover { background: var(--bg); color: var(--text); }
.nav-item.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; font-size: 16px; display: flex; align-items: center; justify-content: center; }
.nav-icon svg { width: 18px; height: 18px; }
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px;
  background: var(--danger); color: white;
  border-radius: var(--radius-full); font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; padding: 0 5px;
}

/* Sidebar footer */
.sidebar-footer { padding: 10px 12px; border-top: 1px solid var(--border); flex-shrink: 0; }

/* ---- MAIN AREA ---- */
.main-area { margin-left: var(--sidebar-w); flex: 1; display: flex; flex-direction: column; }

.topbar {
  height: var(--topbar-h);
  background: var(--surface); border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 12px;
  position: sticky; top: 0; z-index: 50;
}
.topbar-title { font-size: 16px; font-weight: 800; color: var(--text); flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.main-content { flex: 1; padding: 24px; }

/* ============================================================
   4. TAB CONTENT
   ============================================================ */
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn .2s ease; }

/* ============================================================
   5. PAGE HEADER
   ============================================================ */
.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap; gap: 12px; margin-bottom: 20px;
}
.page-title { font-size: 20px; font-weight: 800; color: var(--text); line-height: 1.3; }
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }
.page-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ============================================================
   6. CARDS
   ============================================================ */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-card);
}
.card + .card { margin-top: 16px; }
.card-header { margin-bottom: 16px; }
.card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.card-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.card-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--text-secondary); margin-bottom: 8px;
}

/* ============================================================
   7. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius);
  font-family: inherit; font-size: 13px; font-weight: 600;
  border: 1.5px solid transparent; cursor: pointer;
  transition: all var(--t); line-height: 1; white-space: nowrap;
  text-decoration: none;
}
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-primary  { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-hover); box-shadow: 0 4px 14px rgba(24,119,242,.35); }
.btn-secondary { background: #fff; color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg); border-color: #9CA3AF; }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-facebook { background: #1877F2; color: #fff; border-color: #1877F2; display:inline-flex; align-items:center; font-weight:600; }
.btn-facebook:hover { background: #166FE5; box-shadow: 0 4px 14px rgba(24,119,242,.35); }
.btn-google { background: #fff; color: #3c4043; border-color: #dadce0; display:inline-flex; align-items:center; font-weight:600; }
.btn-google:hover { background: #f8f9fa; border-color: #4285F4; box-shadow: 0 2px 8px rgba(66,133,244,.2); }
.btn-sm  { padding: 6px 12px; font-size: 12px; }
.btn-xs  { padding: 4px 9px; font-size: 11px; }
.btn-lg  { padding: 11px 22px; font-size: 14px; font-weight: 700; }
.btn-full { width: 100%; }
.text-danger { color: var(--danger) !important; }

.icon-btn {
  width: 30px; height: 30px; padding: 0;
  background: transparent; border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-secondary);
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; transition: all var(--t);
}
.icon-btn:hover { background: var(--bg); color: var(--text); }

/* ============================================================
   8. FORMS
   ============================================================ */
.form-group { margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }
.form-label {
  display: block; font-size: 11.5px; font-weight: 700;
  color: var(--text-secondary); text-transform: uppercase;
  letter-spacing: .05em; margin-bottom: 5px;
}
.required { color: var(--danger); }
.optional  { color: var(--text-muted); font-weight: 400; text-transform: none; letter-spacing: 0; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

.input, .textarea, .select {
  width: 100%; background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 9px 12px; font-family: inherit; font-size: 13.5px;
  color: var(--text); transition: border-color var(--t), box-shadow var(--t);
  outline: none; line-height: 1.5;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(24,119,242,.12);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.textarea { resize: vertical; }
.select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%236B7280' d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px;
}
.select-sm { padding: 6px 28px 6px 10px; font-size: 12px; width: auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.input-with-action { display: flex; gap: 6px; }
.input-with-action .input { flex: 1; }
.checkbox-group { display: flex; gap: 16px; flex-wrap: wrap; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.checkbox-label input { accent-color: var(--primary); width: 14px; height: 14px; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }

.color-picker-wrap { display: flex; align-items: center; gap: 8px; }
.color-picker {
  width: 40px; height: 40px; border: 2px solid var(--border);
  border-radius: var(--radius); padding: 2px; cursor: pointer; background: none; flex-shrink: 0;
}
.color-picker-wrap .input { flex: 1; }

/* ============================================================
   9. TAG INPUT
   ============================================================ */
.tag-input-wrapper {
  display: flex; flex-wrap: wrap; align-items: center; gap: 5px;
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 7px 10px; background: var(--surface);
  transition: border-color var(--t), box-shadow var(--t);
  min-height: 42px; cursor: text;
}
.tag-input-wrapper:focus-within {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(24,119,242,.12);
}
.tags-display { display: flex; flex-wrap: wrap; gap: 5px; }
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--primary-light); color: var(--primary);
  border-radius: var(--radius-full); padding: 3px 10px;
  font-size: 12px; font-weight: 600;
}
.tag-removable { padding-right: 5px; }
.tag-remove { background: none; border: none; color: var(--primary); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; opacity: .6; }
.tag-remove:hover { opacity: 1; }
.tag-input { flex: 1; min-width: 80px; border: none; outline: none; font-family: inherit; font-size: 13px; color: var(--text); background: transparent; }

/* ============================================================
   10. PLATFORM
   ============================================================ */
.platform-selector { display: flex; gap: 8px; flex-wrap: wrap; }
.platform-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius); background: var(--surface);
  font-family: inherit; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); cursor: pointer; transition: all var(--t);
}
.platform-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.platform-btn.active { background: var(--primary-light); border-color: var(--primary); color: var(--primary); font-weight: 600; }
.platform-icon {
  width: 22px; height: 22px; border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900;
}
.platform-icon.facebook  { background: #1877F2; color: #fff; }
.platform-icon.instagram { background: linear-gradient(135deg,#F58529,#DD2A7B,#8134AF); color: #fff; }
.platform-icon.threads   { background: #000; color: #fff; font-size: 11px; }
.platform-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-full); font-size: 11px; font-weight: 700; }
.platform-badge.facebook  { background: #E7F0FD; color: #1877F2; }
.platform-badge.instagram { background: #FDF0F8; color: #C62A6A; }
.platform-badge.threads   { background: #F0F0F0; color: #1C1C1C; }

/* ============================================================
   11. STATUS BADGES
   ============================================================ */
.status-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--radius-full);
  font-size: 11px; font-weight: 700;
}
.status-badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-badge.pending   { background: var(--warning-light); color: #B45309; }
.status-badge.approved  { background: var(--success-light); color: #15803D; }
.status-badge.scheduled { background: var(--primary-light);  color: var(--primary); }
.status-badge.posted    { background: var(--purple-light);   color: #7C3AED; }

/* ============================================================
   12. GENERATOR — split panel
   ============================================================ */
.split-panel { display: grid; grid-template-columns: 400px 1fr; gap: 20px; align-items: start; }
.panel-left .card { position: sticky; top: calc(var(--topbar-h) + 16px); }
.panel-right { min-width: 0; }

.output-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.output-actions { display: flex; gap: 6px; }

.hook-card { border-left: 4px solid var(--primary) !important; background: var(--primary-soft) !important; }
.hook-text  { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.5; }

.caption-text { font-size: 13.5px; line-height: 1.8; color: var(--text); white-space: pre-wrap; }
.cta-card     { background: var(--success-light) !important; border-color: #86EFAC !important; }

.image-prompt-text { font-size: 12px; line-height: 1.7; color: var(--text-secondary); font-style: italic; }
.image-meta { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.result-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* Compliance score */
.compliance-card { background: var(--surface) !important; }
.compliance-header { display: flex; align-items: center; gap: 16px; }
.score-wrap { position: relative; width: 60px; height: 60px; flex-shrink: 0; }
.score-ring { width: 60px; height: 60px; transform: rotate(-90deg); }
.score-track { fill: none; stroke: var(--bg-alt); stroke-width: 3; }
.score-fill  { fill: none; stroke: var(--success); stroke-width: 3; stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.score-number { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); font-size: 13px; font-weight: 800; color: var(--text); }
.compliance-info { flex: 1; }
.compliance-status { font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: var(--radius-full); }
.compliance-status.pass    { background: var(--success-light); color: #15803D; }
.compliance-status.warning { background: var(--warning-light); color: #B45309; }
.compliance-status.fail    { background: var(--danger-light);  color: #B91C1C; }
.compliance-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.compliance-details { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.check-item { display: flex; align-items: flex-start; gap: 8px; padding: 7px 10px; border-radius: var(--radius); margin-bottom: 4px; font-size: 12.5px; }
.check-item.pass    { background: var(--success-light); }
.check-item.warning { background: var(--warning-light); }
.check-item.fail    { background: var(--danger-light); }
.check-icon { font-size: 13px; flex-shrink: 0; margin-top: 1px; }
.check-message { font-weight: 500; color: var(--text); }
.check-suggestion { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }
.compliance-suggestions { margin-top: 10px; }
.revised-content-wrap { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.revised-label { font-size: 11px; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.revised-content { font-size: 12.5px; line-height: 1.7; color: var(--text); white-space: pre-wrap; }

/* ============================================================
   13. EMPTY / LOADING STATES
   ============================================================ */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; text-align: center; color: var(--text-secondary);
  border: 1.5px dashed var(--border); border-radius: var(--radius-lg); background: var(--surface);
}
.empty-icon { font-size: 40px; margin-bottom: 12px; opacity: .7; }
.empty-state h3 { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.empty-state p  { font-size: 13px; color: var(--text-secondary); max-width: 280px; }
.empty-hint { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
kbd { display: inline-block; padding: 2px 6px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 4px; font-size: 11px; font-family: monospace; }

.loading-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); gap: 14px;
}
.loading-animation { display: flex; gap: 8px; }
.loading-dot { width: 10px; height: 10px; background: var(--primary); border-radius: 50%; animation: bounce 1.2s infinite ease-in-out; }
.loading-dot:nth-child(2) { animation-delay: .2s; }
.loading-dot:nth-child(3) { animation-delay: .4s; }
@keyframes bounce { 0%,80%,100%{transform:scale(.7);opacity:.5} 40%{transform:scale(1);opacity:1} }
.progress-bar-wrap { width: 100%; max-width: 300px; height: 4px; background: var(--bg-alt); border-radius: var(--radius-full); overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg,var(--primary),#42A4F5); border-radius: var(--radius-full); transition: width .4s ease; width: 0%; }

/* ============================================================
   14. QUEUE
   ============================================================ */
.queue-stats { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; margin-bottom: 20px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 18px; text-align: center; box-shadow: var(--shadow-card); }
.stat-num  { font-size: 30px; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-label{ font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.queue-item {
  display: flex; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 10px;
  box-shadow: var(--shadow-card); transition: box-shadow var(--t);
}
.queue-item:hover { box-shadow: var(--shadow); }
.queue-item-status-bar { width: 4px; flex-shrink: 0; }
.queue-item.pending   .queue-item-status-bar { background: var(--warning); }
.queue-item.approved  .queue-item-status-bar { background: var(--success); }
.queue-item.scheduled .queue-item-status-bar { background: var(--primary); }
.queue-item.posted    .queue-item-status-bar { background: var(--purple); }
.queue-item-body { flex: 1; padding: 12px 16px; }
.queue-item-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.queue-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.queue-item-actions { display: flex; align-items: center; gap: 4px; }
.queue-item-hook    { font-size: 13.5px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.queue-item-preview { font-size: 12.5px; color: var(--text-secondary); line-height: 1.6; }
.queue-item-footer  { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; flex-wrap: wrap; gap: 6px; }
.brand-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); background: var(--primary-light); color: var(--primary); }
.score-mini { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); }
.score-mini.pass    { background: var(--success-light); color: #15803D; }
.score-mini.warning { background: var(--warning-light); color: #B45309; }
.score-mini.fail    { background: var(--danger-light);  color: #B91C1C; }

/* ============================================================
   15. CALENDAR
   ============================================================ */
.calendar-toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.calendar-title { font-size: 15px; font-weight: 700; color: var(--text); flex: 1; }
.calendar-grid {
  display: grid; grid-template-columns: 52px repeat(7,1fr);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--surface); font-size: 12px;
}
.calendar-time-col { background: var(--bg); }
.calendar-day-header {
  padding: 10px 4px; text-align: center;
  border-left: 1px solid var(--border); border-bottom: 1px solid var(--border);
  font-size: 11px; font-weight: 600; color: var(--text-secondary);
  background: var(--surface);
}
.calendar-day-header.today { background: var(--primary-soft); color: var(--primary); }
.day-name { font-size: 10px; text-transform: uppercase; letter-spacing: .05em; }
.day-num  { font-size: 18px; font-weight: 800; color: var(--text); margin-top: 2px; }
.day-num.today {
  width: 30px; height: 30px; background: var(--primary); color: white;
  border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 2px auto 0;
}
.calendar-time-slot { padding: 4px 6px; text-align: right; font-size: 10px; color: var(--text-muted); border-bottom: 1px solid var(--border); background: var(--bg); }
.calendar-cell {
  border-left: 1px solid var(--border); border-bottom: 1px solid var(--border);
  min-height: 38px; padding: 3px; background: var(--surface);
}
.calendar-cell.today { background: #F0F6FF; }
.content-chip {
  display: flex; align-items: center; gap: 3px;
  padding: 3px 5px; border-radius: 5px;
  border-left: 3px solid var(--primary); background: var(--primary-light);
  font-size: 10px; cursor: pointer; margin-bottom: 2px;
  overflow: hidden; transition: opacity var(--t);
}
.content-chip:hover { opacity: .75; }
.content-chip.instagram { border-left-color: #E1306C; background: #FDF0F8; }
.content-chip.threads   { border-left-color: #000; background: #F5F5F5; }
.chip-platform { font-size: 9px; font-weight: 900; flex-shrink: 0; }
.chip-text     { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }

/* ============================================================
   16. RULES
   ============================================================ */
.rules-quick-add { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 16px; }
.section-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.suggestion-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestion-chip {
  padding: 6px 12px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-full); font-family: inherit; font-size: 12px;
  color: var(--text-secondary); cursor: pointer; transition: all var(--t);
}
.suggestion-chip:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.rules-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-chip {
  padding: 5px 12px; border-radius: var(--radius-full);
  background: var(--surface); border: 1px solid var(--border);
  font-family: inherit; font-size: 12px; font-weight: 500; color: var(--text-secondary); cursor: pointer; transition: all var(--t);
}
.filter-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.filter-chip.active { background: var(--primary); border-color: var(--primary); color: white; font-weight: 600; }
.rule-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 8px; box-shadow: var(--shadow-card); }
.rule-item.disabled { opacity: .5; }
.rule-item-type { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.rule-type-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: var(--radius-full); font-size: 11px; font-weight: 700; background: var(--bg); color: var(--text-secondary); border: 1px solid var(--border); }
.rule-type-badge.must    { background: var(--success-light); color: #15803D; }
.rule-type-badge.mustNot { background: var(--danger-light);  color: #B91C1C; }
.rule-type-badge.tone    { background: var(--purple-light);  color: #7C3AED; }
.rule-type-badge.format  { background: var(--warning-light); color: #B45309; }
.rule-type-badge.cta     { background: var(--primary-light); color: var(--primary); }
.rule-description { font-size: 13px; color: var(--text); line-height: 1.6; margin-bottom: 6px; }
.rule-example { font-size: 12px; font-style: italic; color: var(--text-secondary); line-height: 1.5; }
.rule-actions { display: flex; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }

/* ============================================================
   17. KNOWLEDGE BASE
   ============================================================ */
.kb-filter { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.kb-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 10px; box-shadow: var(--shadow-card); transition: box-shadow var(--t); }
.kb-item:hover { box-shadow: var(--shadow); }
.kb-item-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kb-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kb-actions { display: flex; gap: 4px; }
.kb-priority { font-size: 13px; }
.kb-category-badge { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-full); background: var(--bg-alt); color: var(--text-secondary); }
.kb-title   { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.kb-preview { font-size: 12.5px; line-height: 1.6; }
.kb-footer  { margin-top: 8px; }

/* ============================================================
   18. BRANDS GRID
   ============================================================ */
.brands-cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(280px,1fr)); gap: 16px; }
.brand-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 20px;
  box-shadow: var(--shadow-card); transition: box-shadow var(--t), transform var(--t);
  border-top: 4px solid var(--brand-color, var(--primary));
}
.brand-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.brand-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 12px; }
.brand-card-logo   { width: 48px; height: 48px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800; color: white; }
.brand-card-actions{ display: flex; gap: 4px; }
.brand-card-name   { font-size: 16px; font-weight: 800; color: var(--text); }
.brand-card-tagline{ font-size: 12px; color: var(--text-secondary); margin-bottom: 12px; }
.brand-card-pillars{ display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 14px; }

/* ============================================================
   19. BATCH
   ============================================================ */
.batch-layout { display: grid; grid-template-columns: 300px 1fr; gap: 20px; align-items: start; }
.batch-config { position: sticky; top: calc(var(--topbar-h) + 16px); }
.batch-progress-info { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 13px; color: var(--text-secondary); }
.batch-item         { margin-bottom: 10px; }
.batch-item-header  { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.batch-num          { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.batch-item-hook    { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.batch-item-caption { font-size: 12px; color: var(--text-secondary); }
.batch-error        { border-color: var(--danger) !important; background: var(--danger-light) !important; }

/* ============================================================
   20. SETTINGS
   ============================================================ */
.settings-layout { max-width: 600px; display: flex; flex-direction: column; gap: 16px; }
.about-info { display: flex; flex-direction: column; gap: 0; }
.about-row { display: flex; justify-content: space-between; font-size: 13px; padding: 10px 0; border-bottom: 1px solid var(--border); color: var(--text-secondary); }
.about-row span:last-child { font-weight: 600; color: var(--text); }
.api-status { font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: var(--radius-full); }
.api-status.valid    { background: var(--success-light); color: #15803D; }
.api-status.invalid  { background: var(--danger-light);  color: #B91C1C; }
.api-status.checking { background: var(--warning-light); color: #B45309; }

/* ============================================================
   21. ONBOARDING BANNER
   ============================================================ */
.onboarding-banner {
  background: linear-gradient(135deg, #1877F2, #42A4F5);
  border-radius: var(--radius-lg); padding: 16px 20px;
  margin-bottom: 20px; color: white;
}
.onboarding-content {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.onboarding-icon { font-size: 26px; flex-shrink: 0; }
.onboarding-content strong { font-weight: 700; display: block; font-size: 14px; }
.onboarding-content span { font-size: 13px; opacity: .9; }
.onboarding-actions { display: flex; gap: 8px; margin-left: auto; flex-wrap: wrap; }
.onboarding-banner .btn-primary { background: white; color: var(--primary); border-color: white; }
.onboarding-banner .btn-ghost   { color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.4); }
.onboarding-banner .btn-ghost:hover { background: rgba(255,255,255,.15); color: white; }

/* ============================================================
   22. TOASTS
   ============================================================ */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  display: flex; align-items: center;
  padding: 12px 16px; background: white;
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); font-size: 13px; font-weight: 500; color: var(--text);
  min-width: 260px; max-width: 380px; pointer-events: auto;
  border-left: 4px solid var(--primary);
  opacity: 0; transform: translateX(16px);
  transition: opacity .22s ease, transform .22s ease;
}
.toast.show      { opacity: 1; transform: translateX(0); }
.toast-success   { border-left-color: var(--success); }
.toast-error     { border-left-color: var(--danger); }
.toast-warning   { border-left-color: var(--warning); }

/* ============================================================
   23. MODALS
   ============================================================ */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(17,24,39,.4);
  backdrop-filter: blur(4px); z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: white; border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 520px;
  max-height: 90vh; display: flex; flex-direction: column;
  animation: scaleIn .18s ease;
}
.modal-lg { max-width: 700px; }
.modal-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.modal-title { font-size: 16px; font-weight: 700; color: var(--text); }
.modal-meta  { display: flex; align-items: center; gap: 6px; margin-top: 4px; flex-wrap: wrap; }
.modal-close {
  width: 28px; height: 28px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--text-secondary); transition: all var(--t); flex-shrink: 0;
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }
.modal-body   { flex: 1; overflow-y: auto; padding: 20px 24px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 24px; border-top: 1px solid var(--border); flex-shrink: 0; }

/* ============================================================
   24. UTILITIES
   ============================================================ */
.text-secondary { color: var(--text-secondary) !important; }
.text-muted     { color: var(--text-muted) !important; }
.w-full         { width: 100% !important; }

/* ============================================================
   25. KEYFRAMES
   ============================================================ */
@keyframes fadeIn  { from{opacity:0;transform:translateY(6px)} to{opacity:1;transform:translateY(0)} }
@keyframes scaleIn { from{opacity:0;transform:scale(.94)}      to{opacity:1;transform:scale(1)} }
@keyframes shimmer { 0%{background-position:-400px 0} 100%{background-position:400px 0} }
.skeleton {
  background: linear-gradient(90deg,var(--bg) 25%,var(--bg-alt) 50%,var(--bg) 75%);
  background-size: 400px 100%; animation: shimmer 1.4s infinite linear; border-radius: var(--radius);
}

/* ============================================================
   26. SOCIAL CONNECT (Settings tab)
   ============================================================ */
.social-connect-row {
  display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 8px;
}
.social-connect-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 10px 14px; flex: 1; min-width: 160px;
}
.social-platform-icon {
  width: 34px; height: 34px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 900; color: #fff; flex-shrink: 0;
}
.facebook-icon  { background: #1877F2; }
.instagram-icon { background: linear-gradient(135deg,#F58529 0%,#DD2A7B 50%,#8134AF 100%); }
.threads-icon   { background: #000; }
.gdoc-icon      { background: #4285F4; }

.social-platform-info { display: flex; flex-direction: column; gap: 2px; }
.social-platform-name { font-size: 13px; font-weight: 600; color: var(--text); }
.social-status {
  font-size: 11px; font-weight: 600; letter-spacing: .2px;
}
.social-status.connected    { color: #15803D; }
.social-status.disconnected { color: var(--text-muted); }

.social-test-status {
  font-size: 12px; padding: 7px 12px; border-radius: var(--radius);
  margin-top: 6px; display: inline-block;
}
.social-test-status.success {
  background: #F0FDF4; color: #15803D; border: 1px solid #BBF7D0;
}
.social-test-status.error {
  background: #FEF2F2; color: #B91C1C; border: 1px solid #FECACA;
}

.social-help-box {
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; margin-top: 12px;
  font-size: 12px; color: var(--text-muted); line-height: 1.6;
}
.social-help-box a { color: var(--primary); text-decoration: none; }
.social-help-box a:hover { text-decoration: underline; }

/* Brand social connection indicators on brand cards */
.brand-social-status {
  display: flex; gap: 6px; margin-bottom: 10px;
}
.social-mini-badge {
  width: 22px; height: 22px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: #fff;
}
.social-mini-badge.on  { background: var(--primary); }
.social-mini-badge.off { background: var(--border); color: var(--text-muted); }

/* ============================================================
   27. RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
  .split-panel, .batch-layout { grid-template-columns: 1fr; }
  .panel-left .card, .batch-config { position: static; }
  .queue-stats { grid-template-columns: repeat(2,1fr); }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .sidebar { transform: translateX(-240px); width: 240px; transition: transform var(--t); }
  .sidebar.open { transform: translateX(0); }
  .main-area { margin-left: 0; }
  .main-content { padding: 14px; }
  .brands-cards { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   LOGIN SCREEN
   ═══════════════════════════════════════════════════════════ */
.login-screen {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  padding: 24px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,.10);
  padding: 40px 36px;
  width: 100%; max-width: 400px;
  display: flex; flex-direction: column; gap: 0;
}
.login-logo {
  text-align: center;
  margin-bottom: 32px;
}
.login-logo-icon {
  font-size: 36px; line-height: 1;
  margin-bottom: 8px;
}
.login-logo-text {
  font-size: 22px; font-weight: 800; color: var(--text);
  letter-spacing: -.5px;
}
.login-logo-text span { color: var(--primary); }
.login-tagline {
  font-size: 12px; color: var(--text-muted);
  margin: 6px 0 0; line-height: 1.5;
}
.btn-login-fb {
  width: 100%;
  height: 46px;
  font-size: 15px;
  border-radius: 10px;
  justify-content: center;
  gap: 10px;
  margin-bottom: 16px;
}
.login-divider {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 14px;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.login-divider span {
  font-size: 12px; color: var(--text-muted); white-space: nowrap;
}
.login-admin-toggle {
  background: none; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 16px;
  font-size: 13px; color: var(--text-secondary);
  cursor: pointer; width: 100%;
  transition: all var(--t);
}
.login-admin-toggle:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.login-admin-panel {
  flex-direction: column; gap: 10px;
  margin-top: 12px;
  padding: 16px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--border);
}
.login-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin-top: 10px;
  text-align: center;
}
.login-footer {
  font-size: 11px; color: var(--text-muted);
  text-align: center; line-height: 1.6;
  margin-top: 20px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.login-appid-box {
  background: #FFF7ED;
  border: 1.5px solid #FCD34D;
  border-radius: var(--radius);
  padding: 14px 16px;
  text-align: left;
}
.login-appid-title {
  font-size: 13px; font-weight: 700;
  color: #92400E; margin: 0 0 6px;
}
.login-appid-desc {
  font-size: 12px; color: #78350F;
  line-height: 1.6; margin: 0 0 10px;
}
.login-intro {
  font-size: 13px; color: var(--text-secondary);
  text-align: center; margin-bottom: 20px; line-height: 1.5;
}
.login-hint {
  font-size: 12px; color: var(--text-muted); line-height: 1.6;
  text-align: center; margin: 8px 0 4px; padding: 10px 12px;
  background: var(--bg); border-radius: 8px;
}
.login-service-row {
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 10px;
}
.btn-login-service {
  width: 100%; height: 46px; font-size: 14px;
  border-radius: 10px; justify-content: center; gap: 10px;
  position: relative;
}
.login-optional-badge {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 10px; font-weight: 600; color: var(--text-muted);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 20px; padding: 1px 7px;
}
.login-service-status {
  font-size: 12px; font-weight: 600; min-height: 16px; padding-left: 2px;
}
.login-service-status.connected { color: #15803D; }
.login-service-status.error { color: var(--danger); }
.login-admin-section {
  display: flex; justify-content: center; margin-top: 16px;
}

/* ═══════════════════════════════════════════════════════════
   SIDEBAR USER INFO
   ═══════════════════════════════════════════════════════════ */
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  margin-top: 8px;
}
.sidebar-user-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-name {
  font-size: 12px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 11px; color: var(--text-muted);
}
.sidebar-user-logout {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 4px;
  border-radius: 6px; transition: all var(--t);
  flex-shrink: 0;
}
.sidebar-user-logout:hover { background: var(--danger-light); color: var(--danger); }
