/* ========== APP SHELL ========== */
.app-body {
  background: var(--bg);
  min-height: 100vh;
}

.app-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 40px 80px;
}

/* ========== APP NAV ========== */
.app-nav {
  background: var(--primary);
  border-bottom: 1px solid rgba(184, 207, 196, 0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 32px;
}

.app-nav-brand {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  flex-shrink: 0;
}

.nav-brand-name {
  font-family: var(--font-display);
  font-size: 22px;
  color: var(--cream);
}

.nav-brand-tag {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sage);
  background: rgba(184, 207, 196, 0.15);
  padding: 2px 8px;
  border-radius: 100px;
}

.app-nav-links {
  list-style: none;
  display: flex;
  gap: 4px;
  flex: 1;
}

.app-nav-links a {
  display: block;
  padding: 6px 14px;
  border-radius: 8px;
  color: rgba(253, 248, 240, 0.7);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}

.app-nav-links a:hover {
  color: var(--cream);
  background: rgba(255,255,255,0.08);
}

.btn-nav-cta {
  background: var(--accent);
  color: white;
  padding: 7px 16px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s;
}

.btn-nav-cta:hover {
  background: var(--accent-soft);
}

/* ========== PAGE HEADER ========== */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 16px;
}

.page-title {
  font-family: var(--font-display);
  font-size: clamp(24px, 3vw, 36px);
  color: var(--primary);
  font-weight: 400;
  line-height: 1.15;
  margin: 0 0 4px;
}

.page-subtitle {
  color: var(--fg-muted);
  font-size: 15px;
  margin: 0;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover { background: var(--primary-light); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: var(--primary); color: white; }

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
}
.btn-ghost:hover { background: var(--bg-alt); color: var(--fg); }

.btn-green {
  background: #1a7a5a;
  color: white;
}
.btn-green:hover { background: #15614a; }

.btn-danger {
  background: #c0392b;
  color: white;
}
.btn-danger:hover { background: #a93226; }

.btn-danger-soft {
  background: rgba(192, 57, 43, 0.08);
  color: #c0392b;
  border: 1px solid rgba(192, 57, 43, 0.2);
}
.btn-danger-soft:hover { background: #c0392b; color: white; }

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* ========== STATS CARDS ========== */
.stats-cards {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.stat-card {
  flex: 1;
  min-width: 120px;
  background: var(--primary);
  border-radius: 12px;
  padding: 20px 24px;
  text-align: center;
}

.stat-card--accent { background: var(--accent); }
.stat-card--green { background: #1a7a5a; }

.stat-card-value {
  font-family: var(--font-display);
  font-size: 40px;
  color: var(--cream);
  line-height: 1;
  margin-bottom: 6px;
}

.stat-card-label {
  font-size: 12px;
  color: rgba(253, 248, 240, 0.7);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

/* ========== DASHBOARD GRID ========== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.dash-section {
  background: white;
  border-radius: 16px;
  padding: 28px;
  border: 1px solid rgba(13, 79, 79, 0.08);
}

.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.dash-section-title {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

/* ========== BRAND CARDS ========== */
.brand-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--bg-alt);
  gap: 12px;
}
.brand-card:last-child { border-bottom: none; }

.brand-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.brand-initial {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--primary);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 18px;
  flex-shrink: 0;
}

.brand-initial--lg {
  width: 52px;
  height: 52px;
  font-size: 24px;
  border-radius: 14px;
}

.brand-card-name {
  font-weight: 600;
  color: var(--fg);
  font-size: 14px;
}

.brand-card-meta {
  font-size: 12px;
  color: var(--fg-muted);
}

.brand-card-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ========== BRANDS GRID ========== */
.brands-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
}

.brand-full-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(13, 79, 79, 0.08);
}

.brand-full-card-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.brand-full-card-info { flex: 1; min-width: 0; }

.brand-full-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin: 0 0 6px;
}

.brand-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.chip {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--sage-light);
  color: var(--primary);
}

.chip--tone {
  background: rgba(232, 101, 74, 0.1);
  color: var(--accent);
}

.brand-audience {
  font-size: 13px;
  color: var(--fg-muted);
  margin: 0 0 12px;
}

.brand-topics {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.topic-tag {
  font-size: 11px;
  padding: 3px 10px;
  background: var(--bg-alt);
  border-radius: 100px;
  color: var(--fg-muted);
}

.brand-full-card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ========== POST PREVIEWS ========== */
.post-preview-list { display: flex; flex-direction: column; gap: 12px; }

.post-preview {
  padding: 12px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--bg-alt);
}

.post-preview-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.post-brand-label {
  font-size: 11px;
  color: var(--fg-muted);
  font-weight: 600;
}

.post-preview-content {
  font-size: 13px;
  color: var(--fg-muted);
  line-height: 1.5;
}

.view-all-link {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  display: block;
  margin-top: 8px;
}

/* ========== PLATFORM BADGES ========== */
.platform-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.platform-badge--twitter {
  background: rgba(29, 155, 240, 0.12);
  color: #1d9bf0;
}

.platform-badge--linkedin {
  background: rgba(10, 102, 194, 0.12);
  color: #0a66c2;
}

.platform-badge--instagram {
  background: rgba(228, 64, 95, 0.12);
  color: #e4405f;
}

/* ========== STATUS BADGES ========== */
.status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-badge--generating {
  background: rgba(232, 101, 74, 0.1);
  color: var(--accent);
}

.status-badge--ready {
  background: rgba(26, 122, 90, 0.1);
  color: #1a7a5a;
}

.status-badge--failed {
  background: rgba(192, 57, 43, 0.1);
  color: #c0392b;
}

.post-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.post-status-dot--pending_review { background: var(--accent); }
.post-status-dot--approved { background: #1a7a5a; }
.post-status-dot--rejected { background: #c0392b; }

/* ========== CALENDAR WEEK VIEW ========== */
.calendar-week {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.calendar-day {
  background: white;
  border-radius: 16px;
  border: 1px solid rgba(13, 79, 79, 0.08);
  overflow: hidden;
}

.calendar-day-header {
  background: var(--primary);
  padding: 12px 20px;
}

.calendar-day-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--cream);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.calendar-day-posts {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.post-card {
  border-radius: 12px;
  padding: 16px;
  background: var(--bg);
  border: 1.5px solid var(--bg-alt);
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.15s;
}

.post-card--approved {
  border-color: rgba(26, 122, 90, 0.3);
  background: rgba(26, 122, 90, 0.03);
}

.post-card--rejected {
  opacity: 0.6;
  border-style: dashed;
}

.post-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.post-text {
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg);
  white-space: pre-wrap;
  word-break: break-word;
  flex: 1;
}

.post-textarea {
  width: 100%;
  min-height: 120px;
  padding: 10px 12px;
  border: 1.5px solid var(--sage);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.6;
  color: var(--fg);
  background: white;
  resize: vertical;
}

.edit-form-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.post-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.approved-label {
  font-size: 12px;
  font-weight: 600;
  color: #1a7a5a;
}

.post-status-label {
  font-size: 12px;
  color: var(--fg-muted);
}

/* ========== CALENDAR BULK ACTIONS ========== */
.calendar-bulk-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--bg-alt);
}

.bulk-hint {
  font-size: 14px;
  color: var(--fg-muted);
  margin: 0;
}

.bulk-hint.all-approved {
  color: #1a7a5a;
  font-weight: 600;
}

/* ========== REVIEW LIST ========== */
.review-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.review-item {
  background: white;
  border-radius: 14px;
  padding: 20px 24px;
  border: 1px solid rgba(13, 79, 79, 0.08);
}

.review-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.review-brand {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.review-date {
  font-size: 12px;
  color: var(--fg-muted);
  margin-left: auto;
}

.review-post-text {
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg);
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0 0 16px;
}

.review-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ========== BRAND DETAIL ========== */
.detail-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 28px;
  margin-bottom: 32px;
}

.detail-card {
  background: white;
  border-radius: 16px;
  padding: 24px;
  border: 1px solid rgba(13, 79, 79, 0.08);
  align-self: start;
}

.detail-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--fg-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 16px;
}

.detail-rows { display: flex; flex-direction: column; gap: 12px; }

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.detail-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-muted);
}

.detail-value {
  font-size: 14px;
  color: var(--fg);
}

.detail-value a { color: var(--accent); text-decoration: none; }
.detail-value a:hover { text-decoration: underline; }

.detail-topics { margin-top: 16px; }

.detail-main {
  background: white;
  border-radius: 16px;
  padding: 24px 28px;
  border: 1px solid rgba(13, 79, 79, 0.08);
}

/* ========== CALENDAR LIST ========== */
.calendar-list { display: flex; flex-direction: column; gap: 8px; }

.calendar-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg);
  border-radius: 10px;
  border: 1px solid var(--bg-alt);
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}

.calendar-list-item:hover {
  border-color: var(--primary);
  background: var(--sage-light);
}

.calendar-list-date {
  font-size: 14px;
  font-weight: 600;
  color: var(--fg);
  flex: 1;
}

.calendar-list-arrow {
  font-size: 14px;
  color: var(--fg-muted);
}

/* ========== FORM CARD ========== */
.form-card {
  background: white;
  border-radius: 16px;
  padding: 32px;
  border: 1px solid rgba(13, 79, 79, 0.08);
  max-width: 720px;
  margin-bottom: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group--wide { grid-column: span 2; }

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--fg);
}

.required { color: var(--accent); }

.form-input {
  padding: 10px 14px;
  border: 1.5px solid var(--bg-alt);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--fg);
  background: var(--bg);
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: white;
}

.form-select { cursor: pointer; }

.form-hint {
  font-size: 12px;
  color: var(--fg-muted);
  margin: 0;
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ========== TIP BOX ========== */
.tip-box {
  max-width: 720px;
  background: rgba(232, 101, 74, 0.06);
  border: 1px solid rgba(232, 101, 74, 0.2);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 14px;
  color: var(--fg);
}

.tip-icon { font-size: 20px; flex-shrink: 0; }

/* ========== GENERATING BANNER ========== */
.generating-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(232, 101, 74, 0.06);
  border: 1.5px solid rgba(232, 101, 74, 0.3);
  border-radius: 12px;
  padding: 20px 24px;
  margin-bottom: 32px;
}

.generating-banner p {
  font-size: 13px;
  color: var(--fg-muted);
  margin: 4px 0 0;
}

.generating-spinner {
  width: 24px;
  height: 24px;
  border: 2.5px solid rgba(232, 101, 74, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ========== EMPTY STATES ========== */
.empty-state {
  text-align: center;
  padding: 32px 20px;
  color: var(--fg-muted);
  font-size: 14px;
}

.empty-state--large {
  padding: 60px 20px;
}

.empty-state--large h3 {
  font-family: var(--font-display);
  font-size: 24px;
  color: var(--primary);
  margin: 12px 0 8px;
  font-weight: 400;
}

.empty-icon { font-size: 40px; margin-bottom: 12px; }

.empty-state a { color: var(--accent); font-weight: 600; }

/* ========== ALERT ========== */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: 14px;
}

.alert-error {
  background: rgba(192, 57, 43, 0.08);
  border: 1px solid rgba(192, 57, 43, 0.2);
  color: #c0392b;
}

/* ========== DANGER ZONE ========== */
.danger-zone {
  border: 1.5px solid rgba(192, 57, 43, 0.2);
  border-radius: 12px;
  padding: 20px 24px;
  max-width: 500px;
}

.danger-zone h3 {
  font-size: 14px;
  font-weight: 700;
  color: #c0392b;
  margin: 0 0 12px;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
  .app-main { padding: 24px 20px 60px; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .calendar-day-posts { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .form-group--wide { grid-column: span 1; }
  .stats-cards { flex-wrap: wrap; }
  .stat-card { min-width: calc(50% - 8px); }
}

@media (max-width: 600px) {
  .app-nav-inner { gap: 16px; }
  .app-nav-links { display: none; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .brands-grid { grid-template-columns: 1fr; }
}

/* ========== LANDING PAGE TWEAKS ========== */
/* Add "Enter App" CTA to hero */
.hero-cta-group {
  display: flex;
  gap: 12px;
  margin-top: 36px;
}

.btn-hero-primary {
  display: inline-block;
  padding: 14px 32px;
  background: var(--accent);
  color: white;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
}

.btn-hero-primary:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.btn-hero-secondary {
  display: inline-block;
  padding: 14px 32px;
  border: 1.5px solid rgba(184, 207, 196, 0.4);
  color: var(--sage);
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.btn-hero-secondary:hover {
  border-color: var(--sage);
  color: var(--cream);
}
