/* ========================================
   Eppi Den Matek Dashboard — styles
   Brand: Teal #053333 · Pink #FFEEEC · Coral #FF6F61
   Fonts: PP Editorial New (display) · Stabil Grotesk (sans)
   ======================================== */

@font-face {
  font-family: "PP Editorial New";
  src: url("assets/fonts/ppeditorialnew-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Stabil Grotesk";
  src: url("assets/fonts/stabilgrotesk-regular.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Stabil Grotesk";
  src: url("assets/fonts/stabilgrotesk-medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

:root {
  --teal: #053333;
  --teal-lt: #0d4a4a;
  --teal-xlt: #dce9e9;
  --pink: #FFEEEC;
  --offwhite: #fdf8f7;
  --coral: #FF6F61;
  --coral-lt: #ff9b91;
  --gold: #C9A961;
  --text: #1a2121;
  --text-muted: #6b7576;
  --border: #f0e3e0;
  --border-strong: #dac8c4;
  --white: #ffffff;
  --danger: #c0392b;
  --success: #27ae60;
  --warning: #e67e22;

  --font-sans: "Stabil Grotesk", "Inter", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-serif: "PP Editorial New", "EB Garamond", "Cormorant Garamond", Georgia, serif;
  --font-mono: "SF Mono", Menlo, Consolas, monospace;

  --shadow-sm: 0 1px 2px rgba(5, 51, 51, 0.05);
  --shadow-md: 0 2px 8px rgba(5, 51, 51, 0.08);
  --shadow-lg: 0 8px 24px rgba(5, 51, 51, 0.12);
}

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

html, body { height: 100%; }

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--pink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ========== Top bar ========== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--teal);
  color: var(--white);
  border-bottom: 1px solid var(--teal);
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-serif);
}

.brand-mark {
  font-size: 28px;
  color: var(--coral);
  font-family: var(--font-serif);
  line-height: 1;
  font-weight: 400;
}

.brand-name {
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0;
}

.brand-year {
  color: var(--gold);
  font-weight: 400;
}

.top-stats {
  display: flex;
  gap: 32px;
  margin-left: auto;
  margin-right: 20px;
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 80px;
}

.stat-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 500;
}

.stat-value {
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
  font-family: var(--font-serif);
}

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

/* ========== Main layout ========== */
.main-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  flex: 1;
  min-height: 0;
}

.main-layout.drawer-open {
  grid-template-columns: 260px 1fr 380px;
}

/* ========== Sidebar ========== */
.sidebar {
  background: var(--offwhite);
  border-right: 1px solid var(--border);
  padding: 16px 0;
  overflow-y: auto;
  max-height: calc(100vh - 68px);
}

.side-heading {
  padding: 18px 20px 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  color: var(--text-muted);
  font-weight: 700;
}

.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background 0.12s;
}

.side-item:hover {
  background: rgba(5, 51, 51, 0.05);
}

.side-item.active {
  background: var(--teal);
  color: var(--white);
}

.side-item.active .side-badge {
  background: rgba(255, 255, 255, 0.2);
  color: var(--white);
}

.side-icon {
  display: inline-flex;
  width: 18px;
  justify-content: center;
  font-size: 13px;
  color: var(--coral);
}

.side-item.active .side-icon {
  color: var(--coral-lt);
}

.side-badge {
  margin-left: auto;
  background: var(--coral);
  color: var(--white);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
}

.file-list {
  display: flex;
  flex-direction: column;
}

.file-loading {
  padding: 10px 20px;
  color: var(--text-muted);
  font-size: 13px;
  font-style: italic;
}

.file-list .side-item .file-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
}

.file-list .side-item .file-size {
  font-size: 10px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.file-list .side-item.active .file-size {
  color: rgba(255, 255, 255, 0.55);
}

/* ========== Content ========== */
.content {
  padding: 32px 48px;
  overflow-y: auto;
  max-height: calc(100vh - 68px);
  background: var(--pink);
}

.view {
  max-width: 920px;
  margin: 0 auto;
}

/* ========== Overview ========== */
.overview-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 40px;
  padding: 36px 40px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 28px;
}

.overview-hero-text h1 {
  font-family: var(--font-serif);
  font-size: 42px;
  font-weight: 500;
  color: var(--teal);
  line-height: 1.1;
  margin-bottom: 8px;
}

.overview-hero-text .lead {
  color: var(--text-muted);
  font-size: 15px;
  margin-bottom: 18px;
}

.overview-hero-text .dot {
  color: var(--coral);
  padding: 0 4px;
}

.phase-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.phase-pill {
  padding: 6px 12px;
  background: var(--offwhite);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 12px;
  color: var(--teal);
  font-weight: 500;
}

.phase-pill.active {
  background: var(--teal);
  color: var(--white);
  border-color: var(--teal);
}

.overview-hero-counter {
  text-align: center;
  padding: 20px 28px;
  background: var(--teal);
  color: var(--white);
  border-radius: 16px;
  min-width: 140px;
}

.counter-num {
  font-family: var(--font-serif);
  font-size: 64px;
  font-weight: 500;
  line-height: 1;
  color: var(--gold);
}

.counter-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 6px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.overview-section {
  margin-bottom: 32px;
}

.overview-section h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--teal);
  font-weight: 500;
  margin-bottom: 14px;
}

.budget-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.budget-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
}

.budget-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--coral);
}

.budget-card.total::before { background: var(--teal); }
.budget-card .market {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.budget-card .amount {
  font-family: var(--font-serif);
  font-size: 26px;
  color: var(--teal);
  font-weight: 500;
}

.budget-card .breakdown {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

.budget-card .pct {
  position: absolute;
  top: 18px;
  right: 20px;
  font-size: 11px;
  color: var(--coral);
  font-weight: 700;
}

.timeline {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
}

.timeline-phase {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
}

.timeline-phase:last-child { border-bottom: none; }

.timeline-phase .tp-dates {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 110px;
  font-variant-numeric: tabular-nums;
}

.timeline-phase .tp-name {
  flex: 1;
  font-weight: 500;
  color: var(--teal);
}

.timeline-phase .tp-tone {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 100px;
  background: var(--offwhite);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.timeline-phase.current { background: var(--teal-xlt); margin: 0 -24px; padding: 12px 24px; border-radius: 8px; }
.timeline-phase.current .tp-name { color: var(--teal); font-weight: 600; }

.deliverables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}

.deliverable {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border 0.15s, transform 0.1s;
}

.deliverable:hover {
  border-color: var(--coral);
  transform: translateY(-1px);
}

.deliverable .deliverable-title {
  font-weight: 600;
  color: var(--teal);
  font-size: 14px;
  margin-bottom: 4px;
}

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

.deliverable .deliverable-status {
  display: inline-block;
  margin-top: 8px;
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--offwhite);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.deliverable .deliverable-status.done { background: #e6f5ec; color: var(--success); }
.deliverable .deliverable-status.progress { background: #fef3e6; color: var(--warning); }
.deliverable .deliverable-status.draft { background: var(--teal-xlt); color: var(--teal); }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.kpi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  text-align: left;
}

.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-value {
  font-family: var(--font-serif);
  font-size: 32px;
  color: var(--teal);
  margin: 6px 0 4px;
  font-weight: 500;
}

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

/* ========== File view ========== */
.file-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
  gap: 20px;
  flex-wrap: wrap;
}

.file-breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
  font-weight: 600;
}

.file-header h1 {
  font-family: var(--font-serif);
  font-size: 32px;
  font-weight: 500;
  color: var(--teal);
  line-height: 1.2;
}

.file-meta {
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.file-meta .dot { color: var(--coral); padding: 0 4px; }

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

.file-body {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px 40px;
  box-shadow: var(--shadow-sm);
}

.file-rendered {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text);
  line-height: 1.65;
}

.file-editor {
  width: 100%;
  min-height: 70vh;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  resize: vertical;
  background: var(--offwhite);
}

.file-editor:focus {
  outline: 2px solid var(--teal);
  outline-offset: -1px;
  background: var(--white);
}

/* Markdown rendered styles */
.file-rendered h1 {
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--teal);
  margin: 28px 0 14px;
  font-weight: 500;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

.file-rendered h1:first-child { margin-top: 0; }

.file-rendered h2 {
  font-family: var(--font-serif);
  font-size: 22px;
  color: var(--teal);
  margin: 32px 0 12px;
  font-weight: 500;
}

.file-rendered h3 {
  font-size: 17px;
  color: var(--teal);
  margin: 22px 0 10px;
  font-weight: 600;
}

.file-rendered h4 {
  font-size: 14px;
  color: var(--teal);
  margin: 18px 0 8px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.file-rendered p { margin: 0 0 12px; }
.file-rendered strong { color: var(--teal); font-weight: 600; }
.file-rendered em { color: var(--coral); font-style: italic; }

.file-rendered ul, .file-rendered ol {
  margin: 8px 0 16px 20px;
}

.file-rendered li { margin-bottom: 4px; }

.file-rendered code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--offwhite);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--teal);
  border: 1px solid var(--border);
}

.file-rendered pre {
  background: var(--teal);
  color: #e8efef;
  padding: 16px 20px;
  border-radius: 8px;
  overflow-x: auto;
  margin: 14px 0;
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
}

.file-rendered pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
}

.file-rendered blockquote {
  border-left: 3px solid var(--coral);
  padding: 4px 16px;
  margin: 14px 0;
  color: var(--text-muted);
  font-style: italic;
  background: var(--offwhite);
  border-radius: 0 6px 6px 0;
}

.file-rendered a {
  color: var(--coral);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.file-rendered a:hover { border-bottom-color: var(--coral); }

.file-rendered hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

.file-rendered table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0;
  font-size: 13px;
}

.file-rendered th {
  background: var(--offwhite);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 2px solid var(--border-strong);
  font-weight: 600;
  color: var(--teal);
}

.file-rendered td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.file-rendered tr:hover td { background: var(--offwhite); }

/* Inline images (banner thumbnails, inline previews) */
.file-rendered .thumb-link {
  display: inline-block;
  border: none !important;
  line-height: 0;
}

.file-rendered .inline-thumb {
  max-width: 220px;
  max-height: 220px;
  width: auto;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--offwhite);
  object-fit: contain;
  display: block;
  transition: transform 0.15s, box-shadow 0.15s;
}

.file-rendered .thumb-link:hover .inline-thumb {
  transform: scale(1.02);
  box-shadow: var(--shadow-md);
  border-color: var(--coral);
}

.file-rendered td .inline-thumb,
.file-rendered td .thumb-link .inline-thumb {
  max-width: 180px;
  max-height: 180px;
}

/* Broken image fallback — show a placeholder chip */
.file-rendered .thumb-link.broken {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 180px;
  height: 140px;
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  background: var(--offwhite);
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.3;
  padding: 8px;
  text-align: center;
}

.file-rendered .thumb-link.broken::before {
  content: "⚠ preview unavailable\Aklikni pre otvorenie v Canve";
  white-space: pre-line;
}

.file-rendered .anchor-wrap {
  position: relative;
  cursor: pointer;
}

.file-rendered .anchor-wrap:hover::before {
  content: "💬";
  position: absolute;
  left: -28px;
  top: 0;
  font-size: 16px;
  opacity: 0.6;
}

.file-rendered .has-comments::after {
  content: attr(data-comment-count);
  display: inline-block;
  margin-left: 10px;
  background: var(--coral);
  color: var(--white);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 100px;
  vertical-align: middle;
  font-family: var(--font-sans);
  font-weight: 600;
}

/* ========== Drawer (comments) ========== */
.drawer {
  background: var(--white);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  max-height: calc(100vh - 68px);
  display: none;
  flex-direction: column;
}

.main-layout.drawer-open .drawer { display: flex; }

.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--offwhite);
}

.drawer-head h3 {
  font-family: var(--font-serif);
  color: var(--teal);
  font-size: 18px;
  font-weight: 500;
}

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.drawer-composer {
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  background: var(--offwhite);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-composer input[type="text"],
.drawer-composer textarea {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 13px;
  background: var(--white);
  color: var(--text);
}

.drawer-composer textarea {
  min-height: 72px;
  resize: vertical;
  font-family: var(--font-sans);
  line-height: 1.5;
}

.drawer-composer input:focus,
.drawer-composer textarea:focus {
  outline: 2px solid var(--teal);
  outline-offset: -1px;
}

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

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

/* Comment cards */
.comment {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: var(--white);
  position: relative;
}

.comment.resolved {
  background: var(--offwhite);
  opacity: 0.7;
}

.comment-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}

.comment-author {
  font-weight: 600;
  color: var(--teal);
  font-size: 13px;
}

.comment-time {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.comment-anchor {
  font-size: 11px;
  color: var(--coral);
  margin-bottom: 6px;
  font-style: italic;
  background: var(--offwhite);
  padding: 4px 8px;
  border-radius: 4px;
  display: inline-block;
}

.comment-text {
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
  word-wrap: break-word;
}

.comment-actions {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  font-size: 11px;
}

.comment-action {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-family: inherit;
  font-size: 11px;
  transition: all 0.12s;
}

.comment-action:hover { border-color: var(--teal); color: var(--teal); }
.comment-action.danger:hover { border-color: var(--danger); color: var(--danger); }
.comment-action.success:hover { border-color: var(--success); color: var(--success); }

.comment-file-ref {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  cursor: pointer;
  text-decoration: underline;
}

.comment-file-ref:hover { color: var(--teal); }

/* ========== Buttons ========== */
.btn {
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--teal);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}

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

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

.btn-primary:hover {
  background: var(--teal-lt);
  color: var(--white);
}

.btn-ghost {
  background: none;
  border-color: transparent;
}

.btn-ghost:hover {
  background: rgba(5, 51, 51, 0.05);
  border-color: var(--border);
}

.topbar .btn-ghost {
  color: var(--white);
}

.topbar .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-icon {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 22px;
  cursor: pointer;
  padding: 2px 8px;
  line-height: 1;
}

.btn-icon:hover { color: var(--teal); }

.hidden { display: none !important; }

/* ========== Toast ========== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background: var(--teal);
  color: var(--white);
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.25s;
  pointer-events: none;
  z-index: 100;
  font-size: 13px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast.error { background: var(--danger); }
.toast.success { background: var(--success); }

/* ========== Toggle ========== */
.toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
}

/* ========== Comments list all ========== */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ========== Bannery view ========== */

.side-badge-new {
  background: var(--coral);
  color: #fff;
}

/* Round section */
.br-section {
  margin-bottom: 40px;
}
.br-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.br-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--teal);
}
.br-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.br-format {
  font-size: 11px;
  color: var(--text-muted);
  background: var(--offwhite);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 10px;
}
.br-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
}
.br-status {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 10px;
}
.br-done    { background: #e8f8ef; color: #1a7a42; }
.br-wip     { background: #fff3cd; color: #856404; }
.br-pending { background: var(--offwhite); color: var(--text-muted); border: 1px solid var(--border); }

.br-note {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--offwhite);
  border-left: 3px solid var(--border-strong);
  padding: 8px 12px;
  border-radius: 0 6px 6px 0;
  margin-bottom: 16px;
}

/* Banner card grid — 5 cols */
.bc-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}
@media (max-width: 1400px) { .bc-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 1100px) { .bc-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px)  { .bc-grid { grid-template-columns: repeat(2, 1fr); } }

/* Large 2-col grid for layout selection rounds */
.bc-grid-large {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 700px) { .bc-grid-large { grid-template-columns: 1fr; } }

/* Lightbox */
.lightbox {
  display: none;
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(5,51,51,.88);
  align-items: center; justify-content: center;
  cursor: zoom-out;
  backdrop-filter: blur(6px);
}
.lightbox.open { display: flex; }
.lightbox img {
  max-width: min(920px, 90vw);
  max-height: 90vh;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  cursor: default;
  object-fit: contain;
}
.lightbox-close {
  position: fixed; top: 22px; right: 28px;
  color: #fff; font-size: 28px; line-height: 1;
  cursor: pointer; opacity: .7;
  background: none; border: none; padding: 4px 8px;
}
.lightbox-close:hover { opacity: 1; }
.bc-img-wrap.has-preview { cursor: zoom-in; }
.bc-img-wrap.has-preview .bc-hover-badge { opacity: 0; transition: opacity .15s; }
.bc-img-wrap.has-preview:hover .bc-hover-badge { opacity: 1; }
.bc-canva-badge {
  position: absolute; bottom: 8px; left: 8px;
  background: var(--coral); color: #fff;
  font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
  text-decoration: none; z-index: 2;
}

/* Banner card */
.bc {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow .18s, transform .18s;
}
.bc:hover {
  box-shadow: 0 4px 20px rgba(5,51,51,.11);
  transform: translateY(-2px);
}
.bc-pending {
  border-style: dashed;
  opacity: .7;
}

/* Image area */
.bc-img-wrap {
  display: block;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--offwhite);
  text-decoration: none;
}
.bc-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .2s;
}
.bc-clickable:hover img { transform: scale(1.03); }
.bc-clickable:hover .bc-hover-badge { opacity: 1; }

.bc-hover-badge {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: var(--coral);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}
.bc-broken { background: var(--offwhite); }

/* Placeholder (no thumb yet) */
.bc-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.bc-placeholder-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--border-strong);
  font-family: var(--font-serif);
}

/* Info block */
.bc-info {
  padding: 9px 11px 11px;
}
.bc-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bc-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.bc-price {
  font-size: 12px;
  font-weight: 600;
  color: var(--coral);
  margin-bottom: 7px;
}
.btn-sm {
  font-size: 11px;
  padding: 4px 11px;
  border-radius: 20px;
  white-space: nowrap;
}
.bc-status-chip {
  display: inline-block;
  font-size: 10px;
  color: var(--text-muted);
  background: var(--offwhite);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 10px;
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--coral-lt); }

/* Responsive */
@media (max-width: 1100px) {
  .main-layout.drawer-open { grid-template-columns: 260px 1fr; }
  .drawer { position: fixed; right: 0; top: 68px; bottom: 0; width: 380px; z-index: 50; box-shadow: var(--shadow-lg); }
}

@media (max-width: 800px) {
  .main-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .content { padding: 20px; }
  .top-stats { gap: 16px; }
  .stat { min-width: 60px; }
  .stat-value { font-size: 14px; }
}

/* =============================================
   ANALYTICS VIEWS
   ============================================= */

.side-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 20px 16px 6px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}
.side-section-label:first-child { border-top: none; margin-top: 0; }

.view-analytics { max-width: 1100px; }

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

.analytics-section {
  margin-top: 36px;
}
.analytics-section h2 {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

/* Connector chips */
.connectors-status { display: flex; flex-wrap: wrap; gap: 6px; }
.connector-chip {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 20px;
  font-weight: 600;
}
.connector-chip.ok { background: #d1fadf; color: #166534; }
.connector-chip.err { background: #fee2e2; color: #991b1b; }

/* Market grid (overview) */
.analytics-market-grid { display: flex; flex-direction: column; gap: 20px; }

.market-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.market-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--teal);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.market-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--coral);
  color: #fff;
  letter-spacing: 0.05em;
}
.market-kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 900px) { .market-kpi-row { grid-template-columns: repeat(2, 1fr); } }

/* KPI trend */
.kpi-trend { font-size: 12px; font-weight: 700; margin-top: 4px; }
.kpi-trend.up { color: #16a34a; }
.kpi-trend.down { color: #dc2626; }

/* Chart */
.chart-wrap {
  position: relative;
  height: 280px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

/* Analytics table */
.analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.analytics-table th {
  text-align: left;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 6px 10px;
  border-bottom: 2px solid var(--border);
}
.analytics-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.analytics-table tr:last-child td { border-bottom: none; }
.analytics-table tr:hover td { background: var(--offwhite); }
.analytics-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.analytics-table .coupon-code {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  color: var(--coral);
  letter-spacing: 0.04em;
}

/* Mini progress bar in table */
.bar-mini {
  height: 6px;
  background: var(--coral);
  border-radius: 3px;
  min-width: 2px;
  max-width: 100%;
}
