/* ------------------------------------------------------------------ */
/*  Reset & base                                                        */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:           #f5f5f5;
  --surface:      #ffffff;
  --border:       #e0e0e0;
  --text:         #1a1a1a;
  --text-muted:   #6b7280;
  --accent:       #1d4ed8;
  --accent-light: #eff6ff;
  --green:        #16a34a;
  --green-light:  #dcfce7;
  --red:          #dc2626;
  --red-light:    #fee2e2;
  --amber:        #d97706;
  --amber-light:  #fef3c7;
  --radius:       8px;
  --shadow:       0 1px 3px rgba(0,0,0,.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ */
/*  Layout chrome                                                       */
/* ------------------------------------------------------------------ */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.25rem;
  position: sticky;
  top: 0;
  z-index: 10;
}
.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  height: 52px;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.logo { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.logo-tag {
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 7px;
  border-radius: 999px;
}
.header-nav { margin-left: auto; }
.btn-logout {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: .3rem .75rem;
  font-size: .82rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.btn-logout:hover { background: var(--surface-hover, #f1f5f9); color: var(--text); }

.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.site-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: .8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ------------------------------------------------------------------ */
/*  Page header                                                         */
/* ------------------------------------------------------------------ */
.page-header { margin-bottom: 1.25rem; }
.page-header h1 {
  font-size: 1.4rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.back-link {
  display: inline-block;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: .5rem;
}
.back-link:hover { color: var(--accent); text-decoration: none; }

.count-badge {
  font-size: .8rem;
  font-weight: 600;
  background: var(--border);
  color: var(--text-muted);
  padding: 2px 9px;
  border-radius: 999px;
}

/* ------------------------------------------------------------------ */
/*  Badges                                                              */
/* ------------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--border);
  color: var(--text-muted);
}
.badge--category { background: var(--accent-light); color: var(--accent); }
.badge--source   { background: #f3f4f6; color: #374151; }
.badge--publish  { background: var(--green-light); color: var(--green); }
.badge--no-publish { background: var(--red-light); color: var(--red); }

.badge--score-high   { background: var(--green-light); color: var(--green); }
.badge--score-medium { background: var(--amber-light); color: var(--amber); }
.badge--score-low    { background: var(--red-light); color: var(--red); }
.badge--score-unknown { background: var(--border); color: var(--text-muted); }

/* ------------------------------------------------------------------ */
/*  Filter bar                                                          */
/* ------------------------------------------------------------------ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: flex-end;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  margin-bottom: 1.25rem;
}
.filter-group { display: flex; flex-direction: column; gap: .25rem; }
.filter-group label { font-size: .75rem; font-weight: 600; color: var(--text-muted); }
.filter-group input,
.filter-group select {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .35rem .6rem;
  font-size: .875rem;
  background: var(--bg);
  color: var(--text);
  height: 34px;
}
.filter-group--checkbox { flex-direction: row; align-items: center; gap: .4rem; }
.filter-group--checkbox label {
  font-size: .875rem;
  font-weight: 400;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .4rem;
}

/* ------------------------------------------------------------------ */
/*  Buttons                                                             */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  padding: .4rem .9rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: opacity .15s;
}
.btn:hover { opacity: .85; text-decoration: none; }
.btn--primary  { background: var(--accent); color: #fff; }
.btn--ghost    { background: transparent; border-color: var(--border); color: var(--text-muted); }
.btn--detail   { background: var(--accent-light); color: var(--accent); margin-top: .75rem; font-size: .8rem; }

/* ------------------------------------------------------------------ */
/*  Deal grid                                                           */
/* ------------------------------------------------------------------ */
.deal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.deal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.deal-card__image-wrap {
  aspect-ratio: 16/9;
  background: #f9fafb;
  overflow: hidden;
}
.deal-card__image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: .5rem;
}

.deal-card__body { padding: .9rem 1rem 1rem; display: flex; flex-direction: column; gap: .5rem; }

.deal-card__meta { display: flex; flex-wrap: wrap; gap: .3rem; }

.deal-card__title {
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.35;
}
.deal-card__title a { color: var(--text); }
.deal-card__title a:hover { color: var(--accent); text-decoration: none; }

.deal-card__headline {
  font-size: .82rem;
  color: var(--accent);
  font-style: italic;
}

.deal-card__pricing { display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.deal-card__date { font-size: .75rem; color: var(--text-muted); margin-top: auto; }

/* ------------------------------------------------------------------ */
/*  Pricing                                                             */
/* ------------------------------------------------------------------ */
.price-current       { font-size: 1.15rem; font-weight: 700; color: var(--text); }
.price-current--large{ font-size: 1.6rem; }
.price-original      { font-size: .875rem; color: var(--text-muted); text-decoration: line-through; }
.price-discount      { font-size: .85rem; font-weight: 700; color: var(--green); }
.price-discount--large { font-size: 1.1rem; }

/* ------------------------------------------------------------------ */
/*  Warning list                                                        */
/* ------------------------------------------------------------------ */
.warning-list {
  list-style: none;
  padding: .4rem .6rem;
  background: var(--amber-light);
  border-left: 3px solid var(--amber);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .8rem;
  color: #92400e;
}
.warning-list--large { font-size: .875rem; }
.warning-list li + li { margin-top: .2rem; }

/* ------------------------------------------------------------------ */
/*  Empty state                                                         */
/* ------------------------------------------------------------------ */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}

/* ------------------------------------------------------------------ */
/*  Detail layout                                                       */
/* ------------------------------------------------------------------ */
.detail-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 1rem;
  align-items: start;
}
@media (max-width: 720px) {
  .detail-layout { grid-template-columns: 1fr; }
}

.detail-right { display: flex; flex-direction: column; gap: 1rem; }

.detail-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

.detail-image {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
  border-radius: var(--radius);
  background: #f9fafb;
  padding: .5rem;
  margin-bottom: 1rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: .9rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.subsection-title {
  font-size: .85rem;
  font-weight: 700;
  margin: 1rem 0 .5rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* ------------------------------------------------------------------ */
/*  Info table                                                          */
/* ------------------------------------------------------------------ */
.info-table { width: 100%; border-collapse: collapse; font-size: .875rem; }
.info-table th,
.info-table td { padding: .4rem .5rem; vertical-align: top; }
.info-table th {
  width: 40%;
  text-align: left;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}
.info-table tr + tr { border-top: 1px solid var(--border); }

/* ------------------------------------------------------------------ */
/*  Score bars                                                          */
/* ------------------------------------------------------------------ */
.score-bar-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
}
.score-bar {
  height: 6px;
  background: var(--accent);
  border-radius: 999px;
  min-width: 4px;
  transition: width .3s;
}
.score-bar-value { font-size: .8rem; color: var(--text-muted); white-space: nowrap; }

/* ------------------------------------------------------------------ */
/*  Pricing (detail)                                                    */
/* ------------------------------------------------------------------ */
.pricing-large {
  display: flex;
  align-items: baseline;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: .75rem;
}
.badges-row { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }

/* ------------------------------------------------------------------ */
/*  AI content block                                                    */
/* ------------------------------------------------------------------ */
.content-meta { display: flex; flex-wrap: wrap; gap: .3rem; margin-bottom: .75rem; }
.content-headline {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: .4rem;
}
.content-description {
  color: var(--text-muted);
  font-size: .875rem;
  margin-bottom: .6rem;
}
.content-bullets {
  list-style: none;
  margin-bottom: .75rem;
}
.content-bullets li {
  padding: .3rem 0 .3rem .75rem;
  font-size: .875rem;
  border-left: 3px solid var(--accent-light);
}
.content-bullets li + li { margin-top: .25rem; }
.content-analysis {
  background: var(--accent-light);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  font-size: .875rem;
}
.content-analysis h4 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--accent);
  margin-bottom: .4rem;
}

/* ------------------------------------------------------------------ */
/*  Review status badges                                                */
/* ------------------------------------------------------------------ */
.badge--review-pending  { background: var(--amber-light); color: var(--amber); }
.badge--review-approved { background: var(--green-light); color: var(--green); }
.badge--review-rejected { background: var(--red-light);   color: var(--red); }
.badge--mock            { background: #f3e8ff; color: #7c3aed; }
.badge--superseded      { background: #f1f5f9; color: #64748b; }

.mock-warning {
  display: inline-block;
  font-size: .8rem;
  color: #7c3aed;
  background: #f3e8ff;
  border: 1px solid #c4b5fd;
  border-radius: 4px;
  padding: .2rem .5rem;
}
.alert {
  padding: .85rem 1.1rem;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  font-size: .9rem;
  border: 1px solid;
}
.alert--warning {
  background: #fffbeb;
  color: #92400e;
  border-color: #fcd34d;
}
.alert--info {
  background: #eff6ff;
  color: #1e40af;
  border-color: #93c5fd;
}

/* ------------------------------------------------------------------ */
/*  Review action section                                               */
/* ------------------------------------------------------------------ */
.action-section { border-top: 3px solid var(--accent-light); }
.action-status  { font-size: .875rem; margin-bottom: 1rem; }

.action-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; margin-top: .75rem; }
.action-form .filter-group input {
  max-width: 280px;
}

.btn--approve { background: var(--green-light); color: var(--green); border-color: var(--green); }
.btn--approve:hover { background: var(--green); color: #fff; }
.btn--reject  { background: var(--red-light);   color: var(--red);   border-color: var(--red); }
.btn--reject:hover  { background: var(--red);   color: #fff; }

.rejection-reason { color: var(--red); font-style: italic; }

.scoring-note {
  background: #fef9ec;
  border: 1px solid #f0c040;
  border-radius: var(--radius);
  padding: .55rem .75rem;
  font-size: .82rem;
  color: #7a5800;
  margin-bottom: .75rem;
  line-height: 1.4;
}

/* ------------------------------------------------------------------ */
/*  Mobile tweaks                                                       */
/* ------------------------------------------------------------------ */
@media (max-width: 600px) {
  .deal-grid { grid-template-columns: 1fr; }
  .filter-bar { flex-direction: column; align-items: stretch; }
}
