/**
 * Logistics Theme - ERP Design System
 * Based on theme.css with logistics-specific variations
 */

/* ============================================================
   BASE STYLES (Override dark theme to match ERP light theme)
   ============================================================ */

body.logistics-module {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--light-gray);
    color: var(--text-dark);
    padding-top: 80px;
}

/* ============================================================
   PAGE CONTAINER
   ============================================================ */

.page-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 2rem 3rem;
}

/* ============================================================
   PAGE TITLE
   ============================================================ */

.page-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.page-title h1 {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-blue);
    letter-spacing: -1px;
}

.page-title .subtitle {
    color: var(--text-gray);
    font-size: 1rem;
}

/* ============================================================
   TABS - Following ERP system design
   ============================================================ */

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    background: white;
    padding: 0.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.tab {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-gray);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tab:hover {
    background: var(--light-gray);
    color: var(--primary-blue);
}

.tab.active {
    background: var(--accent-turquoise);
    color: white;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================================
   STATS GRID
   ============================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-turquoise);
}

.stat-card.terrestrial::before { background: var(--success); }
.stat-card.maritime::before { background: var(--info); }
.stat-card.air::before { background: #8b5cf6; }
.stat-card.multimodal::before { background: linear-gradient(90deg, var(--success), var(--info), #8b5cf6); }

.stat-card h3 {
    color: var(--text-gray);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary-blue);
}

.stat-card .label {
    color: var(--text-gray);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

/* ============================================================
   CONTENT CARDS
   ============================================================ */

.content-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.content-card h2 {
    color: var(--primary-blue);
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ============================================================
   BUTTONS - ERP Style
   ============================================================ */

.btn {
    background: var(--accent-turquoise);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 217, 255, 0.3);
}

.btn-primary { background: var(--accent-turquoise); color: white; }
.btn-primary:hover { background: #00c4e6; }

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

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #218838; box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3); }

.btn-warning { background: var(--warning); color: #212529; }
.btn-warning:hover { background: #e0a800; }

.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #c82333; }

.btn-light { background: var(--light-gray); color: var(--primary-blue); }
.btn-light:hover { background: var(--light-gray-2); }

.btn-outline {
    background: transparent;
    color: var(--primary-blue);
    border: 2px solid var(--primary-blue);
}
.btn-outline:hover {
    background: var(--primary-blue);
    color: white;
}

.btn-small, .btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }

.btn-small.active, .nomenclator-type-btn.active {
    background: var(--accent-turquoise);
    box-shadow: 0 0 10px rgba(0, 217, 255, 0.3);
}

/* ============================================================
   TRANSPORT MODE ICONS
   ============================================================ */

.mode-icons {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.mode-icon {
    background: white;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid var(--light-gray-2);
    flex: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.mode-icon:hover {
    border-color: var(--accent-turquoise);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.mode-icon.active {
    background: var(--accent-turquoise);
    border-color: var(--accent-turquoise);
    color: white;
}

.mode-icon .icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.mode-icon .label {
    color: var(--primary-blue);
    font-weight: 600;
}

.mode-icon.active .label {
    color: white;
}

.mode-icon .count {
    color: var(--text-gray);
    font-size: 0.85rem;
}

.mode-icon.active .count {
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================================
   TABLE - ERP Style
   ============================================================ */

.table-container {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}

.table th, .table td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

.table th {
    background: var(--light-gray);
    font-weight: 700;
    color: var(--primary-blue);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: var(--light-gray);
}

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

/* ============================================================
   BADGES - ERP Style
   ============================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    gap: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.badge-success { background: rgba(40, 167, 69, 0.1); color: var(--success); }
.badge-warning { background: rgba(255, 193, 7, 0.1); color: #d39e00; }
.badge-danger { background: rgba(220, 53, 69, 0.1); color: var(--danger); }
.badge-info { background: rgba(23, 162, 184, 0.1); color: var(--info); }
.badge-primary { background: rgba(102, 102, 102, 0.1); color: #666666; }
.badge-purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

/* Transport mode specific badges */
.badge-terrestrial { background: rgba(40, 167, 69, 0.1); color: var(--success); }
.badge-maritime { background: rgba(23, 162, 184, 0.1); color: var(--info); }
.badge-air { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

/* ============================================================
   SHIPMENT CARDS
   ============================================================ */

.shipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 1.25rem;
}

.shipment-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border-left: 4px solid var(--accent-turquoise);
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.shipment-card:hover {
    transform: translateX(4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.shipment-card.terrestrial { border-left-color: var(--success); }
.shipment-card.maritime { border-left-color: var(--info); }
.shipment-card.air { border-left-color: #8b5cf6; }

.shipment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.shipment-header h3 {
    color: var(--primary-blue);
    font-size: 1rem;
    margin: 0;
}

.shipment-header .tracking {
    color: var(--accent-turquoise);
    font-size: 0.85rem;
    font-family: monospace;
}

.shipment-route {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--light-gray);
    border-radius: 8px;
}

.shipment-route .point {
    text-align: center;
}

.shipment-route .point .code {
    font-weight: 700;
    color: var(--primary-blue);
    font-size: 1.1rem;
}

.shipment-route .point .name {
    font-size: 0.75rem;
    color: var(--text-gray);
}

.shipment-route .arrow {
    color: var(--accent-turquoise);
    flex: 1;
    text-align: center;
    font-size: 1.25rem;
}

.shipment-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    font-size: 0.85rem;
}

.shipment-details .detail {
    text-align: center;
}

.shipment-details .detail .label {
    color: var(--text-gray);
    font-size: 0.75rem;
}

.shipment-details .detail .value {
    color: var(--primary-blue);
    font-weight: 600;
}

/* ============================================================
   QUOTE CARDS
   ============================================================ */

.quote-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.quote-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.quote-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.quote-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, rgba(0, 217, 255, 0.1), transparent);
    border-radius: 0 12px 0 100%;
}

.quote-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.quote-header h3 {
    color: var(--primary-blue);
    font-size: 1rem;
}

.quote-price {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent-turquoise);
    margin: 1rem 0;
}

.quote-price .currency {
    font-size: 0.9rem;
    color: var(--text-gray);
}

/* ============================================================
   MODAL - ERP Style
   ============================================================ */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: var(--z-toast);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--light-gray);
}

.modal-header h2 {
    color: var(--primary-blue);
    font-size: 1.5rem;
}

.close {
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-gray);
    padding: 0.5rem;
    transition: color 0.3s;
}

.close:hover {
    color: var(--danger);
}

/* ============================================================
   FORM STYLES - ERP Style
   ============================================================ */

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1.25rem;
    border: 2px solid var(--light-gray-2);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
    color: var(--text-dark);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-turquoise);
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

.form-control::placeholder {
    color: var(--text-gray);
    opacity: 0.6;
}

select.form-control {
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

/* ============================================================
   NOMENCLATOR SPECIFIC STYLES
   ============================================================ */

.nomenclator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.nomenclator-types {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.nomenclator-type-btn {
    padding: 0.5rem 1rem;
    background: var(--light-gray);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-gray);
    transition: all 0.3s ease;
}

.nomenclator-type-btn:hover {
    background: var(--light-gray-2);
    color: var(--primary-blue);
}

.nomenclator-type-btn.active {
    background: var(--accent-turquoise);
    color: white;
}

/* ============================================================
   ALERTS
   ============================================================ */

.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid;
}

.alert-success {
    background: rgba(40, 167, 69, 0.1);
    border-color: var(--success);
    color: var(--success);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.1);
    border-color: var(--warning);
    color: #856404;
}

.alert-danger {
    background: rgba(220, 53, 69, 0.1);
    border-color: var(--danger);
    color: var(--danger);
}

.alert-info {
    background: rgba(23, 162, 184, 0.1);
    border-color: var(--info);
    color: var(--info);
}

/* ============================================================
   TRACKING TIMELINE
   ============================================================ */

.tracking-timeline {
    position: relative;
    padding-left: 30px;
}

.tracking-timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--light-gray-2);
}

.tracking-event {
    position: relative;
    padding-bottom: 1.5rem;
}

.tracking-event::before {
    content: '';
    position: absolute;
    left: -24px;
    top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--light-gray-2);
    border: 2px solid white;
}

.tracking-event.active::before {
    background: var(--accent-turquoise);
}

.tracking-event.completed::before {
    background: var(--success);
}

.tracking-event-time {
    font-size: 0.75rem;
    color: var(--text-gray);
}

.tracking-event-title {
    font-weight: 600;
    color: var(--primary-blue);
}

.tracking-event-location {
    font-size: 0.85rem;
    color: var(--text-gray);
}

/* ============================================================
   RESPONSIVE - MOBILE-FIRST
   ============================================================ */

/* Base móvil */
.page-container {
    padding: 1rem 1.5rem;
}

.page-title h1 {
    font-size: 1.5rem;
}

.tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
}

.tab {
    white-space: nowrap;
}

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

.shipment-grid,
.quote-grid {
    grid-template-columns: 1fr;
}

.modal-content {
    padding: 1.5rem;
    margin: 1rem;
}

@media (min-width: 768px) {
    .page-container {
        padding: 1.5rem 2rem;
    }

    .page-title h1 {
        font-size: 1.75rem;
    }

    .tabs {
        flex-wrap: wrap;
    }

    .mode-icons {
        flex-direction: row;
    }

    .shipment-grid,
    .quote-grid {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }

    .modal-content {
        padding: 2rem;
        margin: 2rem auto;
    }
}

@media (min-width: 1024px) {
    .page-container {
        padding: 2rem 3rem;
    }

    .page-title h1 {
        font-size: 2rem;
    }
}
