﻿/* site-enterprise.css - estilo moderno y enterprise para layout */

/* Reset / base */
body, html {
    height: 100%;
    margin: 0;
    font-family: 'Inter', 'Segoe UI', Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #2d3748;
    font-size: 14px;
    line-height: 1.5;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, #5a67d8, #6b46c1);
}

/* Shell layout */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg,#0b3b5c,#08314f);
    color: #fff;
    display: flex;
    flex-direction: column;
    transition: width .2s ease, transform .2s ease;
    min-height: 100vh;
    box-shadow: 2px 0 6px rgba(0,0,0,0.08);
}

    .sidebar.collapsed {
        width: 72px;
    }

    .sidebar .sidebar-header {
        padding: 20px;
        display: flex;
        align-items: center;
        gap: 10px;
        border-bottom: 1px solid rgba(255,255,255,0.04);
    }

.brand-logo {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    background: white;
}

.brand-text {
    font-weight: 600;
    font-size: 18px;
    color: #fff;
}

.sidebar-menu {
    padding-left: 0;
    margin: 0;
    list-style: none;
    flex: 1;
}

    .sidebar-menu .nav-item {
        width: 100%;
    }

    .sidebar-menu .nav-link {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 18px;
        color: rgba(255,255,255,0.92);
        text-decoration: none;
        font-size: 14px;
        border-left: 3px solid transparent;
    }

        .sidebar-menu .nav-link:hover {
            background: rgba(255,255,255,0.03);
            color: #fff;
            text-decoration: none;
        }

        .sidebar-menu .nav-link.active {
            background: rgba(0,0,0,0.12);
            border-left-color: #ffd166;
        }

.sidebar .sidebar-footer {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.03);
}

.user-info .user-name {
    font-size: 13px;
    font-weight: 600;
}

/* Main area */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-header {
    height: 64px;
    background: #ffffff;
    border-bottom: 1px solid #e6e9ef;
}

.content {
    flex: 1;
    background: linear-gradient(180deg, #f4f6f9, #ffffff);
}

/* Footer */
.main-footer {
    background: transparent;
    border-top: 1px solid #eee;
}

/* Responsive: collapse sidebar */
@media (max-width: 767px) {
    .sidebar {
        position: fixed;
        z-index: 1050;
        transform: translateX(-100%);
    }

        .sidebar.collapsed {
            transform: translateX(0);
            width: 260px;
        }

    .main {
        margin-left: 0;
    }
}

/* Small collapsed look */
.sidebar.collapsed .brand-text,
.sidebar.collapsed .sidebar-caption,
.sidebar.collapsed .nav-link span:nth-child(n+2) {
    display: none;
}

.sidebar.collapsed .brand-logo {
    margin: 0 auto;
}

/* Common UI Components */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
    margin-bottom: 1rem;
}

.table-modern {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.status-badge {
    padding: 0.375rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-pendiente { background-color: #fff3cd; color: #856404; }
.status-entregado { background-color: #d1ecf1; color: #0c5460; }
.status-en-proceso { background-color: #cce5ff; color: #004085; }
.status-cancelado { background-color: #f8d7da; color: #721c24; }

.report-card {
    transition: transform 0.2s;
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.report-card:hover {
    transform: translateY(-5px);
}

.kpi-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px;
}

.kpi-value {
    font-size: 2.5rem;
    font-weight: 700;
}

.metric-change {
    font-size: 0.875rem;
    opacity: 0.8;
}

.metric-change.positive { color: #28a745; }
.metric-change.negative { color: #dc3545; }
.metric-change.neutral { color: #6c757d; }

.filter-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.chart-container {
    position: relative;
    height: 350px;
    margin: auto;
}

/* ===========================================
   CONSISTENT BUTTON STYLING SYSTEM
   =========================================== */

.btn {
    font-weight: 500;
    border-radius: 8px;
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
}

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

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

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.25);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Primary Buttons */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
    color: white;
}

/* Secondary Buttons */
.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.5);
    color: white;
}

/* Success Buttons */
.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.4);
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, #218838 0%, #1aa085 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.6);
    color: white;
}

/* Danger Buttons */
.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, #c82333 0%, #d63384 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.6);
    color: white;
}

/* Warning Buttons */
.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.4);
}

.btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, #e0a800 0%, #e8680d 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.6);
    color: #212529;
}

/* Info Buttons */
.btn-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(23, 162, 184, 0.4);
}

.btn-info:hover:not(:disabled) {
    background: linear-gradient(135deg, #138496 0%, #117a8b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.6);
    color: white;
}

/* Outline Buttons */
.btn-outline-primary {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
    box-shadow: none;
}

.btn-outline-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-outline-secondary {
    background: transparent;
    color: #6c757d;
    border: 2px solid #6c757d;
    box-shadow: none;
}

.btn-outline-secondary:hover:not(:disabled) {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.5);
}

/* Button Sizes */
.btn-sm {
    padding: 0.375rem 1rem;
    font-size: 0.75rem;
    border-radius: 6px;
}

.btn-lg {
    padding: 0.75rem 2rem;
    font-size: 1rem;
    border-radius: 10px;
}

/* Button Groups */
.btn-group .btn {
    border-radius: 0;
    margin: 0;
}

.btn-group .btn:first-child {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}

.btn-group .btn:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}

/* ===========================================
   STANDARDIZED TABLE STYLING & DATATABLES
   =========================================== */

.table {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #f1f5f9;
}

.table tbody tr:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    transform: scale(1.01);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.table tbody tr:last-child {
    border-bottom: none;
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border: none;
    font-size: 0.875rem;
}

/* DataTables Customization */
.dataTables_wrapper {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    padding: 1rem;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    transition: border-color 0.3s ease;
}

.dataTables_wrapper .dataTables_length select:focus,
.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dataTables_wrapper .dataTables_info {
    padding: 1rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    font-size: 0.875rem;
    color: #6c757d;
}

.dataTables_wrapper .dataTables_paginate {
    padding: 1rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.375rem 0.75rem;
    margin: 0 0.125rem;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background: white;
    color: #6c757d;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-1px);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    font-weight: 600;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Table Responsive */
@media (max-width: 768px) {
    .table-responsive {
        border-radius: 12px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }

    .table thead {
        display: none;
    }

    .table tbody tr {
        display: block;
        border: 1px solid #e9ecef;
        border-radius: 8px;
        margin-bottom: 1rem;
        padding: 1rem;
        background: white;
    }

    .table tbody td {
        display: block;
        text-align: left;
        padding: 0.5rem 0;
        border: none;
    }

    .table tbody td:before {
        content: attr(data-label) ": ";
        font-weight: 600;
        color: #667eea;
        display: inline-block;
        min-width: 120px;
    }
}

/* ===========================================
   CONSISTENT CARD LAYOUTS & HOVER EFFECTS
   =========================================== */

.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: white;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 1.5rem;
    font-weight: 600;
    font-size: 1rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: #f8f9fa;
    border: none;
    padding: 1rem 1.5rem;
}

/* Card Variants */
.card-primary {
    border-left: 4px solid #667eea;
}

.card-success {
    border-left: 4px solid #28a745;
}

.card-warning {
    border-left: 4px solid #ffc107;
}

.card-danger {
    border-left: 4px solid #dc3545;
}

.card-info {
    border-left: 4px solid #17a2b8;
}

/* Card Hover Effects */
.card-hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.card-hover-scale {
    transition: transform 0.3s ease;
}

.card-hover-scale:hover {
    transform: scale(1.02);
}

.card-hover-glow {
    transition: box-shadow 0.3s ease;
}

.card-hover-glow:hover {
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

/* Card Animations */
@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-animated {
    animation: cardSlideIn 0.5s ease-out;
}

/* ===========================================
   RESPONSIVE DESIGN IMPROVEMENTS
   =========================================== */

/* Mobile First Approach */
@media (max-width: 576px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .btn-group {
        display: flex;
        flex-direction: column;
    }

    .btn-group .btn {
        border-radius: 8px !important;
        margin-bottom: 0.25rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .card-body {
        padding: 1rem;
    }

    .table-responsive {
        font-size: 0.8rem;
    }
}

/* Tablet Styles */
@media (min-width: 577px) and (max-width: 992px) {
    .container-fluid {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .btn-group .btn {
        padding: 0.5rem 1rem;
    }

    .card-body {
        padding: 1.25rem;
    }
}

/* Desktop Styles */
@media (min-width: 993px) {
    .container-fluid {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .btn {
        min-width: auto;
    }

    .card:hover {
        transform: translateY(-8px);
    }
}

/* Grid Improvements */
.row {
    margin-left: -0.75rem;
    margin-right: -0.75rem;
}

.col, [class*="col-"] {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
}

/* Flexbox Utilities */
.d-flex {
    display: flex;
}

.justify-content-center {
    justify-content: center;
}

.justify-content-between {
    justify-content: space-between;
}

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

.flex-wrap {
    flex-wrap: wrap;
}

.flex-column {
    flex-direction: column;
}

/* Spacing Utilities */
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: 0.25rem !important; }
.mb-2 { margin-bottom: 0.5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.mb-5 { margin-bottom: 3rem !important; }

.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: 0.25rem !important; }
.mt-2 { margin-top: 0.5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mt-5 { margin-top: 3rem !important; }

.p-0 { padding: 0 !important; }
.p-1 { padding: 0.25rem !important; }
.p-2 { padding: 0.5rem !important; }
.p-3 { padding: 1rem !important; }
.p-4 { padding: 1.5rem !important; }
.p-5 { padding: 3rem !important; }

/* Text Utilities */
.text-center { text-align: center !important; }
.text-left { text-align: left !important; }
.text-right { text-align: right !important; }

.font-weight-bold { font-weight: 700 !important; }
.font-weight-normal { font-weight: 400 !important; }
.font-weight-light { font-weight: 300 !important; }

/* Display Utilities */
.d-none { display: none !important; }
.d-block { display: block !important; }
.d-inline { display: inline !important; }
.d-inline-block { display: inline-block !important; }

/* Position Utilities */
.position-relative { position: relative !important; }
.position-absolute { position: absolute !important; }
.position-fixed { position: fixed !important; }
.position-sticky { position: sticky !important; }

/* Shadow Utilities */
.shadow-sm { box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important; }
.shadow { box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important; }
.shadow-lg { box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.175) !important; }

/* Border Radius Utilities */
.rounded { border-radius: 0.25rem !important; }
.rounded-sm { border-radius: 0.2rem !important; }
.rounded-lg { border-radius: 0.3rem !important; }
.rounded-xl { border-radius: 0.5rem !important; }
.rounded-circle { border-radius: 50% !important; }

/* Loading States */
.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Notification Styles */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
}

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

.notification-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.notification-error {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    color: white;
}

.notification-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
}

.notification-info {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}
