@import url('https://fonts.googleapis.com/css2?family=SF+Pro+Display:wght@300;400;500;600;700;900&family=Inter:wght@200;300;400;500;600;800&display=swap');

:root {
    --color-cred-base: #367c85; 
    --color-sub-base: #8a4b8f;  
    --color-accent: #ff7f50;    
    --bg: #e4e9f2;
    --text-main: #0f172a; 
    --text-mut: #64748b;  
}

/* SCROLLBARS PERSONALIZADOS A LA PAR DE LA PLATAFORMA */
* { scrollbar-width: thin; scrollbar-color: var(--text-mut) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(100, 116, 139, 0.3); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--color-cred-base); border: 2px solid transparent; background-clip: padding-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    overflow-x: hidden;
    background-image: none;
    background-attachment: fixed;
}

.brand-m-large {
    font-family: 'SF Pro Display', sans-serif;
    font-weight: 900;
    background: linear-gradient(135deg, #0f172a 0%, #334155 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 0.8; margin-bottom: 0; letter-spacing: -6px;
}
.brand-database {
    letter-spacing: 0.8em; font-size: 0.65rem; font-weight: 800; color: var(--text-mut);
    text-transform: uppercase; margin-top: 15px; margin-right: -0.8em; text-align: center; 
}

.open-input {
    width: 100%; background: transparent; border: none; border-bottom: 2px solid rgba(15, 23, 42, 0.1);
    border-radius: 0; padding: 12px 0; color: var(--text-main); font-size: 1.1rem; font-weight: 500;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); appearance: none; -webkit-appearance: none;
}
.open-input::placeholder { color: rgba(15, 23, 42, 0.3); font-weight: 300; text-align: center; }
.open-input:focus { outline: none; border-bottom: 2px solid var(--color-cred-base); transform: translateY(-1px); }
.open-input.text-left::placeholder { text-align: left; }

.otp-box { 
    width: 40px; background: transparent; border: none; border-bottom: 3px solid rgba(15, 23, 42, 0.1); 
    border-radius: 0; text-align: center; font-size: 2rem; font-weight: 800; padding: 5px 0; color: var(--color-cred-base);
    transition: all 0.3s;
}
.otp-box:focus { border-bottom-color: var(--color-cred-base); outline: none; transform: translateY(-4px); }

@keyframes error-shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}
.input-error {
    border-bottom-color: rgba(239, 68, 68, 0.8) !important;
    color: rgba(239, 68, 68, 1) !important;
    animation: error-shake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.open-btn {
    background: transparent; border: none; color: var(--text-main); font-weight: 800;
    text-transform: uppercase; letter-spacing: 2px; padding: 10px 0; position: relative;
    display: inline-flex; align-items: center; gap: 12px; cursor: pointer; overflow: visible;
    transition: color 0.3s;
}
.open-btn .line {
    position: absolute; bottom: 0; left: 0; height: 2px; width: 0%; 
    background: var(--color-cred-base); transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.open-btn:hover .line { width: 100%; }
.open-btn.primary { color: var(--color-cred-base); }
.open-btn.primary .line { width: 30%; background: var(--color-cred-base); }
.open-btn.primary:hover .line { width: 100%; }
.open-btn.danger { color: #ef4444; }
.open-btn.danger .line { background: #ef4444; }

.mobile-fab {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    width: 60px; height: 60px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.5rem; box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border: 1px solid rgba(255,255,255,1);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1); outline: none;
}
.mobile-fab:active { transform: scale(0.9); }

.custom-select-wrapper { position: relative; width: 100%; user-select: none; }
.custom-select-trigger { cursor: pointer; display: flex; justify-content: space-between; align-items: center; }
.custom-select-options {
    position: absolute; top: 100%; left: 0; width: 100%; background: rgba(240, 244, 250, 0.95); backdrop-filter: blur(20px);
    border-left: 2px solid var(--color-cred-base); box-shadow: 20px 20px 40px rgba(0,0,0,0.05);
    opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.3s; z-index: 99; padding: 10px 0;
    max-height: 250px; overflow-y: auto; text-align: left;
}
.custom-select-wrapper.open .custom-select-options { opacity: 1; visibility: visible; transform: translateY(0); }
.custom-select-wrapper.open .trigger-icon { transform: rotate(180deg); color: var(--color-cred-base); }
.custom-option { padding: 12px 20px; font-size: 1.1rem; font-weight: 500; color: var(--text-mut); cursor: pointer; transition: all 0.2s; }
.custom-option:hover { color: var(--color-cred-base); padding-left: 30px; }
.custom-option.selected { color: var(--text-main); font-weight: 700; }

.fullscreen-modal {
    position: fixed; inset: 0; background: rgba(228, 233, 242, 0.9); backdrop-filter: blur(40px);
    z-index: 100; display: flex; flex-direction: column; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.fullscreen-modal.active { opacity: 1; visibility: visible; }
.modal-content-wrapper { width: 100%; max-width: 800px; padding: 40px; transform: translateY(40px); transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1); }
.fullscreen-modal.active .modal-content-wrapper { transform: translateY(0); }
.modal-close-btn { position: absolute; top: 40px; right: 40px; font-size: 2rem; color: var(--text-main); cursor: pointer; transition: transform 0.3s; z-index: 110; }
.modal-close-btn:hover { transform: rotate(90deg); color: #ef4444; }

.modal-scrollable-content { max-height: 70vh; overflow-y: auto; padding-right: 5px; padding-bottom: 40px; width: 100%; }

.toast {
    position: fixed; bottom: -100px; left: 50%; transform: translateX(-50%);
    background: var(--text-main); color: white; padding: 16px 32px; border-radius: 0;
    font-weight: 600; font-size: 14px; letter-spacing: 1px; text-transform: uppercase;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    transition: bottom 0.5s cubic-bezier(0.16, 1, 0.3, 1); z-index: 1000;
}
.toast.show { bottom: 40px; }

.flatpickr-calendar { 
    background: rgba(240, 244, 250, 0.95) !important; backdrop-filter: blur(20px) !important; 
    border: none !important; border-left: 3px solid var(--color-sub-base) !important;
    box-shadow: 20px 20px 50px rgba(0,0,0,0.1) !important; border-radius: 0 !important; font-family: inherit !important;
}
.flatpickr-day { border-radius: 0 !important; color: var(--text-main) !important; font-weight: 500 !important; }
.flatpickr-day.selected { background: var(--color-sub-base) !important; color: white !important; font-weight: 800 !important; border:none!important; }

.elastic-icon { display: inline-block; transition: transform 0.1s; cursor: pointer; }
.label-micro { font-size: 0.65rem; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-mut); margin-bottom: 5px; display: block; text-align: left; }

.icon-composite { position: relative; display: inline-flex; align-items: center; justify-content: center; }
.icon-composite .badge-plus { position: absolute; top: -0.2em; right: -0.4em; font-size: 0.55em; font-weight: 900; color: var(--color-accent) !important; text-shadow: 0 0 2px rgba(255, 127, 80, 0.3); }
.icon-composite .badge-refresh { position: absolute; top: -0.3em; right: -0.4em; font-size: 0.5em; font-weight: 900; background-color: var(--bg); border-radius: 50%; padding: 1px; color: var(--color-accent) !important; text-shadow: 0 0 2px rgba(255, 127, 80, 0.3); }

.mask-security { -webkit-text-security: disc; }
input[type=number]::-webkit-inner-spin-button, input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* INGENIERÍA DE ACORDEÓN CON CSS GRID */
.accordion-wrapper {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.accordion-wrapper.collapsed {
    grid-template-rows: 0fr;
}
.accordion-inner {
    min-height: 0;
    overflow: hidden;
}