/* Expensevues base styles. Brand colors come from /brand.css (per company). */
:root {
  --ev-brand: #1f4e79;
  --ev-brand-text: #ffffff;
  --ev-tabbar-height: 64px;
  /* Chart tokens (single-series charts use slot 1; validated palette). */
  --viz-series-1: #2a78d6;
  --viz-series-1-hover: #256abf;
  --viz-grid: #e8e7e3;
  --viz-text-secondary: #52514e;
}

body {
  background: var(--bs-tertiary-bg);
  min-height: 100vh;
}

.brand-mark {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  background: var(--ev-brand);
  color: var(--ev-brand-text);
}

.narrow {
  max-width: 36rem;
}

/* --- sign-in / account pages --- */
.auth-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-card {
  width: 100%;
  max-width: 26rem;
  border: 0;
}

.brand-logo {
  max-height: 64px;
  max-width: 200px;
  object-fit: contain;
}

/* --- app shell --- */
.header-logo {
  max-height: 32px;
  max-width: 160px;
  object-fit: contain;
}

.brand-mark-sm {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 1rem;
  margin: 0;
}

.icon {
  width: 22px;
  height: 22px;
  flex: none;
}

.icon-sm {
  width: 16px;
  height: 16px;
}

.app-header .nav-link {
  color: var(--bs-secondary-color);
  border-radius: 6px;
}

.app-header .nav-link.active {
  color: var(--ev-brand);
  background: rgba(var(--ev-brand-rgb, 31, 78, 121), 0.08);
}

/* Mobile bottom tab bar */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1030;
  display: flex;
  background: var(--bs-body-bg);
  border-top: 1px solid var(--bs-border-color);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabbar-item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--ev-tabbar-height);
  font-size: 0.7rem;
  color: var(--bs-secondary-color);
  text-decoration: none;
  background: none;
  border: 0;
}

.tabbar-item.active {
  color: var(--ev-brand);
  font-weight: 600;
}

@media (max-width: 767.98px) {
  .app-main {
    padding-bottom: calc(var(--ev-tabbar-height) + env(safe-area-inset-bottom) + 24px) !important;
  }
}

.more-menu {
  height: auto;
  max-height: 70vh;
}

/* Page headings and cards */
.page-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.section-card {
  border: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.table-card td,
.table-card th {
  white-space: nowrap;
}

.subnav {
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
}

.subnav .nav-link {
  white-space: nowrap;
}

.color-swatch {
  width: 3rem;
  height: 2.375rem;
  padding: 0.25rem;
}

.preview-button {
  background: var(--ev-brand);
  border-color: var(--ev-brand);
  color: var(--ev-brand-text);
}

.preview-mark {
  background: var(--ev-brand);
  color: var(--ev-brand-text);
}

.choice-list {
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--bs-border-color);
  border-radius: var(--bs-border-radius);
  background: var(--bs-body-bg);
}

/* --- home --- */
.total-amount {
  font-size: clamp(2.5rem, 11vw, 3.5rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.min-w-0 {
  min-width: 0;
}

.flex-none {
  flex: none;
}

.attention-returned {
  color: var(--bs-danger-text-emphasis);
}

.attention-request,
.attention-draft,
.attention-recurring,
.attention-email,
.attention-share,
.attention-offline {
  color: var(--bs-warning-text-emphasis);
}

.detail-list dt {
  font-weight: 500;
  color: var(--bs-secondary-color);
}

.detail-list dd {
  margin-bottom: 0.5rem;
}

/* --- receipts --- */
.js .js-hide {
  display: none;
}

.receipt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 0.75rem;
}

.receipt-tile {
  margin: 0;
}

.receipt-tile a {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bs-secondary-bg);
  border: 1px solid var(--bs-border-color);
}

.receipt-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.receipt-kind {
  position: absolute;
  left: 4px;
  bottom: 4px;
}

/* --- approvals --- */
.return-box summary {
  list-style: none;
}

.return-box summary::-webkit-details-marker {
  display: none;
}

.return-box[open] summary {
  display: none;
}

/* --- dashboard --- */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.75rem;
}

.kpi {
  background: var(--bs-body-bg);
  border-radius: var(--bs-border-radius-lg);
  padding: 0.75rem 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.kpi-label {
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
}

.kpi-value {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
}

.kpi-hero .kpi-value {
  font-size: clamp(1.75rem, 4.5vw, 2.5rem);
  font-weight: 700;
  overflow-wrap: anywhere;
}

@media (min-width: 576px) {
  .kpi-hero {
    grid-column: span 2;
  }
}

.kpi-delta {
  font-size: 0.8rem;
  color: var(--bs-secondary-color);
}

.chart-box {
  position: relative;
  height: 240px;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
