:root {
  --bg-page: #090716;
  --bg-shell: #1e1f2b;
  --bg-card: #1e1f2b;
  --bg-muted: #30313c;
  --border: #373642;
  --text-primary: #ffffff;
  --text-secondary: #cecdd1;
  --text-tertiary: #a1a2a7;
  --text-muted: #8f8f95;
  --accent-mint: #89dcbe;
  --accent-gold: #e9bc48;
  --accent-blue: #456ac3;
  --accent-red: #ba4040;
  --divider: #43414e;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

[x-cloak] {
  display: none !important;
}

body {
  background: var(--bg-page);
  color: var(--text-primary);
  font-family:
    "Inter",
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
}

.bg-page {
  background-color: var(--bg-page);
}
.bg-shell {
  background-color: var(--bg-shell);
}
.bg-card {
  background-color: var(--bg-card);
}
.bg-muted {
  background-color: var(--bg-muted);
}
.text-primary {
  color: var(--text-primary) !important;
}
.text-secondary {
  color: var(--text-secondary) !important;
}
.text-tertiary {
  color: var(--text-tertiary) !important;
}
.text-muted-2 {
  color: var(--text-muted) !important;
}
.text-accent-mint {
  color: var(--accent-mint) !important;
}
.text-accent-gold {
  color: var(--accent-gold) !important;
}
.text-accent-blue {
  color: var(--accent-blue) !important;
}
.text-accent-red {
  color: var(--accent-red) !important;
}

.card-panel {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.card-title {
  color: var(--text-primary);
  font-weight: 700;
}

.table-highlight {
  background: var(--bg-muted);
}

.app-shell {
  width: 100%;
  height: auto;
  align-items: stretch;
  background: var(--bg-page);
  gap: 0;
}

.sidebar {
  width: 150px;
  background: var(--bg-shell);
  padding: 14px 10px;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow: hidden;
  z-index: 50;
}
.sidebar-shell {
  height: 100%;
  min-height: 100%;
  width: 100%;
  background: var(--bg-shell);
}
.sidebar-menu {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.page-container {
  padding-left: 150px;
}
.sidebar-shell {
  height: 100%;
  width: 100%;
}
.sidebar-menu {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.sidebar .nav-link {
  color: var(--text-muted);
  border-radius: var(--radius);
  padding: 10px 12px;
  display: flex;
  align-items: center;
}

.sidebar .nav-link.active,
.sidebar .nav-link:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.sidebar .nav-link i {
  color: var(--text-muted);
}

.sidebar .nav-link .nav-icon {
  color: var(--text-primary);
  display: inline-block;
  width: 1.2em;
  text-align: center;
}

.sidebar .nav-link.active i,
.sidebar .nav-link:hover i {
  color: var(--text-primary);
}

.sidebar .logo-mark {
  font-size: 32px;
  color: var(--accent-gold);
}

.sidebar .logo-text-sm {
  font-size: 22px;
  font-weight: 700;
}

.sidebar .logo-sub {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.logo-img {
  max-width: 160px;
  height: auto;
  display: block;
  margin: 0 auto;
}

.content {
  padding: 24px;
  min-height: auto;
  height: auto;
  padding-bottom: 0;
}

.topbar {
  margin-bottom: 16px;
}

.search-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px !important;
  padding: 6px 10px;
  gap: 8px;
}

.search-compact .search-input {
  height: 30px;
  padding: 3px 4px;
}

.form-select {
  border-radius: 8px !important;
  border: 1px solid var(--divider) !important;
  background: var(--bg-card);
}

.search-select {
  width: 140px;
  height: 32px;
  padding: 4px 24px 4px 8px;
  border-radius: 8px !important;
  border: 1px solid var(--divider) !important;
  background-color: var(--bg-card) !important;
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3e%3cpolygon fill='%23cecdd1' points='1,1 11,1 6,7'/%3e%3c/svg%3e") !important;
  background-repeat: no-repeat !important;
  background-position: right 10px center !important;
  background-size: 12px 8px !important;
}

.form-check-input {
  border-radius: 6px !important;
}

.search-panel {
  border: 1px dashed var(--divider);
  border-radius: var(--radius);
}
.search-icon {
  margin-left: 2px;
}

.search-input {
  background: transparent !important;
  border: none !important;
  color: var(--text-primary) !important;
  box-shadow: none;
  padding: 6px 6px;
  border-radius: 6px !important;
  height: 34px;
  line-height: 1.4;
}
.search-input:focus {
  box-shadow: none;
}
.search-input::placeholder {
  color: var(--text-tertiary);
}

.icon-btn {
  border-radius: 10px;
  border-color: var(--border);
  color: var(--text-primary);
}

.dropdown-menu {
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.dropdown-item {
  color: var(--text-secondary);
}

.dropdown-item:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-muted);
  display: grid;
  place-items: center;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 0.85rem;
}

.list-yachts .active-item {
  background: var(--bg-muted) !important;
  color: var(--text-primary);
}

.chart-placeholder {
  min-height: 140px;
  background: var(--bg-muted);
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--text-tertiary);
}

.time-filter .btn {
  border-color: var(--divider);
  color: var(--text-secondary);
  flex: 1 1 0;
  min-width: 0;
  padding: 6px 8px;
  line-height: 1.2;
  white-space: nowrap;
}
.time-filter .btn.active {
  background: var(--bg-muted);
  color: var(--text-primary);
  border-color: var(--divider);
}
.year-select {
  width: 110px;
  height: 32px;
  padding: 4px 24px 4px 8px;
  border-radius: 8px !important;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3e%3cpolygon fill='%23cecdd1' points='1,1 11,1 6,7'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 12px 8px;
  -moz-appearance: none;
  -webkit-appearance: none;
  appearance: none;
}

.app-shell {
  width: 100%;
  height: auto;
  align-items: stretch;
}
.page-container {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: auto;
  height: auto;
  padding-bottom: 180px; /* space for sticky footer strips */
}

.content {
  min-height: auto;
  height: auto;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 72px;
}
:root {
  --topbar-height: 72px;
}

/* Cards & charts */
.chart-card {
  background: #111020;
  border: 1px solid var(--border-muted);
  border-radius: 12px;
  min-height: 0;
  min-width: 300px;
  max-width: 300px;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
}

.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.chart-box {
  width: 100%;
  height: 100%;
  margin-top: 0;
}

.chart-card {
  min-width: 0;
  overflow: hidden;
  height: 230px;
}

/* // usage columns sizing */
/* .usage-col {
  min-width: 320px;
  flex: 0 0 320px;
  max-width: 340px;
} */
.usage-col {
  min-width: 0;
  flex: 1 1 0;
}

.metrics-row {
  --bs-gutter-x: 6px;
  --bs-gutter-y: 10px;
}

.revenue-grid {
  display: grid;
  grid-template-columns: 1fr auto auto;
  column-gap: 10px;
  align-items: center;
}

.table-col {
  flex: 0 0 340px;
  min-width: 340px;
}

/* Revenue inner splits */
.chart-col {
  flex: 1 0 375px;
  min-width: 375px !important;
}

@media (max-width: 991.98px) {
  .table-col,
  .chart-col {
    flex: 1 1 100%;
    min-width: 100%;
  }
}

/* Outer layout: menu | content (3 cols) */
.layout-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 16px !important;
  width: 100%;
  min-width: 1650px;
  height: auto;
  overflow-x: auto;
  margin-bottom: 24px;
}

.side-left {
  flex: 0 0 230px;
  max-width: 250px;
  display: flex;
  flex-direction: column;
  height: auto;
}

.side-left .card-body {
  padding: 8px;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
}

.side-left .card-title {
  font-size: 0.95rem;
}

.side-left .refresh-btn {
  font-size: 0.8rem;
  padding: 4px 8px;
}

.side-left .time-filter .btn {
  font-size: 0.75rem;
  padding: 3px 6px;
}

.side-left .time-filter .text-tertiary {
  font-size: 0.76rem;
  margin-bottom: 2px;
}

.side-left .year-select {
  font-size: 0.85rem;
}

.side-left .search-input::placeholder {
  font-size: 0.65rem;
}

.side-left .search-select {
  font-size: 0.85rem;
}

.side-left .search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px;
  column-gap: 6px;
  padding-right: 8px;
}

.side-left .search-row .search-select {
  min-width: 90px;
  max-width: 100px;
  width: 100%;
}

.side-left .exact-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-self: end;
  white-space: nowrap;
  padding-right: 8px;
  margin-right: 0;
}

.side-left .exact-toggle .form-check-input {
  margin: 0;
  transform: translateY(5px);
}

.side-left .list-yachts .list-group-item {
  font-size: 0.9rem;
  padding: 6px 8px;
}
.side-left .list-yachts {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 800px;
  overflow-y: auto;
}

.side-right {
  flex: 0 0 260px;
  max-width: 300px;
  height: auto;
  min-height: 0;
  overflow: visible;
}

.main-col {
  flex: 1 1 auto;
  min-width: 0;
  height: auto;
  padding-bottom: 40px;
  overflow: visible;
  max-height: none;
}

@media (max-width: 1199.98px) {
  .layout-row {
    flex-wrap: wrap;
    min-width: 0;
  }
  .side-left,
  .side-right,
  .main-col {
    flex: 1 1 100%;
    max-width: 100%;
    max-height: none;
    height: auto;
    overflow: visible;
  }
}

/* Revenue split row */
.revenue-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  column-gap: 0.5rem;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.revenue-split .chart-col,
.revenue-split .table-col {
  overflow: hidden;
}

.chart-col {
  min-width: 300px !important;
  max-width: 300px;
}

.table-col {
  min-width: 0;
  width: 100%;
}

.list-group.xsmall {
  min-width: 0;
}

@media (max-width: 991.98px) {
  .revenue-split {
    grid-template-columns: 1fr;
  }
  .chart-col,
  .table-col {
    min-width: 100%;
    max-width: 100%;
  }
}

.map-frame {
  position: relative;
  height: 420px;
  min-height: 320px;
}
.mini-map-frame {
  height: 180px;
  min-height: 180px;
}

.list-yachts {
  flex: 1 1 auto;
  overflow-y: auto;
  max-height: none;
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: var(--divider) var(--bg-card);
}
.list-yachts::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.table-scroll {
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: var(--divider) var(--bg-card);
}
.table-scroll::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.table-scroll::-webkit-scrollbar-track {
  background: var(--bg-card);
  border-radius: 10px;
}
.table-scroll::-webkit-scrollbar-thumb {
  background-color: #5a5968;
  border-radius: 10px;
  border: 1px solid var(--bg-card);
}
.table-scroll::-webkit-scrollbar-thumb:hover {
  background-color: #767585;
}
.table-scroll::-webkit-scrollbar-corner {
  background: var(--bg-card);
}
.safari-scroll-hide .table-scroll {
  scrollbar-width: none;
}
.safari-scroll-hide .table-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
.list-yachts::-webkit-scrollbar-track {
  background: var(--bg-card);
  border-radius: 10px;
}
.list-yachts::-webkit-scrollbar-thumb {
  background-color: #5a5968;
  border-radius: 10px;
  border: 1px solid var(--bg-card);
}
.list-yachts::-webkit-scrollbar-thumb:hover {
  background-color: #767585;
}
.list-yachts::-webkit-scrollbar-corner {
  background: var(--bg-card);
}
.safari-scroll-hide .list-yachts {
  scrollbar-width: none;
}
.safari-scroll-hide .list-yachts::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* When the list stacks on top (md and below), cap height and tighten spacing */
@media (max-width: 1199.98px) {
  .list-yachts {
    max-height: 320px;
  }
  .list-yachts .list-group-item {
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 0.85rem;
  }
}

.map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.map-overlay {
  position: absolute;
  bottom: 8px;
  left: 8px;
  right: 8px;
  padding: 6px 10px;
  box-sizing: border-box;
  background: rgba(9, 7, 22, 0.75);
  border-radius: 10px;
  pointer-events: none;
  z-index: 1100;
  text-align: center;
  overflow: visible;
  white-space: normal;
  min-height: 24px;
  width: auto;
  max-width: calc(100% - 16px);
  margin: 0 auto;
  display: block;
}
.map-overlay span {
  display: block;
  width: 100%;
  overflow: visible;
}
.map-spinner {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(9, 7, 22, 0.4);
  z-index: 1050;
}
.service-list {
  max-height: 230px;
  overflow-y: auto;
}
.service-name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.divider-thin {
  border-top: 1px solid var(--divider) !important;
  border-left: 0 !important;
  border-right: 0 !important;
  border-bottom: 0 !important;
  border-radius: 0 !important;
}

.list-yachts .list-group-item:last-child {
  border-bottom: none !important;
  border-radius: 0 0 var(--radius) var(--radius) !important;
}

.list-yachts .list-group-item:first-child {
  border-radius: var(--radius) var(--radius) 0 0 !important;
}

/* Apply yacht-list scrollbar styling to service lists */
.service-list {
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: var(--divider) var(--bg-card);
}
.service-list::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.service-list::-webkit-scrollbar-track {
  background: var(--bg-card);
  border-radius: 10px;
}
.service-list::-webkit-scrollbar-thumb {
  background-color: #5a5968;
  border-radius: 10px;
  border: 1px solid var(--bg-card);
}
.service-list::-webkit-scrollbar-thumb:hover {
  background-color: #767585;
}
.service-list::-webkit-scrollbar-corner {
  background: var(--bg-card);
}
.safari-scroll-hide .service-list {
  scrollbar-width: none;
}
.safari-scroll-hide .service-list::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

/* Match suggestion dropdown scrollbars to app style */
.suggestion-menu {
  scrollbar-width: thin; /* Firefox */
  scrollbar-color: var(--divider) var(--bg-card);
}
.suggestion-menu::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
.suggestion-menu::-webkit-scrollbar-track {
  background: var(--bg-card);
  border-radius: 10px;
}
.suggestion-menu::-webkit-scrollbar-thumb {
  background-color: #5a5968;
  border-radius: 10px;
  border: 1px solid var(--bg-card);
}
.suggestion-menu::-webkit-scrollbar-thumb:hover {
  background-color: #767585;
}
.suggestion-menu::-webkit-scrollbar-corner {
  background: var(--bg-card);
}
.safari-scroll-hide .suggestion-menu {
  scrollbar-width: none;
}
.safari-scroll-hide .suggestion-menu::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.footer-strips {
  position: fixed;
  left: 150px;
  right: 0;
  bottom: 0;
  width: auto;
  max-width: none;
  min-width: 0;
  box-sizing: border-box;
  overflow: hidden;
  margin-top: 0;
  font-size: 0.75rem;
  line-height: 1.25;
  z-index: 1200;
  border-top: 1px solid #616979;
}
.footer-strips .strip-row {
  display: grid;
  grid-template-columns: minmax(260px, 320px) repeat(6, minmax(0, 1fr));
  min-height: 40px;
}
.footer-strips .strip-cell {
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: normal;
  word-break: break-word;
  height: 100%;
}
.footer-strips .label {
  background: #2f303c;
  color: #99a1ae;
  font-weight: 600;
  font-size: 0.8rem;
}
.footer-strips .strip-row:not(:last-child) .label {
  border-bottom: 1px solid #616979;
}
.footer-strips .strip-row-1 .alt-a {
  background: #1f283c;
  color: #50a1ff;
}
.footer-strips .strip-row-1 .alt-b {
  background: #0f152b;
  color: #50a1ff;
}
.footer-strips .strip-row-2 .alt-a {
  background: #135f59;
  color: #09da94;
}
.footer-strips .strip-row-2 .alt-b {
  background: #1a4e4a;
  color: #09da94;
}
.footer-strips .circle-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: #152e1b;
  color: #adafc8;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.footer-strips .strip-row-3 {
  grid-template-columns: minmax(260px, 320px) 1fr;
}
.footer-strips .breaking-label {
  background: #ffd32f;
  color: #9a3e0e;
  font-weight: 700;
  font-size: 0.8rem;
}
.footer-strips .breaking-ticker {
  background: #090906;
  color: #ffd32f;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  white-space: nowrap;
  padding-right: 12px;
  overflow: hidden;
}
.breaking-ticker .ticker-item {
  display: inline-block;
  white-space: nowrap;
}
.footer-strips .diamond {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: #697282;
  transform: rotate(45deg);
  flex-shrink: 0;
}
@supports (-webkit-touch-callout: none) {
  .suggestion-menu {
    scrollbar-width: none;
  }
  .suggestion-menu::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }
}

.xsmall {
  font-size: 0.8rem;
}

.list-group-item:hover,
.list-group-item:focus,
.list-group-item.active-item {
  background: #30313c !important;
  color: var(--text-primary);
}

.divider-line {
  border-top: 1px solid var(--divider);
  margin: 4px 0;
}

.divider-tight {
  margin: 2px 0;
}

.status-heading {
  margin-top: 14px;
  margin-bottom: 12px;
}

.status-list .list-group-item {
  padding-left: 0;
  padding-right: 0;
}

.divider-status {
  border: 0;
  border-top: 1px solid var(--divider);
  margin: 4px 0;
}

.refresh-btn {
  color: var(--text-secondary);
  border-color: var(--divider);
  padding: 4px 6px;
}
.refresh-btn:hover,
.refresh-btn:focus {
  color: var(--text-primary);
  border-color: var(--text-primary);
}
.login-bg {
  background: var(--bg-page);
}

.login-card {
  width: 360px;
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-mark {
  font-size: 42px;
  color: var(--text-primary);
}

.logo-text {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.logo-sub {
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-size: 12px;
  color: var(--text-muted);
}

.form-control,
.form-select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-primary);
  border-radius: var(--radius);
}

.form-control:focus,
.form-select:focus {
  border-color: var(--accent-mint);
  box-shadow: 0 0 0 2px rgba(137, 220, 190, 0.35);
}

.btn-primary {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #0b0a14;
  font-weight: 700;
  border-radius: var(--radius);
}

.btn-primary:hover {
  background: #f0c65b;
  border-color: #f0c65b;
}

.btn-outline-secondary {
  color: var(--text-primary);
  border-color: var(--border);
  border-radius: var(--radius);
}

.btn-outline-secondary:hover {
  background: var(--bg-muted);
  color: var(--text-primary);
}
html,
body {
  height: auto !important;
  min-height: 100%;
}
