/* WACHEKA SUITES UI theme overrides */
:root {
  --bnb-primary: #d81018;
  --bnb-accent: #707070;
  --bnb-bg: #f6f6f6;
  --bnb-card: #ffffff;
  --bnb-danger: #ef4444;
  --bnb-success: #10b981;
  --bnb-muted: #6b7280;
  --tt-red: #d81018;
  --tt-red-dark: #a90e14;
  --tt-charcoal: #2d2d2d;
  --tt-gray: #707070;
  --tt-light: #f6f6f6;
  --bottom-nav-offset: 118px;
}

body {
  background:
    radial-gradient(1200px 700px at 100% -200px, #f7d5d7 0%, transparent 60%),
    radial-gradient(900px 600px at -100px -180px, #efefef 0%, transparent 58%),
    radial-gradient(700px 420px at 50% 0%, #f8e3e466 0%, transparent 62%),
    var(--bnb-bg);
}

.bnb-card {
  background: var(--bnb-card);
  border-radius: 1rem;
  box-shadow: 0 2px 16px 0 rgba(91, 33, 182, 0.08);
  border-left: 4px solid var(--bnb-primary);
}

.bnb-btn {
  background: var(--bnb-primary);
  color: #fff;
  border-radius: 0.5rem;
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  box-shadow: 0 1px 4px 0 rgba(91, 33, 182, 0.12);
  transition: background 0.2s;
}

.bnb-btn:hover {
  background: var(--bnb-accent);
  color: #1f2937;
}

.bnb-danger {
  color: var(--bnb-danger);
}

.bnb-success {
  color: var(--bnb-success);
}

.bnb-muted {
  color: var(--bnb-muted);
}

input,
select,
textarea {
  border-radius: 0.5rem !important;
  border: 1px solid #e5e7eb !important;
  box-sizing: border-box;
}

input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
select {
  min-height: 48px !important;
  height: 48px !important;
  line-height: 1.2;
  padding-top: 0.5rem !important;
  padding-bottom: 0.5rem !important;
}

/* Force consistent field rhythm for all dropdown/date controls in app content */
.app-main select,
.app-main input[type="date"],
.app-main input[type="month"],
.app-main input[type="datetime-local"],
.app-main input[type="time"] {
  min-height: 48px !important;
  height: 48px !important;
  line-height: 1.2 !important;
}

textarea {
  min-height: 120px !important;
  height: auto !important;
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
}

nav {
  background: var(--bnb-card);
  box-shadow: 0 2px 12px 0 rgba(15, 23, 42, 0.06);
}

#appBottomNav {
  min-height: 74px;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
  backdrop-filter: blur(6px);
}

#appBottomNav.is-fixed-bottom {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 46;
}

/* Absolute guardrail: bottom-nav icons can never scale up unexpectedly */
#appBottomNav svg,
#appBottomNav .tab-ico,
#appBottomNav .tab-ico-wrap {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  flex: 0 0 18px !important;
}

.app-main {
  padding-bottom: calc(var(--bottom-nav-offset) + 1rem);
}

#entriesRoot details,
#entriesRoot [data-worker-submit] {
  scroll-margin-bottom: calc(var(--bottom-nav-offset) + 0.5rem);
}

#syncBtn,
#dateTodayBtn,
#dateYesterdayBtn,
#unitPrevBtn,
#unitNextBtn {
  min-height: 48px;
  height: 48px;
}

.date-input-wrap {
  position: relative;
  display: inline-flex;
}

.date-input-wrap::after {
  content: "Cal";
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 700;
  pointer-events: none;
  opacity: 0.75;
}

.date-input {
  min-height: 48px;
  height: 48px;
  min-width: 170px;
  padding-right: 36px !important;
  font-weight: 600;
  border-color: #cbd5e1 !important;
  background: #ffffff;
}

.date-input:focus {
  border-color: var(--tt-red) !important;
  box-shadow: 0 0 0 3px rgba(216, 16, 24, 0.15);
}

#dateTodayBtn {
  background: linear-gradient(135deg, #e33037, #d81018);
  border-color: transparent !important;
  color: #ffffff !important;
}

#dateYesterdayBtn {
  background: linear-gradient(135deg, #8a8a8a, #707070);
  border-color: transparent !important;
  color: #ffffff !important;
}

#syncBtn {
  background: linear-gradient(135deg, #3f3f3f, #2d2d2d);
  border-color: transparent !important;
  color: #ffffff !important;
}

#unitPrevBtn {
  background: linear-gradient(135deg, #8a8a8a, #707070);
  border-color: transparent !important;
  color: #ffffff !important;
}

#unitNextBtn {
  background: linear-gradient(135deg, #e33037, #d81018);
  border-color: transparent !important;
  color: #ffffff !important;
}

#entriesRoot [data-save-indicator] {
  font-weight: 700;
}

#entriesRoot textarea {
  font-size: 16px;
}

.attachment-thumb {
  width: 100%;
  max-width: 220px;
  height: 120px;
  object-fit: cover;
  display: block;
}

/* Tailwind class overrides for consistent TOPI-style palette */
.bg-indigo-600 {
  background-color: var(--tt-red) !important;
}

.hover\:bg-indigo-700:hover {
  background-color: var(--tt-red-dark) !important;
}

.active\:bg-indigo-800:active {
  background-color: #7f0a0f !important;
}

.bg-indigo-50 {
  background-color: #fdeced !important;
}

.text-indigo-700,
.text-indigo-600 {
  color: var(--tt-red) !important;
}

.border-indigo-200 {
  border-color: #f3c3c6 !important;
}

.border-indigo-100 {
  border-color: #f7d7d9 !important;
}

.text-indigo-100 {
  color: #ffe8e9 !important;
}

.hover\:bg-indigo-100:hover {
  background-color: #fbe2e4 !important;
}

.focus\:border-indigo-600:focus {
  border-color: var(--tt-red) !important;
}

.focus\:ring-indigo-600:focus {
  --tw-ring-color: rgba(216, 16, 24, 0.35) !important;
  box-shadow: 0 0 0 3px rgba(216, 16, 24, 0.18) !important;
}

.text-indigo-600,
.text-indigo-700,
.text-indigo-800 {
  color: var(--tt-red) !important;
}

.from-indigo-700 {
  --tw-gradient-from: #d81018 var(--tw-gradient-from-position) !important;
  --tw-gradient-to: rgb(216 16 24 / 0) var(--tw-gradient-to-position) !important;
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

.via-indigo-600 {
  --tw-gradient-to: rgb(191 12 18 / 0) var(--tw-gradient-to-position) !important;
  --tw-gradient-stops: var(--tw-gradient-from), #c40f17 var(--tw-gradient-via-position), var(--tw-gradient-to) !important;
}

.to-blue-600,
.to-indigo-600 {
  --tw-gradient-to: #8a0c12 var(--tw-gradient-to-position) !important;
}

.tab-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 56px;
}

.tab-ico-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  line-height: 0;
  flex: 0 0 18px;
}

.tab-ico,
.nav-ico {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  min-height: 18px !important;
  max-width: 18px !important;
  max-height: 18px !important;
  vertical-align: middle;
  display: block;
  flex: 0 0 18px;
}

.tab-ico {
  margin: 0 auto;
}

.header-logo-wrap {
  width: 58px;
  height: 58px;
  flex: 0 0 58px;
}

.header-logo-w {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  padding: 0.15rem;
}

@media (max-width: 640px) {
  .tab-link {
    min-height: 52px;
  }

  .app-main {
    padding-bottom: calc(var(--bottom-nav-offset) + 1rem);
  }
}

.tour-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.tour-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}

.tour-card {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  background: #fff;
  border-radius: 0.9rem;
  padding: 1rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
}

.worker-tab-btn.is-active {
  background: #fdeced;
  color: var(--tt-red);
  font-weight: 700;
}

.worker-tab-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-height: 58px;
}

#profileMenuPanel button,
#profileMenuPanel a {
  display: block;
}

@media (min-width: 768px) {
  .tour-card {
    max-width: 420px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }
}

.tour-highlight {
  position: relative;
  z-index: 1001 !important;
  outline: 3px solid rgba(216, 16, 24, 0.75);
  outline-offset: 3px;
  border-radius: 0.75rem;
  transition: outline-color 0.2s ease;
}
