/* ═══════════════════════════════════════════════════════════
   Puhu Creative — Weekly Plan Page
   Dark/Light theme · Grid/List view toggle · Smooth animations
   ═══════════════════════════════════════════════════════════ */

*, *::before, *::after { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

:root {
  /* Dark Theme (Default) */
  --bg-base:       #0d0f10;
  --bg-panel:      #131618;
  --bg-card:       #1a1d20;
  --bg-hover:      #21252a;
  --bg-input:      #171a1d;

  --border:        #2a2e33;
  --border-hover:  #3d4449;

  --teal-600:      #e5c335;
  --teal-500:      #e5c335;
  --teal-400:      #e5c335;
  --teal-dim:      rgba(229,195,53,.15);
  --teal-glow:     rgba(229,195,53,.35);

  --amber-500:     #f59e0b;
  --amber-400:     #fbbf24;
  --amber-dim:     rgba(245,158,11,.12);

  --emerald-500:   #e5c335;
  --emerald-600:   #059669;
  --emerald-dim:   rgba(16,185,129,.15);

  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #475569;

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

  --sidebar-w:     240px;

  --shadow-card:   0 2px 12px rgba(0,0,0,.4), 0 1px 3px rgba(0,0,0,.3);
  --shadow-hover:  0 8px 24px rgba(0,0,0,.5), 0 4px 8px rgba(0,0,0,.4);
  --shadow-glow:   0 0 0 2px var(--teal-600), 0 0 20px var(--teal-glow);

  --transition:    200ms cubic-bezier(.4,0,.2,1);
}

/* Light Theme */
[data-theme="light"] {
  --bg-base:       #f8fafc;
  --bg-panel:      #ffffff;
  --bg-card:       #f1f5f9;
  --bg-hover:      #e2e8f0;
  --bg-input:      #ffffff;

  --border:        #e2e8f0;
  --border-hover:  #cbd5e1;

  --teal-dim:      rgba(229,195,53,.08);
  --amber-dim:     rgba(245,158,11,.08);
  --emerald-dim:   rgba(16,185,129,.08);

  --text-primary:  #0f172a;
  --text-secondary:#475569;
  --text-muted:    #94a3b8;

  --shadow-card:   0 2px 8px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.04);
  --shadow-hover:  0 8px 20px rgba(0,0,0,.12), 0 4px 8px rgba(0,0,0,.08);
  --shadow-glow:   0 0 0 2px var(--teal-600), 0 0 16px rgba(229,195,53,.2);
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background 300ms ease, color 300ms ease;
}

body {
  display: flex;
  flex-direction: row;
}

svg {
  flex-shrink: 0;
}

button { cursor: pointer; border: none; background: none; color: inherit; font: inherit; }
select { font: inherit; }
input { font: inherit; }
a { text-decoration: none; color: inherit; }

.hidden { display: none !important; }

/* ─────────────── SIDEBAR ─────────────── */

.sidebar {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100%;
  z-index: 40;
  overflow-y: auto;
  flex-shrink: 0;
  transition: background 300ms ease, border-color 300ms ease;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 18px;
  border-bottom: 1px solid var(--border);
  position: relative;
  transition: border-color 300ms ease;
}

.logo-image {
  height: 34px;
  width: auto;
  max-width: calc(100% - 72px);
  object-fit: contain;
  display: block;
}


.logo-mark {
  width: 36px; 
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--teal-600), #e5c335);
  display: flex; 
  align-items: center; 
  justify-content: center;
  box-shadow: 0 4px 12px rgba(229,195,53,.3);
}

.logo-mark svg {
  width: 20px;
  height: 20px;
  fill: white;
  stroke: none;
}

.logo-text {
  font-size: 18px; 
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--teal-400), var(--amber-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  flex: 1;
}

.theme-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: all var(--transition);
  position: absolute;
  right: 20px;
  top: 24px;
}

.theme-toggle:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

.theme-toggle svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.nav-section {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 12px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.nav-item svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--teal-dim);
  color: var(--teal-400);
  font-weight: 600;
}

.nav-divider {
  height: 1px;
  background: var(--border);
  margin: 12px 0;
  transition: background 300ms ease;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 300ms ease;
}

.package-info {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: all var(--transition);
}

.package-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.package-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-badge {
  font-size: 11px;
  font-weight: 700;
  color: #ef4444;
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: 6px;
  padding: 4px 10px;
  letter-spacing: 0.5px;
}

.package-notice {
  font-size: 12px;
  color: var(--text-muted);
}

.package-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: linear-gradient(135deg, var(--teal-600), #e5c335);
  color: white;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: opacity var(--transition), transform var(--transition);
  box-shadow: 0 4px 12px rgba(229,195,53,.25);
}

.package-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.logout-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.logout-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.logout-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
}

/* ─────────────── MAIN CONTENT ─────────────── */

.main-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  transition: background 300ms ease;
}

/* ─────────────── TOPBAR ─────────────── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 64px;
  min-height: 64px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
  z-index: 30;
  flex-shrink: 0;
  gap: 20px;
  transition: all 300ms ease;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.btn-action.is-dirty {
  background: rgba(220, 38, 38, 0.14);
  border-color: rgba(220, 38, 38, 0.55);
  color: #fecaca;
}

.btn-action.is-dirty:hover {
  background: rgba(220, 38, 38, 0.2);
  border-color: rgba(220, 38, 38, 0.75);
  color: #fee2e2;
}

.btn-action.is-saved {
  background: rgba(22, 163, 74, 0.16);
  border-color: rgba(22, 163, 74, 0.58);
  color: #bbf7d0;
}

.btn-action.is-saved:hover {
  background: rgba(22, 163, 74, 0.24);
  border-color: rgba(22, 163, 74, 0.78);
  color: #dcfce7;
}

.btn-action svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.btn-action:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.user-info {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.user-email {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-role {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  box-shadow: 0 4px 12px rgba(139,92,246,.3);
}

/* ─────────────── PLAN CONTAINER ─────────────── */

.plan-container {
  flex: 1;
  overflow-y: auto;
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Plan Header */
.plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.plan-intro {
  flex: 1;
}

.plan-title {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.plan-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ─────────────── SETTINGS SECTION ─────────────── */

.settings-section {
  order: 2;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transition: all 300ms ease;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 24px;
  align-items: start;
}

.setting-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setting-card.media-mix {
  grid-column: 2;
}

.setting-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.setting-select {
  width: 100%;
  padding: 11px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  color: var(--text-primary);
  transition: all var(--transition);
  cursor: pointer;
}

.setting-select:focus {
  outline: none;
  border-color: var(--teal-600);
  box-shadow: 0 0 0 3px var(--teal-dim);
}

/* Slider */
.slider-wrapper {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--bg-hover);
  outline: none;
  transition: background var(--transition);
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber-500), var(--amber-400));
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(245,158,11,.4);
  transition: transform var(--transition);
}

.slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
}

.slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber-500), var(--amber-400));
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(245,158,11,.4);
}

.slider-values {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.slider-value {
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 500;
}

.slider-value strong {
  color: var(--amber-400);
  font-weight: 700;
}

/* Checkbox */
.setting-row {
  display: flex;
  align-items: center;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--teal-600);
  cursor: pointer;
}

.checkbox-label {
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  font-weight: 500;
}

/* ─────────────── POSTS SECTION ─────────────── */

.posts-section {
  order: 3;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Posts Header */
.posts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.posts-title {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.posts-title h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.status-indicators {
  display: flex;
  align-items: center;
  gap: 12px;
}

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

.status-dot.onaylı {
  background: var(--emerald-500);
  box-shadow: 0 0 8px rgba(16,185,129,.4);
}

.status-dot.bekliyor {
  background: var(--amber-500);
  box-shadow: 0 0 8px rgba(245,158,11,.4);
}

.status-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* View Toggle */
.view-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-card);
}

.view-btn {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
  position: relative;
}

.view-btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.view-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.view-btn.active {
  background: var(--teal-dim);
  color: var(--teal-400);
}

.view-btn + .view-btn {
  border-left: 1px solid var(--border);
}

/* ─────────────── POSTS GRID VIEW ─────────────── */

.posts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  animation: fadeIn 400ms ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Post Card */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition);
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--border-hover);
}

.post-image {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  overflow: hidden;
}

.post-image-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* Post Overlay */
.post-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.8) 0%, transparent 60%);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 12px;
  gap: 8px;
  opacity: 0;
  transition: opacity var(--transition);
}

.post-card:hover .post-overlay {
  opacity: 1;
}

.post-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  transition: all var(--transition);
}

.post-action-btn svg {
  width: 16px;
  height: 16px;
  stroke: white;
  fill: none;
  stroke-width: 2;
}

.post-action-btn:hover {
  background: rgba(255,255,255,.22);
  transform: scale(1.05);
}

.post-action-btn.danger:hover {
  background: rgba(239,68,68,.45);
  border-color: rgba(239,68,68,.6);
}

/* Post Status Badge */
.post-status {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.3px;
}

.post-status svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
}

.post-status.approved {
  background: rgba(16,185,129,.9);
  color: white;
  box-shadow: 0 2px 8px rgba(16,185,129,.3);
}

.post-status.needs-review {
  background: rgba(245,158,11,.9);
  color: white;
  box-shadow: 0 2px 8px rgba(245,158,11,.3);
}

.post-status.rejected {
  background: rgba(239,68,68,.9);
  color: white;
  box-shadow: 0 2px 8px rgba(239,68,68,.3);
}

/* Post Info */
.post-info {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.post-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

.post-description {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.post-platform {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

.platform-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.platform-icon.instagram {
  stroke: #e4405f;
}

.post-date {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ─────────────── POSTS LIST VIEW ─────────────── */

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 400ms ease;
}

/* List Item */
.post-list-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all var(--transition);
  cursor: pointer;
}

.post-list-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card);
  transform: translateX(4px);
}

.list-item-image {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
}

.list-item-image-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.list-item-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.list-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-item-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.list-item-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.list-item-status svg {
  width: 12px;
  height: 12px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2.5;
}

.list-item-status.approved {
  background: rgba(16,185,129,.15);
  color: var(--emerald-600);
  border: 1px solid rgba(16,185,129,.2);
}

.list-item-status.needs-review {
  background: rgba(245,158,11,.15);
  color: #d97706;
  border: 1px solid rgba(245,158,11,.2);
}

.list-item-status.rejected {
  background: rgba(239,68,68,.15);
  color: #dc2626;
  border: 1px solid rgba(239,68,68,.2);
}

.list-item-description {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.list-item-meta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.list-item-platform {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}

.list-item-platform .platform-icon {
  width: 16px;
  height: 16px;
}

.list-item-date {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.list-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.list-action-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.list-action-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.list-action-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: scale(1.05);
}

.list-action-btn.danger:hover {
  background: rgba(239,68,68,.15);
  color: #ef4444;
  border-color: rgba(239,68,68,.3);
}

/* ─────────────── CALENDAR SECTION ─────────────── */

.calendar-section {
  margin-top: 0;
  order: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.calendar-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.calendar-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-title svg {
  width: 22px;
  height: 22px;
  stroke: var(--teal-400);
  fill: none;
  stroke-width: 2;
}

.calendar-title h3 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.calendar-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.calendar-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.05fr) minmax(320px, 1fr);
  gap: 18px;
  align-items: stretch;
}

.calendar-container {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 640px;
}

.calendar-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.calendar-nav-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.calendar-nav-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.calendar-nav-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.calendar-month-display {
  display: flex;
  gap: 4px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
}

.calendar-view-toggle {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 5px;
  color: var(--text-muted);
  transition: all var(--transition);
}

.calendar-view-toggle:hover {
  color: var(--text-secondary);
}

.calendar-view-toggle.active {
  background: var(--teal-dim);
  color: var(--teal-400);
}

.current-month {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  padding: 0 8px;
}

.calendar-today-btn,
.calendar-filter-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-today-btn:hover,
.calendar-filter-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.calendar-filter-btn svg {
  width: 14px;
  height: 14px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
}

.weekday {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 8px 4px;
}

.weekday.today {
  color: var(--teal-400);
}

.calendar-week-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  min-height: 260px;
}

.calendar-day {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 8px;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: all var(--transition);
  cursor: pointer;
}

.calendar-day:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  transform: translateY(-2px);
}

.calendar-day.today-cell {
  border-color: var(--teal-600);
  background: var(--teal-dim);
}

.calendar-day.active-day {
  border-color: var(--teal-600);
  background: var(--teal-dim);
  box-shadow: var(--shadow-glow);
}

.today-indicator {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 9px;
  font-weight: 700;
  color: var(--teal-400);
  background: rgba(229,195,53,.2);
  padding: 3px 7px;
  border-radius: 5px;
}

.calendar-event {
  position: relative;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal-500);
  border-radius: 7px;
  padding: 8px 26px 8px 9px;
  cursor: pointer;
  transition: all var(--transition);
}

.calendar-event:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.calendar-event.active-event {
  border-left-width: 4px;
  transform: scale(1.02);
}

.event-remove-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(239,68,68,.45);
  background: rgba(15, 23, 42, 0.78);
  color: #fca5a5;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: all var(--transition);
}

.calendar-event:hover .event-remove-btn {
  opacity: 1;
}

.event-remove-btn:hover {
  background: rgba(220, 38, 38, 0.26);
  border-color: rgba(239,68,68,.75);
  color: #fee2e2;
}

.calendar-event.instagram { border-left-color: #e4405f; }
.calendar-event.facebook { border-left-color: #1877f2; }
.calendar-event.youtube { border-left-color: #ff0000; }
.calendar-event.twitter { border-left-color: #1da1f2; }

.event-time {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.event-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.35;
}

.event-platform {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.calendar-sidebar {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  min-height: 640px;
  position: static;
}

.selected-day-info,
.upcoming-plans {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
  height: 100%;
}

.selected-day-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.platform-dropdown,
.time-picker,
.plan-description {
  width: 100%;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.platform-dropdown {
  appearance: none;
  padding: 11px 38px 11px 12px;
  font-size: 13px;
  color: var(--text-primary);
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.platform-dropdown:focus,
.time-picker:focus-within,
.plan-description:focus {
  outline: none;
  border-color: var(--teal-600);
  box-shadow: 0 0 0 3px var(--teal-dim);
}

.time-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.time-picker svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
}

.time-input {
  width: 100%;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 13px;
}

.time-input:focus {
  outline: none;
}

.plan-description {
  min-height: 82px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-primary);
  resize: vertical;
}

.plan-description::placeholder {
  color: var(--text-muted);
}

.plan-actions {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: auto;
}

.plan-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  transition: all var(--transition);
}

.plan-action-btn svg {
  width: 15px;
  height: 15px;
}

.plan-action-btn.outline {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-primary);
}

.plan-action-btn.outline:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.plan-action-btn.primary {
  background: linear-gradient(135deg, var(--teal-600), #e5c335);
  color: #fff;
  box-shadow: 0 4px 14px rgba(229,195,53,.3);
}

.plan-action-btn.primary:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.plan-action-btn.success {
  background: linear-gradient(135deg, #16a34a, #22c55e);
  color: #fff;
  box-shadow: 0 4px 14px rgba(34, 197, 94, 0.32);
}

.plan-action-btn.success:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.upcoming-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.plan-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  max-height: 100%;
  padding-right: 2px;
}

.plan-item {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal-500);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  cursor: pointer;
  transition: all var(--transition);
}

.plan-item:hover {
  background: var(--bg-hover);
  transform: translateX(3px);
}

.plan-item.active-plan {
  border-color: var(--teal-600);
  background: var(--teal-dim);
}

.plan-item.instagram { border-left-color: #e4405f; }
.plan-item.facebook { border-left-color: #1877f2; }
.plan-item.youtube { border-left-color: #ff0000; }
.plan-item.twitter { border-left-color: #1da1f2; }

.plan-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 7px;
}

.plan-item-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.plan-item-menu {
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all var(--transition);
}

.plan-item-menu:hover {
  background: var(--bg-input);
  color: var(--text-primary);
}

.plan-item-menu svg {
  width: 14px;
  height: 14px;
}

.plan-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.plan-item-date {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.plan-item-platform {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-input);
  padding: 3px 7px;
  border-radius: 4px;
}

/* ─────────────── RESPONSIVE ─────────────── */

@media (max-width: 1400px) {
  .posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

  .settings-grid {
    grid-template-columns: 1fr;
  }

  .setting-card.media-mix {
    grid-column: 1;
  }

  .calendar-layout {
    grid-template-columns: 1fr;
  }

  .calendar-sidebar {
    position: static;
    min-height: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
  }

  .calendar-container {
    min-height: 0;
  }
}

@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .topbar {
    padding: 0 20px;
  }

  .plan-container {
    padding: 20px;
  }

  .posts-grid {
    grid-template-columns: 1fr;
  }

  .calendar-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .calendar-nav {
    justify-content: space-between;
  }

  .calendar-week-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 6px;
    min-height: 200px;
  }

  .calendar-day {
    min-height: 92px;
    padding: 7px 6px;
  }

  .btn-action {
    padding: 10px 14px;
    font-size: 12px;
  }

  .btn-action span {
    display: none;
  }

  .user-info {
    display: none;
  }

  .post-list-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .calendar-sidebar {
    grid-template-columns: 1fr;
  }

  .list-item-image {
    width: 100%;
    height: 200px;
  }

  .list-item-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 480px) {
  .topbar-right {
    gap: 8px;
  }

  .settings-section {
    padding: 20px;
  }

  .posts-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .calendar-container {
    padding: 16px;
  }

  .selected-day-info,
  .upcoming-plans {
    padding: 14px;
  }
}

/* ─────────────── WEEKLY PLAN V2 OVERRIDES ─────────────── */

.posts-section {
  order: 2;
}

.cadence-section {
  order: 3;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.cadence-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.cadence-header p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.cadence-controls {
  display: flex;
  gap: 12px;
  align-items: flex-end;
  flex-wrap: wrap;
}

.cadence-card {
  min-width: 260px;
  max-width: 320px;
}

.cadence-save-btn {
  min-width: 220px;
  height: 44px;
}

.calendar-controls {
  align-items: flex-start;
}

.calendar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.calendar-today-btn {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.calendar-today-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.calendar-ai-btn,
.calendar-create-btn {
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  padding: 9px 12px;
  border: 1px solid transparent;
  transition: all var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.calendar-ai-btn {
  color: #fff;
  background: linear-gradient(135deg, var(--teal-600), #e5c335);
  box-shadow: 0 4px 14px rgba(229,195,53,.25);
}

.calendar-ai-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.calendar-ai-btn svg,
.calendar-create-btn svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.calendar-ai-btn svg {
  fill: currentColor;
  stroke: none;
}

.create-post-wrapper {
  position: relative;
}

.calendar-create-btn {
  color: var(--text-primary);
  background: var(--bg-panel);
  border-color: var(--border);
}

.calendar-create-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
}

.create-post-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 150px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-hover);
  z-index: 20;
}

.create-type-option {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 7px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.create-type-option:hover {
  background: var(--teal-dim);
  color: var(--teal-400);
}

.calendar-week-grid.month-view {
  min-height: 0;
}

.calendar-day {
  min-height: 130px;
}

.calendar-day-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  min-height: 14px;
}

.day-number {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
}

.calendar-day.other-month .day-number {
  color: var(--text-muted);
  opacity: 0.65;
}

.calendar-day.drop-target {
  border-color: var(--teal-500);
  background: rgba(229, 195, 53, 0.18);
}

.calendar-event {
  cursor: grab;
}

.calendar-event:active {
  cursor: grabbing;
}

.event-kind {
  display: inline-block;
  margin-top: 4px;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.calendar-empty {
  margin-top: auto;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.75;
}

.calendar-sidebar {
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.calendar-container {
  min-height: unset;
}

.calendar-layout {
  align-items: start;
}

.calendar-week-grid {
  min-height: 0;
}

.upcoming-plans {
  height: auto;
  min-height: 0;
}

.upcoming-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.upcoming-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal-400);
  background: var(--teal-dim);
  border-radius: 999px;
  padding: 3px 8px;
}

.plan-item-type {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.create-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 120;
}

.create-modal {
  width: min(940px, 100%);
  max-height: min(92vh, 1000px);
  overflow-y: auto;
  background: linear-gradient(160deg, var(--bg-card), var(--bg-panel));
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-hover);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.caption-edit-modal {
  width: min(760px, 100%);
}

.create-modal-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.create-modal-header h3 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
}

.create-modal-header p {
  margin-top: 4px;
  font-size: 13px;
  color: var(--text-secondary);
}

.create-modal-close {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.create-modal-close svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.create-modal-close:hover {
  background: var(--bg-hover);
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.create-modal-section {
  background: rgba(15, 23, 42, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.create-modal-section h4 {
  font-size: 18px;
  font-weight: 700;
}

.create-modal-section p {
  font-size: 13px;
  color: var(--text-secondary);
}

.create-media-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.create-media-btn {
  min-width: 160px;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.create-media-btn svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
}

.create-media-btn:hover {
  background: var(--bg-hover);
}

.create-media-btn.active {
  background: var(--teal-dim);
  border-color: var(--teal-600);
  color: var(--teal-400);
}

.modal-media-hint {
  font-size: 12px;
  color: var(--text-secondary);
}

.modal-media-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.modal-media-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-panel);
  color: var(--text-primary);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 6px;
  transition: all var(--transition);
  text-align: left;
}

.modal-media-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 8px;
}

.modal-media-item span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0 2px 2px;
}

.modal-media-item:hover {
  transform: translateY(-1px);
  border-color: var(--border-hover);
  box-shadow: var(--shadow-card);
}

.modal-media-item.active {
  border-color: var(--teal-600);
  box-shadow: var(--shadow-glow);
}

.modal-media-empty {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px dashed var(--border-hover);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 12px;
}

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
}

.checkbox-inline input {
  accent-color: var(--teal-500);
}

.create-caption {
  width: 100%;
  min-height: 130px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-primary);
  font-size: 14px;
  padding: 12px;
  resize: vertical;
}

.create-caption:focus {
  outline: none;
  border-color: var(--teal-600);
  box-shadow: 0 0 0 3px var(--teal-dim);
}

.create-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.switch-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.switch-inline input {
  width: 40px;
  height: 22px;
  accent-color: var(--teal-500);
}

.modal-platform-schedule {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.platform-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.platform-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.platform-inputs {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
  width: min(430px, 100%);
}

.platform-inputs input {
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-panel);
  color: var(--text-primary);
  padding: 0 10px;
}

.create-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 1024px) {
  .calendar-sidebar {
    min-height: 0;
  }
}

@media (max-width: 768px) {
  .calendar-week-grid.month-view {
    min-height: 420px;
  }

  .calendar-actions {
    width: 100%;
  }

  .calendar-ai-btn,
  .create-post-wrapper,
  .calendar-create-btn {
    width: 100%;
    justify-content: center;
  }

  .create-post-menu {
    left: 0;
    right: 0;
  }
}

@media (max-width: 480px) {
  .cadence-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .cadence-card,
  .cadence-save-btn {
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  .create-modal,
  .upcoming-plans {
    padding: 14px;
  }

  .platform-inputs {
    grid-template-columns: 1fr;
  }

  .create-modal-footer {
    flex-direction: column;
  }
}

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

/* ── Calendar Loading Overlay ─────────────────────────────── */
.wp-loading-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: #0A0A0F;
  display: flex; justify-content: center; align-items: center;
  font-family: 'Comfortaa', cursive;
  opacity: 1;
  transition: opacity 0.45s ease;
}
.wp-loading-overlay.wp-hidden {
  opacity: 0;
  pointer-events: none;
}
.wp-loading-bg {
  position: absolute; inset: 0; overflow: hidden;
}
.wp-orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.3;
  animation: wpFloat 20s ease-in-out infinite;
}
.wp-orb-1 { width: 400px; height: 400px; top: -150px; left: -100px;
  background: radial-gradient(circle, #E8FF59, transparent); }
.wp-orb-2 { width: 350px; height: 350px; bottom: -100px; right: -80px;
  background: radial-gradient(circle, #9B6DFF, transparent); animation-delay: -10s; }
.wp-orb-3 { width: 300px; height: 300px; top: 50%; right: 15%;
  background: radial-gradient(circle, #4D9FFF, transparent); animation-delay: -5s; }
@keyframes wpFloat {
  0%, 100% { transform: translate(0,0) scale(1); }
  33%       { transform: translate(30px,-30px) scale(1.05); }
  66%       { transform: translate(-20px,20px) scale(0.95); }
}
.wp-loading-box {
  position: relative; z-index: 10;
  text-align: center; padding: 30px; max-width: 500px;
  animation: wpFadeIn 0.6s ease;
}
@keyframes wpFadeIn {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}
.wp-brand {
  font-size: 42px; font-weight: 700;
  letter-spacing: -1px; margin-bottom: 25px;
  color: #fff;
}
.wp-brand-puhu  { color: #F2DE77; }
.wp-brand-social { color: #F2DE77; }
.wp-loading-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(232,255,89,.15); border: 1px solid rgba(232,255,89,.4);
  padding: 8px 20px; border-radius: 30px;
  font-size: 11px; font-weight: 600; color: #fff;
  margin-bottom: 20px; text-transform: uppercase; letter-spacing: .5px;
  animation: wpFadeInUp 0.6s ease 0.2s both;
}
.wp-pulse-dot {
  width: 6px; height: 6px; background: #E8FF59; border-radius: 50%;
  animation: wpPulseDot 2s ease-in-out infinite;
}
@keyframes wpPulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.5; transform: scale(0.8); }
}
.wp-loading-title {
  font-size: 20px; font-weight: 600; color: #fff;
  margin-bottom: 15px;
  animation: wpFadeInUp 0.6s ease 0.4s both;
}
.wp-dot { animation: wpDotPulse 1.5s ease-in-out infinite; }
.wp-dot:nth-child(1) { animation-delay: 0s; }
.wp-dot:nth-child(2) { animation-delay: 0.2s; }
.wp-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes wpDotPulse {
  0%, 100% { opacity: 0.3; } 50% { opacity: 1; }
}
.wp-loading-status {
  color: #9A9AA8; font-size: 14px; font-weight: 400;
  margin-bottom: 25px;
  animation: wpFadeInUp 0.6s ease 0.6s both;
  transition: opacity 0.3s ease;
}
.wp-progress-wrap {
  width: 320px; height: 6px; margin: 0 auto;
  background: rgba(255,255,255,.05); border-radius: 10px; overflow: hidden;
  animation: wpFadeInUp 0.6s ease 0.8s both;
}
.wp-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #E8FF59 0%, #9B6DFF 50%, #4D9FFF 100%);
  border-radius: 10px; width: 0%;
  animation: wpLoading 2.5s ease-in-out infinite;
  box-shadow: 0 0 15px rgba(232,255,89,.4);
}
@keyframes wpLoading {
  0%   { width: 0%;    transform: translateX(0); }
  50%  { width: 100%;  transform: translateX(0); }
  100% { width: 100%;  transform: translateX(100%); }
}
@keyframes wpFadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}
