:root {
  --bg: #030b14;
  --bg-soft: #061321;
  --panel: rgba(8, 23, 38, 0.88);
  --panel-2: #0b1b2c;
  --panel-3: #0d2237;
  --line: rgba(78, 174, 230, 0.13);
  --line-strong: rgba(31, 199, 244, 0.35);
  --text: #f3f8fd;
  --muted: #8ca4b9;
  --cyan: #23c7f3;
  --cyan-soft: #80e7ff;
  --blue: #087cb8;
  --blue-deep: #034b78;
  --yellow: #ffd336;
  --orange: #ff8a18;
  --success: #66e4b5;
  --danger: #ff7c86;
  --shadow: 0 28px 90px rgba(0, 0, 0, .36);
  --radius: 22px;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: linear-gradient(145deg, #020810 0%, #04101c 48%, #061320 100%);
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }

.ambient {
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(95px);
  opacity: .12;
  pointer-events: none;
}
.ambient-a { top: -250px; right: -170px; background: var(--cyan); }
.ambient-b { bottom: -300px; left: 18%; background: var(--blue); }

.app-shell { display: grid; grid-template-columns: 268px 1fr; min-height: 100vh; position: relative; z-index: 1; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px 20px;
  border-right: 1px solid var(--line);
  background: rgba(2, 10, 18, .82);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  padding: 4px 4px 22px;
}
.brand-logo {
  width: 52px;
  height: 52px;
  object-fit: cover;
  object-position: center;
  border-radius: 15px;
  box-shadow: 0 0 28px rgba(35, 199, 243, .13);
}
.brand-copy { min-width: 0; }
.brand-copy strong { display: block; font: 700 15px/1.2 Manrope, sans-serif; letter-spacing: -.2px; }
.brand-copy span { display: block; color: var(--muted); font-size: 11px; margin-top: 5px; }

.nav { display: grid; gap: 7px; margin-top: 10px; }
.nav-item {
  width: 100%;
  height: 47px;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  align-items: center;
  text-align: left;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #9db0c1;
  cursor: pointer;
  transition: .2s ease;
}
.nav-item:hover:not(.disabled) { background: rgba(255,255,255,.03); color: #fff; }
.nav-item.active {
  color: #fff;
  border-color: rgba(35,199,243,.14);
  background: linear-gradient(90deg, rgba(35,199,243,.14), rgba(35,199,243,.025));
  box-shadow: inset 3px 0 0 var(--cyan);
}
.nav-icon { color: var(--cyan); font-size: 17px; }
.nav-item small { font-size: 9px; color: #5e778c; text-transform: uppercase; letter-spacing: .7px; }
.nav-item.disabled { cursor: default; opacity: .55; }

.sidebar-bottom { margin-top: auto; }
.future-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: linear-gradient(145deg, rgba(35,199,243,.055), rgba(255,138,24,.025));
}
.future-card .mini-label { font-size: 9px; letter-spacing: 1.35px; color: var(--cyan); font-weight: 800; }
.future-card strong { display: block; font-size: 13px; margin-top: 9px; }
.future-card p { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
.future-line { display: flex; gap: 5px; margin-top: 14px; }
.future-line i { width: 26px; height: 3px; border-radius: 999px; background: var(--cyan); }
.future-line i:nth-child(2) { background: var(--yellow); }
.future-line i:nth-child(3) { background: var(--orange); }
.micro { color: #536b7e; font-size: 9px; margin: 13px 4px 0; }

.main { padding: 31px 36px 60px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 30px; max-width: 1500px; margin: 0 auto 28px; }
.eyebrow { color: var(--cyan); font-weight: 800; font-size: 10px; letter-spacing: 1.7px; margin: 0 0 9px; }
h1, h2, h3, h4 { font-family: Manrope, Inter, sans-serif; }
h1 { margin: 0; font-size: clamp(26px, 3vw, 38px); letter-spacing: -1.2px; line-height: 1.14; }
.page-subtitle { margin: 10px 0 0; max-width: 710px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.topbar-actions { display: flex; align-items: center; gap: 10px; padding-top: 4px; flex-shrink: 0; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 13px;
  border: 1px solid var(--line); border-radius: 999px; color: #9eb1c2; font-size: 11px; background: rgba(4,14,24,.55);
}
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--success); box-shadow: 0 0 12px rgba(102,228,181,.8); }

button { border: 0; }
.ghost-btn, .secondary-btn, .google-btn, .icon-btn { cursor: pointer; }
.ghost-btn {
  min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; background: transparent; color: var(--muted); font-size: 11px;
}
.ghost-btn:hover { border-color: var(--line-strong); color: #fff; }

.page { display: none; max-width: 1500px; margin: 0 auto; }
.page.active-page { display: block; }
.workflow-strip {
  display: flex;
  align-items: center;
  max-width: 900px;
  margin-bottom: 22px;
  padding: 0 6px;
}
.workflow-item { display: flex; align-items: center; gap: 9px; color: #647c90; }
.workflow-item > span {
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; background: #0a1a29; border: 1px solid var(--line); font-size: 11px; font-weight: 800;
}
.workflow-item.active > span { color: #00111c; background: var(--cyan); box-shadow: 0 0 22px rgba(35,199,243,.24); }
.workflow-item b { display: block; font-size: 11px; color: #9fb1c0; }
.workflow-item.active b { color: #fff; }
.workflow-item small { display: block; font-size: 9px; margin-top: 1px; }
.workflow-line { flex: 1; min-width: 26px; height: 1px; background: var(--line); margin: 0 12px; }

.creator-grid { display: grid; grid-template-columns: minmax(390px, .88fr) minmax(500px, 1.32fr); gap: 20px; align-items: start; }
.result-stack { display: grid; gap: 20px; }
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(145deg, rgba(9,24,40,.92), rgba(5,16,29,.91));
  box-shadow: var(--shadow);
  overflow: hidden;
}
.form-panel { padding: 24px; }
.result-panel, .production-panel { padding: 24px; }
.section-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.section-heading .step {
  width: 35px; height: 35px; display: grid; place-items: center; flex: 0 0 35px; border-radius: 11px;
  background: rgba(35,199,243,.09); border: 1px solid rgba(35,199,243,.18); color: var(--cyan); font-size: 10px; font-weight: 800;
}
.section-heading .step.warm { color: var(--yellow); border-color: rgba(255,211,54,.2); background: rgba(255,211,54,.07); }
.section-heading h2 { font-size: 16px; margin: 0; letter-spacing: -.25px; }
.section-heading p { color: var(--muted); font-size: 10.5px; margin: 4px 0 0; }
.result-heading .draft-badge, .production-badge { margin-left: auto; }
.draft-badge, .production-badge {
  padding: 6px 9px; border-radius: 999px; border: 1px solid var(--line); color: #9bb0c2; font-size: 9px; text-transform: uppercase; letter-spacing: .6px;
}
.production-badge { color: #e7ba24; border-color: rgba(255,211,54,.16); background: rgba(255,211,54,.04); }

form { display: grid; gap: 17px; }
.two-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: grid; gap: 8px; }
.field > span, .approval-bar label > span { color: #b7c5d1; font-size: 10.5px; font-weight: 700; }
.field em { font-weight: 400; color: #5f778b; font-style: normal; }
select, input, textarea {
  width: 100%; border: 1px solid var(--line); background: rgba(2,11,20,.7); color: var(--text); border-radius: 12px; outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
select, input { height: 43px; padding: 0 12px; }
textarea { padding: 12px; resize: vertical; line-height: 1.55; }
select:focus, input:focus, textarea:focus { border-color: rgba(35,199,243,.46); box-shadow: 0 0 0 3px rgba(35,199,243,.055); background: rgba(3,15,26,.9); }
::placeholder { color: #4e6477; }
select option { background: #071522; }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); padding: 4px; border: 1px solid var(--line); background: rgba(2,10,18,.68); border-radius: 13px; }
.segmented button { background: transparent; border-radius: 9px; min-height: 44px; cursor: pointer; color: #6f879a; }
.segmented button b, .segmented button small { display: block; }
.segmented button b { font-size: 10.5px; }
.segmented button small { font-size: 8.5px; margin-top: 2px; }
.segmented button.selected { color: #fff; background: linear-gradient(145deg, rgba(35,199,243,.14), rgba(8,124,184,.11)); box-shadow: inset 0 0 0 1px rgba(35,199,243,.09); }

.format-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.format-card {
  min-height: 88px; padding: 12px 9px; border: 1px solid var(--line); border-radius: 13px; background: rgba(2,11,20,.58); cursor: pointer; text-align: left; color: #849bad; transition: .18s ease;
}
.format-card:hover { transform: translateY(-1px); border-color: rgba(35,199,243,.25); }
.format-card .format-icon { color: var(--cyan); font-size: 14px; display: block; margin-bottom: 8px; }
.format-card strong { color: #c8d4de; font-size: 10.5px; display: block; }
.format-card small { display: block; font-size: 8.5px; margin-top: 3px; }
.format-card.selected { border-color: rgba(35,199,243,.38); background: linear-gradient(145deg, rgba(35,199,243,.105), rgba(3,75,120,.09)); box-shadow: 0 0 22px rgba(35,199,243,.045); }
.format-card.selected strong { color: #fff; }

.primary-btn {
  height: 46px; border-radius: 13px; cursor: pointer; font-weight: 800; font-size: 11px; letter-spacing: .15px; color: #00131d;
  background: linear-gradient(105deg, var(--cyan), #55dfff); box-shadow: 0 12px 28px rgba(35,199,243,.14); transition: .18s ease;
}
.primary-btn:hover { transform: translateY(-1px); box-shadow: 0 16px 35px rgba(35,199,243,.2); }
.primary-btn:disabled { opacity: .55; cursor: wait; transform: none; }
.primary-btn span { margin-right: 6px; }
.primary-btn.compact { height: 40px; padding: 0 15px; }
.secondary-btn { min-height: 40px; padding: 0 14px; border-radius: 11px; background: #0b2134; border: 1px solid rgba(35,199,243,.16); color: #b9d9e9; font-size: 10.5px; }
.secondary-btn:hover { border-color: rgba(35,199,243,.35); color: #fff; }

.empty-state { min-height: 460px; display: grid; place-content: center; text-align: center; padding: 50px; border: 1px dashed rgba(83,145,187,.16); border-radius: 16px; background: radial-gradient(circle at 50% 44%, rgba(35,199,243,.055), transparent 35%); }
.empty-state .spark { width: 52px; height: 52px; margin: 0 auto 15px; border-radius: 16px; display: grid; place-items: center; color: var(--cyan); border: 1px solid rgba(35,199,243,.17); background: rgba(35,199,243,.055); }
.empty-state h3 { margin: 0; font-size: 14px; }
.empty-state p { max-width: 340px; margin: 8px auto 0; color: var(--muted); font-size: 10.5px; line-height: 1.6; }
.hidden { display: none !important; }
.result-area { display: grid; gap: 13px; }
.result-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.meta-chip { padding: 6px 9px; border: 1px solid var(--line); border-radius: 999px; color: #8eacbf; background: rgba(2,11,20,.45); font-size: 9px; }
#generatedContent { min-height: 390px; max-height: 660px; font-size: 11px; color: #d6e2ea; }
.approval-bar { display: grid; grid-template-columns: minmax(145px, 1fr) auto auto; gap: 9px; align-items: end; padding-top: 3px; }
.approval-bar label { display: grid; gap: 6px; }
.approval-bar input { height: 40px; }
.save-note { color: #587185; font-size: 9px; margin: 0; line-height: 1.5; }

.production-panel { border-color: rgba(255,211,54,.12); background: linear-gradient(145deg, rgba(12,26,39,.95), rgba(8,18,29,.95)); }
#productionContent { min-height: 320px; color: #d9e2e8; font-size: 11px; }
.production-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 11px; }
.production-loading { min-height: 150px; align-items: center; justify-content: center; gap: 14px; color: #aebbc6; }
.production-loading:not(.hidden) { display: flex; }
.production-loading b { display: block; font-size: 11px; }
.production-loading small { display: block; color: #6f8496; margin-top: 4px; font-size: 9.5px; }
.loader { width: 28px; height: 28px; border-radius: 50%; border: 2px solid rgba(255,211,54,.14); border-top-color: var(--yellow); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.planning-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.planning-toolbar h2 { margin: 0; font-size: 24px; letter-spacing: -.7px; }
.planning-toolbar p:not(.eyebrow) { margin: 7px 0 0; font-size: 11px; color: var(--muted); }
.toolbar-right { display: flex; align-items: center; gap: 10px; }
.google-btn { height: 38px; padding: 0 12px; border-radius: 11px; border: 1px solid var(--line); background: rgba(5,16,28,.72); color: #657c8e; font-size: 10px; cursor: default; }
.google-btn small { margin-left: 5px; font-size: 8px; }
.view-switcher { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid var(--line); background: rgba(2,10,18,.68); border-radius: 12px; }
.view-switcher button { min-width: 90px; height: 31px; border-radius: 8px; background: transparent; color: #71899c; cursor: pointer; font-size: 10px; }
.view-switcher button.selected { color: #fff; background: rgba(35,199,243,.12); }
.planning-view { display: none; }
.planning-view.active-view { display: block; }
.calendar-panel { padding: 18px; }
.calendar-head { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 15px; }
.calendar-head h3 { min-width: 190px; text-align: center; margin: 0; text-transform: capitalize; font-size: 14px; }
.icon-btn { width: 32px; height: 32px; border: 1px solid var(--line); background: rgba(2,10,18,.62); border-radius: 9px; color: #9aafbf; font-size: 18px; }
.icon-btn:hover { color: #fff; border-color: var(--line-strong); }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays { color: #5e7588; font-size: 8.5px; font-weight: 800; text-align: center; letter-spacing: .7px; }
.calendar-weekdays span { padding: 8px; }
.calendar-grid { border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.calendar-day { min-height: 115px; padding: 9px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow: hidden; background: rgba(4,14,24,.18); }
.calendar-day.outside { opacity: .34; }
.day-number { font-size: 9px; color: #71889a; display: inline-grid; place-items: center; width: 23px; height: 23px; border-radius: 7px; margin-bottom: 6px; }
.calendar-day.today .day-number { background: var(--cyan); color: #00121b; font-weight: 800; }
.calendar-item { display: block; margin-top: 4px; padding: 6px 7px; border-left: 2px solid var(--cyan); border-radius: 6px; background: rgba(35,199,243,.07); color: #afd6e5; font-size: 8.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.kanban-board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.kanban-column { min-height: 560px; border: 1px solid var(--line); background: rgba(7,20,34,.66); border-radius: 16px; padding: 11px; }
.kanban-header { display: flex; align-items: center; justify-content: space-between; padding: 5px 4px 12px; }
.kanban-header strong { font-size: 10.5px; }
.kanban-count { width: 23px; height: 23px; display: grid; place-items: center; background: #0a2135; border-radius: 7px; color: #7590a4; font-size: 9px; }
.kanban-list { min-height: 490px; border-radius: 11px; transition: .18s ease; }
.kanban-list.drag-over { background: rgba(35,199,243,.04); box-shadow: inset 0 0 0 1px rgba(35,199,243,.13); }
.kanban-card { border: 1px solid var(--line); background: linear-gradient(145deg, #0b1d2e, #071624); border-radius: 13px; padding: 12px; margin-bottom: 9px; cursor: grab; box-shadow: 0 10px 28px rgba(0,0,0,.14); }
.kanban-card:active { cursor: grabbing; }
.k-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.k-format { color: var(--cyan); font-size: 8.5px; text-transform: uppercase; letter-spacing: .5px; }
.k-date { color: #5f7689; font-size: 8.5px; }
.kanban-card h4 { font-size: 10.5px; line-height: 1.45; margin: 9px 0 7px; }
.kanban-card p { margin: 0; color: #758c9e; font-size: 8.8px; line-height: 1.45; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; }
.k-area { display: inline-block; margin-top: 11px; padding: 5px 7px; border-radius: 999px; background: rgba(255,211,54,.05); color: #c6a62d; border: 1px solid rgba(255,211,54,.10); font-size: 8px; }
.empty-kanban { padding: 22px 10px; text-align: center; color: #496275; border: 1px dashed rgba(83,145,187,.10); border-radius: 10px; font-size: 8.5px; }

.toast { position: fixed; right: 24px; bottom: 24px; z-index: 30; max-width: 360px; padding: 12px 15px; border: 1px solid rgba(35,199,243,.18); border-radius: 12px; background: #0b1d2e; color: #d6e3ec; box-shadow: 0 20px 50px rgba(0,0,0,.35); font-size: 10.5px; transform: translateY(25px); opacity: 0; pointer-events: none; transition: .22s ease; }
.toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 220px 1fr; }
  .main { padding: 28px 24px 50px; }
  .creator-grid { grid-template-columns: 1fr; }
  .empty-state { min-height: 310px; }
}
@media (max-width: 820px) {
  .app-shell { display: block; }
  .sidebar { position: relative; width: 100%; height: auto; padding: 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand { padding-bottom: 12px; }
  .brand-logo { width: 44px; height: 44px; }
  .nav { grid-template-columns: 1fr 1fr; margin: 0; }
  .nav-item.disabled, .sidebar-bottom { display: none; }
  .main { padding: 22px 14px 42px; }
  .topbar { display: block; }
  .topbar-actions { margin-top: 15px; }
  .workflow-strip { overflow-x: auto; }
  .workflow-item small, .workflow-line { display: none; }
  .workflow-item { margin-right: 14px; }
  .two-fields, .approval-bar { grid-template-columns: 1fr; }
  .format-grid { grid-template-columns: 1fr; }
  .format-card { min-height: 70px; }
  .planning-toolbar { align-items: flex-start; display: block; }
  .toolbar-right { margin-top: 15px; flex-wrap: wrap; }
  .calendar-day { min-height: 82px; padding: 5px; }
  .calendar-item { font-size: 0; width: 7px; height: 7px; border-radius: 50%; padding: 0; border: 0; background: var(--cyan); }
  .kanban-board { grid-template-columns: repeat(4, 260px); }
}
