/* ========================================================= */
/* --- EXCELLUX ERP: UNIVERSAL MODERN DROPDOWN & DATE UI --- */
/* ========================================================= */

/* --- 1. UNIVERSAL MODERN SELECT TRIGGER & MENU --- */
.modern-select-trigger {
    border: 1px solid var(--border-light, #CBD5E1);
    background: var(--bg-surface, #FFFFFF);
    font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-main, #111827);
    text-transform: uppercase;
    line-height: 1;
    height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-sm, 8px);
    outline: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 120px;
    transition: border-color var(--transition-fast, 0.15s ease), box-shadow var(--transition-fast, 0.15s ease), background var(--transition-fast, 0.15s ease);
    box-sizing: border-box;
    vertical-align: middle;
}

.modern-select-trigger:hover {
    border-color: #94A3B8;
}

.modern-select-trigger:focus,
.modern-select-trigger[aria-expanded="true"] {
    border-color: var(--brand-primary, #2563EB);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.modern-select-trigger .trigger-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.2;
    text-transform: uppercase;
}

.modern-select-trigger .trigger-arrow {
    font-size: 10px;
    color: var(--text-muted, #6B7280);
    flex-shrink: 0;
    transition: transform var(--transition-fast, 0.15s ease), color var(--transition-fast, 0.15s ease);
}

.modern-select-trigger[aria-expanded="true"] .trigger-arrow {
    transform: rotate(180deg);
    color: var(--brand-primary, #2563EB);
}

.modern-select-menu {
    position: fixed;
    min-width: 170px;
    max-width: 320px;
    background: var(--bg-surface, #FFFFFF);
    border: 1px solid var(--border-light, #E5E7EB);
    border-radius: var(--radius-md, 12px);
    box-shadow: 0 12px 28px -4px rgba(15, 23, 42, 0.14), 0 4px 10px -2px rgba(15, 23, 42, 0.06);
    padding: 6px;
    z-index: 10050;
    display: flex;
    flex-direction: column;
    gap: 4px;
    animation: modernUiMenuFadeIn 0.12s ease-out;
    box-sizing: border-box;
}

@keyframes modernUiMenuFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.modern-select-search-wrap {
    position: relative;
    padding: 2px 2px 6px 2px;
    border-bottom: 1px solid var(--border-light, #E5E7EB);
}

.modern-select-search-wrap i {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-60%);
    font-size: 11px;
    color: var(--text-muted, #6B7280);
    pointer-events: none;
}

.modern-select-search-wrap input {
    width: 100%;
    height: 30px;
    padding: 0 8px 0 28px;
    border: 1px solid var(--border-light, #CBD5E1);
    border-radius: 6px;
    background: #F8FAFC;
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-main, #111827);
    outline: none;
    box-sizing: border-box;
}

.modern-select-search-wrap input:focus {
    background: var(--bg-surface, #FFFFFF);
    border-color: var(--brand-primary, #2563EB);
}

.modern-select-options {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.modern-select-option {
    width: 100%;
    border: none;
    background: transparent;
    padding: 7px 10px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-main, #111827);
    text-transform: uppercase;
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: background var(--transition-fast, 0.12s ease), color var(--transition-fast, 0.12s ease);
}

.modern-select-option:hover,
.modern-select-option.highlighted {
    background: var(--bg-hover, #F3F4F6);
}

.modern-select-option.active {
    background: var(--brand-soft, #EFF6FF);
    color: var(--brand-primary, #2563EB);
    font-weight: 700;
}

.modern-select-option .opt-check {
    font-size: 10px;
    color: var(--brand-primary, #2563EB);
    flex-shrink: 0;
}

.modern-select-empty {
    padding: 12px 10px;
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #6B7280);
    text-transform: uppercase;
}

/* --- 2. UNIVERSAL MODERN DATE PICKER TRIGGER & POPOVER --- */
.modern-date-trigger {
    border: 1px solid var(--border-light, #CBD5E1);
    background: var(--bg-surface, #FFFFFF);
    font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-main, #111827);
    text-transform: uppercase;
    line-height: 1;
    height: 34px;
    padding: 0 10px;
    border-radius: var(--radius-sm, 8px);
    outline: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 132px;
    transition: border-color var(--transition-fast, 0.15s ease), box-shadow var(--transition-fast, 0.15s ease), background var(--transition-fast, 0.15s ease);
    box-sizing: border-box;
    vertical-align: middle;
}

.modern-date-trigger:hover {
    border-color: #94A3B8;
}

.modern-date-trigger:focus,
.modern-date-trigger[aria-expanded="true"] {
    border-color: var(--brand-primary, #2563EB);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.modern-date-trigger.is-empty .modern-date-text {
    color: var(--text-muted, #6B7280);
    font-weight: 500;
}

.modern-date-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.2px;
    text-transform: uppercase;
}

.modern-date-icon {
    font-size: 12px;
    color: var(--text-muted, #6B7280);
    flex-shrink: 0;
    transition: color var(--transition-fast, 0.15s ease);
}

.modern-date-trigger[aria-expanded="true"] .modern-date-icon,
.modern-date-trigger:hover .modern-date-icon {
    color: var(--brand-primary, #2563EB);
}

.modern-date-menu {
    position: fixed;
    width: 280px;
    background: var(--bg-surface, #FFFFFF);
    border: 1px solid var(--border-light, #E5E7EB);
    border-radius: var(--radius-md, 12px);
    box-shadow: 0 14px 32px -4px rgba(15, 23, 42, 0.16), 0 4px 12px -2px rgba(15, 23, 42, 0.06);
    padding: 12px;
    z-index: 10055;
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: modernUiMenuFadeIn 0.12s ease-out;
    box-sizing: border-box;
    user-select: none;
}

.modern-date-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.modern-date-nav-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-light, #E5E7EB);
    background: #F8FAFC;
    border-radius: 6px;
    color: var(--text-main, #111827);
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.12s ease;
}

.modern-date-nav-btn:hover {
    background: var(--bg-hover, #F3F4F6);
    border-color: #CBD5E1;
    color: var(--brand-primary, #2563EB);
}

.modern-date-period-btn {
    flex: 1;
    height: 28px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-main, #111827);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background 0.12s ease, color 0.12s ease;
}

.modern-date-period-btn:hover {
    background: var(--brand-soft, #EFF6FF);
    color: var(--brand-primary, #2563EB);
}

.modern-date-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    gap: 2px;
}

.modern-date-weekday {
    font-size: 10px;
    font-weight: 700;
    color: var(--text-muted, #6B7280);
    text-transform: uppercase;
    padding: 2px 0;
}

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

.modern-date-day {
    height: 32px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 7px;
    font-family: inherit;
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-main, #111827);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.modern-date-day:hover:not(:disabled) {
    background: var(--bg-hover, #F3F4F6);
}

.modern-date-day.is-outside {
    color: #9CA3AF;
    font-weight: 500;
}

.modern-date-day.is-today:not(.is-selected) {
    border-color: var(--brand-primary, #2563EB);
    color: var(--brand-primary, #2563EB);
    font-weight: 700;
}

.modern-date-day.is-selected {
    background: var(--brand-primary, #2563EB);
    color: #FFFFFF;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.modern-date-day:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.modern-date-picker-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.modern-date-picker-cell {
    height: 34px;
    border: 1px solid var(--border-light, #E5E7EB);
    background: #F8FAFC;
    border-radius: 7px;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-main, #111827);
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.12s ease;
}

.modern-date-picker-cell:hover {
    background: var(--bg-hover, #F3F4F6);
    border-color: #CBD5E1;
}

.modern-date-picker-cell.is-selected {
    background: var(--brand-primary, #2563EB);
    border-color: var(--brand-primary, #2563EB);
    color: #FFFFFF;
}

.modern-date-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 8px;
    border-top: 1px solid var(--border-light, #E5E7EB);
    gap: 8px;
}

.modern-date-action-btn {
    border: none;
    background: transparent;
    padding: 5px 10px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: background 0.12s ease, color 0.12s ease;
}

.modern-date-action-btn.btn-clear {
    color: var(--text-muted, #6B7280);
}

.modern-date-action-btn.btn-clear:hover {
    background: #FEE2E2;
    color: #DC2626;
}

.modern-date-action-btn.btn-today {
    color: var(--brand-primary, #2563EB);
    background: var(--brand-soft, #EFF6FF);
}

.modern-date-action-btn.btn-today:hover {
    background: #DBEAFE;
}

@media print {
    .modern-select-menu,
    .modern-date-menu {
        display: none !important;
    }
}
