/* Marketing Blueprint v2 — Dark Theme — Enhanced UI */
:root {
  --bg: #0f0f23;
  --bg2: #1a1a2e;
  --bg3: #16213e;
  --bg4: #1e2a45;
  --text: #e2e8f0;
  --text2: #94a3b8;
  --text3: #64748b;
  --accent: #3b82f6;
  --accent2: #6c5ce7;
  --green: #10b981;
  --red: #ef4444;
  --yellow: #f59e0b;
  --orange: #f97316;
  --pink: #ec4899;
  --purple: #8b5cf6;
  --border: #1e293b;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,.3);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.4);
  --transition: .2s ease;
  --gradient: linear-gradient(135deg, #3b82f6, #8b5cf6);
  --gradient-glow: linear-gradient(135deg, rgba(59,130,246,.4), rgba(139,92,246,.4));
  --glass-bg: rgba(255,255,255,0.05);
  --glass-border: rgba(255,255,255,0.1);
}

[data-theme="light"] {
  --bg: #f1f5f9;
  --bg2: #ffffff;
  --bg3: #f8fafc;
  --bg4: #e2e8f0;
  --text: #1e293b;
  --text2: #475569;
  --text3: #94a3b8;
  --border: #cbd5e1;
  --shadow: 0 2px 8px rgba(0,0,0,.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,.12);
  --glass-bg: rgba(255,255,255,0.6);
  --glass-border: rgba(0,0,0,0.08);
}

/* Smooth theme transition */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
  transition: background-color .3s ease, border-color .3s ease, color .3s ease, box-shadow .3s ease;
}

body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }

/* ===== KEYFRAME ANIMATIONS ===== */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideInLeft {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes countUp {
  from { opacity: 0; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes progressGrow {
  from { width: 0; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .5; }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,.4); }
  50% { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}
@keyframes breathe {
  0%, 100% { opacity: .4; }
  50% { opacity: 1; }
}
@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}
@keyframes gradientBorder {
  0% { border-color: #3b82f6; }
  50% { border-color: #8b5cf6; }
  100% { border-color: #3b82f6; }
}

/* Staggered entrance */
.animate-in { animation: fadeSlideIn .5s ease both; }
.animate-in:nth-child(1) { animation-delay: 0s; }
.animate-in:nth-child(2) { animation-delay: .06s; }
.animate-in:nth-child(3) { animation-delay: .12s; }
.animate-in:nth-child(4) { animation-delay: .18s; }
.animate-in:nth-child(5) { animation-delay: .24s; }
.animate-in:nth-child(6) { animation-delay: .3s; }
.animate-in:nth-child(7) { animation-delay: .36s; }
.animate-in:nth-child(8) { animation-delay: .42s; }

/* Active status pulse dot */
.status-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green);
  animation: pulseGlow 2s ease-in-out infinite;
}
.status-dot.inactive { background: var(--text3); animation: none; }

/* Loading state */
.page-loading { text-align: center; padding: 60px; color: var(--text2); animation: breathe 1.5s ease-in-out infinite; font-size: 1rem; }

/* Progress bar animation */
.progress-bar-animated {
  height: 100%; border-radius: 2px; animation: progressGrow .8s ease both;
}

/* ===== LAYOUT ===== */
.app-layout { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar {
  width: 260px; background: var(--bg2); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow-y: auto; flex-shrink: 0;
  transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.sidebar-header { padding: 24px 20px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--border); }
.sidebar-header h2 { font-size: 1rem; font-weight: 700; white-space: nowrap; }
.sidebar-nav { flex: 1; padding: 8px 0; overflow-y: auto; }
.sidebar-footer { padding: 12px; border-top: 1px solid var(--border); }
.nav-section { padding: 18px 20px 6px; font-size: .65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text3); }
.nav-item {
  padding: 9px 20px; display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: .875rem; color: var(--text2); transition: all .2s ease;
  border-left: 3px solid transparent; position: relative;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active {
  background: var(--bg3); color: var(--accent); font-weight: 600;
  border-image: var(--gradient) 1;
}
.nav-item .emoji { font-size: 1rem; width: 20px; text-align: center; }

.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* Topbar with gradient underline */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 24px; border-bottom: 1px solid var(--border);
  background: var(--bg2); flex-shrink: 0; position: relative;
}
.topbar::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 2px;
  background: var(--gradient); opacity: .4;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 10px; }
.menu-btn { display: none; background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text); }
.biz-select { background: var(--bg3); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 12px; font-size: .85rem; cursor: pointer; }
.biz-select option { background: var(--bg2); }
.content { flex: 1; overflow-y: auto; padding: 28px 32px; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  border: none; border-radius: var(--radius-sm); cursor: pointer;
  font-size: .85rem; font-weight: 600; transition: all .2s ease;
}
.btn-primary {
  background: var(--gradient); color: #fff;
  box-shadow: 0 2px 12px rgba(59,130,246,.3);
}
.btn-primary:hover { box-shadow: 0 4px 20px rgba(59,130,246,.5); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text2); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg3); color: var(--text); border-color: var(--glass-border); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 4px 10px; font-size: .75rem; }
.btn-icon { background: none; border: none; cursor: pointer; font-size: 1rem; padding: 4px; color: var(--text2); transition: color .2s ease; }
.btn-icon:hover { color: var(--text); }
.theme-toggle { background: none; border: none; font-size: 1.2rem; cursor: pointer; }

/* ===== GLASSMORPHISM CARDS ===== */
.card {
  background: var(--glass-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border); border-radius: var(--radius); overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--glass-border); display: flex; justify-content: space-between; align-items: center; }
.card-body { padding: 20px; }

.stat-card {
  background: var(--glass-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 20px;
  text-align: center; transition: transform .25s ease, box-shadow .25s ease;
  position: relative; overflow: hidden;
}
.stat-card::before {
  content: ''; position: absolute; inset: 0; border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(59,130,246,.08), rgba(139,92,246,.08));
  opacity: 0; transition: opacity .3s ease;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.stat-card:hover::before { opacity: 1; }
.stat-value { font-size: 2rem; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { font-size: .8rem; color: var(--text2); margin-top: 6px; text-transform: uppercase; letter-spacing: .04em; }

/* Gradient border accent card */
.card-accent {
  position: relative;
}
.card-accent::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient); border-radius: var(--radius) var(--radius) 0 0;
}

.draft-card {
  background: var(--glass-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px;
  transition: transform .2s ease, box-shadow .2s ease;
}
.draft-card:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.draft-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }

/* ===== GRIDS ===== */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ===== TAGS ===== */
.tag { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: .7rem; font-weight: 600; }
.tag-blue { background: rgba(59,130,246,.15); color: #60a5fa; }
.tag-green { background: rgba(16,185,129,.15); color: #34d399; }
.tag-red { background: rgba(239,68,68,.15); color: #f87171; }
.tag-yellow { background: rgba(245,158,11,.15); color: #fbbf24; }
.tag-purple { background: rgba(139,92,246,.15); color: #a78bfa; }
.tag-pink { background: rgba(236,72,153,.15); color: #f472b6; }
.tag-orange { background: rgba(249,115,22,.15); color: #fb923c; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: .8rem; font-weight: 600; margin-bottom: 4px; color: var(--text2); }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
input, select, textarea {
  width: 100%; padding: 10px 14px; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text); font-size: .85rem; font-family: inherit;
  transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59,130,246,.15); }
textarea { min-height: 80px; resize: vertical; }

/* ===== TABLES ===== */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--border); font-size: .85rem; }
th { font-weight: 600; color: var(--text2); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; background: var(--bg); }
tr { transition: background .15s ease; }
tr:hover { background: var(--bg4); }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.6); display: flex; align-items: center; justify-content: center; z-index: 1000; backdrop-filter: blur(4px); animation: fadeIn .2s ease; }
.modal-box {
  background: var(--bg2); border: 1px solid var(--glass-border); border-radius: var(--radius);
  width: 480px; max-width: 95vw; max-height: 90vh; overflow-y: auto;
  animation: fadeSlideIn .3s ease; box-shadow: 0 24px 64px rgba(0,0,0,.5);
}
.modal-box.wide { width: 640px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; }
.modal-foot { padding: 12px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* ===== LOGIN ===== */
.login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.login-box {
  background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 40px; width: 400px; max-width: 95vw;
  animation: fadeSlideIn .5s ease; box-shadow: var(--shadow-lg);
}
.login-header { text-align: center; margin-bottom: 28px; }
.login-header h1 { font-size: 1.6rem; margin-top: 8px; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.login-header p { color: var(--text2); font-size: .9rem; }
.login-error { background: rgba(239,68,68,.1); color: var(--red); padding: 10px; border-radius: var(--radius-sm); font-size: .85rem; margin-bottom: 12px; }
.hidden { display: none !important; }

/* ===== PAGE ELEMENTS ===== */
.page-title { font-size: 1.75rem; font-weight: 800; margin-bottom: 6px; letter-spacing: -.02em; }
.page-desc { color: var(--text2); font-size: .95rem; margin-bottom: 24px; }
.error-msg { text-align: center; padding: 40px; color: var(--red); }

/* ===== WELCOME SECTION ===== */
.welcome-section {
  background: var(--glass-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 28px 32px; margin-bottom: 24px; position: relative; overflow: hidden;
  animation: fadeSlideIn .5s ease;
}
.welcome-section::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--gradient);
}
.welcome-greeting { font-size: 1.6rem; font-weight: 800; margin-bottom: 4px; }
.welcome-subtitle { color: var(--text2); font-size: .95rem; margin-bottom: 16px; }
.welcome-stats { display: flex; gap: 24px; flex-wrap: wrap; }
.welcome-stat { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--text2); }
.welcome-stat strong { color: var(--text); font-size: 1.1rem; }

/* ===== CAVE WARNING ===== */
.cave-warning {
  background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.2);
  border-radius: var(--radius); padding: 16px 20px; display: flex; align-items: center;
  gap: 12px; margin-bottom: 16px; animation: fadeSlideIn .5s ease .1s both;
}

/* ===== ACTION ROWS ===== */
.action-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .85rem; transition: opacity .2s ease; }
.action-row.done { opacity: .5; text-decoration: line-through; }
.action-row.overdue { color: var(--red); }
.action-row.upcoming { color: var(--yellow); }
.delete-action { opacity: 0; transition: opacity .2s ease; }
.action-row:hover .delete-action { opacity: 1; }

/* ===== FRAMEWORK ===== */
.step-flow { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.step-box {
  flex: 1; min-width: 140px;
  background: var(--glass-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 16px; text-align: center; cursor: pointer; transition: all .25s ease;
}
.step-box:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(59,130,246,.15); }
.step-icon { font-size: 1.5rem; }
.step-box h3 { font-size: .8rem; margin-top: 6px; }
.step-box p { font-size: .7rem; color: var(--text2); }
.step-arrow { display: none; }
.detail-panel {
  border: 1px solid var(--glass-border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden;
  background: var(--glass-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.detail-header { padding: 16px 20px; background: var(--bg3); cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.detail-content { display: none; padding: 20px; background: var(--bg2); }
.detail-panel.open .detail-content { display: block; }
.chevron { transition: transform .3s ease; }
.detail-panel.open .chevron { transform: rotate(180deg); }

/* ===== KANBAN ===== */
.kanban { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 12px; min-height: 400px; }
.kanban-col {
  flex: 0 0 240px;
  background: var(--glass-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  display: flex; flex-direction: column;
}
.kanban-col-header { padding: 12px 16px; font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.kanban-col-body { flex: 1; padding: 8px; overflow-y: auto; min-height: 100px; }
.kanban-card {
  background: var(--bg3); border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
  padding: 12px; margin-bottom: 8px; cursor: pointer; transition: all .2s ease;
}
.kanban-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.kanban-card h4 { font-size: .85rem; margin-bottom: 4px; }
.kanban-card p { font-size: .75rem; color: var(--text2); }
.kanban-card .value { font-weight: 700; color: var(--green); }

/* ===== CALENDAR ===== */
.cal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal-day-header { background: var(--bg2); padding: 8px; text-align: center; font-size: .7rem; font-weight: 700; color: var(--text2); text-transform: uppercase; }
.cal-day { background: var(--bg3); min-height: 90px; padding: 6px; cursor: pointer; transition: background .2s ease; position: relative; }
.cal-day:hover { background: var(--bg4); }
.cal-day.today { border: 2px solid var(--accent); box-shadow: inset 0 0 12px rgba(59,130,246,.1); }
.cal-day.other-month { opacity: .3; }
.cal-day-num { font-size: .75rem; font-weight: 600; margin-bottom: 4px; }
.cal-event { font-size: .65rem; padding: 2px 4px; border-radius: 3px; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.cal-event.step-1 { background: rgba(59,130,246,.2); color: #60a5fa; }
.cal-event.step-2 { background: rgba(16,185,129,.2); color: #34d399; }
.cal-event.step-3 { background: rgba(139,92,246,.2); color: #a78bfa; }
.cal-event.step-4 { background: rgba(245,158,11,.2); color: #fbbf24; }

/* ===== TIMELINE ===== */
.timeline { position: relative; padding-left: 30px; }
.timeline::before { content: ''; position: absolute; left: 10px; top: 0; bottom: 0; width: 2px; background: var(--border); }
.timeline-item { position: relative; margin-bottom: 20px; animation: fadeSlideIn .4s ease both; }
.timeline-item:nth-child(1) { animation-delay: 0s; }
.timeline-item:nth-child(2) { animation-delay: .08s; }
.timeline-item:nth-child(3) { animation-delay: .16s; }
.timeline-item:nth-child(4) { animation-delay: .24s; }
.timeline-item:nth-child(5) { animation-delay: .32s; }
.timeline-item::before { content: ''; position: absolute; left: -24px; top: 8px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid var(--bg); }
.timeline-item.overdue::before { background: var(--red); }
.timeline-item.upcoming::before { background: var(--yellow); }
.timeline-item.done::before { background: var(--green); }
.timeline-item-card { background: var(--glass-bg); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); padding: 12px 16px; }

/* ===== TEMPLATE CARDS ===== */
.template-card {
  background: var(--glass-bg); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; cursor: pointer; transition: all .25s ease;
}
.template-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.template-card.expanded .template-content { display: block; }
.template-content { display: none; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }
.template-content pre { white-space: pre-wrap; font-family: inherit; font-size: .85rem; color: var(--text2); background: var(--bg); padding: 12px; border-radius: var(--radius-sm); }

/* ===== PERSONA CARDS ===== */
.persona-card { background: var(--glass-bg); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 20px; }
.persona-card h3 { margin-bottom: 12px; }
.persona-field { margin-bottom: 8px; font-size: .85rem; }
.persona-field strong { color: var(--text2); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; display: block; margin-bottom: 2px; }

/* ===== HASHTAG GROUPS ===== */
.hashtag-group { background: var(--glass-bg); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; }
.hashtag-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hashtag-tag { background: var(--bg4); padding: 4px 10px; border-radius: 99px; font-size: .8rem; color: var(--accent); }

/* ===== PLATFORM GUIDES ===== */
.platform-card { background: var(--glass-bg); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 20px; }
.platform-card h3 { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.platform-card .spec { margin-bottom: 6px; font-size: .85rem; }
.platform-card .spec strong { color: var(--text2); }

/* ===== ROI CALCULATOR ===== */
.roi-result { background: var(--glass-bg); backdrop-filter: blur(10px); border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 24px; text-align: center; }
.roi-big { font-size: 2.2rem; font-weight: 800; background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.roi-label { font-size: .8rem; color: var(--text2); }

/* ===== COPY BUTTON ===== */
.copy-btn { background: var(--bg4); border: 1px solid var(--border); color: var(--text2); padding: 4px 10px; border-radius: var(--radius-sm); font-size: .75rem; cursor: pointer; transition: all .2s ease; }
.copy-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== PLACEHOLDER ===== */
.placeholder-page { text-align: center; padding: 60px 20px; animation: fadeSlideIn .5s ease; }
.placeholder-page .icon { font-size: 3rem; margin-bottom: 16px; }
.placeholder-page h2 { margin-bottom: 8px; }
.placeholder-page p { color: var(--text2); max-width: 500px; margin: 0 auto 20px; }

/* ===== SETTINGS ===== */
.settings-section { margin-bottom: 28px; }
.settings-section h3 { margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); }

/* ===== ASSETS ===== */
.asset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.asset-card {
  background: var(--glass-bg); backdrop-filter: blur(10px); border: 1px solid var(--glass-border);
  border-radius: var(--radius); overflow: hidden; transition: all .25s ease;
}
.asset-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.asset-thumb { height: 120px; display: flex; align-items: center; justify-content: center; background: var(--bg); overflow: hidden; cursor: pointer; }
.asset-thumb img { width: 100%; height: 100%; object-fit: cover; }
.asset-icon { font-size: 2rem; }
.asset-info { padding: 8px 12px; }
.asset-actions { display: flex; gap: 4px; padding: 0 12px 8px; }
.asset-drop-zone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 24px; text-align: center; color: var(--text3); margin-bottom: 16px; transition: all .2s ease; }
.asset-drop-zone.dragover { border-color: var(--accent); background: rgba(59,130,246,.05); color: var(--accent); }

/* ===== NOTIFICATION DROPDOWN ===== */
.notif-wrapper { position: relative; }
.notif-badge { position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff; font-size: .6rem; font-weight: 700; min-width: 16px; height: 16px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; }
.notif-dropdown {
  position: absolute; top: 100%; right: 0; width: 360px; max-height: 420px;
  overflow-y: auto; background: var(--bg2); border: 1px solid var(--glass-border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 200;
  animation: fadeSlideIn .2s ease;
}
.notif-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: .85rem; }
.notif-item { padding: 10px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .15s ease; }
.notif-item:hover { background: var(--bg3); }
.notif-item.read { opacity: .5; }

/* ===== COMMAND PALETTE ===== */
.cmd-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 20vh; z-index: 2000; animation: fadeIn .15s ease;
}
.cmd-box {
  background: var(--bg2); border: 1px solid var(--glass-border); border-radius: var(--radius);
  width: 560px; max-width: 95vw; box-shadow: 0 24px 64px rgba(0,0,0,.6);
  animation: fadeSlideIn .2s ease; overflow: hidden;
}
.cmd-input {
  width: 100%; padding: 16px 20px; background: transparent; border: none;
  border-bottom: 1px solid var(--border); color: var(--text); font-size: 1.1rem;
  font-family: inherit; outline: none;
}
.cmd-input::placeholder { color: var(--text3); }
.cmd-results { max-height: 320px; overflow-y: auto; }
.cmd-item {
  padding: 10px 20px; display: flex; align-items: center; gap: 12px;
  cursor: pointer; font-size: .9rem; transition: background .1s ease;
}
.cmd-item:hover, .cmd-item.selected { background: var(--bg3); }
.cmd-item .emoji { font-size: 1rem; width: 24px; text-align: center; }
.cmd-item .label { flex: 1; }
.cmd-item .shortcut { font-size: .7rem; color: var(--text3); background: var(--bg); padding: 2px 6px; border-radius: 4px; }
.cmd-empty { padding: 24px; text-align: center; color: var(--text3); font-size: .9rem; }
.cmd-hint { padding: 8px 20px; border-top: 1px solid var(--border); font-size: .7rem; color: var(--text3); display: flex; gap: 12px; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text3); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 100; transform: translateX(-100%); box-shadow: none; }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.4); }
  .menu-btn { display: block; }
  .content { padding: 20px 16px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row { flex-direction: column; }
  .step-flow { flex-direction: column; }
  .kanban { flex-direction: column; }
  .kanban-col { flex: none; }
  .page-title { font-size: 1.4rem; }
  .welcome-greeting { font-size: 1.3rem; }
  .welcome-stats { gap: 16px; }
  .cmd-box { width: 95vw; }
  /* Touch-friendly targets */
  .nav-item { padding: 12px 20px; min-height: 44px; }
  .btn { min-height: 44px; padding: 10px 18px; }
  .btn-sm { min-height: 36px; }
  .btn-icon { min-width: 44px; min-height: 44px; display: flex; align-items: center; justify-content: center; }
}

/* Mobile sidebar overlay */
.sidebar-overlay {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 99; animation: fadeIn .2s ease;
}
.sidebar.open ~ .main .sidebar-overlay { display: block; }

/* ===== PRINT ===== */
@media print {
  .no-print, .sidebar, .topbar { display: none !important; }
  .main { overflow: visible !important; }
  .content { padding: 20px !important; overflow: visible !important; }
  body { background: #fff !important; color: #000 !important; }
  .card { border: 1px solid #ddd !important; background: #fff !important; break-inside: avoid; }
  .card-header { background: #f5f5f5 !important; }
  .stat-card { background: #f9f9f9 !important; border: 1px solid #ddd !important; }
  .stat-value { color: #333 !important; }
  .grid-2, .grid-4 { gap: 12px; }
  .report-header { border-bottom-color: #333 !important; }
}

/* ===== APPROVAL BADGE ===== */
.approval-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--red); color: #fff;
  font-size: .65rem; font-weight: 700; margin-left: 6px;
}
.approval-badge:empty { display: none; }

/* ===== APPROVAL CARDS ===== */
.approval-card { transition: transform .15s ease, box-shadow .15s ease; }
.approval-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }

/* ===== BRAND CUSTOM PROPERTIES ===== */
:root { --brand-primary: var(--accent); --brand-secondary: var(--accent2); }

/* ===== ONBOARDING TOUR ===== */
.onboarding-overlay { position: fixed; inset: 0; z-index: 3000; }
.onboarding-svg { position: fixed; inset: 0; z-index: 3001; pointer-events: none; }
.onboarding-highlight {
  position: fixed; z-index: 3002; border: 2px solid var(--accent); border-radius: 12px;
  box-shadow: 0 0 0 4px rgba(59,130,246,.3); pointer-events: none;
  animation: pulseGlow 2s ease-in-out infinite;
}
.onboarding-modal {
  position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%);
  z-index: 3003; background: var(--bg2); border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: 40px; max-width: 480px; width: 90vw;
  text-align: center; box-shadow: 0 24px 64px rgba(0,0,0,.6);
  animation: fadeSlideIn .4s ease;
}
.onboarding-modal h2 { font-size: 1.4rem; margin-bottom: 12px; }
.onboarding-modal p { color: var(--text2); font-size: .95rem; line-height: 1.6; }
.onboarding-tooltip {
  position: fixed; z-index: 3003; background: var(--bg2); border: 1px solid var(--glass-border);
  border-radius: var(--radius); padding: 20px; width: 340px; max-width: 90vw;
  box-shadow: 0 16px 48px rgba(0,0,0,.5); animation: fadeSlideIn .3s ease;
}
.onboarding-tooltip h3 { font-size: 1rem; margin-bottom: 6px; }
.onboarding-tooltip p { font-size: .85rem; color: var(--text2); line-height: 1.5; }
.onboarding-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.onboarding-dots { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.onboarding-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--border); transition: all .2s ease; }
.onboarding-dot.active { background: var(--accent); transform: scale(1.3); }
.onboarding-dot.done { background: var(--green); }

/* ===== CONFETTI & CELEBRATIONS ===== */
.confetti-container { position: fixed; inset: 0; z-index: 4000; pointer-events: none; overflow: hidden; }
@keyframes confettiFall {
  0% { transform: translateY(-20px) translateX(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) translateX(var(--drift)) rotate(var(--rot)); opacity: 0; }
}
.confetti-particle {
  position: absolute; top: 0;
  animation: confettiFall 3s ease-out forwards;
}
.celebration-modal-overlay {
  position: fixed; inset: 0; z-index: 4001; background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); animation: fadeIn .2s ease;
}
.celebration-modal {
  background: var(--bg2); border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 40px; text-align: center; max-width: 400px; width: 90vw;
  box-shadow: 0 24px 64px rgba(0,0,0,.5); transform: scale(0.8);
  transition: transform .3s cubic-bezier(.34,1.56,.64,1);
}
.celebration-modal h2 { background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }

/* ===== SOPHIE CHAT WIDGET ===== */
@keyframes sophiePulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(139,92,246,.3); }
  50% { box-shadow: 0 4px 30px rgba(139,92,246,.6); }
}
@keyframes sophieBounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}
#sophieWidget { position: fixed; bottom: 24px; right: 24px; z-index: 900; }
.sophie-fab {
  background: var(--gradient); color: #fff; border: none; border-radius: 99px;
  padding: 12px 20px; font-size: .9rem; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; gap: 8px; position: relative;
  animation: sophiePulse 2s ease-in-out infinite;
  transition: transform .2s ease;
}
.sophie-fab:hover { transform: scale(1.05); }
.sophie-unread {
  position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff;
  font-size: .65rem; font-weight: 700; min-width: 18px; height: 18px; border-radius: 99px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.sophie-panel {
  width: 360px; max-width: calc(100vw - 32px); height: 480px; max-height: calc(100vh - 80px);
  background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: 0 16px 48px rgba(0,0,0,.4);
  animation: fadeSlideIn .3s ease;
}
.sophie-header {
  padding: 14px 16px; border-bottom: 1px solid var(--glass-border);
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(139,92,246,0.1);
}
.sophie-header-info { display: flex; align-items: center; gap: 10px; }
.sophie-avatar { font-size: 1.5rem; }
.sophie-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.sophie-msg { display: flex; flex-direction: column; }
.sophie-msg-user { align-items: flex-end; }
.sophie-msg-sophie { align-items: flex-start; }
.sophie-bubble {
  max-width: 85%; padding: 10px 14px; border-radius: 16px; font-size: .85rem; line-height: 1.5;
}
.sophie-bubble-user { background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.sophie-bubble-sophie { background: rgba(139,92,246,0.15); color: var(--text); border-bottom-left-radius: 4px; }
.sophie-bubble a { color: var(--accent); }
.sophie-time { font-size: .65rem; color: var(--text3); margin-top: 2px; padding: 0 4px; }
.sophie-typing { display: flex; gap: 4px; padding: 12px 16px; }
.sophie-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--purple);
  animation: sophieBounce 1.2s ease-in-out infinite;
}
.sophie-dot:nth-child(2) { animation-delay: .15s; }
.sophie-dot:nth-child(3) { animation-delay: .3s; }
.sophie-input-row {
  padding: 10px 12px; border-top: 1px solid var(--glass-border);
  display: flex; gap: 8px; align-items: center;
}
.sophie-input-row input {
  flex: 1; background: var(--bg); border: 1px solid var(--border);
  border-radius: 99px; padding: 8px 14px; font-size: .85rem; color: var(--text);
}
.sophie-input-row input:focus { border-color: var(--accent); outline: none; }

/* ===== PAGE TRANSITION ===== */
.content > * { animation: fadeSlideIn .4s ease both; }

/* ===== CONTENT FADE TRANSITION ===== */
.content.fade-out { opacity: 0; transition: opacity 100ms ease; }
.content.fade-in { opacity: 1; transition: opacity 200ms ease; }

/* ===== SKELETON LOADING ===== */
@keyframes skeletonShimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg4) 50%, var(--bg3) 75%);
  background-size: 800px 100%;
  animation: skeletonShimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}
.skeleton-text { height: 14px; margin-bottom: 10px; border-radius: 4px; }
.skeleton-text:last-child { width: 60%; }
.skeleton-circle { width: 48px; height: 48px; border-radius: 50%; }
.skeleton-card {
  height: 120px; border-radius: var(--radius); border: 1px solid var(--glass-border);
}
.skeleton-chart { height: 200px; border-radius: var(--radius); border: 1px solid var(--glass-border); }
.skeleton-row { height: 48px; border-radius: var(--radius-sm); margin-bottom: 8px; }

/* ===== TOAST NOTIFICATIONS ===== */
.toast-container {
  position: fixed; bottom: 90px; right: 24px; z-index: 5000;
  display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none;
}
.toast {
  pointer-events: auto; min-width: 280px; max-width: 400px;
  background: var(--glass-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 14px 16px; display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,.4); cursor: pointer;
  transform: translateX(120%); transition: transform .3s cubic-bezier(.4,0,.2,1), opacity .2s ease;
  position: relative; overflow: hidden;
}
.toast.toast-enter { transform: translateX(0); }
.toast.toast-exit { transform: translateX(120%); opacity: 0; }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; }
.toast-msg { flex: 1; font-size: .85rem; font-weight: 500; }
.toast-progress {
  position: absolute; bottom: 0; left: 0; height: 3px;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: width linear;
}
.toast.success .toast-progress { background: var(--green); }
.toast.error .toast-progress { background: var(--red); }
.toast.warning .toast-progress { background: var(--yellow); }
.toast.info .toast-progress { background: var(--accent); }
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--red); }
.toast.warning { border-left: 3px solid var(--yellow); }
.toast.info { border-left: 3px solid var(--accent); }

/* ===== SESSION TIMEOUT MODAL ===== */
.session-warning-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 6000;
  animation: fadeIn .2s ease;
}
.session-warning-box {
  background: var(--bg2); border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 32px; text-align: center; max-width: 400px; width: 90vw;
  box-shadow: 0 24px 64px rgba(0,0,0,.5); animation: fadeSlideIn .3s ease;
}
.session-warning-box h3 { margin-bottom: 8px; }
.session-warning-box p { color: var(--text2); font-size: .9rem; margin-bottom: 20px; }
.session-countdown { font-size: 2rem; font-weight: 800; color: var(--yellow); margin-bottom: 16px; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 60px 20px; animation: fadeSlideIn .5s ease;
}
.empty-state-emoji { font-size: 4rem; margin-bottom: 16px; display: block; }
.empty-state-title { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.empty-state-desc { color: var(--text2); font-size: .95rem; margin-bottom: 24px; max-width: 400px; margin-left: auto; margin-right: auto; }

/* ===== SCROLL TO TOP ===== */
.scroll-top-btn {
  position: fixed; bottom: 90px; right: 24px; z-index: 800;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--gradient); color: #fff; border: none;
  font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(59,130,246,.3);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.scroll-top-btn.visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.scroll-top-btn:hover { box-shadow: 0 6px 24px rgba(59,130,246,.5); transform: translateY(-2px); }

/* ===== KEYBOARD SHORTCUT HINTS ===== */
.nav-shortcut {
  font-size: .6rem; color: var(--text3); background: var(--bg); padding: 1px 5px;
  border-radius: 3px; margin-left: auto; opacity: 0; transition: opacity .2s ease;
}
.nav-item:hover .nav-shortcut { opacity: 1; }

/* ===== SESSION TIMER ===== */
.session-timer { font-size: .65rem; color: var(--text3); text-align: center; margin-top: 4px; }

/* Position scroll-to-top above Sophie widget */
#sophieWidget ~ .scroll-top-btn,
.scroll-top-btn.with-sophie { bottom: 90px; right: 80px; }
