/* Hyper Games admin theme — overrides Django's default look & feel.
   Palette + typography from HG_Guidelines.pdf. */

@font-face {
  font-family: "Marujo";
  src: url("/static/fonts/Marujo.woff2") format("woff2");
  font-display: swap;
  font-weight: normal;
  font-style: normal;
}
@import url("https://fonts.googleapis.com/css2?family=Sanchez:ital@0;1&display=swap");

:root {
  /* Brand palette */
  --hg-orange:      #F38162;
  --hg-orange-700:  #d96b4d;
  --hg-purple:      #5E4E69;
  --hg-purple-900:  #3f3349;
  --hg-purple-100:  #ede9f0;
  --hg-cream:       #F0EAE1;
  --hg-ink:         #2a2230;

  --hg-display: "Marujo", "Patrick Hand SC", system-ui, sans-serif;
  --hg-body:    "Sanchez", "Sanchez Niu", Georgia, serif;

  /* Django admin variables — wired to our palette */
  --primary:               var(--hg-purple);
  --secondary:             var(--hg-purple-900);
  --accent:                var(--hg-orange);
  --primary-fg:            #fff;
  --body-fg:               var(--hg-ink);
  --body-bg:               var(--hg-cream);
  --body-quiet-color:      #6b6075;
  --body-medium-color:     #4b4253;
  --body-loud-color:       var(--hg-purple-900);
  --header-color:          #fff;
  --header-branding-color: #fff;
  --header-bg:             var(--hg-purple);
  --header-link-color:     #fff;
  --breadcrumbs-fg:        #fff;
  --breadcrumbs-link-fg:   #fff;
  --breadcrumbs-bg:        var(--hg-purple-900);
  --link-fg:               var(--hg-orange-700);
  --link-hover-color:      var(--hg-orange);
  --link-selected-fg:      var(--hg-orange);
  --button-fg:             #fff;
  --button-bg:             var(--hg-purple);
  --button-hover-bg:       var(--hg-purple-900);
  --default-button-bg:     var(--hg-orange);
  --default-button-hover-bg: var(--hg-orange-700);
  --close-button-bg:       #888;
  --close-button-hover-bg: #555;
  --delete-button-bg:      #ba2121;
  --delete-button-hover-bg:#a41515;
  --object-tools-fg:       #fff;
  --object-tools-bg:       var(--hg-purple);
  --object-tools-hover-bg: var(--hg-purple-900);
  --selected-row:          #fff3ec;
  --selected-bg:           var(--hg-cream);
}

/* ---- Global typography ---- */
html, body { font-family: var(--hg-body); color: var(--body-fg); }
body { background: var(--hg-cream); }
h1, h2, h3, h4, h5,
.module h2, .module caption, .inline-group h2,
#content h1, #content h2 {
  font-family: var(--hg-display);
  font-weight: normal;
  letter-spacing: 0.5px;
  color: var(--hg-purple-900);
}
#content h1 { color: var(--hg-orange); }

/* ---- Header ---- */
#header {
  background: var(--hg-purple);
  color: #fff;
  padding: 12px 40px;
  display: flex; align-items: center; gap: 18px;
}
#branding h1 { margin: 0; }
#branding h1 a { color: #fff; text-decoration: none; font-family: var(--hg-display); font-size: 22px; }
#branding .hg-logo { height: 44px; vertical-align: middle; display: block; }
#header { min-height: 56px; }
#user-tools { font-family: var(--hg-body); }
#user-tools a { border-bottom: 1px dotted rgba(255,255,255,0.5); }

/* Top section nav (Reporting / Monitoring / Cash flow …). Sits between the logo
   and #user-tools inside #header. */
#header { gap: 24px; align-items: center; padding: 14px 40px; min-height: 64px; }
#branding { flex: 0 0 auto; }
#branding .hg-logo { height: auto; }
#user-tools { margin-left: auto; }
.hg-section-nav {
  display: flex; align-items: center; gap: 4px;
  font-family: var(--hg-display);
  letter-spacing: 0.5px;
  flex: 1 1 auto;
}
.hg-section-nav a, .hg-section-nav span {
  padding: 9px 18px;
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  border-radius: 10px;
  font-size: 18px;
  border: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.hg-section-nav a:hover { background: rgba(255,255,255,0.08); color: #fff; }
.hg-section-nav a.is-active { background: var(--hg-orange); color: #fff; }
.hg-section-nav .is-disabled { color: rgba(255,255,255,0.30); cursor: not-allowed; }

/* Tighten the logo so the nav has visual room. */
#branding .hg-logo { height: 38px; }

/* Hide the "Home" breadcrumb row on landing pages where there's nothing useful below. */
.hg-dashboard-page div.breadcrumbs { display: none; }

/* ---- Breadcrumbs ---- */
div.breadcrumbs { background: var(--hg-purple-900); color: #fff; padding: 8px 40px; }
div.breadcrumbs a { color: #fff; opacity: 0.85; }
div.breadcrumbs a:hover { opacity: 1; color: var(--hg-orange); }

/* ---- Modules ---- */
.module { border-radius: 10px; background: #fff; box-shadow: 0 2px 10px rgba(94,78,105,0.08); border: none; }
.module h2, .module caption {
  background: var(--hg-purple);
  color: #fff;
  border-radius: 10px 10px 0 0;
  padding: 10px 14px;
}
.module table { background: #fff; }

/* ---- Buttons ---- */
.button, input[type=submit], input[type=button], .submit-row input, a.button {
  background: var(--hg-purple);
  color: #fff;
  border-radius: 8px;
  border: none;
  padding: 8px 14px;
  font-family: var(--hg-body);
  font-weight: bold;
  transition: background 0.12s ease;
}
.button:hover, input[type=submit]:hover, input[type=button]:hover, .submit-row input:hover, a.button:hover {
  background: var(--hg-purple-900);
}
.button.default, input[type=submit].default, .submit-row input.default {
  background: var(--hg-orange);
}
.button.default:hover, input[type=submit].default:hover, .submit-row input.default:hover {
  background: var(--hg-orange-700);
}

/* ---- Tables ---- */
table thead th { background: var(--hg-purple-100); color: var(--hg-purple-900); }
table tbody tr:hover { background: #fff7f3; }

/* ---- Login page ---- */
.login #container {
  background: rgba(255,255,255,0.95);
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(63,51,73,0.35);
}
.login { background: url("/static/img/brand/hypno-bg.png") center/cover no-repeat fixed, var(--hg-purple); }
.login #header { background: transparent; padding: 0; }
.login #branding h1 a { color: var(--hg-purple-900); }

/* ---- Dashboard page layout ----
   Django admin's .colMS class reserves margin-right for the recent-actions sidebar even
   when we hide it. Override the whole chain so the dashboard fills the viewport. */
.hg-dashboard-page #main { display: block; }
.hg-dashboard-page #content,
.hg-dashboard-page #content.colMS,
.hg-dashboard-page #content.colM {
  padding-top: 0;
  max-width: none;
  width: auto;
  margin-right: 0 !important;
  margin-left: 0 !important;
}
.hg-dashboard-page #content-main { width: 100% !important; float: none; }
.hg-dashboard-page #content-related,
.hg-dashboard-page #nav-sidebar,
.hg-dashboard-page #toggle-nav-sidebar { display: none !important; }

/* ---- Dashboard ---- */
.hg-dashboard {
  background: url("/static/img/brand/hypno-bg.png") center/cover no-repeat;
  background-attachment: fixed;
  margin: -20px -40px 20px -40px;
  padding: 36px 40px 28px;
  color: #fff;
  border-bottom: 4px solid var(--hg-orange);
}
.hg-dashboard h1 {
  font-family: var(--hg-display);
  color: #fff;
  font-size: 36px;
  margin: 0 0 6px;
  letter-spacing: 1px;
}
.hg-dashboard p.tagline { color: var(--hg-cream); opacity: 0.85; margin: 0; }

.hg-quick-actions { display: flex; gap: 12px; margin: 20px 0 24px; flex-wrap: wrap; }
.hg-quick-actions a {
  background: var(--hg-orange);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-family: var(--hg-body);
  box-shadow: 0 2px 6px rgba(243,129,98,0.4);
  transition: transform 0.1s ease, background 0.12s ease;
}
.hg-quick-actions a:hover { background: var(--hg-orange-700); transform: translateY(-1px); }
.hg-quick-actions a.secondary { background: #fff; color: var(--hg-purple-900); box-shadow: 0 2px 6px rgba(0,0,0,0.12); }
.hg-quick-actions a.secondary:hover { background: var(--hg-cream); }

.hg-section-title { font-family: var(--hg-display); color: var(--hg-purple-900); font-size: 22px; margin: 24px 0 12px; letter-spacing: 0.5px; }

.hg-automation-alerts { margin-top: 14px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 8px; }
.hg-auto-alert { padding: 10px 14px; border-radius: 10px; font-size: 13px; line-height: 1.45;
  border-left: 5px solid var(--hg-purple); background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.hg-auto-alert--error { border-left-color: #c64545; background: #fef2f2; }
.hg-auto-alert--warning { border-left-color: var(--hg-orange); background: #fff7f0; }
.hg-auto-alert .muted { color: var(--body-medium-color); font-size: 12px; }

.hg-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 24px; }
.hg-stat {
  background: #fff;
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 2px 10px rgba(94,78,105,0.08);
  border-left: 5px solid var(--hg-purple);
}
.hg-stat.warning { border-left-color: var(--hg-orange); }
.hg-stat .label { color: var(--body-quiet-color); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.hg-stat .value { font-family: var(--hg-body); font-size: 24px; font-weight: bold; color: var(--hg-purple-900); margin-top: 4px; }
.hg-stat .sub { color: var(--body-medium-color); font-size: 12px; margin-top: 2px; }

.hg-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.hg-tile {
  position: relative;
  background: var(--hg-purple);
  color: #fff;
  border-radius: 16px;
  padding: 22px 22px 18px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(63,51,73,0.18);
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  display: flex; flex-direction: column; gap: 8px;
  min-height: 130px;
}
/* Subtle hypno texture on the purple card — matches the brand background */
.hg-tile::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("/static/img/brand/hypno-bg.png") right center / cover no-repeat;
  opacity: 0.18;
}
.hg-tile::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 6px;
  background: linear-gradient(90deg, var(--hg-orange) 0%, #ffb89e 100%);
}
.hg-tile > * { position: relative; }
.hg-tile:hover { transform: translateY(-3px) rotate(-0.3deg); box-shadow: 0 10px 24px rgba(63,51,73,0.28); text-decoration: none; color: #fff; }
.hg-tile h3 { font-family: var(--hg-display); color: #fff; margin: 0; font-size: 20px; line-height: 1.15; letter-spacing: 0.5px; }
.hg-tile .meta { color: rgba(255,255,255,0.75); font-size: 12px; }
.hg-tile .last-period { color: var(--hg-orange); font-size: 13px; margin-top: auto; padding-top: 6px; }
.hg-tile .payable { font-family: var(--hg-body); font-weight: bold; font-size: 20px; color: var(--hg-orange); }
.hg-tile .pill { display: inline-block; background: rgba(255,255,255,0.18); color: #fff; padding: 2px 9px; border-radius: 10px; font-size: 11px; backdrop-filter: blur(2px); white-space: nowrap; }
.hg-tile .hg-tile-amount { display: flex; align-items: baseline; gap: 8px; margin-top: 8px; }
.hg-tile .hg-tile-amount-value { font-family: var(--hg-body); font-weight: bold; font-size: 20px; color: var(--hg-orange); }
.hg-tile .hg-tile-amount-label { color: rgba(255,255,255,0.55); font-size: 11px; letter-spacing: 0.3px; }

/* Redesigned tile: head (title + pill), hero (lifetime number), chart, 3-up footer. */
.hg-tile-head { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.hg-tile-hero { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.hg-tile-hero-value { font-family: var(--hg-body); font-weight: bold; font-size: 30px; line-height: 1; color: var(--hg-orange); letter-spacing: -0.5px; }
.hg-tile-hero-label { color: rgba(255,255,255,0.55); font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; }
.hg-tile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: auto; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.12); }
.hg-tile-stat { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.hg-tile-stat-value { font-family: var(--hg-body); font-weight: 600; font-size: 14px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hg-tile-stat-label { color: rgba(255,255,255,0.55); font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; }
/* Estimated sparkline dot — same orange but ring-only so it's visibly distinct
   from the solid actuals dots. */
.qchart-dot.is-estimate {
  background: transparent !important;
  border: 1.5px solid var(--hg-orange);
}

/* Stacked-area monthly HG-net line chart — 3× the prior tile height per design. */
.hg-stack-chart { margin-top: 12px; }
.hg-stack-plot {
  position: relative; height: 645px; background: var(--hg-purple-100);
  border-radius: 12px; padding: 12px;
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: thin;
}
/* Inner wrapper is the actual canvas — width is computed in JS based on the
   chosen px-per-month so the SVG can be wider than the viewport. */
.hg-stack-plot .hg-stack-canvas {
  position: relative; height: 100%; min-width: 100%;
}
/* SVG fills the canvas except for the bottom label strip. */
.hg-stack-plot .hg-stack-canvas svg {
  position: absolute; top: 0; left: 0;
  width: 100%; height: calc(100% - 26px);
  /* Let hover strips above sit on top and receive pointer events. */
  pointer-events: none;
}
.hg-stack-plot [data-hg-stack-hovers] {
  position: absolute; top: 0; left: 0; right: 0; bottom: 26px;
}
.hg-stack-plot .hg-stack-labels {
  position: absolute; left: 0; right: 0; bottom: 0; height: 22px;
}
.hg-stack-zoom {
  display: inline-flex; gap: 4px; margin-left: 14px;
  font-size: 12px; vertical-align: middle;
}
.hg-stack-zoom button {
  background: var(--hg-purple-100); border: 1px solid var(--hg-purple-200, rgba(94,78,105,0.18));
  color: var(--hg-purple-900); border-radius: 6px;
  padding: 2px 8px; cursor: pointer; font-family: inherit;
}
.hg-stack-zoom button:hover { background: var(--hg-orange-50, rgba(243,129,98,0.10)); }
.hg-stack-zoom button[aria-pressed='true'] { background: var(--hg-orange); color: #fff; }
.hg-stack-qhover {
  position: absolute; top: 0; bottom: 0;
  background: transparent; cursor: default;
  /* Width + transform are set inline in JS so the strip catches mouse-over
     across the entire month band. A 1px center-line gives the visual cue. */
  border-left: 1px solid rgba(0,0,0,0.04);
}
.hg-stack-qhover:hover { background: rgba(0,0,0,0.06); border-left-color: rgba(0,0,0,0.22); }
/* is-current marker dropped — user finds it noisy. */
.hg-stack-dot {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  border: 1.5px solid #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.18);
  transform: translate(-50%, -50%); cursor: default;
  z-index: 2; pointer-events: auto;
}
.hg-stack-dot:hover { transform: translate(-50%, -50%) scale(1.35); }
.hg-stack-dot.is-estimate { opacity: 0.55; border-style: dashed; }
.hg-stack-labels { position: relative; height: 20px; margin-top: 6px; }
.hg-stack-labels span {
  position: absolute; transform: translateX(-50%);
  font-size: 11px; color: var(--body-medium-color); letter-spacing: 0.4px;
  white-space: nowrap;
}
.hg-stack-labels span.current { color: var(--hg-orange); font-weight: 600; }
.hg-stack-legend {
  display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12px;
  color: var(--body-medium-color);
}
.hg-stack-legend-item {
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent; border: 0; padding: 4px 8px; border-radius: 8px;
  font: inherit; color: inherit; cursor: pointer;
  transition: background 0.12s, opacity 0.12s;
}
.hg-stack-legend-item:hover { background: rgba(0,0,0,0.05); }
.hg-stack-legend-item.is-hidden { opacity: 0.4; }
.hg-stack-legend-item.is-hidden .hg-stack-swatch {
  background: transparent !important; box-shadow: inset 0 0 0 1px var(--body-medium-color);
}
.hg-stack-legend-item.is-hidden .hg-stack-legend-total { text-decoration: line-through; }
.hg-stack-swatch {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle;
}
.hg-stack-legend-total { color: var(--hg-purple-900); font-weight: 600; margin-left: 2px; }

/* Bundle tiles: lighter & smaller — bundles aren't standalone revenue centres. */
.hg-tiles--bundles { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.hg-tile--bundle { background: var(--hg-purple-100); color: var(--hg-purple-900); box-shadow: 0 2px 8px rgba(94,78,105,0.10); min-height: 100px; padding: 16px 18px; }
.hg-tile--bundle::before { background-image: none; }
.hg-tile--bundle::after { background: var(--hg-purple-900); height: 4px; }
.hg-tile--bundle h3 { color: var(--hg-purple-900); font-size: 18px; }
.hg-tile--bundle .meta { color: var(--body-medium-color); }
.hg-tile--bundle .pill { background: #fff; color: var(--hg-purple-900); }
.hg-tile--bundle .last-period { color: var(--hg-purple); }
.hg-tile--bundle:hover { color: var(--hg-purple-900); }

/* Quarterly line chart inside a project tile — full history of NOK per quarter.
   Dots overlaid as HTML so they stay round under preserveAspectRatio="none". */
.hg-tile .qchart-wrap { position: relative; width: 100%; height: 40px; margin-top: 10px; }
.hg-tile .qchart { display: block; width: 100%; height: 100%; }
.hg-tile .qchart-dot {
  position: absolute; width: 4px; height: 4px; border-radius: 50%;
  background: var(--hg-orange); transform: translate(-50%, -50%);
}
.hg-tile .qchart-label { display: flex; justify-content: space-between; font-size: 10px; color: rgba(255,255,255,0.55); margin-top: 2px; letter-spacing: 0.3px; }

/* ---- Monthly reports checklist ---- */
.hg-month-list { background: #fff; border-radius: 12px; padding: 8px; box-shadow: 0 2px 10px rgba(94,78,105,0.08); }
.hg-month-row { display: grid; grid-template-columns: 1fr 2fr auto; gap: 14px; align-items: center; padding: 10px 14px; border-radius: 8px; text-decoration: none; color: inherit; }
.hg-month-row:hover { background: var(--hg-cream); }
.hg-month-row .hg-month-label { font-family: var(--hg-body); font-weight: bold; color: var(--hg-purple-900); }
.hg-month-row .hg-month-meter { height: 8px; background: var(--hg-purple-100); border-radius: 4px; overflow: hidden; }
.hg-month-row .hg-month-meter-fill { height: 100%; background: linear-gradient(90deg, var(--hg-orange) 0%, var(--hg-orange-700) 100%); border-radius: 4px; }
.hg-month-row.is-complete .hg-month-meter-fill { background: linear-gradient(90deg, #2e7d32 0%, #1b5e20 100%); }
.hg-month-row .hg-month-count { font-family: var(--hg-body); font-weight: bold; color: var(--hg-purple); font-size: 13px; }
.hg-month-row.is-complete .hg-month-count { color: #2e7d32; }

/* "Reporting ready" sibling — uses the same row shell but with a status badge instead of a meter. */
.hg-ready-row { grid-template-columns: 1fr 2fr auto; }
.hg-ready-row .hg-ready-detail { color: var(--body-medium-color); font-size: 12px; }
.hg-ready-row.is-blocked .hg-ready-detail { color: var(--hg-orange-700); }
.hg-ready-row .hg-ready-badge {
  font-family: var(--hg-body); font-weight: bold; font-size: 11px;
  padding: 3px 10px; border-radius: 12px;
  background: var(--hg-purple-100); color: var(--hg-purple-900);
}
.hg-ready-row.is-ready .hg-ready-badge { background: #e6f4ea; color: #1b5e20; }
.hg-ready-row.is-blocked .hg-ready-badge { background: #fdecea; color: var(--hg-orange-700); }

/* ---- Monthly reports detail page ---- */
.hg-month-intake { max-width: 900px; }
.hg-month-progress { background: #fff; border-radius: 10px; padding: 14px 18px; margin: 8px 0 20px; box-shadow: 0 2px 8px rgba(94,78,105,0.08); }
.hg-month-progress-bar { height: 10px; background: linear-gradient(90deg, var(--hg-orange) 0%, var(--hg-orange-700) 100%); border-radius: 5px; transition: width 0.3s ease; }
.hg-month-progress-label { color: var(--body-medium-color); font-size: 13px; margin-top: 6px; }
.hg-slots { display: flex; flex-direction: column; gap: 10px; }
.hg-slot { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; background: #fff; border-radius: 10px; padding: 14px 18px; box-shadow: 0 2px 8px rgba(94,78,105,0.08); border-left: 4px solid var(--hg-orange); }
.hg-slot.is-uploaded { border-left-color: #2e7d32; }
.hg-slot-status { font-size: 22px; font-weight: bold; text-align: center; }
.hg-slot.is-uploaded .hg-slot-status { color: #2e7d32; }
.hg-slot.is-missing .hg-slot-status { color: var(--hg-orange-700); }
.hg-slot h3 { font-family: var(--hg-display); margin: 0 0 2px; color: var(--hg-purple-900); font-size: 18px; }
.hg-slot-desc { color: var(--body-quiet-color); font-size: 13px; margin: 0; }
.hg-slot-detail { color: #2e7d32; font-size: 12px; margin: 4px 0 0; font-weight: bold; }
.hg-slot-hint { color: var(--body-quiet-color); font-size: 12px; font-style: italic; cursor: help; }

.hg-health { background: #fff; border-radius: 12px; padding: 16px 20px; box-shadow: 0 2px 10px rgba(94,78,105,0.08); }
.hg-health ul { list-style: none; padding: 0; margin: 0; }
.hg-health li { padding: 8px 0; border-bottom: 1px dashed var(--hg-purple-100); display: flex; justify-content: space-between; align-items: center; }
.hg-health li:last-child { border-bottom: none; }
.hg-health .badge { background: var(--hg-orange); color: #fff; border-radius: 12px; padding: 2px 10px; font-size: 12px; font-weight: bold; }
.hg-health .badge.ok { background: #2e7d32; }
.hg-health a { color: var(--hg-purple); text-decoration: none; font-weight: bold; }
.hg-health a:hover { color: var(--hg-orange); }

.hg-chart { background: #fff; border-radius: 12px; padding: 18px 20px; box-shadow: 0 2px 10px rgba(94,78,105,0.08); }
.hg-bars { display: flex; gap: 10px; align-items: flex-end; height: 220px; }
.hg-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.hg-bar-value { font-family: var(--hg-body); font-weight: bold; color: var(--hg-purple-900); font-size: 12px; margin-bottom: 4px; min-height: 16px; }
.hg-bar-wrap { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.hg-bar { width: 100%; background: linear-gradient(180deg, var(--hg-orange) 0%, var(--hg-orange-700) 100%); border-radius: 6px 6px 0 0; min-height: 2px; transition: filter 0.12s ease; }
.hg-bar:hover { filter: brightness(1.08); }
.hg-bar.current {
  background: repeating-linear-gradient(45deg, var(--hg-orange) 0 8px, #ffb89e 8px 16px);
  outline: 1.5px dashed var(--hg-orange-700);
  outline-offset: -2px;
}
.hg-bar-label { font-family: var(--hg-body); font-size: 11px; color: var(--body-medium-color); margin-top: 6px; }

/* Line-chart variant for the 12-month revenue trend. SVG carries the line +
   area fill (stretched to fill width); dots are HTML overlays positioned by
   percentage so they stay round regardless of container aspect ratio. */
.hg-chart-line { background: #fff; border-radius: 12px; padding: 18px 20px; box-shadow: 0 2px 10px rgba(94,78,105,0.08); }
.hg-chart-line-plot { position: relative; width: 100%; height: 180px; }
.hg-chart-line svg { display: block; width: 100%; height: 100%; }
.hg-chart-line-dot {
  position: absolute; width: 8px; height: 8px; border-radius: 50%;
  background: var(--hg-orange); border: 2px solid var(--hg-orange);
  transform: translate(-50%, -50%);
}
.hg-chart-line-dot.current { background: #fff; }
.hg-chart-line-labels { display: flex; justify-content: space-between; margin-top: 8px; font-family: var(--hg-body); font-size: 10px; color: var(--body-medium-color); }
.hg-chart-line-labels span.current { color: var(--hg-orange); font-weight: bold; }

/* ---- Auto-match review ---- */
.hg-match-list { display: flex; flex-direction: column; gap: 14px; max-width: 980px; }
.hg-match-card { background: #fff; border-radius: 12px; padding: 18px 22px; box-shadow: 0 2px 10px rgba(94,78,105,0.08); border-left: 4px solid var(--hg-orange); }
.hg-match-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 18px; align-items: center; }
.hg-match-side { min-width: 0; }
.hg-match-label { color: var(--body-quiet-color); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
.hg-match-headline { font-family: var(--hg-body); font-weight: bold; font-size: 18px; color: var(--hg-purple-900); }
.hg-match-sub { color: var(--body-medium-color); font-size: 13px; margin-top: 2px; }
.hg-match-desc { color: var(--body-quiet-color); font-size: 12px; margin-top: 4px; font-style: italic; }
.hg-match-arrow { font-family: var(--hg-display); font-size: 28px; color: var(--hg-orange); text-align: center; }

.hg-match-stats { display: flex; gap: 24px; padding: 12px 0 6px; margin: 12px 0; border-top: 1px dashed var(--hg-purple-100); border-bottom: 1px dashed var(--hg-purple-100); }
.hg-match-stat { display: flex; flex-direction: column; }
.hg-match-stat-label { color: var(--body-quiet-color); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.hg-match-stat-value { font-family: var(--hg-body); font-weight: bold; color: var(--hg-purple-900); font-size: 15px; margin-top: 2px; }

.hg-match-actions { display: flex; gap: 10px; }
.hg-match-actions button { padding: 8px 16px; }

/* ---- Upload preview ---- */
.upload-preview { max-width: 980px; margin: 16px auto; }
.upload-preview h1 { font-family: var(--hg-display, inherit); color: var(--hg-purple-900, #2a1d33); margin-bottom: 18px; }
.upload-preview .up-card {
  background: #fff; border-radius: 12px; padding: 16px 20px; margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(94,78,105,0.08);
  border-left: 4px solid var(--hg-purple-100, #e6dfeb);
}
.upload-preview .up-card h2 { margin: 0 0 12px; font-size: 16px; color: var(--hg-purple-900, #2a1d33); }
.upload-preview .up-card.up-ok { border-left-color: #2e7d32; }
.upload-preview .up-card.up-warn { border-left-color: #d4a017; background: #fff8e1; }
.upload-preview .up-icon { display: inline-block; margin-right: 6px; font-weight: bold; }
.upload-preview dl { display: grid; grid-template-columns: 140px 1fr; gap: 6px 16px; margin: 0; }
.upload-preview dt { color: var(--body-medium-color, #555); font-weight: bold; }
.upload-preview dd { margin: 0; }
.upload-preview .up-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.upload-preview .up-chip {
  background: var(--hg-purple-100, #efe8f4); color: var(--hg-purple-900, #2a1d33);
  border-radius: 16px; padding: 4px 12px; font-weight: bold; font-size: 13px;
}
.upload-preview .up-table { width: 100%; border-collapse: collapse; }
.upload-preview .up-table th, .upload-preview .up-table td {
  padding: 8px 10px; border-bottom: 1px solid var(--hg-purple-100, #efe8f4); text-align: left;
}
.upload-preview .up-table th { background: #faf7fc; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.upload-preview .up-table .up-num { text-align: right; font-variant-numeric: tabular-nums; }
.upload-preview .up-sub { color: var(--body-medium-color, #555); font-size: 12px; }
.upload-preview .up-empty { color: var(--body-medium-color, #555); font-style: italic; }
.upload-preview .up-actions { display: flex; gap: 12px; margin-top: 24px; }
.upload-preview .up-actions button.default {
  background: var(--hg-orange, #ff7841); color: #fff; border: none; border-radius: 8px;
  padding: 10px 20px; font-weight: bold; cursor: pointer;
}
.upload-preview .up-actions button.up-cancel {
  background: #fff; color: var(--hg-purple-900, #2a1d33);
  border: 1px solid var(--hg-purple-100, #d0c2dc); border-radius: 8px;
  padding: 10px 20px; cursor: pointer;
}
.upload-preview .up-actions button.up-cancel:hover { background: #f7f2fa; }
