/*
==========================================================
Archivo: ctt.css

Descripción:
Estilos del módulo de seguimiento CTT.
==========================================================
*/


/* ==========================================================
   PAGE
========================================================== */

.ctt-page
{
    width: 100%;
    max-width: 1400px;
}

.ctt-header
{
    margin-bottom: 22px;
}

.ctt-header h2
{
    margin: 0 0 6px 0;

    font-size: 28px;
}

.ctt-header p
{
    margin: 0;

    color: #666;
}


/* ==========================================================
   FILTERS
========================================================== */

.ctt-filters
{
    margin-bottom: 26px;
    padding: 18px;

    background: #f7f7f7;

    border: 1px solid #ddd;
    border-radius: 8px;
}


/*
El label está arriba.

Input y botón están dentro de
.ctt-filter-controls, por lo que
siempre quedan en la misma línea.
*/

.ctt-filter-group
{
    display: flex;
    flex-direction: column;
    align-items: flex-start;

    gap: 7px;
}

.ctt-filter-group > label
{
    margin: 0;

    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

.ctt-filter-controls
{
    display: flex;
    align-items: stretch;

    gap: 12px;
}


/* ==========================================================
   DATE INPUT
========================================================== */

.ctt-filter-controls input
{
    box-sizing: border-box;

    width: 150px;
    height: 40px;

    margin: 0;
    padding: 0 10px;

    background: white;

    border: 1px solid #ccc;
    border-radius: 5px;

    font-family: inherit;
    font-size: 14px;
}


/* ==========================================================
   CONSULT BUTTON
========================================================== */

.ctt-filter-controls button
{
    box-sizing: border-box;

    height: 40px;

    margin: 0;
    padding: 0 22px;

    background: #222;
    color: white;

    border: 1px solid #222;
    border-radius: 5px;

    font-family: inherit;
    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
}

.ctt-filter-controls button:hover
{
    background: #444;
    border-color: #444;
}


/* ==========================================================
   LOADING / MESSAGES
========================================================== */

.ctt-loading,
.ctt-message
{
    padding: 14px 0;

    color: #666;
}

.ctt-error
{
    padding: 14px 16px;

    background: #fff0f0;
    color: #9b1c1c;

    border: 1px solid #e0a0a0;
    border-radius: 6px;
}


/* ==========================================================
   SUMMARY
========================================================== */

.ctt-summary
{
    display: grid;

    grid-template-columns:
        repeat(5, minmax(130px, 1fr));

    gap: 14px;

    margin-bottom: 18px;
}

.ctt-summary-card
{
    min-width: 0;

    padding: 18px;

    background: white;

    border: 1px solid #ddd;
    border-radius: 8px;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.06);
}

.ctt-summary-card span
{
    display: block;

    margin-bottom: 7px;

    color: #666;

    font-size: 13px;
}

.ctt-summary-card strong
{
    display: block;

    font-size: 28px;
    line-height: 1;
}

.ctt-summary-card-alert
{
    background: #fff2f2;

    border-color: #e5a6a6;
}


/* ==========================================================
   WARNING
========================================================== */

.ctt-warning
{
    margin-bottom: 18px;
    padding: 13px 15px;

    background: #fff8e5;
    color: #665000;

    border: 1px solid #e4c66a;
    border-radius: 6px;
}


/* ==========================================================
   TABLE CONTAINER
========================================================== */

.ctt-table-container
{
    width: 100%;

    overflow-x: auto;

    background: white;

    border: 1px solid #ddd;
    border-radius: 8px;
}


/* ==========================================================
   TABLE
========================================================== */

.ctt-table
{
    width: 100%;
    min-width: 950px;

    border-collapse: collapse;
}

.ctt-table th
{
    padding: 13px 14px;

    background: #f5f5f5;

    border-bottom: 1px solid #ddd;

    text-align: left;

    font-size: 13px;
    font-weight: 600;

    white-space: nowrap;
}

.ctt-table td
{
    padding: 13px 14px;

    border-bottom: 1px solid #eee;

    vertical-align: middle;

    font-size: 14px;
}

.ctt-table tbody tr:last-child td
{
    border-bottom: none;
}

.ctt-table tbody tr:hover
{
    background: #fafafa;
}


/* ==========================================================
   TABLE COLUMNS
========================================================== */

.ctt-code
{
    white-space: nowrap;

    font-family:
        Consolas,
        "Courier New",
        monospace;

    font-size: 13px;
}

.ctt-date-cell
{
    white-space: nowrap;
}

.ctt-empty
{
    padding: 30px !important;

    text-align: center;

    color: #777;
}


/* ==========================================================
   ORDER BUTTON
========================================================== */

.ctt-order-link
{
    min-width: 58px;

    padding: 7px 10px;

    background: white;
    color: #222;

    border: 1px solid #ccc;
    border-radius: 5px;

    font-family: inherit;
    font-weight: 600;

    cursor: pointer;
}

.ctt-order-link:hover
{
    background: #222;
    color: white;

    border-color: #222;
}

.ctt-not-linked
{
    color: #888;
}


/* ==========================================================
   UPDATED SHIPMENT
========================================================== */

.ctt-updated-row
{
    background: #f5f9ff;
}


/* ==========================================================
   INCIDENT
========================================================== */

.ctt-incident-row
{
    background: #fff2f2;
}

.ctt-incident-row:hover
{
    background: #ffe8e8 !important;
}


/* ==========================================================
   RESPONSIVE - TABLET
========================================================== */

@media (max-width: 1100px)
{
    .ctt-summary
    {
        grid-template-columns:
            repeat(3, minmax(130px, 1fr));
    }
}


/* ==========================================================
   RESPONSIVE - MOBILE
========================================================== */

@media (max-width: 700px)
{
    .ctt-header h2
    {
        font-size: 24px;
    }


    /* FILTER */

    .ctt-filter-group
    {
        width: 100%;
    }

    .ctt-filter-controls
    {
        width: 100%;
    }

    .ctt-filter-controls input
    {
        flex: 1;

        width: auto;
        min-width: 0;
    }

    .ctt-filter-controls button
    {
        flex-shrink: 0;
    }


    /* SUMMARY */

    .ctt-summary
    {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 10px;
    }

    .ctt-summary-card
    {
        padding: 14px;
    }

    .ctt-summary-card strong
    {
        font-size: 24px;
    }
}

/* ==========================================================
   CTT SHIPMENT ACTIONS
   ========================================================== */
.order-shipment-actions
{
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 10px;
    margin-top: 10px;
}

/* ==========================================================
   CTT ACTION BUTTONS
========================================================== */
.order-shipment-actions .order-document-link,
.order-shipment-actions .order-update-button
{
    box-sizing: border-box;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    height: 34px;
    padding: 0 14px;

    background: #1f1f1f;
    color: #ffffff;

    border: 1px solid #1f1f1f;
    border-radius: 6px;

    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;

    text-decoration: none;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}


/* ==========================================================
   HOVER
========================================================== */
.order-shipment-actions .order-document-link:hover,
.order-shipment-actions .order-update-button:hover
{
    background: #000000;
    color: #ffffff;

    border-color: #000000;

    text-decoration: none;
}


/* ==========================================================
   DISABLED
========================================================== */
.order-shipment-actions .order-update-button:disabled
{
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================================
   CTT WORKING DAYS
   ========================================================== */

.ctt-working-days
{
    margin-top: 20px;
}

.ctt-working-days h4
{
    margin: 0 0 12px 0;
    font-size: 15px;
    font-weight: 600;
}

.ctt-working-days-list
{
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ctt-working-day
{
    display: flex;
    align-items: center;
    justify-content: center;

    min-width: 145px;
    padding: 10px 14px;

    border: 1px solid #dddddd;
    border-radius: 6px;

    background: #ffffff;

    font-size: 13px;
    font-weight: 500;
    text-align: center;

    text-transform: capitalize;
}

/* ==========================================================
   RESPONSIVE - SMALL MOBILE
========================================================== */

@media (max-width: 450px)
{
    .ctt-filters
    {
        padding: 14px;
    }

    .ctt-filter-controls
    {
        flex-direction: column;
    }

    .ctt-filter-controls input,
    .ctt-filter-controls button
    {
        width: 100%;
    }

    .ctt-summary
    {
        grid-template-columns: 1fr;
    }
}