/* custom.css — small refinements on top of Tailwind */

:root { color-scheme: light dark; }

/* Card surface */
.bh-card {
  border-radius: 1rem;
  border: 1px solid rgb(226 232 240 / 0.8);
  background: #fff;
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 1px 3px rgb(15 23 42 / 0.04);
}
.dark .bh-card {
  border-color: rgb(255 255 255 / 0.06);
  background: linear-gradient(180deg, rgb(255 255 255 / 0.025), rgb(255 255 255 / 0.012));
  box-shadow: 0 1px 0 rgb(255 255 255 / 0.02) inset, 0 8px 24px -12px rgb(0 0 0 / 0.6);
}

/* Thin scrollbars for tables */
.bh-scroll::-webkit-scrollbar { height: 8px; width: 8px; }
.bh-scroll::-webkit-scrollbar-thumb { background: rgb(148 163 184 / 0.35); border-radius: 99px; }
.bh-scroll::-webkit-scrollbar-track { background: transparent; }

/* Skeleton shimmer */
.skeleton {
  background: linear-gradient(90deg, rgb(148 163 184 / 0.10) 25%, rgb(148 163 184 / 0.20) 37%, rgb(148 163 184 / 0.10) 63%);
  background-size: 400% 100%;
  animation: bh-shimmer 1.4s ease infinite;
  border-radius: 0.5rem;
}
@keyframes bh-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

@media (prefers-reduced-motion: reduce) {
  .skeleton, .animate-pulse, .animate-spin { animation: none !important; }
  * { transition: none !important; }
}

/* Auth (login) backdrop */
.auth-bg { position: relative; overflow: hidden; }
.auth-bg::before {
  content: ""; position: absolute; inset: -20% -10% auto -10%; height: 60%;
  background: radial-gradient(60% 80% at 50% 0%, rgba(59,130,246,0.20), transparent 70%);
  pointer-events: none;
}
.dark .auth-bg::before {
  background: radial-gradient(60% 80% at 50% 0%, rgba(37,99,235,0.28), transparent 70%);
}
.auth-grid {
  position: absolute; inset: 0; pointer-events: none; opacity: 0.5;
  background-image:
    linear-gradient(to right, rgba(100,116,139,0.08) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(100,116,139,0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(70% 60% at 50% 30%, #000, transparent 75%);
}

/* =====================================================================
   Theme polish — selection, inputs, autofill, caret, scrollbars
   ===================================================================== */
html        { color-scheme: light; }
html.dark   { color-scheme: dark; }
body        { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* Text selection */
::selection      { background: rgba(37,99,235,0.20); color: #0f172a; }
.dark ::selection{ background: rgba(59,130,246,0.40); color: #ffffff; }

/* Caret + native accents */
input, textarea            { caret-color: #2563eb; }
.dark input, .dark textarea{ caret-color: #60a5fa; }
input[type="checkbox"], input[type="radio"], select, progress { accent-color: #2563eb; }

/* Placeholders */
::placeholder      { color: rgb(148 163 184 / 0.95); opacity: 1; }
.dark ::placeholder{ color: rgb(100 116 139 / 0.95); }

/* Kill the ugly autofill box (yellow/white) and match our field bg */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
  -webkit-text-fill-color: #0f172a;
  -webkit-box-shadow: 0 0 0 1000px #f1f5f9 inset;
          box-shadow: 0 0 0 1000px #f1f5f9 inset;
  caret-color: #2563eb;
  border-radius: 0.75rem;
  transition: background-color 99999s ease-out 0s;
}
.dark input:-webkit-autofill,
.dark input:-webkit-autofill:hover,
.dark input:-webkit-autofill:focus,
.dark input:-webkit-autofill:active {
  -webkit-text-fill-color: #e2e8f0;
  -webkit-box-shadow: 0 0 0 1000px #0e1626 inset;
          box-shadow: 0 0 0 1000px #0e1626 inset;
  caret-color: #60a5fa;
}

/* Remove number spinners + search clear button noise */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; }

/* Global thin scrollbars (theme-aware) */
* { scrollbar-width: thin; scrollbar-color: rgba(148,163,184,0.40) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(148,163,184,0.35); border-radius: 99px;
  border: 2px solid transparent; background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.55); background-clip: padding-box; }

/* Keyboard focus ring (accessible, subtle) */
:focus-visible { outline: 2px solid rgba(37,99,235,0.55); outline-offset: 2px; border-radius: 6px; }
.dark :focus-visible { outline-color: rgba(96,165,250,0.65); }

/* Dropdown / modal animation */
.menu-enter { animation: menu-pop .14s ease-out; transform-origin: top right; }
@keyframes menu-pop { from { opacity: 0; transform: scale(.96) translateY(-4px); } to { opacity: 1; transform: none; } }
.modal-enter { animation: modal-pop .16s ease-out; }
@keyframes modal-pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* Date inputs — no visible calendar icon; entire field is clickable */
input[type="date"] { position: relative; cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  cursor: pointer;
  opacity: 0;            /* hide the icon, keep it covering the whole field */
}
input[type="date"]::-webkit-inner-spin-button,
input[type="date"]::-webkit-clear-button { display: none; }
input[type="date"] { color-scheme: light; }
.dark input[type="date"] { color-scheme: dark; }
