/* ============================================================
   TresMotorSports — Portal de Distribuidores (Frontend)
   ============================================================ */

/* -------------------- Login -------------------- */
.tms-distributor-login-wrap {
    max-width: 420px;
    margin: 40px auto;
    padding: 32px;
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

.tms-distributor-login-form h2 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.4rem;
    text-align: center;
}

.tms-distributor-login-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.tms-distributor-login-form input[type="text"],
.tms-distributor-login-form input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}

.tms-distributor-submit {
    display: inline-block;
    width: 100%;
    padding: 12px;
    background: #1d2327;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    margin-top: 10px;
}

.tms-distributor-submit:hover {
    background: #000;
    color: #fff;
}

.tms-distributor-error {
    background: #fdecea;
    color: #a8261c;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 16px;
}

/* -------------------- Portal -------------------- */
.tms-portal-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0 60px;
}

.tms-portal-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f0;
}

.tms-portal-welcome {
    font-size: 1.1rem;
    color: #333;
}

.tms-portal-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.tms-portal-search {
    padding: 10px 14px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
    min-width: 260px;
}

.tms-portal-logout {
    padding: 9px 16px;
    background: #f0f0f0;
    color: #333;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}

.tms-portal-logout:hover {
    background: #e0e0e0;
    color: #000;
}

/* -------------------- Botones de WhatsApp -------------------- */
.tms-portal-whatsapp-general {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    background: #25D366;
    color: #fff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.tms-portal-whatsapp-general:hover {
    background: #1ebe57;
    color: #fff;
}

.tms-portal-whatsapp-general .tms-whatsapp-icon {
    flex-shrink: 0;
}

.tms-col-action {
    text-align: center;
    width: 60px;
}

.tms-portal-whatsapp-row {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: #25D366;
    color: #fff;
    border-radius: 50%;
    text-decoration: none;
    transition: background 0.15s ease;
}

.tms-portal-whatsapp-row:hover {
    background: #1ebe57;
    color: #fff;
}

.tms-portal-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    font-size: 0.85rem;
    color: #555;
}

.tms-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tms-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.tms-dot-green  { background: #00a32a; }
.tms-dot-yellow { background: #dba617; }
.tms-dot-red    { background: #d63638; }

.tms-portal-group {
    margin-bottom: 28px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
}

.tms-portal-group-header {
    background: #1d2327;
    color: #fff;
    padding: 12px 18px;
    font-weight: 700;
    font-size: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tms-portal-group-count {
    font-weight: 400;
    font-size: 0.8rem;
    color: #ccc;
    text-transform: none;
}

.tms-portal-table-scroll {
    overflow-x: auto;
}

.tms-portal-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

.tms-portal-table thead th {
    background: #f7f7f7;
    text-align: left;
    padding: 10px 16px;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #666;
    border-bottom: 1px solid #e8e8e8;
}

.tms-portal-table tbody td {
    padding: 11px 16px;
    border-bottom: 1px solid #f2f2f2;
    vertical-align: middle;
}

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

.tms-portal-table tbody tr:hover {
    background: #fafafa;
}

.tms-col-sku {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    white-space: nowrap;
}

.tms-col-price {
    font-weight: 700;
    white-space: nowrap;
}

.tms-status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.tms-status-green {
    background: #e6f6ea;
    color: #00a32a;
}

.tms-status-yellow {
    background: #fdf3da;
    color: #9a6700;
}

.tms-status-red {
    background: #fdecea;
    color: #a8261c;
}

.tms-portal-empty,
.tms-portal-no-results {
    text-align: center;
    padding: 40px 0;
    color: #777;
    font-size: 1rem;
}

/* -------------------- Responsive -------------------- */
@media (max-width: 768px) {
    .tms-portal-header {
        flex-direction: column;
        align-items: stretch;
    }

    .tms-portal-header-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .tms-portal-search {
        min-width: 0;
        width: 100%;
    }

    .tms-portal-legend {
        flex-wrap: wrap;
        gap: 12px;
    }
}
