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

/* ========== NAV ========== */
.app-nav {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 24px;
  height: 60px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: rgba(10,10,15,0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  color: #fff;
}

.logo-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--fg);
}

.nav-links {
  display: flex;
  gap: 4px;
  flex: 1;
}

.nav-link {
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-muted);
  text-decoration: none;
  transition: all 0.15s;
}

.nav-link:hover { color: var(--fg); background: rgba(255,255,255,0.05); }
.nav-link.active { color: var(--fg); background: rgba(255,255,255,0.08); }

/* ========== BUTTONS ========== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  flex-shrink: 0;
}
.btn-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.btn-sm { padding: 6px 14px; font-size: 13px; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
}
.btn-ghost:hover { color: var(--fg); border-color: rgba(255,255,255,0.2); }

/* ========== MAIN CONTENT ========== */
.app-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 24px 80px;
}

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

.page-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--fg);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-sub {
  font-size: 14px;
  color: var(--fg-muted);
  margin-top: 4px;
}

.back-link {
  font-size: 13px;
  color: var(--fg-muted);
  text-decoration: none;
  display: block;
  margin-bottom: 4px;
}
.back-link:hover { color: var(--fg); }

/* ========== STATS GRID ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

@media (max-width: 768px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.stat-card {
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 20px;
}

.accent-card { border-color: rgba(192,132,252,0.25); background: rgba(192,132,252,0.06); }

.stat-value {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  color: var(--fg);
  line-height: 1;
}

.accent-card .stat-value { color: var(--accent); }
.stat-label { font-size: 13px; color: var(--fg-muted); margin-top: 6px; }

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

@media (max-width: 768px) { .dashboard-grid { grid-template-columns: 1fr; } }

.dash-section {
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 20px;
}

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

.section-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
}

.link-muted { font-size: 13px; color: var(--fg-muted); text-decoration: none; }
.link-muted:hover { color: var(--accent); }
.link-accent { color: var(--accent); text-decoration: none; }
.link-accent:hover { text-decoration: underline; }

/* ========== BRAND CARDS (mini, for dashboard) ========== */
.brand-cards { display: flex; flex-direction: column; gap: 8px; }

.brand-card-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(255,255,255,0.03);
  text-decoration: none;
  transition: background 0.15s;
}
.brand-card-mini:hover { background: rgba(255,255,255,0.06); }

.brand-avatar-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
}

.brand-info { flex: 1; min-width: 0; }
.brand-name-sm { font-size: 14px; font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-meta-sm { font-size: 12px; color: var(--fg-muted); }

/* ========== CONTENT LIST ========== */
.content-list { display: flex; flex-direction: column; gap: 4px; }

.content-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.content-item-row:last-child { border-bottom: none; }

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

.content-item-info { flex: 1; min-width: 0; }
.content-title { font-size: 13px; font-weight: 500; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.content-meta { font-size: 12px; color: var(--fg-muted); }
.content-date { font-size: 12px; color: var(--fg-muted); text-align: right; white-space: nowrap; }

/* ========== STATUS BADGES ========== */
.status-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-active    { background: rgba(52,211,153,0.15); color: var(--accent-3); }
.status-inactive  { background: rgba(138,134,148,0.15); color: var(--fg-muted); }
.status-archived  { background: rgba(138,134,148,0.1); color: var(--fg-muted); }
.status-draft     { background: rgba(138,134,148,0.15); color: var(--fg-muted); }
.status-scheduled { background: rgba(96,165,250,0.15); color: #60a5fa; }
.status-published { background: rgba(52,211,153,0.15); color: var(--accent-3); }
.status-cancelled { background: rgba(251,146,60,0.15); color: #fb923c; }

/* ========== TAGS ========== */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  background: var(--accent-glow);
  color: var(--accent);
}
.tag-muted { background: rgba(255,255,255,0.06); color: var(--fg-muted); }

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

.brand-card {
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s, transform 0.15s;
  display: flex;
  flex-direction: column;
}
.brand-card:hover { border-color: rgba(192,132,252,0.2); transform: translateY(-2px); }

.brand-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px 16px 0;
}

.brand-avatar {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-avatar-lg {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.8rem;
}

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

.action-btn {
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  color: var(--fg-muted);
  background: rgba(255,255,255,0.05);
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  font-family: var(--font-body);
}
.action-btn:hover { color: var(--fg); background: rgba(255,255,255,0.1); }
.action-btn.danger:hover { color: #f87171; background: rgba(248,113,113,0.1); }

.brand-card-body {
  padding: 12px 16px;
  flex: 1;
  text-decoration: none;
  display: block;
}

.brand-card-name {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 8px;
}

.brand-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; align-items: center; }

.brand-voice { font-size: 12px; color: var(--fg-muted); margin-bottom: 8px; }
.brand-backstory { font-size: 13px; color: var(--fg-muted); line-height: 1.5; }

.brand-card-footer {
  padding: 10px 16px;
  border-top: 1px solid rgba(255,255,255,0.04);
}

/* ========== EMPTY STATE ========== */
.empty-state {
  text-align: center;
  padding: 24px;
  color: var(--fg-muted);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-state.large { padding: 80px 24px; }
.empty-icon { font-size: 2.5rem; }
.empty-state h2 { font-family: var(--font-display); font-size: 1.2rem; color: var(--fg); }

/* ========== FORMS ========== */
.brand-form { max-width: 680px; }

.form-section {
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
}

.form-section-title {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--fg);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }

.form-label { font-size: 13px; font-weight: 500; color: var(--fg); }
.required { color: var(--accent-2); }

.form-input {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 14px;
  transition: border-color 0.15s;
  width: 100%;
}
.form-input:focus { outline: none; border-color: rgba(192,132,252,0.5); }
.form-input::placeholder { color: var(--fg-muted); }

.form-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a8694' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; cursor: pointer; }
.form-select option { background: #1a1a24; }

.form-textarea { resize: vertical; min-height: 80px; }

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

/* ========== COLOR SWATCHES ========== */
.color-swatches { display: flex; gap: 10px; flex-wrap: wrap; }

.color-radio { display: none; }

.color-swatch-label { cursor: pointer; }

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: block;
  border: 3px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
}
.color-swatch-label:hover .color-swatch { transform: scale(1.1); }
.color-radio:checked + .color-swatch { border-color: var(--fg); transform: scale(1.15); }

/* ========== DETAIL GRID ========== */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
@media (max-width: 768px) { .detail-grid { grid-template-columns: 1fr; } }

.detail-panel {
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius);
  padding: 20px;
}

.panel-title { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--fg); margin-bottom: 16px; }

.profile-field { margin-bottom: 16px; }
.field-label { display: block; font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-muted); margin-bottom: 4px; }
.field-value { font-size: 14px; color: var(--fg); line-height: 1.6; }

/* ========== CALENDAR ========== */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cal-month {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--fg);
}

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

.legend-item { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg-muted); }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 32px;
}

.cal-day-header {
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg-muted);
  padding: 8px 4px;
}

.cal-cell {
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 8px;
  min-height: 90px;
  padding: 8px;
  overflow: hidden;
}

.cal-cell.empty { background: transparent; border-color: transparent; }
.cal-cell.today { border-color: rgba(192,132,252,0.35); background: rgba(192,132,252,0.05); }

.cal-day-num {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg-muted);
  margin-bottom: 4px;
}
.today .cal-day-num { color: var(--accent); }

.cal-item {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 4px;
  border-left: 2px solid;
  margin-bottom: 3px;
  font-size: 11px;
  line-height: 1.3;
  overflow: hidden;
}

.cal-item-brand { font-weight: 700; flex-shrink: 0; }
.cal-item-title { color: var(--fg-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.unscheduled-section { margin-top: 24px; }

/* ========== MODAL ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

.modal {
  background: var(--bg-elevated);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
}

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

.modal-title { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--fg); }

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255,255,255,0.06);
  border: none;
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover { background: rgba(255,255,255,0.1); color: var(--fg); }

.modal-form .form-group { margin-bottom: 14px; }

/* ========== UTILITIES ========== */
.text-muted { color: var(--fg-muted); }
.text-xs { font-size: 12px; }

/* Landing page — add dashboard link */
.landing-cta-row {
  display: flex;
  gap: 12px;
  margin-top: 32px;
}
