/* ============================================
   Isabel · TikTok Content Command Center
   Full Modern Styling with Dark/Light Theme
   ============================================ */

:root {
  /* Light theme (default) */
  --bg-primary: #f8f9fc;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f1f3f9;
  --bg-sidebar: #1a1d27;
  --bg-sidebar-hover: #222535;
  --bg-sidebar-active: #2a2e41;
  --bg-modal: #1e2130;

  --bg-dashboard: linear-gradient(135deg, #1e2a4a 0%, #2a3f6f 100%);

  --text-primary: #1a1d27;
  --text-secondary: #5a6075;
  --text-muted: #8a90a0;
  --text-card: #e0e2ea;

  --border: #e1e4ed;
  --border-focus: #ff6b35;

  --primary: #ff6b35;
  --primary-hover: #e85d2c;
  --primary-glow: rgba(255, 107, 53, 0.15);

  --success: #22c55e;
  --success-bg: rgba(34, 197, 94, 0.12);
  --success-border: #22c55e;

  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);

  --info: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.12);

  --danger: #ef4444;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 20px var(--primary-glow);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --sidebar-width: 260px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Dark theme */
[data-theme="dark"] {
  --bg-primary: #0f1119;
  --bg-secondary: #1a1d2b;
  --bg-card: #1e2130;
  --bg-hover: #25283a;
  --bg-sidebar: #0a0c14;
  --bg-sidebar-hover: #141725;
  --bg-sidebar-active: #1a1d2c;
  --bg-modal: #12141f;

  --bg-dashboard: linear-gradient(135deg, #0a0e1a 0%, #141b30 100%);

  --text-primary: #e0e2ea;
  --text-secondary: #9a9fa8;
  --text-muted: #5a5d6b;
  --text-card: #2a2d3c;

  --border: #2a2d3c;
  --border-focus: #ff8a5c;

  --primary: #ff8a5c;
  --primary-hover: #ffa07a;
  --primary-glow: rgba(255, 138, 92, 0.2);

  --success: #4ade80;
  --success-bg: rgba(74, 222, 128, 0.15);
  --success-border: #4ade80;

  --warning: #fbbf24;
  --warning-bg: rgba(251, 191, 36, 0.15);

  --info: #60a5fa;
  --info-bg: rgba(96, 165, 250, 0.15);

  --danger: #ef4444;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px var(--primary-glow);

  --bg-sidebar: #0a0c14;
}

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

html, body {
  height: 100%;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-primary);
  overflow: hidden;
}

body {
  display: flex;
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* ======= SIDEBAR ======= */
.sidebar {
  width: var(--sidebar-width);
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  z-index: 100;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sidebar.collapsed {
  transform: translateX(-100%);
  box-shadow: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 20px;
  color: var(--text-card);
}

.brand-icon {
  font-size: 32px;
}

.brand-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: var(--primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-tagline {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
}

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

.nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.nav-btn.active {
  background: var(--bg-sidebar-active);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.nav-btn.active:active {
  background: var(--bg-sidebar-active);
  color: var(--primary);
}

.nav-icon {
  font-size: 20px;
  width: 28px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 12px;
  border-top: 1px solid var(--border);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
}

.user-avatar {
  font-size: 28px;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-info strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info small {
  font-size: 11px;
  color: var(--text-muted);
}

.badge-btn {
  padding: 6px 12px;
  background: var(--success);
  color: #fff;
  border: none;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.badge-btn:hover {
  background: #16a34a;
  transform: scale(1.05);
}

/* ======= MAIN ======= */
.main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin 0.3s ease;
}

/* ======= HEADER ======= */
.main-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 28px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.header-left h1 {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
}

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

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-icon {
  background: var(--bg-hover);
  border: none;
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

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

.btn-icon.small {
  width: 32px;
  height: 32px;
  font-size: 14px;
}

/* ======= VIEW SWITCHING ======= */
.view {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding: 24px 28px;
}

.view.active {
  display: flex;
  flex-direction: column;
}

/* ======= CARDS ======= */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  margin-bottom: 20px;
  transition: all 0.2s ease;
}

.card:hover {
  border-color: var(--border-focus);
}

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

.card-header h2 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
}

/* ======= STATS GRID ======= */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  font-size: 32px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.stat-value.green { color: var(--success); }
.stat-value.orange { color: var(--warning); }
.stat-value.red { color: var(--danger); }

.stat-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 2px;
}

/* ======= DASHBOARD GRID ======= */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  flex: 1;
}

/* ======= TODAY LIST ======= */
.today-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.today-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.today-item:hover {
  background: var(--bg-primary);
  transform: translateX(4px);
}

.today-item-todo {
  flex: 1;
}

.today-item-icon {
  font-size: 28px;
}

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

.today-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.today-item-actions {
  display: flex;
  gap: 8px;
}

.today-item-actions button {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

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


/* ======= BUTTON ACTIVE STATES ======= */
.btn-primary:active,
.btn-secondary:active,
.btn-danger:active,
.btn-outline:active,
.today-item-actions .btn-primary:active {
  background: var(--primary-hover);
  border-color: var(--primary-hover);
  transform: scale(0.97);
  box-shadow: var(--shadow-sm);
}

/* ======= ACTIVE BUTTON STATE ======= */
.btn-primary.active,
.btn-secondary.active,
.btn-danger.active,
.btn-outline.active {
  background: var(--text-card);
  border-color: var(--border-focus);
  color: var(--text-primary);
}

/* ======= NAVIGATION BUTTON ACTIVE ======= */
.nav-btn.active {
  background: var(--bg-sidebar-active);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.nav-btn.active:active {
  background: var(--bg-sidebar-active);
  color: var(--primary);
}

.nav-btn.active:active {
  background: var(--bg-sidebar-active);
  color: var(--primary);
}

/* ======= GOOD TOUCH FEEDBACK ======= */
button:active {
  transform: scale(0.98);
}

today-item-actions .btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.today-item-actions .btn-primary:hover {
  background: var(--primary-hover);
}

.today-item-check {
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.today-item-check:hover {
  color: var(--success);
}

/* ======= QUICK ADD ======= */
.quick-add {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quick-add input[type="text"] {
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-sans);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.quick-add input[type="text"]:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.quick-add select {
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-sans);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-add select:focus {
  outline: none;
  border-color: var(--border-focus);
}

.quick-add-actions {
  display: flex;
  gap: 12px;
}

/* ======= TASK LIST ======= */
.task-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
}

.task-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.task-item:hover {
  background: var(--bg-primary);
}

.task-item-check {
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}

.task-item-check:hover {
  color: var(--success);
}

.task-item-info {
  flex: 1;
  min-width: 0;
}

.task-item-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.task-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.task-item-actions {
  display: flex;
  gap: 6px;
}

.task-item-actions button {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

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

.task-item.done .task-item-title {
  color: var(--success);
  text-decoration: line-through;
  opacity: 0.6;
}

/* ======= WEEKLY GRID ======= */
.weekly-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.week-day {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  text-align: center;
  transition: all 0.2s ease;
}

.week-day:hover {
  border-color: var(--border-focus);
}

.week-day-day {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.week-day-date {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin-top: 4px;
}

.week-day-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
}

.week-day-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 4px;
}

.week-day-item .icon {
  font-size: 14px;
}

.week-day-item .title {
  font-weight: 600;
  color: var(--text-primary);
}

.week-day-empty {
  color: var(--text-muted);
  font-size: 11px;
  font-style: italic;
}

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

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

.date-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-nav button {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 16px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

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

.current-month {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-top: 16px;
}

.calendar-day {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.calendar-day:hover {
  border-color: var(--border-focus);
  transform: scale(1.05);
}

.calendar-day.today {
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

.calendar-day.today::after {
  content: '';
  position: absolute;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--primary);
}

.calendar-day-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.calendar-day.today .calendar-day-date {
  color: var(--primary);
}

.calendar-day.has_items {
  border-color: var(--primary);
}

.calendar-day .day-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}

.calendar-day .day-item {
  font-size: 9px;
  padding: 2px 4px;
  border-radius: 3px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-day .day-item .icon {
  font-size: 10px;
}

.calendar-day.empty .day-item { display: none; }

/* ======= LIBRARY ======= */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.library-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
}

.library-item:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-md);
}

.library-item-icon {
  font-size: 28px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
}

.library-item-body {
  padding: 14px;
  flex: 1;
}

.library-item-title {
  font-weight: 700;
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.library-item-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.library-item-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.library-item-actions {
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.library-item-actions button {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

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

.library-item-actions .btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.library-item-actions .btn-primary:hover {
  background: var(--primary-hover);
}

/* ======= STATS ======= */
.stats-chart {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.chart-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.chart-bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.chart-bar-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 80px;
  text-align: right;
  flex-shrink: 0;
}

.chart-bar {
  flex: 1;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  overflow: hidden;
  position: relative;
}

.chart-bar-fill {
  height: 100%;
  border-radius: var(--radius-sm);
  transition: width 0.6s ease;
}

.chart-bar-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  width: 40px;
  text-align: right;
  flex-shrink: 0;
}

.stats-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.stat-item .stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--primary);
}

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

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.history-item-icon {
  font-size: 24px;
}

.history-item-body {
  flex: 1;
}

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

.history-item-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.history-item-status {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

.history-item-status.pending { background: var(--warning-bg); color: var(--warning); }
.history-item-status.done { background: var(--success-bg); color: var(--success); }
.history-item-status.scheduled { background: var(--info-bg); color: var(--info); }
.history-item-status.failed { background: var(--danger); color: #fff; }

/* ======= IDEA BANK ======= */
.idea-bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  padding: 20px;
}

.idea-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 16px;
  background: var(--bg-card);
  transition: all 0.2s ease;
}

.idea-card:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-sm);
}

.idea-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.idea-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.idea-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.idea-tag {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-hover);
  color: var(--text-secondary);
}

.idea-card-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-primary);
}

.idea-card-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.idea-meta-item {
  font-size: 11px;
  color: var(--text-muted);
}

.idea-meta-item strong {
  color: var(--text-primary);
}

/* ======= CAPTION GENERATOR ======= */
.view-caption-gen {
  padding: 0;
}

.caption-gen-layout {
  padding: 20px;
}

.generator-form-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.generator-form-section h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.generator-form-section p {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.generator-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.generator-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.generator-form-group {
  margin-bottom: 0;
}

.generator-form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
  display: block;
}

.generator-form-group input,
.generator-form-group select,
.generator-form-group textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-sans);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.generator-form-group input:focus,
.generator-form-group select:focus,
.generator-form-group textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

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

.generator-form-group.full-width {
  grid-column: 1 / -1;
}

.generator-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  align-items: center;
}

.generator-form-actions .btn-primary,
.generator-form-actions .btn-secondary {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 700;
}

.generator-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.generator-preset {
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.generator-preset:hover {
  border-color: var(--primary);
  background: var(--primary-glow);
  color: var(--primary);
}

.generator-preset.active {
  border-color: var(--primary);
  background: var(--primary-glow);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.generator-preset.hidden {
  display: none;
}

.caption-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.caption-detail-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.caption-detail-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  width: 80px;
  flex-shrink: 0;
}

.caption-detail-value {
  flex: 1;
  font-size: 13px;
  color: var(--text-primary);
  background: var(--bg-hover);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  word-break: break-word;
}

.caption-detail-actions {
  display: flex;
  gap: 8px;
}

.generator-samples {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 12px;
}

.generator-sample {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.generator-sample:hover {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-sm);
}

.generator-sample .sample-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.generator-sample .sample-text {
  font-size: 13px;
  color: var(--text-primary);
  line-height: 1.5;
  white-space: pre-wrap;
}

.generator-sample .sample-text .hook {
  font-weight: 700;
  color: var(--primary);
}

.generator-output {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

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

.generator-output p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 4px 0;
}

.generator-output .sample-caption {
  background: var(--bg-hover);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre-wrap;
}

.generator-output .sample-caption .hook {
  font-weight: 700;
  color: var(--primary);
}

.generator-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.generator-actions .btn-primary,
.generator-actions .btn-secondary {
  padding: 12px 20px;
  font-size: 14px;
}

/* ======= MODAL ======= */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 200;
  backdrop-filter: blur(4px);
  animation: fadeIn 0.25s ease;
}

.modal-overlay.open {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.25s ease;
}

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

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-header h2 {
  font-size: 19px;
  font-weight: 800;
  color: var(--text-primary);
}

.close-modal {
  background: var(--bg-hover);
  border: none;
  border-radius: var(--radius-sm);
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

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

.modal-body {
  padding: 20px 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: var(--font-sans);
  background: var(--bg-card);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.form-actions .btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.form-actions .btn-primary:hover {
  background: var(--primary-hover);
}

.form-actions .btn-secondary {
  background: var(--bg-card);
  border-color: var(--border);
  color: var(--text-secondary);
}

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

.btn-primary {
  background: var(--primary);
  border: 2px solid var(--primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-secondary {
  background: var(--bg-card);
  border: 2px solid var(--border);
  color: var(--text-secondary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.btn-danger {
  background: var(--danger);
  border: 2px solid var(--danger);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-danger:hover {
  background: #dc2626;
  border-color: #dc2626;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--border);
  color: var(--text-secondary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

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

/* ======= TOAST ======= */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  min-width: 300px;
  max-width: 400px;
  pointer-events: auto;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.toast.success {
  border-color: var(--success);
  background: var(--success-bg);
}

.toast.success .toast-icon { color: var(--success); }
.toast.error {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.toast.error .toast-icon { color: var(--danger); }
.toast.info {
  border-color: var(--info);
  background: var(--info-bg);
}

.toast.info .toast-icon { color: var(--info); }

.toast-icon {
  font-size: 22px;
}

.toast-message {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.toast-close {
  margin-left: auto;
  background: var(--bg-hover);
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  cursor: pointer;
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* ======= EMPTY STATE ======= */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  gap: 8px;
}

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

.empty-state p {
  font-size: 13px;
  font-weight: 500;
}

/* ======= UTILITY ======= */
.hidden { display: none !important; }

.flex-center { display: flex; align-items: center; justify-content: center; }

/* ======= RESPONSIVE ======= */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main { margin-left: 0; }
  .main-header { padding: 12px 16px; }
  .view { padding: 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .quick-add-actions { flex-wrap: wrap; }
  .library-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .mobile-header {
    display: flex;
    align-items: center;
  }
  .mobile-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    padding: 8px 16px;
    box-shadow: var(--shadow-md);
  }
  .mobile-nav.open {
    display: flex;
  }
  .mobile-menu-btn {
    display: block;
  }
  .mobile-nav-item {
    font-size: 15px;
    padding: 14px 16px;
  }
  .main-header {
    display: none;
  }
  .stat-grid { grid-template-columns: 1fr; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .today-item {
    flex-wrap: wrap;
    gap: 12px;
  }
  .today-item-actions {
    width: 100%;
    justify-content: flex-end;
  }
  .modal {
    max-width: 100%;
    padding: 16px;
  }
  .modal-body { padding: 16px; }
  .library-grid { grid-template-columns: 1fr; }
  .card { padding: 16px; }
  .week-day { padding: 8px; }
  .week-day-date { font-size: 14px; }
  .calendar-day { padding: 6px; }
  .calendar-day-date { font-size: 11px; }
  .calendar-day .day-item { font-size: 8px; padding: 1px 3px; }
  .history-item { flex-wrap: wrap; gap: 8px; }
  .chart-bar-label { width: 60px; font-size: 10px; }
  .stats-summary { grid-template-columns: 1fr 1fr; }
  .stat-value { font-size: 24px; }
  .week-day-item { font-size: 9px; padding: 2px 4px; }
  .calendar-day .day-items { display: none; }
  .calendar-day.has_items .day-items { display: flex; flex-direction: column; gap: 2px; }
  .today-item-check { font-size: 16px; }
  .today-item-title { font-size: 13px; }
  .today-item-meta { font-size: 10px; }
  .quick-add input { padding: 10px 12px; font-size: 13px; }
  .quick-add select { padding: 10px 12px; font-size: 13px; }
  .form-group input, .form-group select, .form-group textarea { padding: 10px 12px; font-size: 13px; }
  .btn-primary, .btn-secondary, .btn-danger { padding: 10px 16px; font-size: 13px; }
  .task-item { padding: 10px 12px; }
  .task-item-title { font-size: 13px; }
  .task-item-meta { font-size: 10px; }
  .library-item-title { font-size: 13px; }
  .library-item-meta { font-size: 11px; }
  .history-item-icon { font-size: 20px; }
  .history-item-title { font-size: 13px; }
  .history-item-date { font-size: 11px; }
  .history-item-status { font-size: 10px; padding: 3px 8px; }
  .stat-card { padding: 16px; }
  .stat-value { font-size: 26px; }
  .footer-btn-group { flex-direction: column; gap: 8px; }
  .footer-btn-group button { padding: 10px 20px; font-size: 13px; border-radius: var(--radius-sm); }
  .mobile-nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 80;
  }
  .mobile-nav-overlay.open {
    display: block;
  }
}

@media (max-width: 768px) and (orientation: landscape) {
  .mobile-nav { display: flex; }
  .mobile-header { padding: 0 8px; }
  .mobile-nav-item { font-size: 14px; padding: 10px 14px; }
  .main-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 16px;
  }
  .main-header .header-left {
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
  }
  .main-header .header-left h1 {
    font-size: 18px;
  }
  .main-header .header-right {
    justify-content: flex-end;
    width: 100%;
  }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .stats-summary { grid-template-columns: 1fr 1fr; }
}

/* Scrollbar styling */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
