﻿body {
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #e6f5ff, #f5fff7);
    margin: 0;
    padding: 0;
}

.body-app {
    overflow-x: hidden;
}

.app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    background-color: #0b3d5c;
    color: #ffffff;
}

.btn-menu {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 22px;
    margin-right: 12px;
    cursor: pointer;
}

.topbar-title {
    font-weight: bold;
    font-size: 18px;
}

.app-body {
    display: flex;
    min-height: 0;
}

.sidebar {
    width: 220px;
    background-color: #102a43;
    color: #ffffff;
    padding-top: 8px;
    flex-shrink: 0;
    box-shadow: 2px 0 6px rgba(0, 0, 0, 0.15);
}

.sidebar-header {
    padding: 8px 16px;
    font-size: 14px;
    text-transform: uppercase;
    opacity: 0.8;
}

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

.sidebar-menu li a {
    display: block;
    padding: 8px 16px;
    color: #e0e8f9;
    text-decoration: none;
    font-size: 14px;
}

.sidebar-menu li a:hover {
    background-color: #243b53;
}

.overlay {
    display: none;
}

.contenedor-dashboard {
    padding: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    flex: 1;
}

.tarjeta {
    background: linear-gradient(135deg, #ffffff, #f9fcff);
    border-radius: 8px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.12);
    padding: 16px;
    min-width: 200px;
    max-width: 260px;
    flex: 1;
    transform: translateY(0);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-top: 4px solid #0b7dda;
}

.tarjeta-ancha {
    width: 22em; /* aprox 20 caracteres */
    max-width: 100%;
    flex: 0 0 auto;
    margin: 0 auto;
}

.tarjeta:nth-child(2) {
    border-top-color: #00a676; /* verde temporada */
}

.tarjeta:nth-child(3) {
    border-top-color: #ff9800; /* naranja temporada */
}

.tarjeta:nth-child(4) {
    border-top-color: #9c27b0; /* violeta temporada */
}

.tarjeta:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
}

.tarjeta h3 {
    margin-top: 0;
    margin-bottom: 8px;
    color: #0b3d5c;
}

.tarjeta .valor {
    font-size: 28px;
    font-weight: bold;
    color: #0b7dda;
}

.tarjeta .detalle {
    font-size: 12px;
    color: #555555;
}

.campo-formulario {
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    font-size: 14px;
}

.campo-formulario label {
    margin-bottom: 4px;
    font-weight: 600;
    color: #0b3d5c;
}

.campo-formulario input,
.campo-formulario select,
.campo-formulario textarea {
    padding: 8px 10px;
    border: 1px solid #ccd5e0;
    border-radius: 4px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.acciones-formulario {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

button {
    border: none;
    background-color: #0b7dda;
    color: #ffffff;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

button:hover {
    background-color: #095f9f;
}

.btn-secundario {
    background-color: #ffffff;
    color: #0b7dda;
    border: 1px solid #0b7dda;
}

.btn-secundario:hover {
    background-color: #e6f5ff;
}

@media (max-width: 768px) {
    .app-body {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 50px;
        left: 0;
        height: calc(100% - 50px);
        transform: translateX(-100%);
        transition: transform 0.2s ease;
        z-index: 1000;
    }

    .overlay {
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.3);
        display: none;
        z-index: 900;
    }

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

    body.menu-open .overlay {
        display: block;
    }

    .contenedor-dashboard {
        padding: 12px;
        flex-direction: column;
    }

    .tarjeta {
        max-width: 100%;
        min-width: auto;
    }

    .tarjeta-ancha {
        max-width: 100%;
        width: 100%;
        margin: 0;
    }

    .tarjeta .valor {
        font-size: 24px;
    }
}

.footer {
    padding: 8px 16px;
    font-size: 12px;
    color: #555555;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 40px;
    z-index: 1200;
}

.modal-overlay.visible {
    display: flex;
}

.modal {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
    padding: 16px;
    width: 22em; /* similar al ancho de Buque */
    max-width: 100%;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.modal-cerrar {
    background: transparent;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #555555;
}

.bloque-detalle {
    border-top: 1px dashed #ccd5e0;
    padding-top: 8px;
    margin-top: 8px;
}

.bloque-detalle:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.tarjeta-cargoplan {
    width: min(900px, 100%);
    max-width: 100%;
    flex: 0 0 auto;
    margin: 0 auto;
}

.cargoplan-cabeza {
    border: 1px solid #d7e1ea;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 14px;
    background: #fbfdff;
}

.tabla-excel-wrap {
    overflow-x: auto;
    border: 1px solid #d7e1ea;
    border-radius: 6px;
    background: #ffffff;
}

.tabla-excel {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}

.tabla-excel th,
.tabla-excel td {
    border: 1px solid #dfe7ee;
    padding: 8px;
    text-align: left;
    vertical-align: middle;
}

.tabla-excel thead th {
    background: #eef5fb;
    color: #143d5b;
    font-size: 13px;
}

.tabla-excel td input {
    margin: 0;
}

.acciones-detalle-final {
    justify-content: flex-end;
}

.resumen-cargoplan {
    margin-top: 14px;
    border: 1px solid #d7e1ea;
    border-radius: 6px;
    padding: 12px;
    background: #fcfeff;
}

.resumen-total {
    margin-bottom: 10px;
    color: #143d5b;
    font-size: 14px;
}

.tarjeta-cargoplan .campo-formulario input[type="text"],
.tarjeta-cargoplan .campo-formulario input[list],
.tarjeta-cargoplan .tabla-excel td input[type="text"],
.tarjeta-cargoplan .tabla-excel td input[list] {
    width: 30ch;
    min-width: 16ch;
    max-width: 100%;
}

@media (max-width: 768px) {
    .tarjeta-cargoplan {
        width: 100%;
        margin: 0;
    }

    .tabla-excel {
        min-width: 420px;
    }

    .tarjeta-cargoplan .campo-formulario input[type="text"],
    .tarjeta-cargoplan .campo-formulario input[list],
    .tarjeta-cargoplan .tabla-excel td input[type="text"],
    .tarjeta-cargoplan .tabla-excel td input[list] {
        width: 100%;
        min-width: 10ch;
    }
}

@media (max-width: 480px) {
    .tabla-excel {
        min-width: 320px;
    }

    .tabla-excel th,
    .tabla-excel td {
        padding: 6px;
        font-size: 12px;
    }

    .btn-eliminar-fila {
        padding: 4px 8px;
        font-size: 11px;
    }
}

/* ── Resumen ─────────────────────────────── */
.contenedor-resumen {
    padding: 16px;
    flex: 1;
}

.resumen-titulo {
    color: #0b3d5c;
    font-size: 16px;
    margin: 12px 0 10px;
}

.resumen-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.tab {
    padding: 7px 16px;
    border-radius: 4px 4px 0 0;
    border: 1px solid #ccd5e0;
    border-bottom: none;
    background: #eef5fb;
    color: #0b3d5c;
    text-decoration: none;
    font-size: 14px;
}

.tab-activo {
    background: #0b3d5c;
    color: #ffffff;
}

.col-num {
    text-align: right;
    white-space: nowrap;
}

.fila-subtotal td {
    background: #f0f7ff;
    font-size: 13px;
}

.fila-subtotal-manif td {
    background: #dceeff;
    font-size: 13px;
}

.fila-subtotal-buque td {
    background: #c2dff7;
    font-size: 13px;
}

.fila-total td {
    background: #0b3d5c;
    color: #ffffff;
}

/* ── Fila número ───────────────────────── */
.fila-numero {
    text-align: center;
    font-weight: 700;
    color: #1a4d73;
}

.tabla-excel th:nth-child(1),
.tabla-excel td:nth-child(1) {
    text-align: center;
}

.btn-eliminar-fila {
    padding: 6px 10px;
    font-size: 12px;
}

.tarjeta-cargoplan .tabla-excel td input.cp-bodega {
    width: 10ch;
    max-width: 100%;
}

.tarjeta-cargoplan .tabla-excel td input.cp-producto {
    width: 30ch;
    max-width: 100%;
}

.tarjeta-cargoplan .tabla-excel td input.cp-destino {
    width: 15ch;
    max-width: 100%;
}

.tarjeta-cargoplan .cargoplan-cabeza input.cp-fecha {
    width: 18ch;
    min-width: 14ch;
    max-width: 100%;
}

@media (max-width: 768px) {
    .tarjeta-cargoplan .tabla-excel td input.cp-bodega,
    .tarjeta-cargoplan .tabla-excel td input.cp-producto,
    .tarjeta-cargoplan .tabla-excel td input.cp-destino {
        width: 100%;
        min-width: 0;
    }

    .tarjeta-cargoplan .cargoplan-cabeza input.cp-fecha {
        width: 100%;
        min-width: 0;
    }
}

