/* Anchos de columnas para tablas de clientes */
#clientes-table col.col-cliente { width: 40%; }
#clientes-table col.col-contacto { width: 30%; }
#clientes-table col.col-lista { width: 20%; }
#clientes-table col.col-acciones { width: 10%; min-width: 160px; }

@media (max-width: 768px) {
    #clientes-table col.col-cliente { width: 75% !important; }
    #clientes-table col.col-acciones { width: 25% !important; min-width: 0 !important; }
    #clientes-table col.col-contacto,
    #clientes-table col.col-lista {
        width: 0 !important;
        display: none !important;
    }
}
@media (max-width: 768px) {
    #clientes-table colgroup col:nth-child(1),
    #clientes-table colgroup col:nth-child(4) {
        width: 50% !important;
    }
    #clientes-table th,
    #clientes-table td {
        width: auto;
    }
    #clientes-table th:nth-child(2),
    #clientes-table td:nth-child(2),
    #clientes-table th:nth-child(3),
    #clientes-table td:nth-child(3) {
        display: none !important;
    }
}
@media (max-width: 768px) {
    .system-title {
        display: none !important;
    }
    html, body, .system-body, .system-container, .system-main {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        width: 100vw !important;
        box-sizing: border-box;
    }
    .system-header, .system-toolbar {
        max-width: 100vw !important;
        width: 100vw !important;
    }
    .system-content {
        padding-left: 8px;
        padding-right: 8px;
    }
}
/* Sistema Comercial - Dark Theme CSS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.system-body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    color: #1a1a1a;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    line-height: 1.6;
}

.system-container {
    display: flex;
    min-height: 100vh;
}

/* Header/Navbar Styles */
.system-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #2d2d2d;
    color: white;
    padding: 12px 24px;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    border-bottom: 1px solid #404040;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.system-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.system-logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.system-logo i {
    font-size: 24px;
    color: #4CAF50;
}

.system-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
}

.system-user {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #ffffff;
    font-size: 14px;
}

.logout-btn {
    color: #ff6b6b;
    text-decoration: none;
    font-size: 18px;
    transition: color 0.3s ease;
}

.logout-btn:hover {
    color: #ff5252;
}

/* Sidebar Styles */
.system-sidebar {
    position: fixed;
    left: 0;
    top: 60px;
    width: 70px;
    height: calc(100vh - 60px);
    background: #2d2d2d;
    border-right: 1px solid #404040;
    z-index: 999;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.system-sidebar:hover {
    width: 250px;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.3);
}

.system-menu {
    width: 100%;
    height: 100%;
    position: relative;
}

.system-menu ul {
    list-style: none;
    padding: 12px 0;
    margin: 0;
    width: 100%;
}

.system-menu ul li {
    width: 100%;
}

.menu-item {
    position: relative;
    width: 100%;
}

.menu-item a {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 20px;
    color: #b3b3b3;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    white-space: nowrap;
    min-height: 56px;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.menu-item a:hover {
    background: linear-gradient(90deg, #3a3a3a 0%, #424242 100%);
    color: #ffffff;
    transform: translateX(2px);
}

.menu-item.active a {
    background: var(--color-primary) !important;
    color: #ffffff !important;
    box-shadow: inset 3px 0 0 var(--color-primary-dark, #333) !important;
}

.menu-item.active a::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: #ffffff;
    opacity: 0.3;
}

.menu-item a i {
    font-size: 20px;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.menu-item a:hover i {
    transform: scale(1.1);
}

.menu-item a span {
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
    margin-left: -8px;
}

.system-sidebar:hover .menu-item a span {
    opacity: 1;
    margin-left: 0;
}

/* Tooltip mejorado para items del menú */
.menu-item::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 80px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #333 0%, #444 100%);
    color: white;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1001;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid #555;
}

.menu-item::before {
    content: '';
    position: absolute;
    left: 72px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 8px solid #333;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    z-index: 1001;
    pointer-events: none;
}

.system-sidebar:not(:hover) .menu-item:hover::after,
.system-sidebar:not(:hover) .menu-item:hover::before {
    opacity: 1;
    visibility: visible;
}

.system-sidebar:not(:hover) .menu-item:hover::after {
    transform: translateY(-50%) translateX(8px);
}

.system-sidebar:not(:hover) .menu-item:hover::before {
    transform: translateY(-50%) translateX(4px);
}

/* Indicador de estado colapsado */

/* Main Content Styles */
.system-main {
    margin-left: 70px;
    margin-top: 60px;
    flex: 1;
    min-height: calc(100vh - 60px);
    background: #f5f5f5;
    transition: margin-left 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Ajustar margin-left cuando el sidebar está expandido */
.system-sidebar.expanded ~ .system-main {
    margin-left: 250px;
}

.system-content {
    padding: 24px;
    min-height: calc(100vh - 60px);
}

/* Page Header */
.page-header {
    border-bottom: none !important;
    margin-bottom: 32px;
}

.page-title h1 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 16px;
    color: #6c757d;
.mobile-menu-toggle {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    border-radius: 0;
    transition: all 0.2s ease;
    display: none;
    margin-right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-width: 60px;
    width: 60px;
    height: 60px;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 1100;
    box-sizing: border-box;
    outline: none;
    border: none;
    -webkit-appearance: none;
    appearance: none;
}

.mobile-menu-toggle:hover {
     /* No background or transform for flat icon */
}

.mobile-menu-toggle:active {
     /* No transform for flat icon */
}
    margin: 0;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #4CAF50;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.warning {
    background: #FF9800;
}

.stat-icon.danger {
    background: #f44336;
}

.stat-icon.info {
    background: #2196F3;
}

.stat-info {
    flex: 1;
}

.stat-number {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.2;
}

.stat-label {
    font-size: 14px;
    color: #6c757d;
    margin-top: 4px;
}

/* Toolbar */
.system-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 0;
    position: relative;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.btn-primary {
    background: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #c6c8ca;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-success {
    background: #28a745;
    color: white;
}

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-warning:hover {
    background: #e0a800;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 8px;
    color: #1a1a1a;
    font-size: 14px;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary) !important;
    box-shadow: 0 0 0 3px var(--color-primary-alpha, rgba(76,175,80,0.1)) !important;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    padding-right: 40px;
}

/* Search Input */
.search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    background: #ffffff;
    border: 1px solid #ced4da;
    border-radius: 8px;
    color: #1a1a1a;
    font-size: 14px;
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 14px;
}

/* Tables */
.table-container {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.table th {
    background: #1582c7 !important;
    font-weight: 600;
    color: #ffffff !important;
    font-size: 14px;
}

.table td {
    color: #1a1a1a;
    font-size: 14px;
}

.table tbody tr:hover {
    background: #f8f9fa;
}

/* Cards */
.card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.card-header {
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 16px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
        background: transparent;
        border-radius: 0;
    }
    .mobile-menu-toggle {
        display: flex;
        height: 60px;
        min-width: 60px;
        width: 60px;
        border-radius: 0 6px 6px 0;
        z-index: 1001;
        padding: 0;
    }
    .system-sidebar {
        width: 60px;
        transform: translateX(-100%);
        transition: all 0.3s ease;
    }
    
    .system-sidebar:hover {
        width: 200px;
        transform: translateX(0);
        box-shadow: 4px 0 20px rgba(0, 0, 0, 0.4);
    }
    
    .system-sidebar.mobile-open {
        transform: translateX(0);
        width: 200px;
    }
    
    /* Tooltips deshabilitados en móvil */
    .system-sidebar .menu-item::after,
    .system-sidebar .menu-item::before {
        display: none;
    }
    
    /* Los textos siempre visibles en hover móvil */
    .system-sidebar:hover .menu-item a span,
    .system-sidebar.mobile-open .menu-item a span {
        opacity: 1;
        margin-left: 0;
    }
    
    /* Overlay para cerrar sidebar en móvil */
    .system-sidebar:hover::before,
    .system-sidebar.mobile-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        animation: fadeIn 0.3s ease;
    }
    
    .system-main {
        margin-left: 0 !important;
    }
    .system-sidebar.mobile-open ~ .system-main {
        margin-left: 200px !important;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .system-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toolbar-left,
    .toolbar-right {
        justify-content: center;
    }
}

/* Tablet breakpoint */
@media (max-width: 1024px) and (min-width: 769px) {
    .system-sidebar {
        width: 65px;
    }
    
    .system-sidebar:hover {
        width: 220px;
    }
    
    .system-main {
        margin-left: 65px;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f5f5f5;
}

::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Loading Spinner */
.spinner {
    border: 3px solid #e0e0e0;
    border-top: 3px solid #4CAF50;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    #clientes-table {
        width: 100% !important;
        table-layout: fixed !important;
    }
    #clientes-table th:nth-child(1),
    #clientes-table td:nth-child(1) {
        width: 75% !important;
        box-sizing: border-box;
    }
    #clientes-table th:nth-child(4),
    #clientes-table td:nth-child(4) {
        width: 25% !important;
        box-sizing: border-box;
    }
    .action-buttons {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5em;
        justify-content: center;
    }
    .action-buttons button {
        flex: 1 1 40%;
        min-width: 40px;
        max-width: 48%;
        margin-bottom: 0.3em;
    }
    .action-buttons button:nth-child(odd) {
        margin-right: 0.3em;
    }
    .action-buttons button:nth-child(2n) {
        margin-right: 0;
    }
}
.dashboard .system-main {
    padding-top: 60px;
    padding-left: 70px;
}

/* Estilo base para todos los toolbars */
[class*="-toolbar"] {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #504c4c !important;
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid #404040;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    flex-wrap: nowrap;
}

[class*="-toolbar"] input,
[class*="-toolbar"] select {
    background: #504c4c !important;
}

/* Estilo general para labels de formularios */
.form-label {
    font-weight: 500 !important;
    color: black !important;
    font-size: 0.9rem !important;
}

/* Estilo general para inputs, selects y textareas de formularios */
.form-group input,
.form-group select,
.form-group textarea {
    background: #ffffff;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 0.75rem;
    color: black;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
    width: 100%;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #1582c7;
    box-shadow: 0 0 0 3px rgba(21, 130, 199, 0.1);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: #888;
    opacity: 0.7;
}

.form-group select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    padding-right: 40px;
    cursor: pointer;
}

.form-group select option {
    background: #ffffff;
    color: black;
}

/* Estilos generales para modales */
.modal {
    display: none;
    position: fixed;
    z-index: 11000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal[style*="block"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    animation: modalSlideIn 0.3s ease;
    margin: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    background: #1582c7 !important;
    color: white;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-header .close {
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    color: white;
    opacity: 0.8;
    transition: opacity 0.2s ease;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
}

.modal-header .close:hover {
    opacity: 1;
}

.modal-body {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #404040;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    background: #ffffff;
    margin: 0;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Proveedores table specific styles */
#proveedores-table th:nth-child(4),
#proveedores-table th:nth-child(5),
#proveedores-table th:nth-child(6),
#proveedores-table th:nth-child(7),
#proveedores-table td:nth-child(4),
#proveedores-table td:nth-child(5),
#proveedores-table td:nth-child(6),
#proveedores-table td:nth-child(7) {
    text-align: center;
}

/* Alinear botones de acciones a la derecha */
#proveedores-table td:nth-child(8) {
    text-align: right !important;
}

/* Estilos específicos para textarea en modal de proveedores */
.modal .form-group textarea {
    background: #ffffff !important;
    border: 1px solid #404040 !important;
    border-radius: 8px !important;
    padding: 0.75rem !important;
    color: black !important;
    font-size: 0.95rem !important;
    transition: border-color 0.2s ease !important;
    width: 100% !important;
    max-width: 100% !important;
    resize: vertical !important;
    box-sizing: border-box !important;
    overflow-x: hidden !important;
    min-height: 80px !important;
}

.modal .form-group textarea:focus {
    outline: none !important;
    border-color: #1582c7 !important;
    box-shadow: 0 0 0 3px rgba(21, 130, 199, 0.1) !important;
}

.modal .form-group textarea::placeholder {
    color: #888 !important;
    opacity: 0.7 !important;
}