:root {
  --background: hsl(210 17% 98%);
  --foreground: hsl(222.2 84% 4.9%);
  --muted-foreground: hsl(215.4 16.3% 46.9%);
  --border: hsl(214.3 31.8% 91.4%);
  --card: hsl(0 0% 100%);
  --accent-blue: hsl(210 98% 45%);
  --accent-blue-soft: hsl(210 100% 96%);
  --accent-orange: hsl(24 94% 50%);
  --accent-green: hsl(142 72% 30%);
  --accent-red: hsl(0 72% 51%);
  --gray-50: hsl(210 40% 98%);
  --gray-100: hsl(210 40% 96.1%);
  --gray-200: hsl(214 32% 91%);
  --gray-300: hsl(210 14% 83%);
  --gray-700: hsl(215 25% 27%);
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --shadow-soft: 0 8px 30px hsla(220 20% 20% / 0.08);
  --muted: hsl(210 40% 96.1%);
}

/* Main Navigation Bar */
.main-nav {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-tabs {
  display: flex;
  gap: 0;
  max-width: 1400px;
  margin: 0 auto;
}

.nav-tab {
  padding: 1rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.nav-tab:hover {
  color: var(--foreground);
  background: var(--gray-50);
}

.nav-tab.active {
  color: var(--accent-blue);
  border-bottom-color: var(--accent-blue);
  font-weight: 600;
}

/* Nav brand - hidden on desktop, shown on mobile */
.nav-brand {
  display: none;
}

/* Flatpickr custom styling */
.flatpickr-calendar {
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 10px 40px hsla(220 20% 20% / 0.15) !important;
  border: 1px solid var(--border) !important;
  font-family: inherit !important;
}

.flatpickr-calendar.arrowTop::before,
.flatpickr-calendar.arrowTop::after {
  display: none;
}

.flatpickr-months {
  padding: 0.5rem 0;
}

.flatpickr-month {
  height: 36px !important;
}

.flatpickr-current-month {
  font-size: 0.95rem !important;
  font-weight: 600 !important;
}

.flatpickr-weekdays {
  background: transparent !important;
}

.flatpickr-weekday {
  color: var(--muted-foreground) !important;
  font-weight: 500 !important;
  font-size: 0.75rem !important;
}

.flatpickr-day {
  border-radius: var(--radius-sm) !important;
  font-weight: 500 !important;
  transition: all 0.15s ease !important;
}

.flatpickr-day:hover {
  background: var(--accent-blue-soft) !important;
  border-color: transparent !important;
}

.flatpickr-day.selected,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--accent-blue) !important;
  border-color: var(--accent-blue) !important;
}

.flatpickr-day.today {
  border-color: var(--accent-blue) !important;
}

.flatpickr-day.today:hover {
  background: var(--accent-blue) !important;
  color: white !important;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  visibility: hidden;
}

.flatpickr-innerContainer {
  padding: 0.5rem;
}

.flatpickr-prev-month,
.flatpickr-next-month {
  padding: 8px !important;
}

.flatpickr-prev-month:hover svg,
.flatpickr-next-month:hover svg {
  fill: var(--accent-blue) !important;
  stroke: var(--accent-blue) !important;
}

/* Reset-ish */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
    "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #e0f2fe 0, #f9fafb 40%, #e5e7eb 100%);
  color: var(--foreground);
}

/* Layout */

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 8px 20px;
}

.page-header-left {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.page-header-title {
  font-size: 1.5rem;
  font-weight: 700;
}

.page-header-subtitle {
  font-size: 0.95rem;
  color: var(--muted-foreground);
}

.page-header-right {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.page-main {
  padding: 0 20px 24px 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Modern Controls Bar */
.controls-bar {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  padding: 1rem 1.5rem;
  margin-bottom: 1rem;
}

.controls-bar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1.5rem;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.control-group-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted-foreground);
}

.control-group-action {
  margin-left: auto;
}

/* Date Range Picker */
.date-range-picker {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.date-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.date-icon {
  position: absolute;
  left: 10px;
  color: var(--muted-foreground);
  pointer-events: none;
}

.date-input {
  padding: 0.6rem 0.75rem 0.6rem 2.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--gray-50);
  color: var(--foreground);
  width: 140px;
  height: 42px;
  transition: all 0.15s ease;
  cursor: pointer;
}

.date-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: white;
  box-shadow: 0 0 0 3px var(--accent-blue-soft);
}

.date-separator {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* Preset Buttons */
.preset-buttons {
  display: flex;
  gap: 0.25rem;
}

.preset-btn {
  padding: 0.6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--gray-50);
  color: var(--foreground);
  font-size: 0.85rem;
  font-weight: 500;
  height: 42px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  background: var(--accent-blue-soft);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.preset-btn:active {
  transform: scale(0.98);
}

/* Modern Select (Choices.js overrides) */
.modern-select {
  min-width: 320px;
}

.choices {
  margin-bottom: 0 !important;
}

.choices__inner {
  background: var(--gray-50) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  padding: 0.5rem 0.75rem !important;
  min-height: 42px !important;
  font-size: 1rem !important;
}

.choices__list--single .choices__item {
  font-size: 1rem !important;
  font-weight: 500 !important;
}

.choices__list--dropdown .choices__item {
  font-size: 1rem !important;
}

.choices__inner:focus-within {
  border-color: var(--accent-blue) !important;
  box-shadow: 0 0 0 3px var(--accent-blue-soft) !important;
}

.choices__list--dropdown {
  border-radius: var(--radius-md) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 10px 40px hsla(220 20% 20% / 0.12) !important;
}

.choices__list--dropdown .choices__item--selectable.is-highlighted {
  background: var(--accent-blue-soft) !important;
  color: var(--accent-blue) !important;
}

.choices__list--single {
  padding: 0 !important;
}

.choices[data-type*="select-one"]::after {
  border-color: var(--muted-foreground) transparent transparent transparent !important;
}

/* Budget Input */
.budget-input-wrapper {
  position: relative;
}

.budget-input {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  background: var(--gray-50);
  color: var(--foreground);
  width: 100px;
  height: 42px;
  transition: all 0.15s ease;
}

.budget-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  background: white;
  box-shadow: 0 0 0 3px var(--accent-blue-soft);
}

.budget-input::-webkit-inner-spin-button,
.budget-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Load Button */
.load-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.25rem;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: 0 2px 8px hsla(210 98% 45% / 0.3);
}

.load-btn:hover {
  background: hsl(210 98% 40%);
  box-shadow: 0 4px 12px hsla(210 98% 45% / 0.4);
  transform: translateY(-1px);
}

.load-btn:active {
  transform: translateY(0);
}

.load-btn svg {
  flex-shrink: 0;
}

/* Cards & controls */

.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-soft);
  padding: 1rem 1.25rem;
  backdrop-filter: blur(6px);
}

.control-card {
  margin-bottom: 1rem;
}

.section-title {
  margin: 0 0 0.75rem 0;
  font-size: 1rem;
  font-weight: 600;
}

.controls-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.control-label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.control-input {
  margin-top: 0.25rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  min-width: 170px;
  background: var(--card);
}

.control-input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 1px var(--accent-blue-soft);
}

.btn-primary {
  border-radius: var(--radius-md);
  border: none;
  background: linear-gradient(135deg, var(--accent-blue), hsl(210 90% 40%));
  color: #fff;
  font-size: 0.9rem;
  padding: 0.4rem 0.9rem;
  cursor: pointer;
  box-shadow: 0 6px 14px hsla(210 60% 40% / 0.35);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}

.btn-primary:hover {
  filter: brightness(1.02);
  transform: translateY(-1px);
  box-shadow: 0 10px 25px hsla(210 60% 40% / 0.4);
}

.btn-ghost {
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
  padding: 0.35rem 0.8rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--muted-foreground);
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.btn-ghost:hover {
  background: #f3f4ff;
  border-color: hsl(240 90% 90%);
  transform: translateY(-1px);
}

.control-hint {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

/* Status */

.status-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.status-url code {
  background: var(--gray-100);
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
}

/* JSON viewer */

.json-viewer {
  max-height: 260px;
  overflow: auto;
  background: #020617;
  color: #e5e7eb;
  font-size: 0.75rem;
  border-radius: var(--radius-md);
  border: 1px solid #111827;
  padding: 0.75rem;
}

/* Tables */

.tables-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.table-card {
  padding-bottom: 0.75rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
  margin-top: 0.4rem;
}

th,
td {
  padding: 4px 7px;
  border: 1px solid var(--border);
}

th {
  background: var(--gray-100);
  text-align: left;
  font-weight: 500;
  color: var(--muted-foreground);
}

tbody tr:nth-child(even) {
  background: #f9fafb;
}

tbody tr.highlight-row {
  background: #e0f2fe !important;
}

/* Pills / legend */

.pill {
  border-radius: 999px;
  font-size: 0.8rem;
  padding: 0.2rem 0.75rem;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: default;
}

.pill-muted {
  color: var(--muted-foreground);
}

.pill-active {
  background: var(--accent-blue-soft);
  border-color: var(--accent-blue);
  color: var(--foreground);
}

.chart-metric-toggle .pill {
  cursor: pointer;
}

.chart-metric-toggle .pill:not(.pill-active):hover {
  background: var(--gray-100);
}

/* Chart */

.chart-shell {
  margin-top: 1.5rem;
}

.chart-card {
  position: relative;
  overflow: hidden;
}

.chart-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(219, 234, 254, 0.55) 0,
    rgba(255, 255, 255, 0.9) 36%,
    rgba(249, 250, 251, 0.95) 100%
  );
  opacity: 0.4;
  pointer-events: none;
}

.chart-card > * {
  position: relative;
  z-index: 1;
}

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chart-card-title {
  font-size: 1rem;
  font-weight: 600;
}

.chart-card-subtitle {
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.chart-svg-wrapper {
  margin-top: 0.5rem;
}

.chart-svg-wrapper svg {
  width: 100%;
  height: 260px;
  display: block;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--muted-foreground);
  margin-top: 0.5rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.legend-swatch {
  width: 12px;
  height: 6px;
  border-radius: 999px;
}

.legend-blue {
  background-color: var(--accent-blue);
}

.legend-green {
  background-color: var(--accent-green);
}

.legend-red {
  background-color: var(--accent-red);
}

.legend-orange {
  background-color: var(--accent-orange);
}

/* Chart element classes */

.chart-grid-line {
  stroke: hsla(215 16% 70% / 0.22);
  stroke-width: 1;
}

.chart-axis-line {
  stroke: var(--gray-200);
  stroke-width: 1;
}

.chart-tick-label {
  font-size: 10px;
  fill: var(--muted-foreground);
}

.chart-y-label {
  font-size: 10px;
  fill: var(--muted-foreground);
}

.chart-bar {
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.bar-this-year {
  fill: var(--accent-blue);
}

.bar-diff-pos {
  fill: var(--accent-green);
}

.bar-diff-neg {
  fill: var(--accent-red);
}

.chart-bar:hover {
  opacity: 0.95;
  transform: translateY(-1px);
}

.chart-weekend {
  fill: #f3f4ff;
}

.chart-line {
  fill: none;
  stroke: var(--accent-orange);
  stroke-width: 2;
}

.chart-line-dot {
  fill: var(--accent-orange);
  stroke: var(--card);
  stroke-width: 1;
}

/* Tooltip */

.hover-panel {
  position: fixed;
  z-index: 9999;
  pointer-events: none;
  background: var(--card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: 0 14px 40px hsla(220 20% 20% / 0.3);
  padding: 0;
  font-size: 0.75rem;
  min-width: 480px;
  max-width: 550px;
  color: var(--foreground);
  animation: tooltip-pop 120ms ease-out;
  overflow: visible;
}

.hover-panel strong {
  font-size: 0.78rem;
}

/* Tooltip header */
.tooltip-header {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--foreground);
  padding: 0.75rem 1rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

/* ADR header section */
.tooltip-adr-header {
  display: flex;
  justify-content: space-around;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: 2rem;
}

.tooltip-adr-col {
  text-align: center;
}

.tooltip-adr-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--foreground);
}

.tooltip-adr-label {
  font-size: 0.7rem;
  color: var(--muted-foreground);
  margin-top: 0.15rem;
}

/* Tooltip table */
.tooltip-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
}

.tooltip-table thead th {
  padding: 0.5rem 0.5rem 0.25rem;
  font-weight: 600;
  color: var(--foreground);
  text-align: right;
  border-bottom: 1px solid var(--border);
}

.tooltip-table thead th:first-child {
  text-align: left;
}

.tooltip-table tbody td {
  padding: 0.4rem 0.5rem;
  vertical-align: middle;
}

.tooltip-row-label {
  font-weight: 500;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.tooltip-sub-label {
  font-size: 0.7rem;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.tooltip-row-separator td {
  border-top: 1px solid var(--border);
}

.tooltip-diff-row td {
  padding-top: 0.6rem;
}

.tooltip-muted {
  color: var(--muted-foreground);
  opacity: 0.7;
}

/* Bar cells */
.tooltip-bar-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
}

.tooltip-bar-wrapper {
  width: 50px;
  height: 8px;
  background: var(--muted);
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
}

.tooltip-bar-cell span {
  font-weight: 600;
  min-width: 45px;
  text-align: right;
  flex-shrink: 0;
}

.tooltip-bar {
  height: 8px;
  border-radius: 4px;
  min-width: 2px;
}

.tooltip-bar-blue {
  background: var(--accent-blue);
}

.tooltip-bar-blue.tooltip-bar-light {
  opacity: 0.6;
}

.tooltip-bar-gray {
  background: var(--muted-foreground);
  opacity: 0.5;
}

.tooltip-bar-striped {
  background: repeating-linear-gradient(
    -45deg,
    var(--accent-red),
    var(--accent-red) 2px,
    transparent 2px,
    transparent 4px
  );
}

.tooltip-bar-green {
  background: var(--accent-green);
}

.tooltip-bar-red {
  background: var(--accent-red);
}

/* Diff row */
.tooltip-diff-cell {
  position: relative;
}

.tooltip-diff-bar {
  height: 6px;
  border-radius: 3px;
  min-width: 2px;
}

.tooltip-positive {
  color: var(--accent-green);
  font-weight: 600;
}

.tooltip-negative {
  color: var(--accent-red);
  font-weight: 600;
}

.hidden {
  display: none !important;
}

@keyframes tooltip-pop {
  from {
    opacity: 0;
    transform: translateY(2px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* KPI section */

.kpi-section {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.kpi-header-card {
  padding-block: 0.6rem;
}

.kpi-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kpi-header-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-right: 0.3rem;
}

.kpi-header-subtitle {
  font-size: 0.95rem;
  color: var(--muted-foreground);
}

.kpi-header-meta {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--muted-foreground);
}

.kpi-synced {
  font-size: 0.8rem;
}

.kpi-preferences {
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--gray-100);
  padding: 0.2rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.kpi-pref-icon {
  font-size: 0.9rem;
}

.kpi-panels-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.75rem;
}

.kpi-panel {
  padding-block: 0.7rem;
}

.kpi-panel-header {
  margin-bottom: 0.4rem;
}

.kpi-panel-title-tabs {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.kpi-panel-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.kpi-panel-tabs {
  display: inline-flex;
  border-radius: 999px;
  background: #e5edff;
  padding: 2px;
  gap: 2px;
}

.kpi-tab {
  border: none;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
}

.kpi-tab-active {
  background: #ffffff;
  color: var(--foreground);
  font-weight: 500;
}

.kpi-panel-body {
  background: #f3f6ff;
  border-radius: 0.7rem;
  padding: 0.4rem 0.5rem 0.45rem 0.5rem;
}

.kpi-row {
  display: grid;
  grid-template-columns: minmax(70px, 90px) minmax(0, 1fr) max-content;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.78rem;
  padding: 0.22rem 0;
}

.kpi-row-main {
  border-bottom: 1px solid rgba(148, 163, 184, 0.4);
  padding-bottom: 0.35rem;
  margin-bottom: 0.15rem;
}

.kpi-row-label {
  font-weight: 500;
}

.kpi-row-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.kpi-row-bars-muted .kpi-bar-track {
  opacity: 0.5;
}

.kpi-bar-track {
  position: relative;
  height: 5px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.kpi-bar-track-ly {
  background: #e5e7eb;
}

.kpi-bar-current {
  position: absolute;
  inset: 0;
  width: 0%;
  background: #2563eb;
  border-radius: inherit;
  transition: width 0.18s ease-out;
}

.kpi-bar-ly {
  position: absolute;
  inset: 0;
  width: 0%;
  background: #a855f7;
  border-radius: inherit;
  transition: width 0.18s ease-out;
}

.kpi-row-numbers {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.kpi-row-value {
  font-weight: 600;
}

.kpi-row-secondary {
  font-size: 0.72rem;
  color: var(--muted-foreground);
}

.kpi-row-delta {
  font-weight: 600;
  font-size: 0.75rem;
}

.kpi-positive {
  color: var(--accent-green);
}

.kpi-negative {
  color: var(--accent-red);
}

.kpi-neutral {
  color: var(--muted-foreground);
}

/* Monthly Breakdown Table */
.monthly-breakdown-section {
  margin-top: 1.5rem;
}

.monthly-breakdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.monthly-breakdown-year {
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.monthly-breakdown-table-wrapper {
  overflow-x: auto;
}

.monthly-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  color: var(--foreground, #1f2937);
}

.monthly-breakdown-table th,
.monthly-breakdown-table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border, #e5e7eb);
  color: var(--foreground, #1f2937);
}

.monthly-breakdown-table th {
  background: var(--gray-50);
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.5px;
}

.monthly-breakdown-table tbody tr:hover {
  background: var(--gray-50);
}

.monthly-breakdown-table .text-right {
  text-align: right;
}

.monthly-breakdown-table .monthly-total-row {
  background: var(--accent-blue-soft);
  border-top: 2px solid var(--accent-blue);
}

.monthly-breakdown-table .monthly-total-row td {
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.legend-gray {
  background-color: var(--gray-300);
}

.kpi-chip {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  background: var(--gray-100);
  color: var(--muted-foreground);
  margin-right: 0.25rem;
}

.kpi-chip-green {
  background: hsl(142 72% 90%);
  color: var(--accent-green);
}

.kpi-chip-outline {
  background: transparent;
  border: 1px solid var(--border);
}

.kpi-panel-badge-row {
  margin-top: 0.35rem;
}

.kpi-main-legend {
  display: flex;
  gap: 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Hamburger Menu */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 101;
}

.hamburger-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--foreground);
  margin: 5px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}

.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Navigation Overlay */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
  opacity: 1;
}

.mobile-nav-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: var(--card);
  z-index: 100;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  transition: right 0.3s ease;
  overflow-y: auto;
}

.mobile-nav-menu.active {
  right: 0;
}

.mobile-nav-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-nav-title {
  font-weight: 600;
  font-size: 1rem;
}

.mobile-nav-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--muted-foreground);
  padding: 0.25rem;
}

.mobile-nav-links {
  padding: 0.5rem 0;
}

.mobile-nav-links a {
  display: block;
  padding: 0.875rem 1.25rem;
  color: var(--foreground);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: all 0.15s ease;
}

.mobile-nav-links a:hover {
  background: var(--gray-50);
}

.mobile-nav-links a.active {
  color: var(--accent-blue);
  background: var(--accent-blue-soft);
  border-left-color: var(--accent-blue);
}

.mobile-nav-user {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.mobile-nav-user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.mobile-nav-user-icon {
  font-size: 1.25rem;
}

.mobile-nav-user-name {
  font-weight: 500;
  font-size: 0.9rem;
}

.mobile-nav-signout {
  width: 100%;
  padding: 0.5rem 1rem;
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-nav-signout:hover {
  background: var(--gray-200);
}

.mobile-nav-signin {
  width: 100%;
  padding: 0.625rem 1rem;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mobile-nav-signin:hover {
  background: hsl(210 98% 40%);
}

.mobile-nav-property {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
}

.mobile-nav-property-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}

.mobile-nav-property select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  background: var(--gray-50);
}

/* Responsive */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
  .nav-tab {
    padding: 0.875rem 1rem;
    font-size: 0.85rem;
  }
  
  .nav-property-select {
    display: none;
  }
}

/* Mobile and Tablet (max 768px) */
@media (max-width: 768px) {
  /* Show hamburger, hide desktop nav */
  .hamburger-btn {
    display: block;
  }
  
  .nav-tabs {
    display: none;
  }
  
  .nav-right {
    display: none;
  }
  
  .mobile-nav-overlay,
  .mobile-nav-menu {
    display: block;
  }
  
  /* Main nav becomes minimal header */
  .main-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
  }
  
  .nav-brand {
    display: block;
    font-weight: 600;
    font-size: 1rem;
    color: var(--foreground);
  }
  
  .page-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .page-main {
    padding-inline: 12px;
  }

  .controls-row {
    align-items: stretch;
  }

  .kpi-panels-row {
    grid-template-columns: 1fr;
  }
  
  /* Room Availability specific mobile styles */
  .max-w-6xl {
    padding: 1rem !important;
  }
  
  /* Header adjustments */
  .text-3xl {
    font-size: 1.5rem !important;
  }
  
  /* Summary cards - stack on mobile */
  #summary-cards {
    grid-template-columns: 1fr !important;
    gap: 0.75rem;
  }
  
  #summary-cards > div {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  #summary-cards > div p:first-child {
    margin: 0;
  }
  
  #summary-cards > div p:last-child {
    margin: 0;
    font-size: 1.5rem !important;
  }
  
  /* Property cards - single column */
  #airport-container,
  #other-container {
    grid-template-columns: 1fr !important;
  }
  
  /* Refresh button area */
  .flex.items-center.gap-3 {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
  }
  
  #refreshBtn {
    width: 100%;
    justify-content: center;
  }
  
  #lastUpdated {
    width: 100%;
    text-align: center;
  }
}

/* Small mobile (max 480px) */
@media (max-width: 480px) {
  .max-w-6xl {
    padding: 0.75rem !important;
  }
  
  .text-3xl {
    font-size: 1.25rem !important;
  }
  
  .text-gray-500 {
    font-size: 0.85rem;
  }
  
  /* Property cards compact */
  #airport-container > div,
  #other-container > div {
    padding: 0.875rem !important;
  }
  
  .text-lg {
    font-size: 1rem !important;
  }
  
  /* Section headers */
  .text-xl {
    font-size: 1.1rem !important;
  }
}

/* Budget Modal Styles */
.budget-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.budget-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.budget-modal-content {
  position: relative;
  background: var(--card);
  border-radius: 12px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.budget-modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.budget-modal-header h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
}

.budget-modal-property {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  background: var(--muted);
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
}

.budget-modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
}

.budget-form-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.budget-form-header {
  display: grid;
  grid-template-columns: 100px 1fr 1fr;
  gap: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.budget-form-row {
  display: grid;
  grid-template-columns: 100px 1fr 1fr;
  gap: 0.75rem;
  align-items: center;
}

.budget-form-row label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--foreground);
}

.budget-month-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  background: var(--background);
  color: var(--foreground);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.budget-month-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.budget-month-input::placeholder {
  color: var(--muted-foreground);
  opacity: 0.6;
}

.budget-modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--muted);
}

.budget-modal-btn {
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  border: none;
}

.budget-modal-btn-cancel {
  background: var(--background);
  color: var(--foreground);
  border: 1px solid var(--border);
}

.budget-modal-btn-cancel:hover {
  background: var(--muted);
}

.budget-modal-btn-save {
  background: #6366f1;
  color: white;
}

.budget-modal-btn-save:hover {
  background: #4f46e5;
}

.budget-modal-btn-save:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Variance colors for monthly breakdown */
.text-green {
  color: #22c55e;
}

.text-red {
  color: #ef4444;
}

/* Monthly Breakdown Table Column Color Coding */
.monthly-breakdown-table th.col-data,
.monthly-breakdown-table td.col-data {
  background: hsl(210 100% 97%);
}

.monthly-breakdown-table th.col-budget,
.monthly-breakdown-table td.col-budget {
  background: hsl(270 50% 97%);
}

.monthly-breakdown-table th.col-variance,
.monthly-breakdown-table td.col-variance {
  background: hsl(45 100% 97%);
}

.monthly-breakdown-table th.col-data {
  background: hsl(210 100% 94%);
  color: hsl(210 80% 40%);
}

.monthly-breakdown-table th.col-budget {
  background: hsl(270 50% 94%);
  color: hsl(270 60% 40%);
}

.monthly-breakdown-table th.col-variance {
  background: hsl(45 100% 92%);
  color: hsl(35 80% 35%);
}

.monthly-breakdown-table tbody tr:hover td.col-data {
  background: hsl(210 100% 94%);
}

.monthly-breakdown-table tbody tr:hover td.col-budget {
  background: hsl(270 50% 94%);
}

.monthly-breakdown-table tbody tr:hover td.col-variance {
  background: hsl(45 100% 90%);
}

.monthly-breakdown-table .monthly-total-row td.col-data {
  background: hsl(210 100% 92%);
}

.monthly-breakdown-table .monthly-total-row td.col-budget {
  background: hsl(270 50% 92%);
}

.monthly-breakdown-table .monthly-total-row td.col-variance {
  background: hsl(45 100% 88%);
}

/* Navbar Right Section with User Info and Property Dropdown */
.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-right: 1rem;
}

.nav-property-select {
  min-width: 160px;
}

.nav-select {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  background: var(--gray-50);
  color: var(--foreground);
  cursor: pointer;
  min-width: 140px;
}

.nav-select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  background: var(--gray-100);
}

.nav-select:focus {
  outline: none;
  border-color: var(--accent-blue);
}

.nav-user-info {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 0.75rem;
  background: var(--gray-50);
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  color: var(--foreground);
}

.nav-user-icon {
  font-size: 1rem;
}

.nav-user-name {
  font-weight: 500;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-signout-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
  color: var(--muted-foreground);
  transition: color 0.15s ease;
}

.nav-signout-btn:hover {
  color: var(--accent-red);
}

.nav-signin-btn {
  padding: 0.5rem 1rem;
  background: var(--accent-blue);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.nav-signin-btn:hover {
  background: hsl(210 98% 40%);
}

.hidden {
  display: none !important;
}

/* Year Picker */
.year-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.4rem 0.5rem;
  height: 42px;
}

.year-nav-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s ease;
}

.year-nav-btn:hover {
  background: var(--accent-blue-soft);
  color: var(--accent-blue);
}

.year-nav-btn:active {
  transform: scale(0.95);
}

.year-display {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--foreground);
  min-width: 50px;
  text-align: center;
}
