/* INVOXA: Form controls, custom selects and document filters */

/* ===== FORM ELEMENTE ===== */
input, select, textarea {
  transition: all 0.2s ease;
  border: 1px solid #e2e8f0;
  background: white;
  font-size: 0.95rem;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.08);
}

/* ===== CUSTOM SELECTS ===== */
.custom-select-native {
  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;
}

.custom-select {
  position: relative;
  width: 100%;
  min-width: 9rem;
}

.custom-select-trigger {
  width: 100%;
  min-height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.9rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  background: rgba(255, 255, 255, 0.96);
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  box-shadow: 0 3px 10px -7px rgba(15, 23, 42, 0.4);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.custom-select-trigger:hover {
  border-color: #a5b4fc;
  background: #fff;
}

.custom-select-trigger:focus,
.custom-select.is-open .custom-select-trigger {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.custom-select-trigger:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.custom-select-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.custom-select-chevron {
  flex-shrink: 0;
  color: #64748b;
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

.custom-select.is-open .custom-select-chevron {
  transform: rotate(180deg);
}

.custom-select-menu {
  position: fixed;
  z-index: 10000;
  display: none;
  max-height: 18rem;
  overflow-y: auto;
  padding: 0.4rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 20px 45px -16px rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(16px);
}

.custom-select-menu.is-open {
  display: block;
}

.custom-select-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: left;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.custom-select-option:hover,
.custom-select-option.is-focused {
  background: #eef2ff;
  color: #4338ca;
}

.custom-select-option.is-selected {
  background: #4f46e5;
  color: #fff;
}

.custom-select-option:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.custom-select-option-check {
  opacity: 0;
  font-size: 0.75rem;
}

.custom-select-option.is-selected .custom-select-option-check {
  opacity: 1;
}

/* ===== CUSTOM DATE PICKER ===== */
.custom-date-native {
  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;
}

.custom-date {
  position: relative;
  width: 100%;
  margin-top: 0.45rem;
}

.custom-date-trigger {
  display: flex;
  width: 100%;
  min-height: 2.9rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0.9rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  background: #fff;
  color: #111827;
  font-size: 0.925rem;
  font-weight: 600;
  text-align: left;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.custom-date-trigger:hover {
  border-color: #a5b4fc;
}

.custom-date-trigger:focus,
.custom-date.is-open .custom-date-trigger {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.14);
}

.custom-date-trigger.is-placeholder .custom-date-value {
  color: #9ca3af;
  font-weight: 500;
}

.custom-date-icon {
  flex: 0 0 auto;
  color: #6366f1;
}

.custom-date-panel {
  position: fixed;
  z-index: 10001;
  display: none;
  padding: 0.8rem;
  border: 1px solid #e0e7ff;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 50px -16px rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(16px);
}

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

.custom-date-header,
.custom-date-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.custom-date-header {
  margin-bottom: 0.75rem;
}

.custom-date-title {
  color: #1e293b;
  font-size: 0.95rem;
  text-transform: capitalize;
}

.custom-date-nav {
  display: inline-flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  color: #6366f1;
}

.custom-date-nav:hover {
  background: #eef2ff;
}

.custom-date-weekdays,
.custom-date-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.2rem;
}

.custom-date-weekdays {
  margin-bottom: 0.25rem;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
}

.custom-date-day {
  display: inline-flex;
  aspect-ratio: 1;
  align-items: center;
  justify-content: center;
  border-radius: 0.65rem;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
}

.custom-date-day:hover,
.custom-date-day:focus-visible {
  outline: none;
  background: #eef2ff;
  color: #4338ca;
}

.custom-date-day.is-outside {
  color: #cbd5e1;
}

.custom-date-day.is-today {
  box-shadow: inset 0 0 0 1px #818cf8;
  color: #4f46e5;
}

.custom-date-day.is-selected {
  background: #4f46e5;
  color: #fff;
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.25);
}

.custom-date-actions {
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid #eef2f7;
}

.custom-date-actions button {
  border-radius: 0.6rem;
  padding: 0.45rem 0.65rem;
  color: #6366f1;
  font-size: 0.78rem;
  font-weight: 800;
}

.custom-date-actions button:hover {
  background: #eef2ff;
}

/* Dokumentfilter: Suche, Dropdowns und Export in einer Reihe */
.invoice-filter-bar {
  flex-wrap: nowrap;
}

.invoice-filter-search {
  min-width: 16rem;
}

.invoice-filter-bar > .custom-select {
  flex: 0 0 12rem;
  width: 12rem;
  min-width: 12rem;
}

.invoice-filter-export {
  flex: 0 0 auto;
  min-height: 2.75rem;
  white-space: nowrap;
}

button {
  transition: all 0.15s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:active {
  transform: scale(0.98);
}

.language-picker {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    margin-right: 0;
    color: #4f46e5;
}

.language-picker .custom-select {
    min-width: 4.25rem;
}

.language-picker .custom-select-trigger {
    min-height: 2.4rem;
    padding: 0.5rem 0.7rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(99, 102, 241, 0.22);
    box-shadow: 0 4px 14px rgba(79, 70, 229, 0.08);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.language-picker .custom-select-trigger:hover,
.language-picker .custom-select.is-open .custom-select-trigger {
    border-color: rgba(79, 70, 229, 0.52);
    background: rgba(255, 255, 255, 0.94);
}

html.dark .language-picker {
    color: #a5b4fc;
}

html.dark .language-picker .custom-select-trigger {
    background: rgba(15, 23, 42, 0.76);
    border-color: rgba(129, 140, 248, 0.28);
}

@media (max-width: 767px) {
    .auth-header-actions {
        gap: 0.5rem !important;
    }

    .auth-header-actions nav {
        gap: 0 !important;
    }

    .auth-header-actions nav a {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .auth-header-controls {
        gap: 0.5rem !important;
    }

    .language-picker .custom-select {
        min-width: 4rem;
    }

    .language-picker .custom-select-trigger {
        min-height: 2.25rem;
        padding: 0.4rem 0.6rem;
    }
}
