/* ── CSS Variables ───────────────────────────────────────────────────────────── */
:root {
  --blue-900: #002366;
  --blue-800: #003087;
  --blue-700: #004aad;
  --blue-100: #e8f0ff;
  --gold:     #c8a64a;
  --gold-light: #f5e8c0;
  --green:    #1a8a4a;
  --green-light: #e6f5ed;
  --orange:   #d46c1a;
  --orange-light: #fff0e0;
  --red:      #c0392b;
  --red-light: #fdecea;
  --yellow:   #e8a020;
  --yellow-light: #fffae0;
  --gray-900: #1a1a2e;
  --gray-700: #444466;
  --gray-500: #7777aa;
  --gray-300: #c0c0d8;
  --gray-100: #f4f4f8;
  --white:    #ffffff;
  --shadow-sm: 0 1px 4px rgba(0,0,100,0.07);
  --shadow:    0 2px 12px rgba(0,0,100,0.10);
  --shadow-lg: 0 4px 24px rgba(0,0,100,0.14);
  --radius:   10px;
  --radius-lg:16px;
}

/* ── Reset & Base ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--gray-100);
  color: var(--gray-900);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}
a { color: var(--blue-700); text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }
textarea { resize: vertical; }

/* ── Header ──────────────────────────────────────────────────────────────────── */
.site-header {
  background: linear-gradient(135deg, var(--blue-900) 0%, var(--blue-800) 100%);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,80,0.25);
}
.header-brand { display: flex; align-items: center; gap: 14px; }
.brand-logo {
  width: 44px; height: 44px;
  background: var(--gold);
  color: var(--blue-900);
  border-radius: 10px;
  font-size: 22px;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-name  { display: block; font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.brand-agent { display: block; font-size: 12px; opacity: .75; margin-top: 1px; }
.header-right { display: flex; align-items: center; gap: 16px; }
.date-display { font-size: 13px; opacity: .85; white-space: nowrap; }
.auth-status  { display: flex; align-items: center; gap: 6px; font-size: 12px; opacity: .9; white-space: nowrap; }
.auth-dot     { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.auth-dot.connected    { background: #4cdb8a; }
.auth-dot.disconnected { background: #ff8c69; }
.auth-label a { color: #aad4ff; }

/* ── Summary Bar ─────────────────────────────────────────────────────────────── */
.summary-bar {
  background: linear-gradient(90deg, var(--blue-700), var(--blue-800));
  color: var(--white);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.summary-message { font-size: 14px; font-style: italic; opacity: .92; }
.summary-stats   { display: flex; gap: 16px; font-size: 13px; font-weight: 600; opacity: .95; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 8px; border: none; cursor: pointer;
  font-weight: 600; font-size: 13px; transition: all .15s; white-space: nowrap;
}
.btn-primary  { background: var(--gold); color: var(--blue-900); }
.btn-primary:hover { background: #d4b050; transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-secondary{ background: var(--white); color: var(--blue-800); border: 1.5px solid var(--blue-700); }
.btn-secondary:hover { background: var(--blue-100); }
.btn-ghost    { background: transparent; color: var(--gray-700); border: 1.5px solid var(--gray-300); }
.btn-ghost:hover { background: var(--gray-100); }
.btn-danger   { background: var(--red-light); color: var(--red); border: 1.5px solid #f5a0a0; }
.btn-sm       { padding: 5px 12px; font-size: 12px; }
.btn-large    { padding: 13px 28px; font-size: 15px; }
.btn-icon     { font-size: 16px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none !important; }

/* ── Main Layout ─────────────────────────────────────────────────────────────── */
.main-content { max-width: 1280px; margin: 0 auto; padding: 0 24px 48px; }

/* ── Tab Navigation ──────────────────────────────────────────────────────────── */
.tab-nav {
  display: flex; gap: 4px; padding: 16px 0 0;
  border-bottom: 2px solid var(--gray-300);
  margin-bottom: 24px;
}
.tab-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 18px; border: none; background: none; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--gray-500);
  border-bottom: 3px solid transparent; margin-bottom: -2px;
  border-radius: 8px 8px 0 0; transition: all .15s;
  position: relative;
}
.tab-btn:hover  { background: var(--blue-100); color: var(--blue-800); }
.tab-btn.active { color: var(--blue-800); border-bottom-color: var(--blue-800); font-weight: 700; }
.badge {
  background: var(--red); color: var(--white);
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px; min-width: 18px; text-align: center;
}
.badge-warning { background: var(--orange); }
.badge-blue    { background: var(--blue-700); }

/* ── Tab Content ─────────────────────────────────────────────────────────────── */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Section Cards ───────────────────────────────────────────────────────────── */
.section-card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 24px; margin-bottom: 20px;
}
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.section-header-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title { font-size: 18px; font-weight: 700; color: var(--blue-900); }

/* ── Auth notice ──────────────────────────────────────────────────────────────── */
.auth-notice {
  background: var(--yellow-light); border: 1.5px solid #f5d070;
  color: var(--yellow); border-radius: 8px; padding: 8px 14px; font-size: 13px;
  display: flex; align-items: center; gap: 6px;
}

/* ── Overview Cards ──────────────────────────────────────────────────────────── */
.overview-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 8px;
}
.overview-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 24px; text-align: center; cursor: pointer;
  box-shadow: var(--shadow); transition: all .15s;
  border-left: 4px solid transparent;
}
.overview-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.overview-card.card-red    { border-left-color: var(--red); }
.overview-card.card-orange { border-left-color: var(--orange); }
.overview-card.card-yellow { border-left-color: var(--yellow); }
.overview-card.card-blue   { border-left-color: var(--blue-700); }
.overview-number { font-size: 42px; font-weight: 800; color: var(--blue-900); line-height: 1; }
.overview-label  { font-size: 13px; color: var(--gray-500); margin-top: 6px; font-weight: 500; }

/* ── Priority List ───────────────────────────────────────────────────────────── */
.priority-list { display: flex; flex-direction: column; gap: 8px; }
.priority-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px; border-radius: 8px; background: var(--gray-100);
}
.priority-item.priority-overdue { background: var(--red-light); }
.priority-item.priority-due     { background: var(--orange-light); }
.priority-item.priority-contact { background: var(--blue-100); }
.priority-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.priority-item.priority-overdue .priority-dot { background: var(--red); }
.priority-item.priority-due     .priority-dot { background: var(--orange); }
.priority-item.priority-contact .priority-dot { background: var(--blue-700); }
.priority-text  { flex: 1; font-size: 13px; }
.priority-meta  { font-size: 12px; color: var(--gray-500); }

/* ── Email Cards ─────────────────────────────────────────────────────────────── */
.email-card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden;
}
.email-card-header {
  padding: 16px 20px;
  display: flex; align-items: flex-start; gap: 14px;
  cursor: pointer; border-bottom: 1px solid var(--gray-100);
}
.email-avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--blue-800); color: var(--white);
  font-size: 16px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.email-meta    { flex: 1; min-width: 0; }
.email-from    { font-weight: 700; font-size: 14px; color: var(--gray-900); }
.email-subject { font-size: 13px; color: var(--gray-700); margin-top: 2px; }
.email-preview { font-size: 12px; color: var(--gray-500); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.email-time    { font-size: 11px; color: var(--gray-500); white-space: nowrap; margin-left: auto; }
.email-client-tag {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px; margin-top: 4px;
}
.tag-buyer  { background: var(--green-light); color: var(--green); }
.tag-seller { background: var(--gold-light);  color: #7a5a00; }
.tag-contact{ background: var(--blue-100);    color: var(--blue-800); }
.tag-unknown{ background: var(--gray-100);    color: var(--gray-700); }

.email-draft-section { padding: 16px 20px; background: var(--gray-100); }
.email-draft-label   { font-size: 12px; font-weight: 700; color: var(--blue-800); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px; }
.email-draft-text {
  background: var(--white); border-radius: 8px; padding: 14px 16px;
  font-size: 13px; line-height: 1.7; white-space: pre-wrap; border: 1.5px solid var(--gray-300);
  max-height: 220px; overflow-y: auto;
}
.email-draft-actions { display: flex; gap: 8px; margin-top: 10px; }

/* ── Transaction Cards ───────────────────────────────────────────────────────── */
.txn-card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden;
}
.txn-card-header {
  padding: 18px 24px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--gray-100);
}
.txn-type-badge {
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 10px;
  text-transform: uppercase; letter-spacing: .5px; margin-right: 10px;
}
.txn-type-badge.buyer  { background: var(--green-light); color: var(--green); }
.txn-type-badge.seller { background: var(--gold-light);  color: #7a5a00; }
.txn-client-name   { font-size: 18px; font-weight: 700; color: var(--blue-900); }
.txn-property-addr { font-size: 13px; color: var(--gray-500); margin-top: 2px; }
.txn-stage-label   { font-size: 12px; color: var(--gray-500); font-style: italic; }
.txn-closing-date  { font-size: 13px; font-weight: 600; color: var(--blue-800); }

.txn-progress-bar {
  height: 6px; background: var(--gray-100); position: relative;
}
.txn-progress-fill {
  height: 100%; border-radius: 3px; transition: width .5s;
  background: linear-gradient(90deg, var(--blue-700), var(--gold));
}

.txn-body { padding: 20px 24px; }
.txn-info-row {
  display: flex; gap: 24px; flex-wrap: wrap;
  font-size: 12px; color: var(--gray-500); margin-bottom: 16px;
}
.txn-info-item strong { color: var(--gray-900); display: block; margin-bottom: 1px; }

.task-list { display: flex; flex-direction: column; gap: 0; }
.task-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 0; border-bottom: 1px solid var(--gray-100);
  font-size: 13px;
}
.task-item:last-child { border-bottom: none; }
.task-checkbox {
  width: 18px; height: 18px; border: 2px solid var(--gray-300);
  border-radius: 4px; cursor: pointer; flex-shrink: 0; appearance: none;
  display: flex; align-items: center; justify-content: center;
  transition: all .1s; position: relative;
}
.task-checkbox:checked {
  background: var(--green); border-color: var(--green);
}
.task-checkbox:checked::after {
  content: '✓'; color: white; font-size: 11px; font-weight: 700;
  position: absolute;
}
.task-label { flex: 1; }
.task-item.completed .task-label { text-decoration: line-through; color: var(--gray-500); }
.task-due {
  font-size: 11px; white-space: nowrap; padding: 2px 7px; border-radius: 6px;
}
.task-due.overdue   { background: var(--red-light);    color: var(--red);    font-weight: 700; }
.task-due.due-today { background: var(--orange-light);  color: var(--orange); font-weight: 700; }
.task-due.due-soon  { background: var(--yellow-light);  color: var(--yellow); }
.task-due.future    { color: var(--gray-500); }
.task-due.done      { color: var(--green); }

.txn-notes {
  margin-top: 14px; padding: 12px 14px;
  background: var(--blue-100); border-radius: 8px;
  font-size: 12px; color: var(--blue-800); font-style: italic;
}
.txn-notes strong { font-style: normal; }

/* ── Alerts ──────────────────────────────────────────────────────────────────── */
.alert-banner {
  border-radius: var(--radius); padding: 12px 16px; margin-bottom: 12px;
  display: flex; align-items: flex-start; gap: 10px; font-size: 13px;
}
.alert-overdue { background: var(--red-light);    border-left: 4px solid var(--red); }
.alert-due     { background: var(--orange-light); border-left: 4px solid var(--orange); }
.alert-icon    { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.alert-text    { flex: 1; }
.alert-count   { font-weight: 700; }

/* ── Contact Cards ───────────────────────────────────────────────────────────── */
.contact-card {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); margin-bottom: 16px; overflow: hidden;
}
.contact-card-header {
  padding: 16px 20px;
  display: flex; align-items: center; gap: 14px;
  border-bottom: 1px solid var(--gray-100);
}
.contact-avatar {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: var(--white); flex-shrink: 0;
}
.contact-name { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.contact-meta { font-size: 12px; color: var(--gray-500); margin-top: 2px; display: flex; gap: 12px; flex-wrap: wrap; }
.days-since {
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 10px;
  margin-left: auto; white-space: nowrap; flex-shrink: 0;
}
.days-since.urgent   { background: var(--red-light);    color: var(--red); }
.days-since.moderate { background: var(--orange-light); color: var(--orange); }
.days-since.mild     { background: var(--yellow-light); color: var(--yellow); }

.contact-draft-section { padding: 14px 20px; background: var(--gray-100); }
.contact-notes-section { padding: 12px 20px; border-top: 1px solid var(--gray-100); font-size: 12px; color: var(--gray-700); font-style: italic; }
.contact-draft-text {
  background: var(--white); border-radius: 8px; padding: 12px 14px;
  font-size: 13px; line-height: 1.65; white-space: pre-wrap;
  border: 1.5px solid var(--gray-300); max-height: 160px; overflow-y: auto;
}
.contact-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.category-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px;
}
.cat-past_client  { background: var(--green-light); color: var(--green); }
.cat-lead         { background: var(--blue-100);    color: var(--blue-800); }
.cat-referral     { background: var(--gold-light);  color: #7a5a00; }
.cat-professional { background: var(--gray-100);    color: var(--gray-700); }
.cat-sphere       { background: #f0e8ff;            color: #6a3db5; }

/* ── Social Media — Theme Bar ────────────────────────────────────────────────── */
.social-theme-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: linear-gradient(135deg, #0D1B2A 0%, #1a2e45 100%);
  border-radius: var(--radius-lg); padding: 16px 24px; margin-bottom: 20px;
  color: var(--white);
}
.social-theme-badge {
  background: var(--gold); color: #0D1B2A; font-size: 11px; font-weight: 800;
  padding: 4px 11px; border-radius: 20px; white-space: nowrap;
  text-transform: uppercase; letter-spacing: .5px; flex-shrink: 0;
}
.social-theme-name { font-size: 16px; font-weight: 700; color: var(--gold); }
.social-theme-desc { font-size: 12px; opacity: .75; font-style: italic; }

/* ── Social Section Wrapper ──────────────────────────────────────────────────── */
.social-section {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); margin-bottom: 20px; overflow: hidden;
}
.social-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-bottom: 2px solid var(--gray-100);
  background: var(--gray-100); gap: 12px; flex-wrap: wrap;
}
.social-section-title-block { display: flex; align-items: center; gap: 12px; }
.social-section-icon {
  font-size: 22px; flex-shrink: 0;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
}
.social-section-icon.platform-fb { background: #1877f2; border-radius: 8px; color: white; font-size: 18px; font-weight: 900; }
.social-section-icon.platform-li { background: #0a66c2; border-radius: 8px; color: white; font-size: 14px; font-weight: 900; }
.social-section-label { font-size: 15px; font-weight: 700; color: var(--blue-900); }
.social-section-sublabel { font-size: 11px; color: var(--gray-500); margin-top: 2px; }
.social-section-body { padding: 20px; }

/* ── Carousel Slides ─────────────────────────────────────────────────────────── */
.carousel-slides-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; padding: 20px;
}
.carousel-slide-card {
  border: 2px solid var(--gray-100); border-radius: 10px;
  padding: 16px; display: flex; flex-direction: column; gap: 8px;
  transition: border-color .15s;
}
.carousel-slide-card:hover { border-color: #C9A84C; }
.carousel-slide-number {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px;
  color: var(--white); background: #0D1B2A;
  display: inline-block; padding: 3px 9px; border-radius: 6px; width: fit-content;
}
.carousel-slide-headline {
  font-size: 15px; font-weight: 800; color: #0D1B2A; line-height: 1.3;
}
.carousel-slide-body {
  font-size: 12px; color: var(--gray-700); line-height: 1.65; flex: 1;
}
.carousel-slide-design {
  font-size: 11px; color: var(--gray-500); font-style: italic;
  background: var(--gray-100); border-radius: 6px; padding: 7px 9px; line-height: 1.5;
}

/* ── Reel Script ─────────────────────────────────────────────────────────────── */
.reel-hook {
  background: linear-gradient(135deg, #C9A84C 0%, #dfc070 100%);
  border-radius: 10px; padding: 16px 20px; margin-bottom: 14px;
}
.reel-hook-label {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .8px;
  color: #0D1B2A; margin-bottom: 6px;
}
.reel-hook-text { font-size: 18px; font-weight: 800; color: #0D1B2A; line-height: 1.3; }
.reel-slides-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.reel-slide-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--gray-100); border-radius: 8px; padding: 10px 14px;
}
.reel-slide-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: #0D1B2A; color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.reel-slide-text { font-size: 13px; font-weight: 600; color: var(--gray-900); }
.reel-cta-block {
  background: var(--blue-100); border-left: 4px solid var(--blue-700);
  border-radius: 8px; padding: 12px 16px; margin-bottom: 12px;
}
.reel-cta-label {
  font-size: 10px; font-weight: 800; color: var(--blue-800);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px;
}
.reel-cta-text { font-size: 13px; font-weight: 700; color: var(--blue-900); }
.reel-broll-block {
  background: var(--gray-100); border-left: 4px solid var(--gray-300);
  border-radius: 8px; padding: 12px 16px;
}
.reel-broll-label {
  font-size: 10px; font-weight: 800; color: var(--gray-700);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 4px;
}
.reel-broll-text { font-size: 12px; color: var(--gray-700); font-style: italic; line-height: 1.6; }

/* ── Long-form text boxes (Facebook, LinkedIn, Caption) ──────────────────────── */
.long-post-box {
  background: var(--gray-100); border-radius: 10px; padding: 18px 20px;
  font-size: 13px; line-height: 1.8; color: var(--gray-900);
  white-space: pre-wrap; border: 1.5px solid var(--gray-300);
  max-height: 300px; overflow-y: auto; margin-bottom: 12px;
}
.comment-question-box {
  background: var(--blue-100); border-left: 4px solid var(--blue-700);
  border-radius: 8px; padding: 12px 16px; font-size: 13px; color: var(--blue-900);
  margin-bottom: 12px;
}
.hashtag-box {
  background: #f0f4ff; border: 1.5px solid #c0d4ff; border-radius: 8px;
  padding: 12px 16px; font-size: 13px; color: #1877f2;
  font-weight: 600; line-height: 1.8; margin-bottom: 12px; word-break: break-word;
}

/* ── Canva Design Brief ───────────────────────────────────────────────────────── */
.canva-brief-meta {
  display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
  padding-bottom: 18px; border-bottom: 1px solid var(--gray-100);
}
.canva-meta-item {
  background: var(--gray-100); border-radius: 8px; padding: 12px 14px; flex: 1; min-width: 180px;
}
.canva-meta-label {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .6px;
  color: var(--gray-500); margin-bottom: 5px;
}
.canva-meta-value { font-size: 13px; color: var(--gray-900); line-height: 1.55; }
.canva-color-chips { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.canva-color-chip {
  width: 28px; height: 28px; border-radius: 6px; border: 2px solid var(--gray-300);
  display: inline-block; flex-shrink: 0; cursor: default;
}
.canva-slides-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.canva-slide-brief {
  border: 1.5px solid #C9A84C; border-radius: 10px; padding: 14px;
  background: linear-gradient(135deg, #fdf9f0 0%, #fff 100%);
}
.canva-slide-num {
  font-size: 10px; font-weight: 800; color: #7a5a00;
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 6px;
}
.canva-slide-layout {
  font-size: 12px; color: var(--gray-900); line-height: 1.65; margin-bottom: 6px;
}
.canva-slide-image { font-size: 11px; color: var(--gray-500); font-style: italic; }

/* ── Legacy social grid kept for fallback ────────────────────────────────────── */
.social-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.social-card { background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; }
.social-header { padding: 14px 18px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--gray-100); }
.social-icon { width: 34px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.social-icon.facebook  { background: #1877f2; }
.social-icon.instagram { background: linear-gradient(135deg, #e1306c, #833ab4); }
.social-icon.linkedin  { background: #0a66c2; }
.social-platform { font-size: 15px; font-weight: 700; color: var(--gray-900); }
.social-theme    { font-size: 11px; color: var(--gray-500); margin-top: 2px; }
.social-body     { padding: 16px 18px; }
.social-text { font-size: 13px; line-height: 1.7; color: var(--gray-900); white-space: pre-wrap; min-height: 80px; }
.social-hashtags { font-size: 12px; color: #1877f2; margin-top: 8px; font-weight: 500; }
.social-footer { padding: 12px 18px; border-top: 1px solid var(--gray-100); display: flex; gap: 8px; }

/* ── Empty State ─────────────────────────────────────────────────────────────── */
.empty-state {
  text-align: center; padding: 64px 32px; color: var(--gray-500);
}
.empty-icon { font-size: 48px; margin-bottom: 16px; }
.empty-state h2 { font-size: 22px; font-weight: 700; color: var(--gray-700); margin-bottom: 8px; }
.empty-state p  { font-size: 14px; max-width: 400px; margin: 0 auto 24px; }

/* ── Loading ──────────────────────────────────────────────────────────────────── */
.loading-overlay {
  position: fixed; inset: 0; background: rgba(0,3,40,0.65); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.loading-card {
  background: var(--white); border-radius: var(--radius-lg);
  padding: 36px 48px; text-align: center; box-shadow: var(--shadow-lg); min-width: 340px;
}
.spinner {
  width: 44px; height: 44px; border: 4px solid var(--gray-100);
  border-top-color: var(--blue-800); border-radius: 50%;
  animation: spin .8s linear infinite; margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-title { font-size: 17px; font-weight: 700; color: var(--blue-900); margin-bottom: 16px; }
.loading-steps { text-align: left; }
.loading-step {
  font-size: 13px; color: var(--gray-300); padding: 5px 0 5px 22px; position: relative;
}
.loading-step::before { content: '○'; position: absolute; left: 0; }
.loading-step.active  { color: var(--blue-800); font-weight: 600; }
.loading-step.active::before  { content: '●'; color: var(--gold); }
.loading-step.done    { color: var(--green); }
.loading-step.done::before    { content: '✓'; }

/* ── Modals ──────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,3,40,0.55); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 200; padding: 20px;
}
.modal {
  background: var(--white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 640px; max-height: 90vh;
  display: flex; flex-direction: column;
}
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 18px; font-weight: 700; color: var(--blue-900); }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: var(--gray-500); padding: 4px 8px; }
.modal-close:hover { color: var(--gray-900); }
.modal-body  { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer{ padding: 16px 24px; border-top: 1px solid var(--gray-100); display: flex; justify-content: flex-end; gap: 10px; }

.form-row    { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-group  { display: flex; flex-direction: column; gap: 5px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--gray-700); text-transform: uppercase; letter-spacing: .4px; }
.form-group input,
.form-group select,
.form-group textarea {
  padding: 8px 12px; border: 1.5px solid var(--gray-300); border-radius: 8px;
  font-size: 14px; color: var(--gray-900); background: var(--white);
  transition: border-color .15s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { outline: none; border-color: var(--blue-700); }

/* ── Site Footer ─────────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--gray-900);
  color: rgba(255, 255, 255, 0.65);
  text-align: center;
  padding: 22px 28px 20px;
  margin-top: 48px;
}
.footer-disclaimer {
  font-size: 12px;
  line-height: 1.6;
  max-width: 720px;
  margin: 0 auto 8px;
  color: rgba(255, 255, 255, 0.8);
}
.footer-legal {
  font-size: 11px;
  opacity: 0.5;
  letter-spacing: 0.2px;
}

/* ── Toast ────────────────────────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 500; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--gray-900); color: var(--white);
  padding: 12px 18px; border-radius: 10px; font-size: 13px; font-weight: 500;
  box-shadow: var(--shadow-lg); animation: slideIn .2s; max-width: 320px;
}
.toast.success { background: var(--green); }
.toast.error   { background: var(--red); }
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .overview-grid        { grid-template-columns: repeat(2, 1fr); }
  .social-grid          { grid-template-columns: 1fr; }
  .carousel-slides-grid { grid-template-columns: repeat(2, 1fr); }
  .canva-slides-grid    { grid-template-columns: repeat(2, 1fr); }
  .form-row             { grid-template-columns: 1fr; }
  .site-header          { flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
  .header-right         { width: 100%; justify-content: space-between; }
  .main-content         { padding: 0 16px 32px; }
}
@media (max-width: 600px) {
  .overview-grid        { grid-template-columns: 1fr 1fr; }
  .carousel-slides-grid { grid-template-columns: 1fr; }
  .canva-slides-grid    { grid-template-columns: 1fr; }
  .canva-brief-meta     { flex-direction: column; }
  .social-theme-bar     { flex-direction: column; align-items: flex-start; gap: 8px; }
  .tab-btn span:first-child { display: none; }
  .txn-card-header      { flex-wrap: wrap; gap: 8px; }
}
