/**
 * Estilos adicionales para el SaaS
 */

/* ========================================
   LOGIN / REGISTER
   ======================================== */

html:has(.auth-container),
html:has(.auth-container) body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.auth-container {
    height: 100%;
    display: flex;
}

.auth-branding {
    flex: 1;
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 60px;
    color: white;
    position: relative;
    overflow: hidden;
}

.auth-branding::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
}

.auth-branding h1 {
    font-size: 42px;
    font-weight: 800;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.auth-branding p {
    font-size: 18px;
    opacity: 0.9;
    max-width: 400px;
    text-align: center;
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

.auth-branding .features-list {
    list-style: none;
    margin-top: 40px;
    position: relative;
    z-index: 1;
}

.auth-branding .features-list li {
    padding: 8px 0;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-branding .features-list li i {
    color: #4ade80;
    font-size: 18px;
}

.auth-form-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--gray-50);
}

.auth-form-wrapper {
    width: 100%;
    max-width: 440px;
}

.auth-form-wrapper .logo-text {
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 8px;
}

.auth-form-wrapper h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 8px;
}

.auth-form-wrapper .subtitle {
    color: var(--gray-500);
    margin-bottom: 32px;
    font-size: 15px;
}

.password-toggle {
    position: relative;
}

.password-toggle .toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    padding: 4px;
}

.password-toggle .toggle-btn:hover {
    color: var(--gray-600);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: var(--spacing-md);
}

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

.auth-footer {
    text-align: center;
    margin-top: 24px;
    color: var(--gray-500);
    font-size: 14px;
}

.auth-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

@media (max-width: 992px) {
    .auth-branding {
        display: none;
    }
}

/* ========================================
   HEADER
   ======================================== */

.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: white;
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    width: var(--sidebar-width);
}

.header-brand i {
    font-size: 24px;
}

.header-search {
    flex: 1;
    max-width: 400px;
    margin: 0 24px;
    position: relative;
}

.header-search input {
    width: 100%;
    padding: 10px 16px 10px 40px;
    border: 2px solid var(--gray-200);
    border-radius: 25px;
    font-size: 14px;
    background: var(--gray-50);
    transition: all 0.3s;
}

.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(43, 92, 138, 0.1);
}

.header-search i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gray-400);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    border: none;
    color: var(--gray-600);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.header-action-btn:hover {
    background: var(--gray-200);
    color: var(--primary);
}

.header-action-btn .badge-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    border: 2px solid white;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--border-radius-md);
    transition: background 0.2s;
}

.user-menu:hover {
    background: var(--gray-100);
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 14px;
}

.user-info {
    line-height: 1.3;
}

.user-info .name {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-800);
}

.user-info .role {
    font-size: 12px;
    color: var(--gray-500);
}

/* ========================================
   SIDEBAR
   ======================================== */

.main-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: white;
    border-right: 1px solid var(--gray-200);
    overflow-y: auto;
    z-index: 999;
    padding: 20px 0;
    transition: width 0.3s ease;
}

.sidebar-section {
    margin-bottom: 8px;
}

.sidebar-section-title {
    padding: 8px 24px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--gray-400);
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

.sidebar-nav li a:hover {
    background: var(--gray-50);
    color: var(--primary);
}

.sidebar-nav li a.active {
    background: rgba(43, 92, 138, 0.08);
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-nav li a i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* ========================================
   WELCOME CARD (DASHBOARD)
   ======================================== */

.welcome-card {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    border-radius: var(--border-radius-xl);
    padding: 30px;
    color: white;
    margin-bottom: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: -30%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 70%);
    border-radius: 50%;
}

.welcome-card h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.welcome-card p {
    opacity: 0.9;
    font-size: 15px;
}

/* ========================================
   QUICK ACTIONS
   ======================================== */

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.quick-action-card {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 24px;
    border: 1px solid var(--gray-200);
    text-decoration: none;
    color: var(--gray-700);
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.quick-action-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    color: var(--primary);
}

.quick-action-card i {
    font-size: 32px;
    color: var(--primary);
}

.quick-action-card span {
    font-weight: 600;
    font-size: 14px;
}

/* ========================================
   WIZARD STEPS
   ======================================== */

.wizard-steps {
    display: flex;
    justify-content: center;
    gap: 0;
    margin-bottom: var(--spacing-lg);
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    color: var(--gray-400);
    font-weight: 600;
    font-size: 14px;
    position: relative;
}

.wizard-step .step-number {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--gray-200);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.wizard-step.active {
    color: var(--primary);
}

.wizard-step.active .step-number {
    background: var(--primary);
    color: white;
}

.wizard-step.completed {
    color: var(--success);
}

.wizard-step.completed .step-number {
    background: var(--success);
    color: white;
}

.wizard-connector {
    width: 60px;
    height: 2px;
    background: var(--gray-200);
    align-self: center;
}

.wizard-connector.active {
    background: var(--primary);
}

/* ========================================
   MODAL OVERRIDES
   ======================================== */

.modal-content {
    border-radius: var(--border-radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
    padding: 20px 24px;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--gray-200);
    padding: 16px 24px;
}

/* ========================================
   EMPTY STATE
   ======================================== */

.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 64px;
    color: var(--gray-300);
    margin-bottom: 16px;
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--gray-600);
    margin-bottom: 8px;
}

.empty-state p {
    color: var(--gray-500);
    margin-bottom: 24px;
}

/* ========================================
   TAB STYLES
   ======================================== */

.nav-tabs-custom {
    border-bottom: 2px solid var(--gray-200);
    gap: 0;
}

.nav-tabs-custom .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    color: var(--gray-500);
    font-weight: 600;
    padding: 12px 20px;
    margin-bottom: -2px;
    transition: all 0.2s;
}

.nav-tabs-custom .nav-link:hover {
    color: var(--primary);
    border-bottom-color: var(--gray-300);
}

.nav-tabs-custom .nav-link.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: transparent;
}

/* ========================================
   SYSTEM STATUS
   ======================================== */

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online { background: var(--success); }
.status-dot.warning { background: var(--warning); }
.status-dot.offline { background: var(--danger); }

/* ========================================
   LOADING / WIRE TRANSITIONS
   ======================================== */

[wire\:loading] {
    display: inline-block;
}

.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* ========================================
   TOAST CONTAINER
   ======================================== */

.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast-item {
    padding: 14px 20px;
    border-radius: var(--border-radius-md);
    color: white;
    font-weight: 500;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    animation: slideInRight 0.3s ease;
    min-width: 300px;
}

.toast-item.success { background: var(--success); }
.toast-item.error { background: var(--danger); }
.toast-item.warning { background: var(--warning); }
.toast-item.info { background: var(--info); }

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Items table for comprobantes */
.items-table .remove-item {
    color: var(--danger);
    cursor: pointer;
    border: none;
    background: none;
    font-size: 18px;
    padding: 4px 8px;
}

.items-table .remove-item:hover {
    background: #fee;
    border-radius: var(--border-radius-sm);
}

/* Responsive sidebar */
@media (max-width: 992px) {
    .main-sidebar {
        transform: translateX(-100%);
    }
    .main-sidebar.show {
        transform: translateX(0);
    }
}
