:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --text-color: #2c3e50;
    --light-bg: #f5f6fa;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: #f6f7fb;
    color: var(--text-color);
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.login-form {
    background: var(--white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    width: 100%;
    max-width: 400px;
}

.logo-container {
    text-align: center;
    margin-bottom: 2rem;
}

.login-logo {
    max-width: 200px;
    height: auto;
    display: block;
    margin: 0 auto;
}

.login-form h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.form-group input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.btn {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--secondary-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-sm {
    width: auto;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn:hover {
    background-color: var(--primary-color);
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    min-height: 100vh;
    background: #fff;
    border-right: 1px solid #e3e6ea;
    padding: 32px 18px 18px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 280px;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 1000;
}

.sidebar .logo-company {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 18px;
}

.sidebar .btn {
    width: 100% !important;
    margin-bottom: 15px !important;
    text-align: left !important;
    padding: 12px 15px !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    display: flex !important;
    align-items: center !important;
    transition: background-color 0.3s !important;
}

.sidebar .btn i {
    width: 25px !important;
    text-align: center !important;
    margin-right: 10px !important;
    font-size: 1.1rem !important;
}

/* Estilos específicos para forzar separación uniforme */
.sidebar button.btn,
.sidebar a.btn {
    margin-bottom: 15px !important;
    padding: 12px 15px !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    display: flex !important;
    align-items: center !important;
}

/* Asegurar que el último botón no tenga margin-bottom */
.sidebar button.btn:last-child,
.sidebar a.btn:last-child {
    margin-bottom: 0 !important;
}

/* Estilos específicos para el botón de cerrar sesión */
.sidebar a[href="logout.php"] {
    width: 100% !important;
    padding: 12px 15px !important;
    border-radius: 8px !important;
    text-align: center !important;
    text-decoration: none !important;
    transition: all 0.3s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    font-size: 1rem !important;
}

.sidebar a[href="logout.php"] i {
    width: 25px !important;
    text-align: center !important;
    margin-right: 10px !important;
    font-size: 1.1rem !important;
}

/* Asegurar que el contenedor del botón de cerrar sesión tenga el ancho completo */
.sidebar > div:last-child {
    width: 100% !important;
}

.main-content {
    padding: 40px 30px;
    margin-left: 280px; /* Espacio para el sidebar fijo */
    width: calc(100% - 280px);
}

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

.logout-btn {
    padding: 0.5rem 1rem;
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
}

/* Users Table */
.users-table {
    width: 100%;
    background: var(--white);
    border-radius: 10px;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.users-table table {
    width: 100%;
    border-collapse: collapse;
}

.users-table th,
.users-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.users-table th {
    background-color: var(--primary-color);
    color: var(--white);
}

.users-table tr:hover {
    background-color: #f5f5f5;
}

.action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    margin-right: 0.5rem;
}

.edit-btn {
    background-color: var(--secondary-color);
    color: var(--white);
}

.delete-btn {
    background-color: var(--accent-color);
    color: var(--white);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background-color: var(--white);
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--light-gray);
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5em;
    color: var(--white);
    font-weight: 500;
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 130px); /* Altura máxima menos el espacio de header y footer */
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid var(--light-gray);
    background-color: var(--white);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    position: sticky;
    bottom: 0;
    z-index: 1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.close-modal {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    font-size: 1.2em;
    color: var(--white);
    cursor: pointer;
    padding: 8px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

/* Estilos específicos para el modal de usuarios */
.users-list-container {
    margin-bottom: 30px;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.users-list-container h3 {
    padding: 15px 20px;
    margin: 0;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: var(--white);
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    font-size: 1.2em;
    font-weight: 500;
}

.users-table-container {
    margin-top: 15px;
    overflow-x: auto;
    max-height: 300px; /* Altura máxima para la tabla de usuarios */
    overflow-y: auto;
}

#companyUsersTable {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 20px;
}

#companyUsersTable th {
    position: sticky;
    top: 0;
    background-color: #f5f5f5;
    z-index: 1;
}

#companyUsersTable th,
#companyUsersTable td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.add-user-container {
    border-top: 1px solid #eee;
    padding-top: 20px;
    margin-top: 20px;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.add-user-container h3 {
    padding: 15px 20px;
    margin: 0;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: var(--white) !important;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    font-size: 1.2em;
    font-weight: 500;
}

/* Ajustes para el scroll del modal */
.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Companies Table */
.companies-table {
    width: 100%;
    margin-top: 20px;
    overflow-x: auto;
}

.companies-table table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    min-width: 1200px;
}

.companies-table th {
    padding: 15px 10px;
    text-align: left;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.85em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    background-color: var(--primary-color);
    color: var(--white);
}

.companies-table th:first-child {
    padding-left: 15px;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.companies-table th:last-child {
    padding-right: 15px;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.companies-table td {
    padding: 12px 10px;
    background: var(--white);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    font-size: 0.9em;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.companies-table td:first-child {
    padding-left: 15px;
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.companies-table td:last-child {
    padding-right: 15px;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.companies-table tr {
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    border-radius: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.companies-table tr:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.companies-table .company-logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
    cursor: pointer;
}

.companies-table .company-logo:hover {
    transform: scale(1.1);
}

.companies-table .company-name {
    font-weight: 600;
    color: var(--primary-color);
}

.companies-table .company-info {
    color: var(--text-color);
    font-size: 0.9em;
}

.companies-table .company-contact {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.companies-table .company-contact span {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-color);
    font-size: 0.9em;
}

.companies-table .company-contact i {
    color: var(--secondary-color);
    font-size: 0.9em;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.status-badge.active {
    background-color: #e8f5e9;
    color: #2e7d32;
}

.status-badge.inactive {
    background-color: #ffebee;
    color: #c62828;
}

.status-badge i {
    font-size: 0.8em;
}

.action-btn {
    padding: 8px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.action-btn i {
    font-size: 0.9em;
}

.edit-btn {
    background-color: #e3f2fd;
    color: var(--secondary-color);
}

.edit-btn:hover {
    background-color: var(--secondary-color);
    color: var(--white);
}

.delete-btn {
    background-color: #ffebee;
    color: var(--accent-color);
}

.delete-btn:hover {
    background-color: var(--accent-color);
    color: var(--white);
}

.companies-table .company-address {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.9em;
    color: var(--text-color);
}

.companies-table .address-line {
    line-height: 1.4;
}

.companies-table .address-line:first-child {
    font-weight: 500;
}

/* Responsive table */
@media (max-width: 1400px) {
    .companies-table {
        overflow-x: auto;
    }
    
    .companies-table table {
        min-width: 1200px;
    }
}

@media (max-width: 768px) {
    .companies-table th:nth-child(4),
    .companies-table td:nth-child(4),
    .companies-table th:nth-child(5),
    .companies-table td:nth-child(5),
    .companies-table th:nth-child(6),
    .companies-table td:nth-child(6),
    .companies-table th:nth-child(7),
    .companies-table td:nth-child(7),
    .companies-table th:nth-child(8),
    .companies-table td:nth-child(8),
    .companies-table th:nth-child(9),
    .companies-table td:nth-child(9),
    .companies-table th:nth-child(10),
    .companies-table td:nth-child(10),
    .companies-table th:nth-child(11),
    .companies-table td:nth-child(11),
    .companies-table th:nth-child(12),
    .companies-table td:nth-child(12) {
        display: none;
    }
}

/* Header Actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.search-filter-container {
    display: flex;
    gap: 15px;
    flex: 1;
    max-width: 600px;
}

.search-box {
    position: relative;
    flex: 2;
}

.search-box input {
    width: 100%;
    padding: 10px 15px;
    padding-right: 40px;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    font-size: 0.95em;
    transition: all 0.3s ease;
    background-color: var(--white);
}

.search-box input:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

.search-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
    pointer-events: none;
}

.filter-box {
    position: relative;
    flex: 1;
}

.filter-box select {
    width: 100%;
    padding: 10px 15px;
    padding-right: 40px;
    border: 2px solid var(--light-gray);
    border-radius: 8px;
    font-size: 0.95em;
    appearance: none;
    background-color: var(--white);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-box select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    outline: none;
}

.filter-box i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--secondary-color);
    pointer-events: none;
    transition: transform 0.3s ease;
}

.filter-box select:focus + i {
    transform: translateY(-50%) rotate(180deg);
}

/* Responsive para el buscador y filtro */
@media (max-width: 768px) {
    .header-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    .search-filter-container {
        flex-direction: column;
        max-width: none;
    }

    .search-box,
    .filter-box {
        width: 100%;
    }
}

/* Estilos modernos para botones y controles del modal de usuarios */
.modal .btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.95em;
    text-transform: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.modal .btn i {
    font-size: 1em;
}

.modal .btn-primary {
    background: linear-gradient(135deg, var(--secondary-color), #2980b9);
    color: white;
}

.modal .btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, var(--secondary-color));
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.modal .btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
}

.modal .btn-secondary:hover {
    background: linear-gradient(135deg, #7f8c8d, #95a5a6);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.modal .btn-danger {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.modal .btn-danger:hover {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Estilos modernos para el selector de rol */
.modal select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background-color: white;
    font-size: 0.95em;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%232c3e50' 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 12px center;
    background-size: 16px;
    padding-right: 40px;
}

.modal select:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.1);
}

.modal select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    outline: none;
}

/* Estilos modernos para los botones de acción en la tabla */
.action-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-start;
}

#companyUsersTable .action-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

#companyUsersTable .action-btn i {
    font-size: 1.1em;
    transition: transform 0.3s ease;
}

#companyUsersTable .edit-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

#companyUsersTable .edit-btn:hover {
    background: linear-gradient(135deg, #2980b9, #3498db);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#companyUsersTable .edit-btn:hover i {
    transform: scale(1.1);
}

#companyUsersTable .delete-btn {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

#companyUsersTable .delete-btn:hover {
    background: linear-gradient(135deg, #c0392b, #e74c3c);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#companyUsersTable .delete-btn:hover i {
    transform: scale(1.1);
}

/* Tooltip para los botones de acción */
#companyUsersTable .action-btn::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 0.8em;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

#companyUsersTable .action-btn:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: -35px;
}

/* Estilos modernos para el checkbox */
.modal .checkbox-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
}

.modal .checkbox-container input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
}

.modal .checkbox-container input[type="checkbox"]:checked {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.modal .checkbox-container input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.modal .checkbox-container input[type="checkbox"]:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.1);
}

/* Estilos modernos para el modal de editar empresa */
#editCompanyModal .modal-content {
    max-width: 900px;
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
}

#editCompanyModal .modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 25px 30px;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
}

#editCompanyModal .modal-header h2 {
    color: white;
    font-size: 1.8em;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#editCompanyModal .modal-body {
    padding: 30px;
}

#editCompanyModal .form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

#editCompanyModal .form-group {
    margin-bottom: 25px;
}

#editCompanyModal .form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95em;
}

#editCompanyModal .form-group input,
#editCompanyModal .form-group textarea,
#editCompanyModal .form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95em;
    color: var(--text-color);
    transition: all 0.3s ease;
    background-color: white;
}

#editCompanyModal .form-group input:focus,
#editCompanyModal .form-group textarea:focus,
#editCompanyModal .form-group select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    outline: none;
}

#editCompanyModal .form-group input:hover,
#editCompanyModal .form-group textarea:hover,
#editCompanyModal .form-group select:hover {
    border-color: #bdc3c7;
}

#editCompanyModal .form-group textarea {
    min-height: 100px;
    resize: vertical;
}

#editCompanyModal h3 {
    color: var(--primary-color);
    font-size: 1.3em;
    margin: 30px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

#editCompanyModal .current-logo-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 2px dashed #e0e0e0;
    text-align: center;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

#editCompanyModal .current-logo-container:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#editCompanyModal .current-logo-container img {
    max-width: 200px;
    max-height: 100px;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#editCompanyModal .checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#editCompanyModal .checkbox-label:hover {
    background-color: rgba(52, 152, 219, 0.05);
}

#editCompanyModal .checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
    position: relative;
    transition: all 0.3s ease;
    margin: 0;
}

#editCompanyModal .checkbox-label input[type="checkbox"]:checked {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

#editCompanyModal .checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    color: white;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

#editCompanyModal .checkbox-label input[type="checkbox"]:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 2px 4px rgba(52, 152, 219, 0.1);
}

#editCompanyModal .modal-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

#editCompanyModal .modal-footer .btn {
    padding: 12px 25px;
    font-size: 1em;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#editCompanyModal .modal-footer .btn i {
    font-size: 1.1em;
}

#editCompanyModal .modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--secondary-color), #2980b9);
    color: white;
    border: none;
}

#editCompanyModal .modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#editCompanyModal .modal-footer .btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    border: none;
}

#editCompanyModal .modal-footer .btn-secondary:hover {
    background: linear-gradient(135deg, #7f8c8d, #95a5a6);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Estilos para el input de archivo */
#editCompanyModal input[type="file"] {
    padding: 10px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: white;
}

#editCompanyModal input[type="file"]:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#editCompanyModal input[type="file"]::-webkit-file-upload-button {
    background: linear-gradient(135deg, var(--secondary-color), #2980b9);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    margin-right: 10px;
    transition: all 0.3s ease;
}

#editCompanyModal input[type="file"]::-webkit-file-upload-button:hover {
    background: linear-gradient(135deg, #2980b9, var(--secondary-color));
}

/* Estilos modernos para el modal de nueva empresa */
#createCompanyModal .modal-content {
    max-width: 900px;
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
}

#createCompanyModal .modal-header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    padding: 25px 30px;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
}

#createCompanyModal .modal-header h2 {
    color: white;
    font-size: 1.8em;
    font-weight: 600;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#createCompanyModal .modal-body {
    padding: 30px;
}

#createCompanyModal .form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 20px;
}

#createCompanyModal .form-group {
    margin-bottom: 25px;
    position: relative;
}

#createCompanyModal .form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-color);
    font-weight: 500;
    font-size: 0.95em;
}

#createCompanyModal .form-group label::after {
    content: '*';
    color: var(--accent-color);
    margin-left: 4px;
    font-weight: bold;
}

#createCompanyModal .form-group label:not([for*="required"])::after {
    content: '';
}

#createCompanyModal .form-group input,
#createCompanyModal .form-group textarea,
#createCompanyModal .form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 0.95em;
    color: var(--text-color);
    transition: all 0.3s ease;
    background-color: white;
}

#createCompanyModal .form-group input:focus,
#createCompanyModal .form-group textarea:focus,
#createCompanyModal .form-group select:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.15);
    outline: none;
}

#createCompanyModal .form-group input:hover,
#createCompanyModal .form-group textarea:hover,
#createCompanyModal .form-group select:hover {
    border-color: #bdc3c7;
}

#createCompanyModal .form-group textarea {
    min-height: 100px;
    resize: vertical;
}

#createCompanyModal h3 {
    color: var(--primary-color);
    font-size: 1.3em;
    margin: 30px 0 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
    position: relative;
}

#createCompanyModal h3::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100px;
    height: 2px;
    background: linear-gradient(to right, var(--secondary-color), transparent);
}

#createCompanyModal .form-group input[type="file"] {
    padding: 10px;
    border: 2px dashed #e0e0e0;
    border-radius: 8px;
    width: 100%;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: white;
}

#createCompanyModal .form-group input[type="file"]:hover {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#createCompanyModal .form-group input[type="file"]::-webkit-file-upload-button {
    background: linear-gradient(135deg, var(--secondary-color), #2980b9);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    margin-right: 10px;
    transition: all 0.3s ease;
}

#createCompanyModal .form-group input[type="file"]::-webkit-file-upload-button:hover {
    background: linear-gradient(135deg, #2980b9, var(--secondary-color));
}

#createCompanyModal .modal-footer {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    border-radius: 0 0 12px 12px;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

#createCompanyModal .modal-footer .btn {
    padding: 12px 25px;
    font-size: 1em;
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
}

#createCompanyModal .modal-footer .btn i {
    font-size: 1.1em;
}

#createCompanyModal .modal-footer .btn-primary {
    background: linear-gradient(135deg, var(--secondary-color), #2980b9);
    color: white;
    border: none;
}

#createCompanyModal .modal-footer .btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, var(--secondary-color));
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#createCompanyModal .modal-footer .btn-secondary {
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    border: none;
}

#createCompanyModal .modal-footer .btn-secondary:hover {
    background: linear-gradient(135deg, #7f8c8d, #95a5a6);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Animación de entrada para el modal */
#createCompanyModal.modal.show .modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estilo para campos requeridos */
#createCompanyModal .form-group.required label::after {
    content: '*';
    color: var(--accent-color);
    margin-left: 4px;
    font-weight: bold;
}

/* Estilo para mensajes de ayuda */
#createCompanyModal .form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.85em;
    font-style: italic;
}

/* Estilo para grupos de campos relacionados */
#createCompanyModal .form-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}

#createCompanyModal .form-section:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Tabla moderna para tarifas */
.table-modern {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    background: #fff;
}
.table-modern th {
    background: #f8fafc;
    color: #222;
    font-weight: 600;
    border-bottom: 2px solid #e3e6ea;
}
.table-modern td {
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}
.table-modern tr:hover {
    background: #f6faff;
}

/* Botón usuarios más visible */
.btn-usuarios {
    background: linear-gradient(90deg, #4f8cff 0%, #6ed0fa 100%);
    color: #fff;
    border: none;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(79,140,255,0.08);
    transition: background 0.2s;
}
.btn-usuarios:hover {
    background: linear-gradient(90deg, #357ae8 0%, #4fc3f7 100%);
    color: #fff;
}

/* Desplegable de usuarios */
.usuarios-row td {
    background: #f8fafc;
    border-bottom: 2px solid #e3e6ea;
    border-radius: 0 0 12px 12px;
}
.usuarios-row .table {
    margin-bottom: 0;
    background: transparent;
}
.usuarios-row input[type=number] {
    max-width: 90px;
    border-radius: 6px;
    border: 1px solid #d0d7de;
    background: #fff;
    font-size: 0.95em;
}
.usuarios-row .guardar-tarifa-usuario {
    background: #4f8cff;
    color: #fff;
    border-radius: 6px;
    font-size: 0.95em;
    padding: 3px 14px;
}
.usuarios-row .guardar-tarifa-usuario:hover {
    background: #357ae8;
}

.suma-total-badge {
    background: linear-gradient(90deg, #4f8cff 0%, #6ed0fa 100%);
    color: #fff;
    border-radius: 16px;
    padding: 2px 14px;
    font-weight: 600;
    font-size: 1em;
    margin-left: 8px;
    box-shadow: 0 1px 4px rgba(79,140,255,0.10);
}

/* Estilos para la tabla de tarifas */
.table-tarifas tbody tr:nth-child(odd) {
    background-color: #f0f4f8;
}

.table-tarifas tbody tr:nth-child(even) {
    background-color: #ffffff;
}

.table-tarifas tbody tr:hover {
    background-color: #e3eaf3 !important;
}

.table-tarifas td {
    border-bottom: 1px solid #e9ecef;
    padding: 12px 15px;
}

.table-tarifas th {
    background-color: #f8fafc;
    border-bottom: 2px solid #dee2e6;
    padding: 12px 15px;
}

/* Estilos para la tabla de tarifas tipo ficha */
.table-tarifas {
    border-collapse: separate;
    border-spacing: 0 16px;
    width: 100%;
    margin-top: 8px;
}

.table-tarifas tbody tr {
    background-color: #ffffff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.06);
    border-radius: 12px;
    margin-bottom: 16px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.table-tarifas tbody tr:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    filter: brightness(0.98);
}

.table-tarifas td {
    padding: 20px;
    border: none;
    vertical-align: middle;
    position: relative;
}

.table-tarifas td:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.table-tarifas td:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

.table-tarifas thead {
    display: none;
}

.table-tarifas tbody tr td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.75em;
    color: #64748b;
    margin-bottom: 6px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table-tarifas .input-group {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    padding: 6px;
    backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    transition: all 0.3s ease;
}

.table-tarifas .input-group:focus-within {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    background: rgba(255, 255, 255, 0.95);
}

.table-tarifas .input-group-text {
    background: transparent;
    border: none;
    color: #64748b;
    font-weight: 500;
}

.table-tarifas .form-control {
    border: none;
    background: transparent;
    font-size: 1.1em;
    font-weight: 500;
    color: #1e293b;
    padding: 8px 12px;
}

.table-tarifas .form-control:focus {
    box-shadow: none;
}

/* Colores pastel mejorados para las fichas */
.table-tarifas tbody tr:nth-child(4n+1) {
    background: linear-gradient(135deg, #f8e8ff 0%, #fff 100%);
    border-left: 5px solid #d8b4fe;
}

.table-tarifas tbody tr:nth-child(4n+2) {
    background: linear-gradient(135deg, #e0f2fe 0%, #fff 100%);
    border-left: 5px solid #7dd3fc;
}

.table-tarifas tbody tr:nth-child(4n+3) {
    background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
    border-left: 5px solid #86efac;
}

.table-tarifas tbody tr:nth-child(4n+4) {
    background: linear-gradient(135deg, #fff7ed 0%, #fff 100%);
    border-left: 5px solid #fdba74;
}

.table-tarifas tbody tr:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    filter: brightness(0.98);
}

/* Mejora del botón de usuarios */
.btn-usuarios {
    background: linear-gradient(135deg, #4f8cff 0%, #6ed0fa 100%);
    color: #fff;
    border: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(79,140,255,0.15);
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-usuarios:hover {
    background: linear-gradient(135deg, #357ae8 0%, #4fc3f7 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79,140,255,0.25);
    color: #fff;
}

.btn-usuarios i {
    font-size: 1.1em;
}

/* Mejora del badge del total */
.suma-total-badge {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 24px;
    font-weight: 600;
    font-size: 1.1em;
    background: linear-gradient(135deg, #4f8cff 0%, #6ed0fa 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(79,140,255,0.15);
    transition: all 0.3s ease;
}

.suma-total-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79,140,255,0.25);
}

/* Mejora del desplegable de usuarios */
.usuarios-row td {
    background: rgba(248, 250, 252, 0.95) !important;
    backdrop-filter: blur(8px);
    border-radius: 0 0 12px 12px !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    margin-top: -16px;
    padding: 24px !important;
    border-top: 1px solid rgba(0,0,0,0.05);
}

.usuarios-row .table {
    margin-bottom: 0;
    background: transparent;
}

.usuarios-row .table th {
    font-size: 0.85em;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px;
    border-bottom: 2px solid rgba(0,0,0,0.05);
}

.usuarios-row .table td {
    padding: 12px;
    vertical-align: middle;
}

.usuarios-row .guardar-tarifa-usuario {
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    color: #fff;
    border: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(16,185,129,0.15);
    transition: all 0.3s ease;
}

.usuarios-row .guardar-tarifa-usuario:hover {
    background: linear-gradient(135deg, #059669 0%, #10b981 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16,185,129,0.25);
}

/* Mejora del buscador */
#searchInput {
    border-radius: 12px;
    padding: 12px 20px;
    border: 2px solid #e2e8f0;
    font-size: 1.1em;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

#searchInput:focus {
    border-color: #4f8cff;
    box-shadow: 0 4px 12px rgba(79,140,255,0.1);
}

#searchInput::placeholder {
    color: #94a3b8;
}

.config-section {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.section-header {
    background: white !important;
    color: #333 !important;
    border-radius: 10px;
    padding: 18px 28px;
    margin-bottom: 32px;
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 1px;
    border: none !important;
}

.form-label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-control {
    border-radius: 8px;
    border: 1px solid #ddd;
    padding: 12px 15px;
}

.form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.btn-primary {
    background: #0d6efd;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
}

.btn-secondary {
    background: #6c757d;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-weight: 600;
}

.alert {
    border-radius: 8px;
    border: none;
}

.status-active {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-inactive {
    background: #ffebee;
    color: #c62828;
}

.help-text {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px 15px;
    }
    
    .sidebar {
        position: relative;
        width: 100%;
        min-height: auto;
    }
    
    .dashboard {
        flex-direction: column;
    }
}

/* Estilos del sidebar - FORZAR UNIFORMIDAD EN TODAS LAS SECCIONES */
.dashboard .sidebar {
    min-height: 100vh !important;
    background: #fff !important;
    border-right: 1px solid #e3e6ea !important;
    padding: 32px 18px 18px 18px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    width: 280px !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    z-index: 1000 !important;
}

.dashboard .sidebar .logo-section {
    text-align: center !important;
    margin-bottom: 30px !important;
}

.dashboard .sidebar .logo-company {
    width: 120px !important;
    height: 120px !important;
    object-fit: contain !important;
    margin-bottom: 18px !important;
}

.dashboard .sidebar h4 {
    color: #222 !important;
    font-weight: 600 !important;
    margin: 0 !important;
    font-size: 1.25rem !important;
    line-height: 1.4 !important;
}

/* Contenedor de botones del menú */
.dashboard .sidebar > div:nth-child(2) {
    width: 100% !important;
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
}

/* TODOS los botones del sidebar - FORZAR UNIFORMIDAD */
.dashboard .sidebar button.btn,
.dashboard .sidebar a.btn {
    width: 100% !important;
    margin-bottom: 15px !important;
    text-align: left !important;
    padding: 12px 15px !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-size: 1rem !important;
    transition: background-color 0.3s !important;
    display: flex !important;
    align-items: center !important;
    text-decoration: none !important;
    box-sizing: border-box !important;
}

/* TODOS los iconos del sidebar - FORZAR UNIFORMIDAD */
.dashboard .sidebar button.btn i,
.dashboard .sidebar a.btn i {
    width: 25px !important;
    text-align: center !important;
    margin-right: 10px !important;
    font-size: 1.1rem !important;
    flex-shrink: 0 !important;
}

/* Contenedor del botón de cerrar sesión */
.dashboard .sidebar > div:last-child {
    width: 100% !important;
    margin-top: auto !important;
}

/* Botón de cerrar sesión específico */
.dashboard .sidebar a[href="logout.php"] {
    background: transparent !important;
    color: #dc3545 !important;
    border: 1px solid #dc3545 !important;
    justify-content: center !important;
}

/* Eliminar margin-bottom del último botón */
.dashboard .sidebar > div:last-child .btn {
    margin-bottom: 0 !important;
}

/* Estilos específicos para forzar separación uniforme */
.sidebar .btn {
    width: 100% !important;
    margin-bottom: 15px !important;
    text-align: left !important;
    padding: 12px 15px !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    display: flex !important;
    align-items: center !important;
    transition: background-color 0.3s !important;
}

.sidebar .btn i {
    width: 25px !important;
    text-align: center !important;
    margin-right: 10px !important;
    font-size: 1.1rem !important;
}

/* Estilos específicos para forzar separación uniforme */
.sidebar button.btn,
.sidebar a.btn {
    margin-bottom: 15px !important;
    padding: 12px 15px !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    display: flex !important;
    align-items: center !important;
}

/* Asegurar que el último botón no tenga margin-bottom */
.sidebar button.btn:last-child,
.sidebar a.btn:last-child {
    margin-bottom: 0 !important;
}

/* Estilos específicos para el botón de cerrar sesión */
.sidebar a[href="logout.php"] {
    width: 100% !important;
    padding: 12px 15px !important;
    border-radius: 8px !important;
    text-align: center !important;
    text-decoration: none !important;
    transition: all 0.3s !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    font-size: 1rem !important;
}

.sidebar a[href="logout.php"] i {
    width: 25px !important;
    text-align: center !important;
    margin-right: 10px !important;
    font-size: 1.1rem !important;
}

/* Asegurar que el contenedor del botón de cerrar sesión tenga el ancho completo */
.sidebar > div:last-child {
    width: 100% !important;
}

#notesTable, #notesTable th, #notesTable td {
    width: 100% !important;
    min-width: unset !important;
    table-layout: auto !important;
}

#notesTable_wrapper, #notesTable {
    width: 100% !important;
    overflow-x: auto;
    display: block;
} 

/* ESTILO PLANO PARA EMAILS */
.email-item {
    background: #fff;
    border-radius: 10px;
    /* Eliminar sombra y borde para evitar efecto de cuadros anidados */
    box-shadow: none !important;
    border: none !important;
    margin: 16px 32px;
    padding: 18px 20px;
    display: flex;
    align-items: center;
}

.email-item:hover {
    background: #f5faff;
    box-shadow: none !important;
    border: none !important;
} 

/* Estilos para los botones de acción de carpetas */
.folder-item {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

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

.folder-item.custom-folder {
    background-color: #e3f2fd;
    border-left: 3px solid #2196f3;
}

.folder-item.custom-folder:hover {
    background-color: #bbdefb;
}

.folder-actions {
    display: none;
    gap: 5px;
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
}

.folder-item:hover .folder-actions {
    display: flex !important;
}

/* Asegurar que los botones se muestren en carpetas personalizadas */
.folder-item .folder-actions {
    display: none;
}

.folder-item:hover .folder-actions {
    display: flex !important;
}

.folder-actions button {
    padding: 4px 8px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.3s;
}

.folder-actions .edit-folder-btn {
    background-color: #ffc107;
    color: #000;
}

.folder-actions .edit-folder-btn:hover {
    background-color: #ffb300;
}

.folder-actions .delete-folder-btn {
    background-color: #dc3545;
    color: #fff;
}

.folder-actions .delete-folder-btn:hover {
    background-color: #c82333;
}

.folder-name {
    flex: 1;
    margin-right: 10px;
}

/* --- Mejora visual para el pie de correo en el modal de Nuevo Email --- */
#emailSignaturePreview {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1em;
    color: #333;
    background: #f8f9fa;
    border-radius: 6px;
    padding: 12px 16px;
    overflow-x: auto;
    word-break: break-word;
}
#emailSignaturePreview table {
    width: auto;
    max-width: 100%;
    border-collapse: collapse;
    background: transparent;
}
#emailSignaturePreview td, #emailSignaturePreview th {
    border: none;
    background: transparent;
    padding: 4px 8px;
}
#emailSignaturePreview img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 4px 0;
}
#emailSignaturePreview a {
    color: #1976d2;
    text-decoration: underline;
    word-break: break-all;
}
#emailSignaturePreview strong, #emailSignaturePreview b {
    color: #222;
}
#emailSignaturePreview .email-signature-table {
    width: 100% !important;
    max-width: 100% !important;
    border-collapse: collapse !important;
}
@media (max-width: 600px) {
    #emailSignaturePreview table, #emailSignaturePreview tr, #emailSignaturePreview td, #emailSignaturePreview th {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
}