/* 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;
}

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(1100px 560px at 0% -120px, #ff6b3d 0%, transparent 58%),
    radial-gradient(1200px 680px at 100% -220px, #e00046 0%, transparent 63%),
    linear-gradient(180deg, #0e0c12 0%, #17131e 24%, #f4f1f2 25%, #f4f1f2 100%);
}

.app-main {
  max-width: 100%;
  overflow-x: hidden;
}

.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);
}

header.sticky {
  background: linear-gradient(130deg, rgba(239, 62, 54, 0.94), rgba(192, 20, 58, 0.94)) !important;
  border-bottom-color: rgba(255, 255, 255, 0.2) !important;
}

header.sticky .font-semibold,
header.sticky #netStatus {
  color: #fff !important;
}

#appBottomNav {
  min-height: 74px;
  padding-bottom: max(0.5rem, env(safe-area-inset-bottom, 0px));
  backdrop-filter: blur(6px);
  background: linear-gradient(145deg, rgba(14, 12, 18, 0.94), rgba(20, 16, 28, 0.92)) !important;
  color: #e5e7eb;
  border-top-color: rgba(255, 255, 255, 0.14) !important;
}

#appBottomNav .text-gray-600 {
  color: #d1d5db !important;
}

#appBottomNav .hover\:bg-gray-50:hover {
  background: rgba(255, 255, 255, 0.08) !important;
}

#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);
  scroll-padding-bottom: calc(var(--bottom-nav-offset) + 1rem);
}

.app-main > .app-scroll-wrap > section {
  background: linear-gradient(180deg, #fff8f8 0%, #ffffff 100%);
  border-color: #f4c9cc !important;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.app-main .text-gray-500 {
  color: #6b5d63 !important;
}

.app-scroll-wrap {
  position: relative;
  padding-bottom: calc(var(--bottom-nav-offset) + 0.75rem);
}

.app-scroll-wrap > *:last-child {
  margin-bottom: calc(var(--bottom-nav-offset) + 0.5rem) !important;
}

#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: 64px;
  height: 64px;
  flex: 0 0 64px;
  overflow: hidden;
  border-radius: 0.75rem;
}

.header-logo-mark {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 9%;
  transform: scale(1.8);
  transform-origin: top center;
  padding: 0;
  border-radius: 0.75rem;
}

@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;
}

/* Hybrid premium worker UI (dark-gradient hero + clean cards) */
body.worker-hybrid-ui {
  background:
    radial-gradient(860px 420px at 5% -20%, #ff7a3d 0%, transparent 60%),
    radial-gradient(860px 560px at 98% -40%, #ff0050 0%, transparent 62%),
    linear-gradient(180deg, #0a0a0f 0%, #12121a 28%, #f3f4f6 29%, #f3f4f6 100%);
}

body.worker-hybrid-ui header {
  background: linear-gradient(130deg, rgba(255, 122, 61, 0.9), rgba(255, 0, 80, 0.9));
  border-bottom-color: rgba(255, 255, 255, 0.18);
}

body.worker-hybrid-ui header .font-semibold,
body.worker-hybrid-ui #netStatus {
  color: #fff !important;
}

body.worker-hybrid-ui #workerHeroCard {
  background: linear-gradient(160deg, rgba(17, 24, 39, 0.95), rgba(31, 41, 55, 0.92));
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: 0 14px 34px rgba(8, 10, 18, 0.35);
}

body.worker-hybrid-ui #todayGreeting,
body.worker-hybrid-ui #todayHint {
  color: rgba(255, 255, 255, 0.75) !important;
}

body.worker-hybrid-ui #todayTitle,
body.worker-hybrid-ui #currentUnitName {
  color: #ffffff !important;
}

body.worker-hybrid-ui #currentUnitMeta,
body.worker-hybrid-ui #unitPosition {
  color: rgba(255, 255, 255, 0.72) !important;
}

body.worker-hybrid-ui #workerHeroCard .bg-indigo-50 {
  background: rgba(255, 255, 255, 0.08) !important;
}

body.worker-hybrid-ui #workerHeroCard .border-indigo-200 {
  border-color: rgba(255, 255, 255, 0.16) !important;
}

.worker-unit-btn {
  text-align: left;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  background: #fff;
  padding: 0.7rem;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.worker-unit-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.worker-unit-btn.is-active {
  border-color: #fecdd3;
  background: linear-gradient(150deg, #fff1f2, #ffe4e6);
}

.worker-unit-head {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  color: #111827;
}

.worker-unit-icon {
  display: inline-flex;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #ff4d6d, #d81018);
}

.worker-unit-meta {
  margin-top: 0.25rem;
  font-size: 12px;
  color: #6b7280;
}

.worker-unit-tags {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.worker-pill {
  font-size: 11px;
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
  background: #f3f4f6;
  color: #374151;
}

.section-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.2rem;
}

.section-head-ico {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(145deg, #ffe4e6, #ffd0d6);
  color: #a80f15;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.section-head-txt {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
}

.worker-entry-card {
  animation: cardRise 260ms cubic-bezier(0.2, 0.75, 0.2, 1) both;
}

.worker-stagger {
  opacity: 0;
  transform: translateY(10px) scale(0.985);
  animation: itemIn 360ms cubic-bezier(0.2, 0.75, 0.2, 1) forwards;
}

@keyframes itemIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes cardRise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .worker-entry-card,
  .worker-stagger {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

body.worker-hybrid-ui #entriesRoot > div {
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

body.worker-hybrid-ui .worker-tab-btn {
  border-radius: 14px;
}

body.worker-hybrid-ui .worker-tab-btn.is-active {
  background: linear-gradient(145deg, #ffe4e6, #fde2e4);
}

body.worker-hybrid-ui .chooser-sheet {
  border-radius: 20px 20px 14px 14px;
  padding-top: 1.1rem;
  background: #ffffff;
}

body.worker-hybrid-ui .chooser-sheet::before {
  content: "";
  width: 54px;
  height: 6px;
  border-radius: 999px;
  background: #d1d5db;
  display: block;
  margin: 0 auto 0.8rem;
}

body.worker-hybrid-ui #workerHeroCard {
  padding: 1.1rem;
}

body.worker-hybrid-ui #entriesRoot textarea,
body.worker-hybrid-ui #entriesRoot input,
body.worker-hybrid-ui #entriesRoot select {
  font-size: 15px;
}
