:root {
  --pricetool-primary: #1B4F8A;
  --pricetool-primary-dark: #153F6E;
  --pricetool-border: #E3E8EF;
  --pricetool-muted: #637381;
  --pricetool-bg: #F6F8FB;
}

body {
  min-height: 100vh;
  color: #1F2937;
  background: var(--pricetool-bg);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.btn-primary {
  --bs-btn-bg: var(--pricetool-primary);
  --bs-btn-border-color: var(--pricetool-primary);
  --bs-btn-hover-bg: var(--pricetool-primary-dark);
  --bs-btn-hover-border-color: var(--pricetool-primary-dark);
}

.btn-outline-primary {
  --bs-btn-color: var(--pricetool-primary);
  --bs-btn-border-color: var(--pricetool-primary);
  --bs-btn-hover-bg: var(--pricetool-primary);
  --bs-btn-hover-border-color: var(--pricetool-primary);
}

.app-navbar {
  background: var(--pricetool-primary);
}

.app-shell {
  display: flex;
  min-height: calc(100vh - 56px);
}

.sidebar {
  width: 260px;
  flex: 0 0 260px;
  align-self: flex-start;
  height: calc(100vh - 56px);
  padding: 24px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-right: 1px solid var(--pricetool-border);
  background: #ffffff;
  position: sticky;
  top: 56px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  color: #334155;
  border-radius: 8px;
  text-decoration: none;
}

.sidebar-link i {
  width: 20px;
  color: var(--pricetool-primary);
  text-align: center;
}

.sidebar-link:hover,
.sidebar-link.active {
  color: var(--pricetool-primary);
  background: #EAF2FA;
}

.sidebar-link.disabled {
  color: #94A3B8;
  pointer-events: none;
}

.sidebar-link.disabled i {
  color: #94A3B8;
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-thumb {
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #CBD5E1;
}

.content {
  width: 100%;
  min-width: 0;
  padding: 28px;
}

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

.page-header h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
}

.page-header p {
  margin: 6px 0 0;
  color: var(--pricetool-muted);
}

.panel,
.metric-card,
.login-card {
  border: 1px solid var(--pricetool-border);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.panel {
  padding: 20px;
}

.panel-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--pricetool-border);
}

.metric-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 20px;
}

.metric-card.compact {
  min-height: 110px;
}

.metric-card.success .metric-icon {
  color: #15803d;
  background: #dcfce7;
}

.metric-card.danger .metric-icon {
  color: #b91c1c;
  background: #fee2e2;
}

.metric-card span {
  color: var(--pricetool-muted);
}

.metric-card strong {
  font-size: 30px;
  line-height: 1;
}

.metric-card .metric-date {
  font-size: 18px;
  line-height: 1.25;
}

.metric-card .metric-label {
  font-size: 18px;
  line-height: 1.25;
}

.metric-icon {
  display: inline-grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--pricetool-primary);
  border-radius: 8px;
  background: #EAF2FA;
}

.auth-page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #F8FAFC 0%, #EAF2FA 100%);
}

.login-card {
  width: min(100%, 420px);
  padding: 28px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  color: #ffffff;
  border-radius: 8px;
  background: var(--pricetool-primary);
  font-weight: 700;
}

.flash-stack {
  margin-bottom: 20px;
}

.product-table th {
  color: #475569;
  background: #F8FAFC;
  font-size: 13px;
  text-transform: uppercase;
}

.lowest-price-row {
  --bs-table-bg: #f0fdf4;
}

.own-price-row {
  --bs-table-bg: #eff6ff;
}

.price-progress {
  height: 8px;
}

.table-link {
  color: var(--pricetool-primary);
  font-weight: 600;
  text-decoration: none;
}

.table-link:hover {
  text-decoration: underline;
}

.clickable-row {
  cursor: pointer;
}

.detail-list {
  display: grid;
  grid-template-columns: minmax(120px, 42%) 1fr;
  gap: 10px 16px;
}

.detail-list dt {
  color: var(--pricetool-muted);
  font-weight: 600;
}

.detail-list dd {
  margin: 0;
}

.sync-status:empty {
  display: none;
}

@media (max-width: 991.98px) {
  .content {
    padding: 20px;
  }

  .page-header {
    display: grid;
  }
}
