/* Dobrynya panel UI */

body {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

.ui-native-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.ui-field {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  color: #0f172a;
  font-size: 0.875rem;
  line-height: 1.25rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ui-field:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Custom select */
.ui-select {
  position: relative;
  width: 100%;
}

.ui-select__trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  min-height: 2.5rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #fff;
  color: #0f172a;
  font-size: 0.875rem;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.ui-select__trigger:hover {
  border-color: #94a3b8;
}

.ui-select.is-open .ui-select__trigger,
.ui-select__trigger:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.ui-select__trigger-text {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ui-select__chevron {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  color: #64748b;
  transition: transform 0.15s;
}

.ui-select.is-open .ui-select__chevron {
  transform: rotate(180deg);
}

.ui-select__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 16rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15), 0 4px 6px -4px rgba(15, 23, 42, 0.1);
}

.ui-select__option {
  display: block;
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.35;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  border: none;
  background: transparent;
}

.ui-select__option:hover,
.ui-select__option.is-focused {
  background: #f1f5f9;
}

.ui-select__option.is-selected {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 500;
}

.ui-select__option + .ui-select__option {
  border-top: 1px solid #f1f5f9;
}

/* Address combobox */
.ui-combobox {
  position: relative;
  width: 100%;
}

.ui-combobox__menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 50;
  max-height: 14rem;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.15);
}

.ui-combobox__item {
  display: block;
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.35;
  color: #0f172a;
  text-align: left;
  cursor: pointer;
  border: none;
  background: transparent;
}

.ui-combobox__item:hover,
.ui-combobox__item.is-focused {
  background: #f1f5f9;
}

.ui-combobox__item + .ui-combobox__item {
  border-top: 1px solid #f1f5f9;
}

.ui-combobox__hint {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* Time picker */
.ui-time {
  display: flex;
  gap: 0.375rem;
  align-items: center;
}

.ui-time__sep {
  color: #94a3b8;
  font-weight: 600;
  user-select: none;
}

.ui-time .ui-select {
  flex: 1;
  min-width: 0;
}

/* Date picker */
.ui-date {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.375rem;
}

.ui-date .ui-select {
  min-width: 0;
}

/* Checkbox in panel style */
.ui-check {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-size: 0.875rem;
}

.ui-check input {
  width: 1rem;
  height: 1rem;
  accent-color: #2563eb;
}

/* Prevent parent overflow from clipping dropdowns in form cards */
.bg-white.rounded-xl.shadow {
  overflow: visible;
}

form.space-y-6 > .bg-white {
  overflow: visible;
}

/* Cabinet nav store selector */
.ui-select--cabinet {
  min-width: 10rem;
  max-width: 16rem;
}

.ui-select--cabinet .ui-select__trigger {
  background: #047857;
  border-color: #059669;
  color: #fff;
  min-height: 2.25rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.ui-select--cabinet .ui-select__trigger:hover {
  background: #065f46;
  border-color: #10b981;
}

.ui-select--cabinet.is-open .ui-select__trigger,
.ui-select--cabinet .ui-select__trigger:focus {
  border-color: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.25);
}

.ui-select--cabinet .ui-select__chevron {
  color: #a7f3d0;
}

.ui-select--cabinet .ui-select__trigger-text.text-slate-400 {
  color: #d1fae5 !important;
}

/* Cabinet dropdown menu — higher z-index in nav */
nav .ui-select__menu {
  z-index: 100;
}

/* Sortable table headers */
.sortable-th {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.sortable-th:hover {
  background: #e2e8f0;
}

.sortable-th .sort-icon {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.7rem;
  color: #94a3b8;
  vertical-align: middle;
}

.sortable-th.is-sorted {
  color: #0f172a;
  background: #e2e8f0;
}

.sortable-th.is-sorted .sort-icon {
  color: #059669;
}
