:root {
  --primary: #0d6efd;
  --primary-dark: #0b5ed7;
  --surface: #ffffff;
  --surface-soft: #f3f6fb;
  --surface-muted: #eef2f8;
  --border: rgba(13, 110, 253, 0.15);
  --text: #0f172a;
  --text-muted: #5b6b84;
  --success: #2ecc71;
  --warning: #f39c12;
  --info: #17a2b8;
  --danger: #e74c3c;
  --shadow: 0 18px 40px -24px rgba(15, 23, 42, 0.35);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', 'Segoe UI', Tahoma, sans-serif;
  background: radial-gradient(circle at top, rgba(13, 110, 253, 0.12), transparent 55%),
              linear-gradient(135deg, #edf2fb 0%, #f8fbff 100%);
  color: var(--text);
  margin: 0;
  padding: 20px;
  min-height: 100vh;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--surface);
  padding: 28px 30px 34px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid rgba(15, 23, 42, 0.05);
  position: relative;
  overflow: hidden;
}

.container::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at 20% 20%, rgba(13, 110, 253, 0.12), transparent 45%),
              radial-gradient(circle at 80% 0%, rgba(23, 162, 184, 0.12), transparent 50%);
  opacity: 0.35;
  pointer-events: none;
}

.container > * { position: relative; z-index: 1; }

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.title-block h1 { margin: 4px 0 6px; font-size: 2rem; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.12em; color: var(--primary-dark); font-weight: 700; margin: 0; font-size: 0.9rem; }
.subtitle { color: var(--text-muted); margin: 0; max-width: 620px; line-height: 1.45; }
.hero-meta { display: flex; align-items: center; gap: 8px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(13, 110, 253, 0.12);
  color: var(--primary-dark);
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9rem;
}

.notification-area { display: grid; gap: 10px; margin-bottom: 12px; }
.alert {
  border-radius: var(--radius-md);
  padding: 14px 18px;
  border: 1px solid transparent;
  font-size: 0.98rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
  background: var(--surface-soft);
}
.alert-success { border-color: rgba(46, 204, 113, 0.25); background: rgba(46, 204, 113, 0.12); color: #1d6f45; }
.alert-warning { border-color: rgba(243, 156, 18, 0.25); background: rgba(243, 156, 18, 0.14); color: #8c5a08; }
.alert-info { border-color: rgba(23, 162, 184, 0.25); background: rgba(23, 162, 184, 0.12); color: #0b5561; }
.action-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(231, 76, 60, 0.35);
  background: linear-gradient(90deg, rgba(231, 76, 60, 0.12), rgba(231, 76, 60, 0.05));
  box-shadow: 0 16px 28px -26px rgba(231, 76, 60, 0.45);
}
.action-banner .subtitle { margin: 4px 0 0; }
.banner-meta { text-align: right; }
.banner-meta .meta-text { margin: 6px 0 0; color: var(--text-muted); font-weight: 600; }

.upload-form {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  border: 1px dashed rgba(13, 110, 253, 0.3);
}
.upload-copy h3 { margin: 0 0 6px; }
.upload-copy p { margin: 0; color: var(--text-muted); }
.upload-controls { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.upload-controls label { font-weight: 600; }
.upload-form input[type="file"] { padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid rgba(15, 23, 42, 0.12); background: #fff; }
.upload-form button {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 10px 22px -16px rgba(13, 110, 253, 0.8);
}
.upload-form button:hover { background: var(--primary-dark); transform: translateY(-1px); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--surface-soft);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: 0 10px 24px -20px rgba(15, 23, 42, 0.35);
}
.stat-card.overdue { border-color: rgba(231, 76, 60, 0.2); background: rgba(231, 76, 60, 0.06); }
.stat-card.highlight { background: linear-gradient(135deg, rgba(13,110,253,0.12), rgba(23,162,184,0.08)); }
.stat-label { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.stat-value { font-size: 1.4rem; font-weight: 700; color: var(--primary-dark); }
.stat-hint { color: var(--text-muted); }

.marketplace-due {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  padding: 16px 18px 8px;
  box-shadow: 0 14px 32px -24px rgba(15, 23, 42, 0.4);
  margin-bottom: 22px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 10px;
}

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

.due-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 12px;
}

.due-column { background: var(--surface-soft); border-radius: var(--radius-md); padding: 12px; border: 1px solid rgba(15, 23, 42, 0.08); }
.column-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.due-card {
  background: #fff;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(15, 23, 42, 0.08);
  padding: 10px 10px 8px;
  margin-bottom: 8px;
  box-shadow: 0 10px 24px -24px rgba(15, 23, 42, 0.35);
}
.due-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.due-action { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; font-weight: 600; color: var(--text); }
.due-action input { width: 18px; height: 18px; }

.backlog-panel {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--radius-md);
  padding: 16px 18px 12px;
  box-shadow: 0 14px 28px -26px rgba(15, 23, 42, 0.4);
  margin-bottom: 18px;
}
.panel-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 10px; }
.backlog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.backlog-card {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(15, 23, 42, 0.08);
  background: var(--surface-soft);
  box-shadow: 0 12px 28px -24px rgba(15, 23, 42, 0.35);
}
.backlog-card .backlog-title { font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: var(--text-muted); margin: 0; }
.backlog-card .backlog-total { font-size: 1.7rem; font-weight: 800; margin: 4px 0; color: var(--text); }
.backlog-meta { margin: 2px 0; color: var(--text); font-weight: 600; }
.backlog-meta.subtle { color: var(--text-muted); font-weight: 500; }
.backlog-card.shopify { border-color: rgba(13, 110, 253, 0.3); background: linear-gradient(135deg, rgba(13,110,253,0.1), rgba(13,110,253,0.02)); }
.backlog-card.amazon { border-color: rgba(243, 156, 18, 0.35); background: linear-gradient(135deg, rgba(243,156,18,0.12), rgba(243,156,18,0.03)); }
.backlog-card.ebay { border-color: rgba(23, 162, 184, 0.35); background: linear-gradient(135deg, rgba(23,162,184,0.12), rgba(23,162,184,0.03)); }

.groups-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; }
.group { background: var(--surface-soft); border-radius: var(--radius-md); padding: 16px 18px; border: 1px solid rgba(15, 23, 42, 0.12); box-shadow: 0 14px 34px -24px rgba(15, 23, 42, 0.45); }
.group h2 { text-align: center; margin: 0 0 10px; display: inline-flex; gap: 8px; align-items: center; justify-content: center; font-size: 1.2rem; }
.overdue-block { margin-bottom: 18px; }
.overdue-block h2 { margin: 4px 0 0; }
.badge { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; padding: 4px 10px; border-radius: 999px; background: rgba(13, 110, 253, 0.12); color: var(--primary-dark); font-weight: 600; font-size: 0.9rem; }

.group-box { border: 1px solid rgba(15, 23, 42, 0.08); border-radius: var(--radius-md); margin-bottom: 12px; padding: 12px 14px; background: #fff; box-shadow: 0 10px 28px -24px rgba(15, 23, 42, 0.35); }
.group-box.duplicate { border-color: rgba(231, 76, 60, 0.35); box-shadow: 0 12px 30px -24px rgba(231, 76, 60, 0.4); }
.group-box h3 { margin: 0 0 8px; text-align: center; font-size: 1rem; }

.event-card { background: var(--surface-muted); border: 1px solid rgba(15, 23, 42, 0.08); border-radius: var(--radius-md); padding: 12px 12px 8px; margin-bottom: 10px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8); display: flex; flex-direction: column; gap: 8px; }
.event-card.compact { gap: 6px; }
.event-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.product-id { font-size: 1.05rem; font-weight: 700; color: var(--primary-dark); }
.status-badges { display: flex; gap: 8px; flex-wrap: wrap; }
.status-chip { padding: 6px 10px; border-radius: 999px; font-size: 0.9rem; font-weight: 600; }
.status-chip.neutral { background: rgba(15, 23, 42, 0.08); color: var(--text); }
.status-chip.warning { background: rgba(243, 156, 18, 0.16); color: #8c5a08; }
.status-chip.critical { background: rgba(231, 76, 60, 0.16); color: var(--danger); }
.status-chip.muted { background: rgba(15, 23, 42, 0.06); color: var(--text-muted); }
.status-chip.amazon { background: rgba(255, 165, 0, 0.16); color: #c77b00; }
.status-chip.ebay { background: rgba(0, 143, 213, 0.16); color: #0072b1; }

.dates { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.date-block { background: #fff; border: 1px solid rgba(15, 23, 42, 0.08); border-radius: var(--radius-sm); padding: 8px 10px; }
.label { text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); font-size: 0.8rem; margin: 0 0 4px; }
.value { margin: 0; font-weight: 700; }
.helper { margin: 4px 0 0; color: var(--text-muted); font-size: 0.88rem; }

.action-board { background: #fff; border: 1px solid rgba(15, 23, 42, 0.08); border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.board-title { margin: 0; font-weight: 700; color: var(--text); }
.action-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-sm); border: 1px solid rgba(15,23,42,0.08); background: var(--surface-soft); }
.action-row.done { border-color: rgba(46, 204, 113, 0.3); background: rgba(46, 204, 113, 0.08); }
.action-row.due { border-color: rgba(231, 76, 60, 0.3); background: rgba(231, 76, 60, 0.05); }
.action-row.fading-out { opacity: 0; transition: opacity 0.4s ease; }
.action-left { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; cursor: pointer; }
.action-left input { width: 18px; height: 18px; cursor: pointer; }
.action-meta { display: flex; align-items: center; }
.pill.success { background: rgba(46, 204, 113, 0.18); color: #1b6f45; }
.pill.critical { background: rgba(231, 76, 60, 0.16); color: var(--danger); }
.pill.warning { background: rgba(243, 156, 18, 0.16); color: #8c5a08; }
.pill.muted { background: rgba(15, 23, 42, 0.06); color: var(--text-muted); }

.countdown { font-weight: 700; color: var(--danger); }
.countdown.overdue { color: #b02a37; }
.critical-text { color: #8c1a1a; font-weight: 600; }
.no-events { text-align: center; font-size: 0.95rem; color: var(--text-muted); padding: 18px 10px; }

.collapsible-section .collapsible-header { display: flex; align-items: center; cursor: pointer; margin-bottom: 0.5rem; padding-bottom: 0.3rem; border-bottom: 1px solid rgba(15, 23, 42, 0.08); }
.collapsible-section .arrow { font-size: 1.2rem; margin-right: 0.6rem; color: var(--primary-dark); }
.collapsible-section .collapsible-content { padding-left: 1rem; border-left: 3px solid rgba(13, 110, 253, 0.15); margin-bottom: 0.6rem; }

.calendar-board { background: #fff; border: 1px solid rgba(15, 23, 42, 0.08); border-radius: var(--radius-md); padding: 16px 18px; box-shadow: 0 14px 34px -24px rgba(15, 23, 42, 0.45); margin-bottom: 22px; }
.calendar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.calendar-filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.calendar-filters label { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--text); }
.ghost-button { border: 1px solid rgba(15, 23, 42, 0.1); background: transparent; padding: 10px 14px; border-radius: 999px; cursor: pointer; font-weight: 700; color: var(--text); transition: all 0.2s ease; }
.ghost-button:hover { border-color: rgba(13, 110, 253, 0.4); color: var(--primary-dark); box-shadow: 0 10px 20px -18px rgba(15,23,42,0.5); }
.calendar-list { display: flex; flex-direction: column; gap: 10px; }
.plan-row { display: flex; gap: 12px; border: 1px solid rgba(15, 23, 42, 0.08); border-radius: var(--radius-md); padding: 10px 12px; background: var(--surface-soft); align-items: center; }
.plan-row.collapsed { display: none; }
.plan-platform { min-width: 90px; text-align: center; font-weight: 700; padding: 10px 12px; border-radius: var(--radius-sm); color: #fff; text-transform: uppercase; letter-spacing: 0.05em; }
.plan-platform.shopify { background: linear-gradient(135deg, #95bf47, #6b9b28); }
.plan-platform.amazon { background: linear-gradient(135deg, #ff9900, #d17a00); }
.plan-platform.ebay { background: linear-gradient(135deg, #0064d2, #0052a8); }
.plan-main { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.plan-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.plan-details { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.plan-countdown { font-weight: 700; color: var(--danger); background: #fff; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid rgba(231, 76, 60, 0.2); min-width: 180px; text-align: center; box-shadow: inset 0 1px 0 rgba(255,255,255,0.8); }


@media (max-width: 900px) {
  body { padding: 18px; }
  .container { padding: 24px 18px 26px; }
  .upload-form { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .groups-grid { grid-template-columns: 1fr; }
}
