* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #00a8cc;
    --primary-dark: #0088aa;
    --secondary: #5a1a9c;
    --accent: #d63031;
    --success: #00b894;
    --danger: #d63031;
    --warning: #e17055;
    --dark: #0a0a1a;
    --dark-card: #15152a;
    --light: #e0e0ff;
    --gray: #8a8aaa;
    --border: #2a2a4a;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: radial-gradient(ellipse at top, #0a0a1a 0%, #050510 100%);
    min-height: 100vh;
    color: var(--light);
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 10% 20%, rgba(0, 212, 255, 0.03) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(123, 44, 191, 0.03) 0%, transparent 20%);
    z-index: -1;
}

.hidden {
    display: none !important;
}

/* Login Styles - Split Layout */
.login-container {
    display: flex;
    min-height: 100vh;
    align-items: stretch;
}

.login-wrapper {
    display: flex;
    width: 100%;
}

.login-logo-section {
    flex: 7;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.login-logo-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 30% 30%, rgba(0, 212, 255, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 70% 70%, rgba(123, 44, 191, 0.15) 0%, transparent 50%);
    z-index: 0;
}

.hero-logo {
    width: 400px;
    height: 400px;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(0, 168, 204, 0.4));
    animation: float 6s ease-in-out infinite;
    z-index: 1;
    margin-bottom: 1rem;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(5deg); }
}

.logo-text {
    text-align: center;
    margin-top: 2rem;
    z-index: 1;
}

.logo-text h1 {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: 4px;
    background: linear-gradient(90deg, var(--primary), var(--secondary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 30px rgba(0, 212, 255, 0.5);
}

.logo-text p {
    color: var(--gray);
    font-size: 1.2rem;
    margin-top: 0.5rem;
    letter-spacing: 2px;
}

.login-form-section {
    flex: 3;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(21, 21, 42, 0.85);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border);
    position: relative;
}

.login-form-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, var(--primary), transparent, var(--secondary), transparent);
    animation: rotate 12s linear infinite;
    opacity: 0.05;
    z-index: 0;
}

@keyframes rotate {
    100% { transform: rotate(360deg); }
}

.login-box {
    background: rgba(21, 21, 42, 0.9);
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 
        0 0 50px rgba(0, 212, 255, 0.2),
        inset 0 0 30px rgba(0, 212, 255, 0.1);
    width: 90%;
    max-width: 400px;
    border: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.user-type-selector {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.user-type-btn {
    flex: 1;
    padding: 0.9rem;
    border: 2px solid var(--border);
    background: rgba(10, 10, 26, 0.5);
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.4s ease;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
}

.user-type-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.2), transparent);
    transition: left 0.5s;
}

.user-type-btn:hover::before {
    left: 100%;
}

.user-type-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(0, 168, 204, 0.3);
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1.1rem;
    z-index: 1;
}

.input-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(10, 10, 26, 0.5);
    color: var(--light);
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(0, 168, 204, 0.15);
}

.input-group input::placeholder {
    color: var(--gray);
}

.login-btn {
    width: 100%;
    padding: 1.1rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 168, 204, 0.3);
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 168, 204, 0.4);
}

.login-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.login-btn:hover::before {
    left: 100%;
}

/* Main Container */
.main-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: rgba(21, 21, 42, 0.9);
    backdrop-filter: blur(20px);
    color: white;
    padding: 1.5rem 0;
    border-right: 1px solid var(--border);
}

.sidebar-header {
    text-align: center;
    padding: 0 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
    position: relative;
}

.sidebar-header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 10%;
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    opacity: 0.6;
}

.sidebar-logo {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: drop-shadow(0 0 10px rgba(0, 212, 255, 0.5));
}

.sidebar-header h2 {
    margin-top: 0.5rem;
    color: var(--primary);
    font-weight: 700;
    letter-spacing: 1px;
}

.nav-menu {
    list-style: none;
    padding: 1rem 0;
}

.nav-menu li {
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.3rem 0.8rem;
    border-radius: 12px;
    position: relative;
    overflow: hidden;
}

.nav-menu li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.3s;
}

.nav-menu li:hover {
    background: rgba(0, 168, 204, 0.08);
    transform: translateX(3px);
}

.nav-menu li:hover::before {
    opacity: 1;
}

.nav-menu li.active {
    background: linear-gradient(90deg, rgba(0, 168, 204, 0.12), rgba(90, 26, 156, 0.12));
}

.nav-menu li.active {
    background: linear-gradient(90deg, rgba(0, 168, 204, 0.15), rgba(90, 26, 156, 0.15));
}

.nav-menu li.active::before {
    opacity: 1;
}

.nav-menu i {
    width: 24px;
    color: var(--primary);
    font-size: 1.2rem;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: rgba(10, 10, 26, 0.3);
}

.top-bar {
    background: rgba(21, 21, 42, 0.8);
    backdrop-filter: blur(20px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
}

.back-btn {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    display: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 168, 204, 0.3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info span {
    color: var(--primary);
    font-weight: 600;
}

#logoutBtn {
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, var(--danger), #ff6b7a);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

#logoutBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 71, 87, 0.4);
}

.content-body {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
}

.module-container {
    background: rgba(21, 21, 42, 0.8);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 
        0 8px 30px rgba(0, 0, 0, 0.25),
        inset 0 0 30px rgba(0, 168, 204, 0.03);
    border: 1px solid var(--border);
}

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.module-header h2 {
    color: var(--light);
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.search-box {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.search-box input, .search-box select {
    padding: 0.9rem 1rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(10, 10, 26, 0.5);
    color: var(--light);
    transition: all 0.3s ease;
}

.search-box input:focus, .search-box select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(0, 168, 204, 0.15);
}

.search-box input {
    flex: 1;
    min-width: 200px;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.85rem;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    box-shadow: 0 2px 8px rgba(0, 168, 204, 0.25);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #00a878);
    color: var(--dark);
    box-shadow: 0 2px 8px rgba(0, 184, 148, 0.25);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #e05656);
    color: white;
    box-shadow: 0 2px 8px rgba(214, 48, 49, 0.25);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning), #d1613d);
    color: var(--dark);
    box-shadow: 0 2px 8px rgba(225, 112, 85, 0.25);
}

.btn-info {
    background: linear-gradient(135deg, #06b6d4, #0e7490);
    color: white;
    box-shadow: 0 2px 8px rgba(6, 182, 212, 0.25);
}

.btn:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.data-table th {
    background: rgba(0, 168, 204, 0.08);
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.data-table th, .data-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.data-table tr:hover {
    background: rgba(0, 168, 204, 0.04);
}

.data-table input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: rgba(10, 10, 26, 0.5);
    color: var(--light);
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.modal-content {
    background: rgba(21, 21, 42, 0.95);
    padding: 2.5rem;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    box-shadow: 0 0 40px rgba(0, 168, 204, 0.15);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.modal-header h3 {
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
}

.close-btn {
    background: rgba(255, 71, 87, 0.2);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--danger);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: var(--danger);
    color: white;
    transform: rotate(90deg);
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--light);
    font-weight: 600;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 0.9rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    background: rgba(10, 10, 26, 0.5);
    color: var(--light);
    transition: all 0.3s ease;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 12px rgba(0, 168, 204, 0.15);
}

.password-prompt {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(21, 21, 42, 0.95);
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 0 40px rgba(0, 168, 204, 0.2);
    z-index: 1001;
    min-width: 320px;
    border: 1px solid var(--border);
}

.alert {
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    text-align: center;
}

.alert-success {
    background: rgba(0, 245, 168, 0.15);
    color: var(--success);
    border: 1px solid var(--success);
}

.alert-error {
    background: rgba(255, 71, 87, 0.15);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.invoice-section {
    background: rgba(0, 168, 204, 0.04);
    padding: 1.5rem;
    border-radius: 15px;
    margin-top: 1.5rem;
    border: 1px solid var(--border);
}

.invoice-total {
    display: flex;
    justify-content: space-between;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--border);
    color: var(--light);
}

.invoice-total.final {
    font-weight: bold;
    font-size: 1.3rem;
    color: var(--primary);
    border-bottom: none;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
    color: var(--light);
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

select[multiple] {
    height: 150px;
}

.client-autocomplete {
    position: relative;
}

.autocomplete-items {
    position: absolute;
    background: rgba(21, 21, 42, 0.95);
    border: 1px solid var(--border);
    border-radius: 12px;
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

.autocomplete-items div {
    padding: 0.9rem;
    cursor: pointer;
    color: var(--light);
    transition: all 0.2s ease;
}

.autocomplete-items div:hover {
    background: rgba(0, 212, 255, 0.2);
}

.log-table {
    font-size: 0.9rem;
}

.log-table td {
    padding: 0.5rem;
    color: var(--gray);
}

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes glow {
    0% { box-shadow: 0 0 5px rgba(0, 212, 255, 0.5); }
    50% { box-shadow: 0 0 20px rgba(0, 212, 255, 0.8); }
    100% { box-shadow: 0 0 5px rgba(0, 212, 255, 0.5); }
}

/* Responsive */
@media (max-width: 768px) {
    .login-wrapper {
        flex-direction: column;
    }
    
    .login-logo-section {
        flex: 1;
        padding: 2rem;
    }
    
    .hero-logo {
        width: 150px;
        height: 150px;
    }
    
    .logo-text h1 {
        font-size: 2.5rem;
    }
    
    .login-form-section {
        flex: 1;
        padding: 2rem;
    }
    
    .main-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
    }
    
    .content-body {
        padding: 1rem;
    }
    
    .login-box {
        padding: 2rem;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .module-container {
        padding: 1.5rem;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(10, 10, 26, 0.3);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary), var(--secondary));
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--primary-dark), var(--secondary));
}

/* Ventas Vertical Layout */
.ventas-vertical-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-section {
    background: rgba(0, 168, 204, 0.04);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid var(--border);
}

.form-section h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-section {
    background: rgba(90, 26, 156, 0.04);
    padding: 1.5rem;
    border-radius: 15px;
    border: 1px solid var(--border);
}

.product-section h3 {
    color: var(--secondary);
    margin-bottom: 1rem;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.product-selection {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.5rem;
}

.product-list {
    flex: 2;
    padding: 0.8rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: rgba(10, 10, 26, 0.5);
    color: var(--light);
    min-height: 120px;
    max-height: 200px;
    overflow-y: auto;
}

.product-actions {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding-top: 0.5rem;
}

.product-actions .btn {
    width: 100%;
    justify-content: center;
}

.cart-title {
    color: var(--primary);
    margin: 1.5rem 0 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.2rem;
}

.totals-container {
    background: rgba(10, 10, 26, 0.3);
    padding: 1.5rem;
    border-radius: 12px;
    max-width: 350px;
    margin-left: auto;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.invoice-total {
    display: flex;
    justify-content: space-between;
    padding: 0.6rem 0;
    color: var(--light);
    border-bottom: 1px dashed var(--border);
}

.invoice-total.final {
    font-weight: bold;
    font-size: 1.3rem;
    color: var(--success);
    border-bottom: none;
    margin-top: 0.5rem;
}

.btn-finalizar {
    width: 100%;
    max-width: 300px;
    padding: 1rem;
    font-size: 1.1rem;
}

.text-center {
    text-align: center;
}

/* Loading para selects */
.form-group select.loading {
    background-image: linear-gradient(90deg, rgba(0,168,204,0.1) 0%, rgba(0,168,204,0.2) 50%, rgba(0,168,204,0.1) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}


/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 26, 0.85);
    backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.hidden {
    display: none;
}

.loading-spinner {
    width: 70px;
    height: 70px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 30px rgba(0, 212, 255, 0.6);
}

.loading-text {
    margin-top: 1.5rem;
    color: var(--primary);
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 0 0 10px rgba(0, 212, 255, 0.8);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}