/* BONTRACK Design System — import this file globally */
:root {
  --bt-green: #278B43;
  --bt-green-dark: #176B35;
  --bt-green-light: #8BCF65;
  --bt-yellow: #FFD43B;
  --bt-bg: #F5F8F1;
  --bt-surface: #FFFFFF;
  --bt-text: #26352B;
  --bt-muted: #68766B;
  --bt-border: #E1E9DE;
  --bt-success: #278B43;
  --bt-warning: #D99A12;
  --bt-danger: #C94B43;

  --bt-font: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bt-radius-sm: 8px;
  --bt-radius-md: 12px;
  --bt-radius-lg: 18px;
  --bt-card-radius: 16px;
  --bt-button-radius: 10px;

  --bt-shadow-card: 0 2px 10px rgba(38, 53, 43, 0.06);
  --bt-shadow-floating: 0 8px 24px rgba(38, 53, 43, 0.10);

  /* Recommended chart palette */
  --bt-chart-1: #278B43;
  --bt-chart-2: #8BCF65;
  --bt-chart-3: #FFD43B;
  --bt-chart-4: #5A9D70;
  --bt-chart-5: #A7C98B;
}

html, body {
  font-family: var(--bt-font);
  color: var(--bt-text);
  background: var(--bt-bg);
  -webkit-tap-highlight-color: transparent;
}

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

.bt-card {
  background: var(--bt-surface);
  border: 1px solid var(--bt-border);
  border-radius: var(--bt-card-radius);
  box-shadow: var(--bt-shadow-card);
}

.bt-floating {
  background: var(--bt-surface);
  border: 1px solid var(--bt-border);
  border-radius: var(--bt-card-radius);
  box-shadow: var(--bt-shadow-floating);
}

.bt-button-primary {
  color: #FFFFFF;
  background: var(--bt-green);
  border: 1px solid var(--bt-green);
  border-radius: var(--bt-button-radius);
  font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.bt-button-primary:hover {
  background: var(--bt-green-dark);
  border-color: var(--bt-green-dark);
}
.bt-button-primary:active {
  transform: scale(0.99);
}
.bt-button-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bt-button-secondary {
  color: var(--bt-text);
  background: var(--bt-surface);
  border: 1px solid var(--bt-border);
  border-radius: var(--bt-button-radius);
  font-weight: 600;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.bt-button-secondary:hover {
  background: var(--bt-bg);
  border-color: var(--bt-green);
}

.bt-accent {
  color: var(--bt-text);
  background: var(--bt-yellow);
  border-radius: var(--bt-button-radius);
  font-weight: 600;
}

.bt-input {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--bt-surface);
  color: var(--bt-text);
  border: 1px solid var(--bt-border);
  border-radius: var(--bt-button-radius);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.bt-input::placeholder {
  color: var(--bt-muted);
}
.bt-input:focus {
  border-color: var(--bt-green);
  box-shadow: 0 0 0 3px rgba(39, 139, 67, 0.16);
}

/* Fix iOS Safari / Mobile native date & select intrinsic width overflow inside CSS Grid */
input[type="date"].bt-input,
input[type="datetime-local"].bt-input {
  -webkit-appearance: none;
  appearance: none;
  min-width: 0;
  max-width: 100%;
  min-height: 2.375rem;
}

select.bt-input {
  min-width: 0;
  max-width: 100%;
  text-overflow: ellipsis;
}

.bt-badge-caring {
  background: #EAF5EC;
  color: var(--bt-green-dark);
  border: 1px solid #C6E3CC;
}

.bt-badge-sold {
  background: #FFF8DB;
  color: #8A5D00;
  border: 1px solid #F3D56B;
}

.bt-badge-dead {
  background: #FDF0EF;
  color: var(--bt-danger);
  border: 1px solid #F3C4C1;
}

.safe-bottom {
  padding-bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
}

/* App Shell Flex Layout: Khắc phục triệt để lỗi thanh menu đáy bị lơ lửng trên Chrome/Safari iOS khi cuộn */
.bt-app-shell {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bt-bg);
}

.bt-main-scroll {
  flex: 1 1 0%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

.bt-bottom-nav {
  flex-shrink: 0;
  width: 100%;
  background: var(--bt-surface);
  border-top: 1px solid var(--bt-border);
  box-shadow: var(--bt-shadow-floating);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transform: translate3d(0, 0, 0);
}
