/* GiaTieu — dashboard giá tiêu (vỏ card + tab + bảng + biểu đồ) */

.gt-price-shell {
  --gt-forest: #1b5e20;
  --gt-forest-soft: #2e7d32;
  --gt-forest-mid: #388e3c;
  --gt-surface: #ffffff;
  --gt-ink: #263238;
  --gt-muted: #78909c;
  --gt-border: #e8ece9;
  background: var(--gt-surface);
  border: 1px solid var(--gt-border);
  border-radius: 24px;
  padding: clamp(22px, 3vw, 30px) clamp(20px, 3vw, 28px) 28px;
  margin: 28px 0 36px;
  box-shadow:
    0 1px 2px rgba(27, 94, 32, 0.04),
    0 14px 40px rgba(0, 0, 0, 0.07);
}

.gt-dash-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 18px 24px;
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--gt-border);
}

.gt-dash-head__main {
  max-width: 38rem;
}

.gt-dash-head__title {
  margin: 10px 0 8px;
  font-size: clamp(1.35rem, 2.8vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--gt-ink);
}

.gt-dash-head__lead {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--gt-muted);
}

.gt-prices-tabs {
  position: relative;
}

.gt-tab-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.gt-tab-bar {
  display: inline-flex;
  gap: 8px;
  margin-bottom: 20px;
  padding: 5px;
  background: rgba(27, 94, 32, 0.06);
  border-radius: 14px;
  border: 1px solid var(--gt-border);
}

.gt-tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border-radius: 11px;
  font-weight: 800;
  font-size: 0.875rem;
  color: var(--gt-ink);
  border: 1px solid transparent;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.gt-tab-btn:hover {
  background: rgba(255, 255, 255, 0.75);
}

.gt-tab-pane {
  display: none;
}

.gt-price-shell .gt-dash {
  margin: 0;
}

.gt-dash__line {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--gt-border);
}

.gt-dash__line-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gt-forest);
  letter-spacing: -0.02em;
}

.gt-dash__line-note {
  margin: 0 0 14px;
  font-size: 0.8125rem;
  color: var(--gt-muted);
  line-height: 1.5;
}

.gt-dash__line .gt-chart-wrap {
  margin-top: 0;
}

.gt-world-panel {
  padding: 8px 4px 12px;
  max-width: 40rem;
}

.gt-world-panel__title {
  margin: 0 0 10px;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--gt-forest);
  letter-spacing: -0.02em;
}

.gt-world-panel__text {
  margin: 0 0 18px;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--gt-muted);
}

.gt-world-panel__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 0.9rem;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #1b5e20, #2e7d32);
  box-shadow: 0 6px 20px rgba(27, 94, 32, 0.25);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.gt-world-panel__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(27, 94, 32, 0.32);
  color: #fff;
}

.gt-world-panel__meta {
  margin: 0 0 14px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--gt-muted);
}

.gt-world-table-wrap {
  margin-bottom: 18px;
}

.gt-world-panel__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 18px;
  margin: 0;
}

.gt-world-chart-block {
  margin-bottom: 16px;
}

.gt-world-chart-block .gt-chart-wrap--series {
  margin: 0;
}

.gt-world-chart-block .gt-chart__canvas-wrap--compact {
  height: 180px;
}

.gt-world-panel__footnote {
  margin: 12px 0 0;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--gt-muted);
}

.gt-world-panel__secondary {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--gt-forest-soft);
  text-decoration: none;
  border-bottom: 1px solid rgba(46, 125, 50, 0.35);
}

.gt-world-panel__secondary:hover {
  color: var(--gt-forest);
  border-bottom-color: var(--gt-forest);
}

/* GiaTieu — dashboard giá tiêu (layout thẻ + bảng + biểu đồ cột) */

.gt-dash {
  --gt-forest: #1b5e20;
  --gt-forest-soft: #2e7d32;
  --gt-forest-mid: #388e3c;
  --gt-surface: #ffffff;
  --gt-ink: #263238;
  --gt-muted: #78909c;
  --gt-border: #e8ece9;
  margin: 28px 0 36px;
}

.gt-dash__top {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.gt-spotlight {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 20px 22px;
  min-height: 132px;
  background: var(--gt-surface);
  border-radius: 20px;
  border: 1px solid var(--gt-border);
  box-shadow:
    0 1px 2px rgba(27, 94, 32, 0.04),
    0 8px 28px rgba(0, 0, 0, 0.06);
  text-decoration: none;
  color: var(--gt-ink);
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.gt-spotlight:hover {
  transform: translateY(-3px);
  border-color: rgba(27, 94, 32, 0.18);
  box-shadow:
    0 4px 14px rgba(27, 94, 32, 0.1),
    0 20px 48px rgba(0, 0, 0, 0.08);
}

.gt-spotlight:focus-visible {
  outline: 2px solid var(--gt-forest-soft);
  outline-offset: 3px;
}

.gt-spotlight__name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--gt-muted);
  letter-spacing: 0.01em;
}

.gt-spotlight__price {
  font-size: clamp(1.25rem, 2.8vw, 1.6rem);
  font-weight: 800;
  color: var(--gt-forest);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 8px 0 4px;
}

.gt-spotlight__delta {
  font-size: 0.8125rem;
  font-weight: 700;
  margin-top: auto;
}

.gt-spotlight__delta.gt-delta--up {
  color: var(--gt-forest-soft);
}

.gt-spotlight__delta.gt-delta--down {
  color: #c62828;
}

.gt-spotlight__delta.gt-delta--flat {
  color: var(--gt-muted);
}

.gt-dash__mid {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  gap: 20px;
  align-items: stretch;
}

.gt-panel {
  background: var(--gt-surface);
  border-radius: 20px;
  border: 1px solid var(--gt-border);
  padding: 22px 24px 20px;
  box-shadow:
    0 1px 2px rgba(27, 94, 32, 0.04),
    0 10px 36px rgba(0, 0, 0, 0.06);
}

.gt-panel__title {
  margin: 0 0 4px;
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--gt-forest);
  letter-spacing: -0.02em;
}

.gt-panel__note {
  margin: 0 0 18px;
  font-size: 0.8125rem;
  color: var(--gt-muted);
  line-height: 1.45;
}

.gt-panel--chart {
  display: flex;
  flex-direction: column;
}

.gt-table-scroll {
  overflow-x: auto;
  margin: 12px -6px 0;
  -webkit-overflow-scrolling: touch;
}

.gt-table {
  width: 100%;
  min-width: 280px;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.gt-table thead th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--gt-muted);
  padding: 8px 14px 14px;
  border-bottom: 1px solid var(--gt-border);
}

.gt-table thead th:nth-child(2),
.gt-table thead th:nth-child(3) {
  text-align: right;
}

.gt-table tbody td {
  padding: 14px 14px;
  border-bottom: 1px solid var(--gt-border);
  vertical-align: middle;
}

.gt-table tbody tr {
  transition: background 0.15s ease;
}

.gt-table tbody tr:hover {
  background: rgba(27, 94, 32, 0.035);
}

.gt-table tbody tr:last-child td {
  border-bottom: none;
}

.gt-table-link {
  display: flex;
  flex-direction: column;
  gap: 3px;
  text-decoration: none;
  color: inherit;
}

.gt-table-link:hover .gt-table-name {
  color: var(--gt-forest-soft);
}

.gt-table-name {
  font-weight: 700;
  color: var(--gt-ink);
  transition: color 0.15s ease;
}

.gt-table-region {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gt-muted);
}

.gt-td-price {
  text-align: right;
  font-weight: 800;
  color: var(--gt-forest);
  white-space: nowrap;
}

.gt-td-change {
  text-align: right;
  font-weight: 700;
  white-space: nowrap;
}

.gt-td-change--up {
  color: var(--gt-forest-soft);
}

.gt-td-change--down {
  color: #c62828;
}

.gt-td-change--flat {
  color: var(--gt-muted);
}

.gt-bar-chart {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  flex: 1;
  min-height: 168px;
  padding: 8px 4px 0;
}

.gt-bar-chart__col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.gt-bar-chart__track {
  height: 140px;
  width: 100%;
  max-width: 44px;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.gt-bar-chart__bar {
  width: 100%;
  max-width: 34px;
  background: linear-gradient(180deg, var(--gt-forest-mid) 0%, var(--gt-forest) 100%);
  border-radius: 10px 10px 4px 4px;
  box-shadow: 0 2px 8px rgba(27, 94, 32, 0.2);
  transition: height 0.35s ease;
}

.gt-bar-chart__label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--gt-muted);
}

/* Legacy / compact */
.gt-price-box {
  --gt-green: #1b5e20;
  --gt-green-mid: #2e7d32;
  --gt-ink: #263238;
  --gt-muted: #78909c;
  --gt-line: #e8ece9;
  --gt-card: #ffffff;
  background: var(--gt-card);
  border: 1px solid var(--gt-line);
  border-radius: 20px;
  padding: clamp(18px, 3vw, 24px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
  margin: 20px 0;
}

.gt-price-head--compact {
  margin-bottom: 12px;
}

.gt-price-box--compact .gt-price-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--gt-green);
}

.gt-price-list-compact {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gt-price-list-compact .gt-row {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--gt-ink);
  background: #fafbfb;
  border: 1px solid var(--gt-line);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    border-color 0.15s ease;
}

.gt-price-list-compact .gt-row:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(27, 94, 32, 0.08);
  border-color: rgba(27, 94, 32, 0.15);
}

.gt-row__main {
  grid-column: 1;
  grid-row: 1 / span 2;
  min-width: 0;
}

.gt-row__name {
  display: block;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: -0.02em;
}

.gt-row__region {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--gt-muted);
  margin-top: 2px;
}

.gt-row__price {
  grid-column: 2;
  grid-row: 1;
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--gt-green);
  text-align: right;
  white-space: nowrap;
}

.gt-price-list-compact .gt-delta {
  grid-column: 2;
  grid-row: 2;
  text-align: right;
  font-size: 0.78rem;
  white-space: nowrap;
}

.gt-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(27, 94, 32, 0.1);
  color: var(--gt-green);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gt-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gt-green-mid);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.25);
  animation: gt-pulse 2s ease-in-out infinite;
}

@keyframes gt-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.gt-delta--up {
  color: var(--gt-forest-soft, #2e7d32);
}

.gt-delta--down {
  color: #c62828;
}

.gt-delta--flat {
  color: var(--gt-muted);
}

.gt-province-box {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  padding: clamp(24px, 4vw, 32px);
  margin: 24px 0;
  color: #f4fff9;
  background: linear-gradient(125deg, #1b5e20 0%, #2e7d32 48%, #1b5e20 100%);
  box-shadow: 0 20px 50px rgba(27, 94, 32, 0.25);
}

.gt-province-box::after {
  content: "";
  position: absolute;
  right: -20%;
  top: -40%;
  width: 55%;
  height: 140%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.gt-province-box > * {
  position: relative;
  z-index: 1;
}

.gt-badge--light {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.gt-badge--light::before {
  background: #c8e6c9;
  box-shadow: 0 0 0 3px rgba(200, 230, 201, 0.35);
  animation: none;
}

.gt-province-kicker {
  margin: 14px 0 0;
  font-size: 0.9rem;
  opacity: 0.92;
}

.gt-province-price {
  margin: 6px 0 12px;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

.gt-province-change {
  margin: 0 0 12px;
  font-size: 1rem;
}

.gt-province-change .gt-delta--up {
  color: #c8e6c9;
}

.gt-province-change .gt-delta--down {
  color: #ffc8c4;
}

.gt-province-change .gt-delta--flat {
  color: rgba(244, 255, 249, 0.75);
}

.gt-province-updated {
  opacity: 0.85;
  font-size: 0.85rem;
}

/* Chart.js (trang tỉnh) */
.gt-chart-wrap {
  margin: 20px 0 28px;
}

.gt-chart-title {
  margin: 0 0 12px;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--gt-ink, #263238);
}

.gt-chart {
  background: #fafbfb;
  border: 1px solid var(--gt-border, #e8ece9);
  border-radius: 20px;
  padding: 16px 18px 14px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.05);
}

.gt-chart__canvas-wrap {
  position: relative;
  width: 100%;
  height: 260px;
}

.gt-chart__canvas-wrap--compact {
  height: 200px;
}

.gt-chart-canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.gt-chart__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--gt-border, #e8ece9);
  font-size: 0.85rem;
  color: var(--gt-muted, #78909c);
}

.gt-chart__meta strong {
  color: var(--gt-ink, #263238);
  font-weight: 800;
}

.gt-chart-fallback {
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(27, 94, 32, 0.06);
  border: 1px dashed var(--gt-border, #e8ece9);
  color: var(--gt-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

@media (max-width: 960px) {
  .gt-dash__mid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .gt-dash__top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .gt-dash__top {
    grid-template-columns: 1fr;
  }

  .gt-bar-chart__track {
    height: 120px;
  }
}

/* Dark */
[data-theme="dark"] .gt-price-shell {
  --gt-forest: #81c784;
  --gt-forest-soft: #a5d6a7;
  --gt-forest-mid: #66bb6a;
  --gt-surface: #1e2a24;
  --gt-ink: #e8f0eb;
  --gt-muted: #94a398;
  --gt-border: rgba(129, 199, 132, 0.2);
  background: var(--gt-surface);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .gt-dash-head {
  border-color: var(--gt-border);
}

[data-theme="dark"] .gt-tab-bar {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--gt-border);
}

[data-theme="dark"] .gt-tab-btn:hover {
  background: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .gt-dash {
  --gt-forest: #81c784;
  --gt-forest-soft: #a5d6a7;
  --gt-forest-mid: #66bb6a;
  --gt-surface: #1e2a24;
  --gt-ink: #e8f0eb;
  --gt-muted: #94a398;
  --gt-border: rgba(129, 199, 132, 0.2);
}

[data-theme="dark"] .gt-spotlight {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .gt-panel {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .gt-table tbody tr:hover {
  background: rgba(129, 199, 132, 0.08);
}

[data-theme="dark"] .gt-bar-chart__bar {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

[data-theme="dark"] .gt-price-box {
  --gt-green: #81c784;
  --gt-green-mid: #a5d6a7;
  --gt-ink: #e8f0eb;
  --gt-muted: #94a398;
  --gt-line: rgba(129, 199, 132, 0.2);
  --gt-card: #1e2a24;
}

[data-theme="dark"] .gt-price-list-compact .gt-row {
  background: #182018;
}

[data-theme="dark"] .gt-chart {
  background: #1a2420;
}

[data-theme="dark"] .gt-delta--up {
  color: #a5d6a7;
}

[data-theme="dark"] .gt-delta--down {
  color: #ff9a93;
}
