.ui-input {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.ui-input::placeholder {
  font-weight: 400;
  color: #9ca3af;
}

.ui-input:focus,
.ui-input:focus-visible {
  outline: none !important;
  outline-offset: 0;
  box-shadow: 0 0 0 2px rgba(216, 34, 49, 0.2);
  border-color: #d82231;
}

.ui-date-picker .ui-input:focus,
.ui-date-picker .ui-input:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(216, 34, 49, 0.2);
  border-color: #d82231;
}

.ui-time-picker .ui-input:focus,
.ui-time-picker .ui-input:focus-visible {
  outline: none !important;
  box-shadow: 0 0 0 2px rgba(216, 34, 49, 0.2);
  border-color: #d82231;
}

.ui-select {
  position: relative;
}

.ui-select-trigger {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  padding: 0.5rem 2.25rem 0.5rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  outline: none;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  appearance: none;
  -webkit-appearance: none;
}

.ui-select-trigger:focus,
.ui-select-trigger:focus-visible {
  outline: none !important;
  outline-offset: 0;
  box-shadow: 0 0 0 2px rgba(216, 34, 49, 0.2);
  border-color: #d82231;
}

.ui-select-trigger:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.ui-select-caret {
  color: #9ca3af;
  font-size: 1rem;
  flex-shrink: 0;
}

.ui-select-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  min-width: 100%;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  padding: 0.5rem;
  z-index: 40;
  display: none;
  max-height: 15rem;
  overflow: auto;
}

.ui-select.open .ui-select-panel {
  display: block;
}

.ui-select-panel.ui-select-panel-teleported {
  position: fixed;
  top: -9999px;
  left: -9999px;
  right: auto;
  min-width: 0;
  display: none;
  z-index: 1300;
}

.ui-select-panel.ui-select-panel-teleported.is-open {
  display: block;
}

.ui-select.open-up .ui-select-panel {
  top: auto;
  bottom: calc(100% + 0.5rem);
}

.ui-select-option {
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: #111827;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.ui-select-option:hover {
  background: #f3f4f6;
}

.ui-select-option.is-selected {
  background: rgba(216, 34, 49, 0.08);
  color: #d82231;
}

.ui-select-option.is-disabled {
  color: #9ca3af;
  cursor: not-allowed;
}

.ui-upload {
  display: block;
}

.ui-upload-input {
  display: none;
}

.ui-upload-surface {
  border: 1px dashed #e5e7eb;
  border-radius: 1rem;
  background: #fff;
  padding: 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  min-height: 3.25rem;
}

.ui-upload-surface:hover {
  background: #f9fafb;
}

.ui-upload-surface.is-dragover {
  border-color: #d82231;
  box-shadow: 0 0 0 2px rgba(216, 34, 49, 0.12);
  background: #fff5f6;
}

.ui-upload-icon {
  color: #6b7280;
  font-size: 1.1rem;
}

.ui-upload-title {
  font-weight: 700;
  color: #111827;
  font-size: 0.9rem;
}

.ui-upload-sub {
  font-size: 0.75rem;
  color: #6b7280;
}

.ui-upload.is-disabled .ui-upload-surface {
  opacity: 0.6;
  cursor: not-allowed;
}

.ui-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 80;
}

.ui-modal.is-open {
  display: flex;
}

.ui-modal.ui-modal-top {
  z-index: 90;
}

.ui-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.ui-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 36rem;
  background: #fff;
  border-radius: 1.5rem;
  border: 1px solid #e5e7eb;
  box-shadow: 0 25px 50px rgba(15, 23, 42, 0.25);
  overflow: visible;
}

body.ui-modal-open {
  overflow: hidden;
}

body.ui-modal-open #adminTopbar,
body.ui-modal-open #adminSidebar,
body.ui-modal-open #adminChildPanel,
body.ui-modal-open #adminSidebarBackdrop {
  z-index: 20 !important;
}

/* Reusable Components */

.ui-notice {
  background-color: #f9fafb;
  border: 1px solid #f3f4f6;
  border-radius: 1rem;
  padding: 1rem;
}

.ui-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.025em;
  color: #6b7280;
  margin-bottom: 0.375rem;
  margin-left: 0.25rem;
}

/* Date Picker (Calendar) */
.ui-date-picker {
  position: relative;
}

.ui-date-picker .ui-input {
  cursor: pointer;
  padding-right: 2.5rem;
  height: 3.25rem;
}

.ui-date-picker.ui-date-compact .ui-input {
  height: 2.25rem;
}

.ui-date-picker.ui-date-size-md .ui-input {
  height: 2.5rem;
}

.ui-date-picker-icon {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.ui-date-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  padding: 1rem;
  z-index: 100;
  display: none;
  width: 18rem;
}

.ui-date-picker.open .ui-date-panel {
  display: block;
}

.ui-date-panel.is-open {
  display: block;
}

.ui-date-panel.ui-date-panel-teleported {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 17000;
}

.ui-date-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.375rem;
  margin-bottom: 0.75rem;
}

.ui-date-nav-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.ui-date-btn {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.625rem;
  border: 1px solid transparent;
  background: #fff;
  color: #6b7280;
  outline: none;
  transition: all 0.15s ease;
}

.ui-date-btn:hover {
  background: #f9fafb;
  color: #111827;
}

.ui-date-btn:focus,
.ui-date-btn:focus-visible {
  outline: none !important;
  border-color: #d82231;
  box-shadow: 0 0 0 2px rgba(216, 34, 49, 0.16);
}

.ui-date-title {
  font-weight: 700;
  color: #111827;
  font-size: 0.875rem;
  text-align: center;
  flex: 1 1 auto;
}

.ui-date-quick-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  margin-bottom: 0.625rem;
}

.ui-date-link {
  border: 0;
  background: transparent;
  color: #6b7280;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.125rem 0.25rem;
  border-radius: 0.375rem;
  cursor: pointer;
}

.ui-date-link:hover {
  color: #111827;
  background: #f9fafb;
}

.ui-date-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 1px;
}

.ui-date-weekday {
  font-size: 0.7rem;
  font-weight: 700;
  color: #9ca3af;
  text-align: center;
  padding-bottom: 0.5rem;
  text-transform: uppercase;
}

.ui-date-day {
  aspect-ratio: 1/1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  border-radius: 0.5rem;
  transition: all 0.1s;
}

.ui-date-day:hover {
  background: #f3f4f6;
}

.ui-date-day.is-today {
  color: #d82231;
  font-weight: 800;
  border: 1px solid rgba(216, 34, 49, 0.2);
}

.ui-date-day.is-selected {
  background: #d82231 !important;
  color: #fff !important;
  border: 1px solid #d82231;
  box-shadow: none;
}

.ui-date-day.is-other-month {
  opacity: 0.25;
  pointer-events: none;
}

.ui-date-day.is-disabled {
  opacity: 0.35;
  color: #9ca3af;
  background: transparent;
  cursor: not-allowed;
  pointer-events: none;
}

/* Time Picker */
.ui-time-picker {
  position: relative;
}

.ui-time-picker .ui-input {
  cursor: text;
  padding-right: 2.5rem;
  height: 3.25rem;
}

.ui-time-picker.ui-time-compact .ui-input {
  height: 2.25rem;
}

.ui-time-picker.ui-time-size-md .ui-input {
  height: 2.5rem;
}

.ui-time-picker-icon {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  pointer-events: none;
}

.ui-time-panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.12);
  padding: 0.75rem;
  z-index: 100;
  display: none;
}

.ui-time-picker.open .ui-time-panel,
.ui-time-panel.is-open {
  display: block;
}

.ui-time-panel.ui-time-panel-teleported {
  position: fixed;
  top: -9999px;
  left: -9999px;
  right: auto;
  min-width: 0;
  display: none;
  z-index: 17000;
}

.ui-time-panel.ui-time-panel-teleported.is-open {
  display: block;
}

.ui-time-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.ui-time-clear {
  border: 0;
  background: transparent;
  color: #d82231;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0.125rem 0;
}

.ui-time-list {
  max-height: 18rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.ui-time-option {
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  border: 0;
  background: transparent;
  color: #111827;
  font-size: 0.875rem;
  cursor: pointer;
}

.ui-time-option:hover {
  background: #f3f4f6;
}

.ui-time-option.is-selected {
  background: rgba(216, 34, 49, 0.08);
  color: #d82231;
  font-weight: 700;
}

/* Native button cursor affordance (Safari keeps arrow by default) */
button,
input[type="button"],
input[type="submit"],
input[type="reset"] {
  cursor: pointer;
}

button:disabled,
input[type="button"]:disabled,
input[type="submit"]:disabled,
input[type="reset"]:disabled {
  cursor: not-allowed;
}

/* UI Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all 0.2s;
  cursor: pointer;
  border: 1px solid transparent;
  gap: 0.5rem;
}

.btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-primary {
  background-color: #d82231;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 6px -1px rgba(216, 34, 49, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background-color: #b61c29;
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-white {
  background-color: #fff;
  color: #374151;
  border-color: #e5e7eb;
}

.btn-white:hover:not(:disabled) {
  background-color: #f9fafb;
  border-color: #d1d5db;
  color: #111827;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  border-radius: 0.5rem;
}
