/* 
 * TENSOR ERP - QUANTUM V2 SOVEREIGN DESIGN SYSTEM (PORTAL READY)
 * The definitive standard for elite enterprise performance.
 */

:root {
    --q-bg-dark: #0f172a;
    --q-accent-blue: #3b82f6;
    --q-sidebar-bg: #0044A3;
    --q-accent-gold: #facc15;
    --q-glass-bg: rgba(255, 255, 255, 0.05);
    --q-glass-border: rgba(255, 255, 255, 0.1);
    --q-text-muted: #64748b;
    --q-primary-dark: #1e293b;
}

body {
    font-family: 'Inter', sans-serif !important;
}

/* Glassmorphism Layers */
.q-glass {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(25px) saturate(200%);
    -webkit-backdrop-filter: blur(25px) saturate(200%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.q-glass-light {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid #cbd5e1;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
    color: #0f172a;
}

/* Base Inputs */
.q-input {
    background: #ffffff;
    border: 2px solid #94a3b8;
    /* Enhanced border visibility */
    color: #0f172a;
    border-radius: 10px;
    padding: 10px 16px;
    transition: all 0.2s ease;
    outline: none;
    font-size: 14px;
    font-weight: 500;
}

.q-input:focus {
    background: white;
    border-color: var(--q-accent-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* Sovereign Portal Dropdown System */
.q-select-container {
    position: relative;
    width: 100%;
}

.q-select-enhanced {
    display: none !important;
}

.q-select-current {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 10px 16px;
    background: #ffffff;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    height: 44px;
    /* Reduced from 56px */
    padding: 0 20px;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    cursor: pointer;
    backdrop-filter: blur(10px);
    font-size: 11px !important;
    font-weight: 900 !important;
    /* font-black */
    color: #ffffff;
    text-transform: uppercase;
    font-style: italic;
    transition: all 0.2s ease;
    white-space: normal;
    line-height: 1.4;
    user-select: none;
}

.q-select-current:hover {
    border-color: var(--q-accent-blue);
    background: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.05);
}

.q-select-container.active .q-select-current {
    border-color: var(--q-accent-blue);
    background: white;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.1);
}

/* THE PORTAL: Rendered at body level */
.q-select-dropdown {
    position: fixed;
    background: #ffffff !important;
    /* Force white background for visibility */
    border: 2px solid #0f172a;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    z-index: 100000 !important;
    max-height: 350px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

.q-select-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
}

/* Scrollbar for dropdown */
.q-select-dropdown::-webkit-scrollbar {
    width: 6px;
}

.q-select-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.q-select-option {
    padding: 14px 20px;
    font-size: 11px !important;
    font-weight: 900 !important;
    font-style: italic;
    text-transform: uppercase;
    color: #475569;
    cursor: pointer;
    white-space: nowrap !important;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.15s ease;
    line-height: 1.5;
    background: #ffffff;
    width: 100% !important;
    box-sizing: border-box !important;
    display: block;
}

.q-select-option:last-child {
    border-bottom: none;
}

.q-select-option:hover {
    background: #f1f5f9;
    color: #0044A3;
    padding-left: 28px;
}

.q-select-option.selected {
    background: #0044A3 !important;
    color: #ffffff !important;
    border-left: 3px solid #facc15;
}

.q-select-dropdown {
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

/* Premium Buttons */
.q-btn-primary {
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    border-radius: 12px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: white;
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 12px 24px;
    border: none;
}

.q-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.4);
    filter: brightness(1.1);
}

/* Standardized Tables */
.q-table-wrapper {
    background: white;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.q-table {
    width: 100%;
    border-collapse: collapse;
}

.q-table th {
    background: #f8fafc;
    padding: 16px 20px;
    text-align: left;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    color: #64748b;
    border-bottom: 2px solid #e2e8f0;
}

.q-table td {
    padding: 14px 20px;
    font-size: 13px;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
}

/* Animations */
@keyframes q-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-q-fade {
    animation: q-fade-in 0.5s ease forwards;
}

/* UI FIX: REMOVE NUMERIC SPINNERS */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
}

/* TAREO SPECIFIC FIXES */
.tareo-input {
    padding: 0 !important;
    margin: 0 !important;
    height: 100% !important;
    width: 100% !important;
    text-align: center !important;
    line-height: inherit !important;
}

.tareo-table td {
    height: 48px !important;
    padding: 0 !important;
}

/* QUANTUM COMBO BOXES (SELECT ELEMENTS) - EXECUTIVE STYLE */
.q-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
    padding-right: 2.5rem !important;
    background-color: #ffffff;
    border: 2px solid #cbd5e1;
    color: #1e293b;
    border-radius: 12px;
    padding: 10px 16px;
    font-size: 11px !important;
    font-weight: 900;
    font-style: italic;
    text-transform: uppercase;
    transition: all 0.2s ease;
    outline: none;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.q-select:hover {
    border-color: #94a3b8;
    /* slate-400 */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04);
}

.q-select:focus {
    border-color: var(--q-accent-blue);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    background-color: #fff;
}

/* Base style for native options within .q-select */
.q-select option {
    font-size: 10px !important;
    /* Smaller, elegant font for options */
    font-weight: 600;
    color: #1e293b;
    padding: 8px 12px;
    background-color: #ffffff;
}

.q-select option:hover {
    background-color: #f1f5f9;
}

/* DASHBOARD EXECUTIVE TABS (RRHH STYLE HARMONIZATION) */
.view-btn {
    white-space: nowrap;
    border-radius: 1rem;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255, 255, 255, 0.5);
    background: transparent;
    border: 1px solid transparent;
}

.view-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    /* bg-white/10 */
}

.view-btn.active {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.2) !important;
    /* bg-white/20 */
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    /* border-white/30 */
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    /* shadow-lg */
}

/* UTILITIES */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

@keyframes spin-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-spin-slow {
    animation: spin-slow 3s linear infinite;
}

/* PREMIUM SELECT WRAPPER (QUANTUM EDITION) */
.q-select-premium-wrapper {
    position: relative;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(59, 130, 246, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    width: 100%;
}

.q-select-premium-wrapper:hover {
    background: #1e3a8a;
    border-color: #3b82f6;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

.q-select-premium-wrapper select {
    width: 100%;
    background: transparent;
    border: none;
    color: white;
    font-size: 11px;
    font-weight: 950 !important;
    font-style: italic !important;
    height: 48px;
    padding: 0 40px 0 16px;
    appearance: none;
    outline: none;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    z-index: 2;
}

.q-select-premium-wrapper select option {
    background: #0f172a;
    color: #ffffff;
    font-weight: 800;
    font-style: normal;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.q-select-premium-wrapper::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 16px;
    color: #facc15;
    pointer-events: none;
    z-index: 1;
    transition: transform 0.3s ease;
}

.q-select-premium-wrapper:focus-within::after {
    transform: rotate(180deg);
}