/* Base Reset */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #f8f9fa;
    overflow-x: hidden;
    margin-top: 0px !important;
}

/* Variables */
:root {
    --sidebar-width: 250px;
    --header-height: 60px;
    --primary-color: #4e73df;
    --sidebar-dark: #343a40;
    --sidebar-dark-active: #1f2d3d;
    --sidebar-white: #fff;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--sidebar-white);
    transition: all 0.3s;
    z-index: 1000;
    border-right: 1px solid #e3e6f0;
}

.sidebar-brand {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding-left: 15px;
    font-weight: 700;
    font-size: 1.2rem;
    background: rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #e3e6f0;
}

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

.nav-item {
    position: relative;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: #000;
    text-decoration: none;
    transition: all 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: #4e73df;
    background: rgba(0, 0, 0, 0.05);
}

.nav-link i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.nav-link .arrow {
    margin-left: auto;
    transition: transform 0.3s;
}

.nav-link.collapsed .arrow {
    transform: rotate(-90deg);
}

.submenu {
    list-style: none;
    padding-left: 35px;
    background: rgba(0, 0, 0, 0.05);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.submenu.show {
    max-height: 500px;
}

.submenu .nav-link {
    padding: 8px 20px;
    font-size: 0.9rem;
}

/* Main Panel Structure */
.crm-client-panel {
    display: flex;
    min-height: 100vh;
}

.main-content {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s;
}

/* Header */
.topbar {
    height: var(--header-height);
    background: white;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.topbar .search-bar {
    flex-grow: 1;
    max-width: 500px;
}

.user-menu {
    display: flex;
    align-items: center;
}

.user-menu .dropdown-toggle {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
}

.user-menu img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.user-menu .user-name {
    margin-right: 5px;
}

/* Content */
.content-wrapper {
    padding: 20px;
    flex: 1; /* hace que crezca y empuje el footer hacia abajo */
}

.card {
    border: none;
    border-radius: 0.35rem;
    box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.1);
    margin-bottom: 20px;
    min-width: 0;
    word-wrap: break-word;
}

.card-header {
    background-color: #f8f9fc;
    border-bottom: 1px solid #e3e6f0;
    font-weight: 600;
}

/* Ticket Styles */
.ticket-header {
    background-color: #f8f9fa;
    border-left: 4px solid #4e73df;
}

.ticket-content {
    border-left: 4px solid #1cc88a;
}

.reply {
    border-left: 4px solid #36b9cc;
}

/* Badges */
.badge.bg-warning { color: #1f2d3d; }
.badge.bg-primary,
.badge.bg-success,
.badge.bg-danger,
.badge.bg-info,
.badge.bg-secondary {
    color: white;
}

/* Formulario */
.needs-validation .invalid-feedback { display: none; }
.needs-validation.was-validated .form-control:invalid ~ .invalid-feedback,
.needs-validation.was-validated .form-control:invalid ~ .invalid-tooltip {
    display: block;
}

/* Attachments */
.attachments ul {
    margin-top: 0.5rem;
    padding-left: 0;
}

.attachments li {
    margin-bottom: 0.3rem;
}

.attachments a {
    color: #4e73df;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.attachments a:hover {
    text-decoration: underline;
}

.attachments .fa-paperclip {
    color: #6c757d;
}

.attachments .fa-file,
.attachments .fa-file-pdf,
.attachments .fa-file-word,
.attachments .fa-file-excel,
.attachments .fa-file-image {
    margin-left: 0.3rem;
    font-size: 0.9em;
}

.fs-6 {
    font-size: 0.9rem !important;
}

.text-gray-700 {
    color: #b4b4b4;
}

/* Carrito */
.cart-dropdown {
    max-height: 70vh;
    overflow-y: auto;
}

.cart-item {
    transition: all 0.3s;
}
.cart-item:hover {
    background-color: #f8f9fa;
}

/* Modal */
#serviceDetailsModal .modal-body img {
    max-height: 300px;
    object-fit: contain;
}

/* Notificaciones */
.alert.fixed-top {
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    max-width: 500px;
    z-index: 9999;
}

.img-block {
    margin: auto;
    width: 100%;
    height: 450px;
    overflow: hidden;
}

.card-img-top {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.color-dark {
    color: #000 !important;
}

.payment-method-btn {
    margin: 0.5rem;
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

#paypal-button-container {
    min-height: 50px;
    margin: 1rem 0;
}

#card-element {
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    padding: 0.5rem 0.75rem;
}

.modal-content {
    border-radius: 0.5rem;
}

/* ========================== */
/* RESPONSIVE AJUSTES MÓVIL  */
/* ========================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        position: fixed;
        z-index: 1050;
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        width: 100%;
    }

    .topbar .search-bar {
        display: none;
    }

    .card .card-text.display-4 {
        font-size: 2rem;
    }

    .card .card-title {
        font-size: 1rem;
    }

    .row {
        gap: 1rem;
    }

    .container,
    .container-fluid {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* Estilos para el contenedor de carga de PayPal */
.paypal-loading-container {
    min-height: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

/* Asegurar que los botones de PayPal tengan espacio adecuado */
#paypal-button-container {
    width: 100%;
    min-height: 200px;
    margin: 1rem 0;
}

/* Estilos para el modal de PayPal */
#paypalPaymentModal .modal-dialog {
    max-width: 400px;
}


/* Notificaciones */
.noti-dropdown {
    max-height: 400px;
    overflow-y: auto;
}

.noti-dropdown .dropdown-item {
    white-space: normal;
    padding: 0.75rem 1rem;
}

.noti-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
}

.noti-dropdown .fa {
    font-size: 1.25rem;
    margin-top: 0.25rem;
}

.noti-dropdown .text-primary { background-color: rgba(13,110,253,.1); }
.noti-dropdown .text-success { background-color: rgba(25,135,84,.1); }
.noti-dropdown .text-danger { background-color: rgba(220,53,69,.1); }
.noti-dropdown .text-warning { background-color: rgba(255,193,7,.1); }
.noti-dropdown .text-info { background-color: rgba(13,202,240,.1); }

.notification-read {
    opacity: 0.7;
    background-color: #f8f9fa;
    border-left: 3px solid #6c757d;
}

.notification-unread {
    background-color: rgb(203 234 253 / 80%);
    border-left: 3px solid #0da7fd;
}

.notification-paid {
    background-color: rgba(153, 253, 207, 0.161);
    border-left: 3px solid #198754;
}

.notification-read .text-muted {
    color: #6c757d !important;
}


/* Frontend General Styles */
.crm-front-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.crm-front-card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    padding: 20px;
}

/* Dashboard */
.crm-dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.crm-stat-card {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 20px;
    text-align: center;
}

.crm-stat-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 10px 0;
    color: #007bff;
}

.crm-stat-label {
    font-size: 0.9rem;
    color: #6c757d;
}

/* Tables */
.crm-front-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.crm-front-table th, .crm-front-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.crm-front-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

/* Forms */
.crm-front-form-group {
    margin-bottom: 1.5rem;
}

.crm-front-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.crm-front-input {
    display: block;
    width: 100%;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.crm-front-input:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
}

/* Buttons */
.crm-front-btn {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 0.25rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.crm-front-btn-primary {
    color: #fff;
    background-color: #007bff;
    border-color: #007bff;
}

.crm-front-btn-primary:hover {
    color: #fff;
    background-color: #0069d9;
    border-color: #0062cc;
}

/* Invoice Styles */
.crm-invoice {
    background: #fff;
    padding: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.crm-invoice-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
}

.crm-invoice-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.crm-invoice-details {
    text-align: right;
}

.crm-invoice-items {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.crm-invoice-items th {
    background-color: #f8f9fa;
    text-align: left;
    padding: 10px;
}

.crm-invoice-items td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.crm-invoice-totals {
    margin-left: auto;
    width: 300px;
}

.crm-invoice-totals table {
    width: 100%;
}

.crm-invoice-totals td:last-child {
    text-align: right;
}

.crm-invoice-total {
    font-weight: 700;
    font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .crm-invoice-header {
        flex-direction: column;
    }
    
    .crm-invoice-details {
        text-align: left;
        margin-top: 20px;
    }
    
    .crm-invoice-totals {
        width: 100%;
    }
}


/* Panel principal */
.crm-client-panel {
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 0 10px rgba(0,0,0,0.05);
    overflow: hidden;
}

/* Encabezado */
.crm-client-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crm-client-header h2 {
    margin: 0;
    color: #333;
}

.crm-status-badge {
    background: #28a745;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 0.8em;
}

/* Navegación */
.crm-client-nav {
    background: #fff;
    border-bottom: 1px solid #dee2e6;
}

.crm-client-nav .nav-tabs {
    border-bottom: none;
}

.crm-client-nav .nav-link {
    border: none;
    color: #495057;
    padding: 12px 20px;
    font-weight: 500;
}

.crm-client-nav .nav-link.active {
    color: #007bff;
    background: transparent;
    border-bottom: 2px solid #007bff;
}

.crm-client-nav .nav-link i {
    margin-right: 8px;
}

/* Contenido */
.crm-client-content {
    padding: 20px;
}

/* Alertas */
.crm-alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.crm-alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.crm-alert-warning {
    background-color: #fff3cd;
    border-color: #ffeeba;
    color: #856404;
}

.crm-alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.crm-login-required {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.crm-login-required .card {
    border: none;
    border-radius: 12px;
}

.crm-login-required .btn {
    border-radius: 8px;
    font-weight: 500;
}

.crm-login-required .fa-lock,
.crm-login-required .fa-exclamation-circle {
    opacity: 0.8;
}

.mayu {
  text-transform: uppercase !important;
}

.table thead th{
  color: #000 !important;
  text-align: left; /* asegura alineación */
  font-weight: 700;
}

.table tbody td {
  color: #000 !important;
  text-align: left; /* asegura alineación */
}

/* Overlay para móvil */
#sidebarOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
}

/* Sidebar para móvil */
@media (max-width: 768px) {
    .sidebar {
        background-color: #fff !important; /* Fondo sólido */
        color: #333 !important;            /* Texto visible */
    }

    .sidebar-nav li a {
        display: block;
        padding: 12px 16px;
        color: #333 !important;
        font-weight: 500;
        text-decoration: none;
    }

    .sidebar-nav li a:hover {
        background-color: #f5f5f5;
    }
}


@media (min-width: 769px) {
    #sidebarOverlay {
        display: none !important;
    }
}

/* Prevenir scroll del body cuando el sidebar está abierto */
body.sidebar-open {
    overflow: hidden;
}


