/* ============================================================
   C&A TMS - CODIGO PROPIO

   Que hace:
   Define la presentacion aislada del Load Board.

   Datos que recibe:
   Elementos creados por assets/loads.js.

   Resultado:
   Workspace responsive para escritorio, tablet y telefono.

   Donde se usa:
   Portal web C&A TMS.
   ============================================================ */

body.loads-workspace-open {
    overflow: hidden;
}

.loads-workspace-v1[hidden] {
    display: none !important;
}

.loads-workspace-v1 {
    background: #f3f6fa;
    inset: 0;
    overflow: auto;
    position: fixed;
    z-index: 10000;
}

.loads-workspace-v1__shell {
    margin: 0 auto;
    max-width: 1800px;
    min-height: 100%;
    padding: 1.25rem;
}

.loads-workspace-v1__header {
    align-items: flex-start;
    background: #ffffff;
    border: 1px solid #dbe2ea;
    border-radius: 14px;
    box-shadow:
        0 8px 24px
        rgba(15, 23, 42, 0.06);
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding: 1.25rem 1.4rem;
}

.loads-workspace-v1__header h1 {
    color: #111827;
    font-size:
        clamp(
            1.55rem,
            2vw,
            2rem
        );
    line-height: 1.15;
    margin: 0.15rem 0 0.35rem;
}

.loads-workspace-v1__eyebrow {
    color: #1e3a8a;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin: 0;
    text-transform: uppercase;
}

.loads-workspace-v1__subtitle {
    color: #64748b;
    margin: 0;
}

.loads-workspace-v1__header-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    justify-content: flex-end;
}

.loads-workspace-v1__content {
    background: #ffffff;
    border: 1px solid #dbe2ea;
    border-radius: 14px;
    box-shadow:
        0 8px 24px
        rgba(15, 23, 42, 0.05);
    padding: 1.15rem;
}

.loads-toolbar-v1 {
    align-items: end;
    display: grid;
    gap: 0.9rem;
    grid-template-columns:
        minmax(260px, 1fr)
        minmax(180px, 240px)
        auto;
}

.loads-toolbar-v1__field {
    display: grid;
    gap: 0.4rem;
}

.loads-toolbar-v1__field > span {
    color: #374151;
    font-size: 0.8rem;
    font-weight: 750;
}

.loads-toolbar-v1 input,
.loads-toolbar-v1 select {
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #111827;
    font: inherit;
    min-height: 44px;
    padding: 0.65rem 0.75rem;
    width: 100%;
}

.loads-toolbar-v1 input:focus,
.loads-toolbar-v1 select:focus {
    border-color: #1e3a8a;
    box-shadow:
        0 0 0 3px
        rgba(30, 58, 138, 0.15);
    outline: none;
}

.loads-toolbar-v1__actions {
    display: flex;
    gap: 0.65rem;
}

.loads-message-v1 {
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 0.88rem;
    margin-top: 1rem;
    padding: 0.75rem 0.85rem;
}

.loads-message-v1--error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #991b1b;
}

.loads-message-v1--warning {
    background: #fffbeb;
    border-color: #fde68a;
    color: #92400e;
}

.loads-result-bar-v1 {
    align-items: center;
    border-bottom: 1px solid #e5e7eb;
    color: #64748b;
    display: flex;
    font-size: 0.82rem;
    gap: 1rem;
    justify-content: space-between;
    margin-top: 1rem;
    padding: 0.75rem 0 0.65rem;
}

.loads-result-bar-v1 p {
    margin: 0;
}

.loads-loading-v1 {
    align-items: center;
    color: #475569;
    display: flex;
    gap: 0.65rem;
    justify-content: center;
    min-height: 90px;
}

.loads-loading-v1__spinner {
    animation:
        loads-spin-v1
        0.8s
        linear
        infinite;
    border: 3px solid #dbeafe;
    border-radius: 50%;
    border-top-color: #1e3a8a;
    height: 24px;
    width: 24px;
}

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

.loads-table-wrap-v1 {
    overflow-x: auto;
    width: 100%;
}

.loads-table-v1 {
    border-collapse: collapse;
    min-width: 1250px;
    width: 100%;
}

.loads-table-v1 th,
.loads-table-v1 td {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.8rem 0.7rem;
    text-align: left;
    vertical-align: top;
}

.loads-table-v1 th {
    background: #f8fafc;
    color: #475569;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.035em;
    position: sticky;
    text-transform: uppercase;
    top: 0;
    z-index: 1;
}

.loads-table-v1 td {
    color: #334155;
    font-size: 0.82rem;
    line-height: 1.4;
}

.loads-table-v1 td strong,
.loads-table-v1 td span {
    display: block;
}

.loads-table-v1 td span {
    color: #64748b;
    margin-top: 0.2rem;
}

.loads-table-v1 tbody tr:hover {
    background: #f8fbff;
}

.loads-load-number-v1 {
    color: #1e3a8a;
    font-size: 0.9rem;
}

.loads-status-v1 {
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    color: #475569 !important;
    display: inline-block !important;
    font-size: 0.72rem;
    font-weight: 800;
    margin: 0 !important;
    padding: 0.25rem 0.55rem;
    white-space: nowrap;
}

.loads-status-v1--available,
.loads-status-v1--assigned {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8 !important;
}

.loads-status-v1--dispatched,
.loads-status-v1--loaded {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534 !important;
}

.loads-status-v1--docked {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #9a3412 !important;
}

.loads-status-v1--closed,
.loads-status-v1--empty,
.loads-status-v1--void {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #4b5563 !important;
}

.loads-empty-v1 {
    align-items: center;
    color: #64748b;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    justify-content: center;
    min-height: 180px;
    text-align: center;
}

.loads-empty-v1 strong {
    color: #334155;
}

.loads-pagination-v1 {
    align-items: center;
    display: flex;
    gap: 0.85rem;
    justify-content: flex-end;
    padding-top: 1rem;
}

.loads-pagination-v1 span {
    color: #475569;
    font-size: 0.82rem;
    font-weight: 700;
    min-width: 72px;
    text-align: center;
}

@media (max-width: 1050px) {
    .loads-toolbar-v1 {
        grid-template-columns:
            1fr
            220px;
    }

    .loads-toolbar-v1__actions {
        grid-column: 1 / -1;
    }
}

@media (max-width: 720px) {
    .loads-workspace-v1__shell {
        padding: 0.65rem;
    }

    .loads-workspace-v1__header {
        align-items: stretch;
        flex-direction: column;
        padding: 1rem;
    }

    .loads-workspace-v1__header-actions {
        justify-content: stretch;
    }

    .loads-workspace-v1__header-actions button {
        flex: 1;
    }

    .loads-workspace-v1__content {
        padding: 0.8rem;
    }

    .loads-toolbar-v1 {
        grid-template-columns: 1fr;
    }

    .loads-toolbar-v1__actions {
        grid-column: auto;
    }

    .loads-toolbar-v1__actions button {
        flex: 1;
    }

    .loads-result-bar-v1 {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.25rem;
    }

    .loads-table-v1 {
        min-width: 0;
    }

    .loads-table-v1 thead {
        display: none;
    }

    .loads-table-v1,
    .loads-table-v1 tbody,
    .loads-table-v1 tr,
    .loads-table-v1 td {
        display: block;
        width: 100%;
    }

    .loads-table-v1 tr {
        border: 1px solid #dbe2ea;
        border-radius: 10px;
        margin-top: 0.8rem;
        overflow: hidden;
    }

    .loads-table-v1 td {
        border-bottom: 1px solid #edf0f4;
        display: grid;
        gap: 0.75rem;
        grid-template-columns:
            120px
            1fr;
        padding: 0.7rem;
    }

    .loads-table-v1 td:last-child {
        border-bottom: 0;
    }

    .loads-table-v1 td::before {
        color: #64748b;
        content: attr(data-label);
        font-size: 0.7rem;
        font-weight: 800;
        letter-spacing: 0.03em;
        text-transform: uppercase;
    }

    .loads-pagination-v1 {
        justify-content: center;
    }
}
