/* ============================================================
   ALDO CARGO - PORTAL DE CLIENTES
   Tema claro moderno. Powered by Agdala 2026
   ============================================================ */

:root {
    --primario: #FFC107;
    --primario-oscuro: #e6ac00;
    --oscuro: #111111;
    --fondo: #f5f6f8;
    --tarjeta: #ffffff;
    --borde: #e4e6eb;
    --texto: #1a1c1e;
    --texto-suave: #6b7280;
    --radio: 14px;
    --sombra: 0 2px 12px rgba(17, 17, 17, .06);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
    background: var(--fondo);
    color: var(--texto);
    line-height: 1.55;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a { color: var(--oscuro); text-decoration: none; }
a:hover { opacity: .85; }

img { max-width: 100%; }

/* ---------- Barra superior ---------- */
.topbar {
    background: var(--tarjeta);
    border-bottom: 1px solid var(--borde);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 4px rgba(17, 17, 17, .04);
}

.topbar-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: .7rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.brand {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.brand img {
    height: 46px;
    width: auto;
    object-fit: contain;
}

.brand-text { line-height: 1.15; }
.brand-text strong {
    display: block;
    font-size: 1.05rem;
    letter-spacing: .3px;
}
.brand-text small {
    color: var(--texto-suave);
    font-size: .72rem;
}

.nav {
    display: flex;
    align-items: center;
    gap: .25rem;
    flex-wrap: wrap;
}

.nav a,
.nav button {
    padding: .5rem .85rem;
    border-radius: 9px;
    font-size: .9rem;
    font-weight: 600;
    color: var(--texto);
    background: transparent;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.nav a:hover,
.nav button:hover { background: #f1f2f4; opacity: 1; }

.nav .badge-notif {
    background: #dc3545;
    color: #fff;
    font-size: .68rem;
    min-width: 17px;
    height: 17px;
    padding: 0 5px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.nav .btn-ingresar {
    background: var(--primario);
    color: var(--oscuro);
    padding: .5rem 1.1rem;
}
.nav .btn-ingresar:hover { background: var(--primario-oscuro); }

.nav .btn-registro {
    border: 1.5px solid var(--oscuro);
    padding: .45rem 1rem;
}

/* ---------- Contenido ---------- */
.contenido {
    flex: 1;
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.75rem 1.25rem 3rem;
}

.titulo-pagina {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: .25rem;
}
.subtitulo-pagina { color: var(--texto-suave); margin-bottom: 1.5rem; }

/* ---------- Tarjetas ---------- */
.tarjeta {
    background: var(--tarjeta);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    box-shadow: var(--sombra);
    padding: 1.4rem;
    margin-bottom: 1.25rem;
}

.tarjeta h2, .tarjeta h3 { font-size: 1.02rem; font-weight: 700; margin-bottom: 1rem; }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    padding: .6rem 1.15rem;
    border-radius: 10px;
    font-weight: 700;
    font-size: .92rem;
    border: none;
    cursor: pointer;
    transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }

.btn-primario { background: var(--primario); color: var(--oscuro); }
.btn-primario:hover { background: var(--primario-oscuro); opacity: 1; }

.btn-oscuro { background: var(--oscuro); color: #fff; }
.btn-oscuro:hover { background: #2a2a2a; opacity: 1; }

.btn-contorno {
    background: transparent;
    border: 1.5px solid var(--borde);
    color: var(--texto);
}
.btn-contorno:hover { background: #f1f2f4; opacity: 1; }

.btn-peligro { background: #dc3545; color: #fff; }
.btn-peligro:hover { background: #c02636; opacity: 1; }

.btn-peq { padding: .4rem .8rem; font-size: .82rem; border-radius: 8px; }

/* ---------- Formularios ---------- */
.form-group { margin-bottom: 1rem; }

.form-group label {
    display: block;
    font-weight: 600;
    font-size: .88rem;
    margin-bottom: .35rem;
}

.form-control,
.form-select {
    width: 100%;
    padding: .62rem .8rem;
    border: 1.5px solid var(--borde);
    border-radius: 10px;
    font-size: .95rem;
    font-family: inherit;
    background: #fff;
    color: var(--texto);
}
.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primario-oscuro);
    box-shadow: 0 0 0 3px rgba(255, 193, 7, .25);
}

.ayuda { font-size: .78rem; color: var(--texto-suave); margin-top: .3rem; }

.errores { margin-bottom: 1rem; }
.error-texto {
    color: #b02a37;
    font-size: .82rem;
    margin-top: .25rem;
}

/* ---------- Alertas / flash ---------- */
.alerta {
    padding: .85rem 1.1rem;
    border-radius: 10px;
    margin-bottom: 1.1rem;
    font-size: .92rem;
    font-weight: 500;
    border: 1px solid transparent;
}
.alerta-success { background: #e9f9ef; color: #116633; border-color: #b7ecd0; }
.alerta-error   { background: #fdecee; color: #a31d2e; border-color: #f6c6cd; }
.alerta-info    { background: #eaf4fd; color: #1c5d99; border-color: #c2e0f8; }
.alerta-warning { background: #fff8e1; color: #8a6d00; border-color: #f7e7a8; }

/* ---------- Hero (inicio) ---------- */
.hero {
    text-align: center;
    padding: 2.5rem 1rem 2rem;
}
.hero h1 { font-size: 2rem; font-weight: 900; letter-spacing: .3px; }
.hero p { color: var(--texto-suave); margin-top: .4rem; }

.buscador {
    max-width: 620px;
    margin: 1.6rem auto 0;
    display: flex;
    gap: .5rem;
}
.buscador .form-control { padding: .85rem 1rem; font-size: 1rem; }

.paises-portal {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}
.pais-card-portal {
    background: var(--tarjeta);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 1.4rem;
    text-align: center;
    box-shadow: var(--sombra);
}
.pais-card-portal .bandera { font-size: 2.2rem; }
.pais-card-portal h3 { font-size: 1rem; font-weight: 800; margin: .4rem 0 .15rem; }
.pais-card-portal p { font-size: .82rem; color: var(--texto-suave); }

/* ---------- Resumen / stats ---------- */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .9rem;
    margin-bottom: 1.4rem;
}
.stat {
    background: var(--tarjeta);
    border: 1px solid var(--borde);
    border-radius: var(--radio);
    padding: 1.1rem;
    box-shadow: var(--sombra);
}
.stat .num { font-size: 1.7rem; font-weight: 900; }
.stat .lbl { font-size: .78rem; color: var(--texto-suave); text-transform: uppercase; letter-spacing: .4px; }
.stat.amarillo { background: var(--primario); border-color: transparent; }
.stat.negro { background: var(--oscuro); color: #fff; }
.stat.negro .lbl { color: rgba(255,255,255,.65); }

/* ---------- Tablas ---------- */
.tabla { width: 100%; border-collapse: collapse; }
.tabla th {
    text-align: left;
    font-size: .74rem;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--texto-suave);
    padding: .55rem .7rem;
    border-bottom: 2px solid var(--borde);
    white-space: nowrap;
}
.tabla td {
    padding: .7rem;
    border-bottom: 1px solid var(--borde);
    font-size: .9rem;
    vertical-align: middle;
}
.tabla tr:last-child td { border-bottom: none; }
.tabla-fila:hover { background: #fafbfc; }

/* ---------- Badges de estado ---------- */
.badge-estado {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    padding: .28rem .65rem;
    border-radius: 20px;
    font-size: .75rem;
    font-weight: 700;
}
.badge-estado::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}
.c-recibido   { background: #eef0f2; color: #495057; }
.c-escaneado  { background: #e3f2fd; color: #1565c0; }
.c-bolsa      { background: #fff3cd; color: #8a6d00; }
.c-vuelo      { background: #e1bee7; color: #7b1fa2; }
.c-aduana     { background: #ffe0b2; color: #bf360c; }
.c-disponible { background: #d1ecf1; color: #0c5460; }
.c-entregado  { background: #d4edda; color: #155724; }
.c-otro       { background: #eef0f2; color: #495057; }

/* ---------- Línea de tiempo ---------- */
.timeline {
    position: relative;
    padding-left: 1.6rem;
}
.timeline::before {
    content: '';
    position: absolute;
    left: .5rem;
    top: .3rem;
    bottom: .3rem;
    width: 2px;
    background: var(--borde);
}
.timeline-item {
    position: relative;
    padding: .45rem 0 .9rem 1.1rem;
}
.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.6rem;
    top: .6rem;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--borde);
    border: 2px solid #fff;
    box-shadow: 0 0 0 2px var(--borde);
}
.timeline-item.actual::before {
    background: var(--primario);
    box-shadow: 0 0 0 2px var(--primario);
}
.timeline-item .t-estado { font-weight: 800; font-size: .92rem; }
.timeline-item .t-desc { color: var(--texto-suave); font-size: .85rem; margin-top: .15rem; }
.timeline-item .t-fecha { font-size: .76rem; color: var(--texto-suave); margin-top: .1rem; }

/* ---------- Listas ---------- */
.lista-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .8rem 0;
    border-bottom: 1px solid var(--borde);
}
.lista-item:last-child { border-bottom: none; }

.paquete-linea {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    flex-wrap: wrap;
    padding: .85rem;
    border: 1px solid var(--borde);
    border-radius: 11px;
    margin-bottom: .7rem;
    background: #fff;
}
.paquete-linea:hover { border-color: var(--primario-oscuro); }
.paquete-guia { font-weight: 800; font-size: 1rem; }
.paquete-meta { font-size: .8rem; color: var(--texto-suave); }

/* ---------- Notificaciones ---------- */
.notif-item {
    display: flex;
    gap: .85rem;
    padding: .9rem;
    border-radius: 11px;
    margin-bottom: .6rem;
    border: 1px solid var(--borde);
    background: #fff;
}
.notif-item.no-leida { background: #fffaf0; border-color: #ffd97a; }
.notif-item .n-ico {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    background: var(--primario);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}
.notif-item .n-ico.entregado { background: #d4edda; }
.notif-item .n-txt { flex: 1; }
.notif-item .n-txt b { font-size: .9rem; }
.notif-item .n-txt p { font-size: .85rem; color: var(--texto-suave); margin-top: .1rem; }
.notif-item .n-fecha { font-size: .74rem; color: var(--texto-suave); white-space: nowrap; }

/* ---------- Documentos ---------- */
.doc-item {
    display: flex;
    align-items: center;
    gap: .9rem;
    padding: .85rem;
    border: 1px solid var(--borde);
    border-radius: 11px;
    margin-bottom: .6rem;
    background: #fff;
}
.doc-item .d-ico {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: #f1f2f4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}
.doc-item .d-txt { flex: 1; min-width: 0; }
.doc-item .d-txt b { display: block; font-size: .92rem; }
.doc-item .d-txt small { color: var(--texto-suave); }

/* ---------- Autenticación ---------- */
.auth-caja {
    max-width: 430px;
    margin: 1.5rem auto;
}
.auth-titulo { text-align: center; font-size: 1.35rem; font-weight: 800; }
.auth-sub { text-align: center; color: var(--texto-suave); margin-bottom: 1.4rem; }

.enlace-centro { text-align: center; font-size: .88rem; margin-top: 1rem; }
.enlace-centro a { color: var(--texto); font-weight: 700; text-decoration: underline; }

/* ---------- Footer ---------- */
.footer {
    background: var(--oscuro);
    color: rgba(255, 255, 255, .7);
    padding: 1.6rem 1.25rem;
    text-align: center;
    font-size: .85rem;
}
.footer a { color: var(--primario); }
.footer .marca { font-weight: 700; color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .topbar-inner { flex-direction: column; align-items: flex-start; }
    .nav { width: 100%; justify-content: flex-start; flex-wrap: wrap; }
    .buscador { flex-direction: column; }
    .titulo-pagina { font-size: 1.25rem; }
}
